OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/assets/javascripts/vendor/ckeditor/ckeditor.js

6 lines
690 KiB

This file contains unexpected Bidirectional Unicode characters!

This file contains unexpected Bidirectional Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

/*!
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
!function(t){t.en=Object.assign(t.en||{},{a:"Cannot upload file:",b:"Image toolbar",c:"Table toolbar",d:"Bold",e:"Strikethrough",f:"Code",g:"Italic",h:"Dropdown toolbar",i:"Upload in progress",j:"Insert table",k:"Header column",l:"Insert column left",m:"Insert column right",n:"Delete column",o:"Column",p:"Header row",q:"Insert row below",r:"Insert row above",s:"Delete row",t:"Row",u:"Merge cell up",v:"Merge cell right",w:"Merge cell down",x:"Merge cell left",y:"Split cell vertically",z:"Split cell horizontally",aa:"Merge cells",ab:"To-do List",ac:"Editor toolbar",ad:"Numbered List",ae:"Bulleted List",af:"Widget toolbar",ag:"Full size image",ah:"Side image",ai:"Left aligned image",aj:"Centered image",ak:"Right aligned image",al:"Link",am:"Rich Text Editor, %0",an:"image widget",ao:"Enter image caption",ap:"Upload failed",aq:"%0 of %1",ar:"Previous",as:"Next",at:"Change image text alternative",au:"Unlink",av:"Edit link",aw:"Open link in new tab",ax:"This link has no URL",ay:"Save",az:"Cancel",ba:"Link URL",bb:"Open in a new tab",bc:"Downloadable",bd:"Text alternative",be:"Undo",bf:"Redo",bg:"Insert image",bh:"Choose heading",bi:"Heading",bj:"Block quote",bk:"Paragraph",bl:"Heading 1",bm:"Heading 2",bn:"Heading 3",bo:"Heading 4",bp:"Heading 5",bq:"Heading 6"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.OPEditor=e():t.OPEditor=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=196)}([function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"a",function(){return r});const o="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class i extends Error{constructor(t,e,n){t=r(t),n&&(t+=" "+JSON.stringify(n)),super(t),this.name="CKEditorError",this.context=e,this.data=n}is(t){return"CKEditorError"===t}}function r(t){const e=t.match(/^([^:]+):/);return e?t+` Read more: ${o}#error-${e[1]}\n`:t}},function(t,e,n){var o={},i=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),r=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var o=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}}(),s=null,a=0,c=[],l=n(65);function d(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=o[i.id];if(r){r.refs++;for(var s=0;s<r.parts.length;s++)r.parts[s](i.parts[s]);for(;s<i.parts.length;s++)r.parts.push(g(i.parts[s],e))}else{var a=[];for(s=0;s<i.parts.length;s++)a.push(g(i.parts[s],e));o[i.id]={id:i.id,refs:1,parts:a}}}}function u(t,e){for(var n=[],o={},i=0;i<t.length;i++){var r=t[i],s=e.base?r[0]+e.base:r[0],a={css:r[1],media:r[2],sourceMap:r[3]};o[s]?o[s].parts.push(a):n.push(o[s]={id:s,parts:[a]})}return n}function h(t,e){var n=r(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=c[c.length-1];if("top"===t.insertAt)o?o.nextSibling?n.insertBefore(e,o.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=r(t.insertAt.before,n);n.insertBefore(e,i)}}function f(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function p(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return n.nc}();o&&(t.attrs.nonce=o)}return m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,o,i,r;if(e.transform&&t.css){if(!(r="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=r}if(e.singleton){var c=a++;n=s||(s=p(e)),o=w.bind(null,n,c,!1),i=w.bind(null,n,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),o=function(t,e,n){var o=n.css,i=n.sourceMap,r=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||r)&&(o=l(o));i&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var s=new Blob([o],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,e),i=function(){f(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(e),o=function(t,e){var n=e.css,o=e.media;o&&t.setAttribute("media",o);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){f(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=i()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=u(t,e);return d(n,e),function(t){for(var i=[],r=0;r<n.length;r++){var s=n[r];(a=o[s.id]).refs--,i.push(a)}t&&d(u(t,e),e);for(r=0;r<i.length;r++){var a;if(0===(a=i[r]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete o[a.id]}}}};var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function w(t,e,n,o){var i=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{var r=document.createTextNode(i),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}},function(t,e,n){"use strict";var o=Object.prototype.hasOwnProperty;function i(t,e){return o.call(t,e)}function r(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function s(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}var a=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(a.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,d=n(25);var u=/[&<>"]/,h=/[&<>"]/g,f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function p(t){return f[t]}var m=/[.?*+^$[\]\\(){}|-]/g;var g=n(14);e.lib={},e.lib.mdurl=n(26),e.lib.ucmicro=n(142),e.assign=function(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach(function(n){t[n]=e[n]})}}),t},e.isString=function(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)},e.has=i,e.unescapeMd=function(t){return t.indexOf("\\")<0?t:t.replace(a,"$1")},e.unescapeAll=function(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(c,function(t,e,n){return e||function(t,e){var n=0;return i(d,e)?d[e]:35===e.charCodeAt(0)&&l.test(e)&&r(n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?s(n):t}(t,n)})},e.isValidEntityCode=r,e.fromCodePoint=s,e.escapeHtml=function(t){return u.test(t)?t.replace(h,p):t},e.arrayReplaceAt=function(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))},e.isSpace=function(t){switch(t){case 9:case 32:return!0}return!1},e.isWhiteSpace=function(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},e.isMdAsciiPunct=function(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},e.isPunctChar=function(t){return g.test(t)},e.escapeRE=function(t){return t.replace(m,"\\$&")},e.normalizeReference=function(t){return t.trim().replace(/\s+/g," ").toUpperCase()}},,function(t,e,n){"use strict";var o=n(8),i="object"==typeof self&&self&&self.Object===Object&&self,r=o.a||i||Function("return this")();e.a=r},function(t,e,n){"use strict";(function(t){var o=n(8),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=r&&r.exports===i&&o.a.process,a=function(){try{var t=r&&r.require&&r.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();e.a=a}).call(this,n(13)(t))},function(t,e,n){"use strict";(function(t){var o=n(4),i=n(33),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===r?o.a.Buffer:void 0,c=(a?a.isBuffer:void 0)||i.a;e.a=c}).call(this,n(13)(t))},function(t,e,n){"use strict";(function(t){var e=n(35),o=n(0);const i="object"==typeof window?window:t;if(i.CKEDITOR_VERSION)throw new o.b("ckeditor-duplicated-modules: Some CKEditor 5 modules are duplicated.",null);i.CKEDITOR_VERSION=e.a}).call(this,n(12))},function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(12))},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.591 10.177l4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm0 3V6h5.674v1.5zm0 3V9h5.674v1.5zm0 3V12h5.674v1.5zm8.5-6V12h6V7.5h-6zM9.682 6h7.636c.377 0 .682.407.682.91v5.68c0 .503-.305.91-.682.91H9.682c-.377 0-.682-.407-.682-.91V6.91c0-.503.305-.91.682-.91zM2 16.5V15h16v1.5z"/></svg>'},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e){t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(t,e,n){"use strict";function o(){this.__rules__=[],this.__cache__=null}o.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},o.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(t){e.indexOf(t)<0&&e.push(t)})}),t.__cache__={},e.forEach(function(e){t.__cache__[e]=[],t.__rules__.forEach(function(n){n.enabled&&(e&&n.alt.indexOf(e)<0||t.__cache__[e].push(n.fn))})})},o.prototype.at=function(t,e,n){var o=this.__find__(t),i=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__[o].fn=e,this.__rules__[o].alt=i.alt||[],this.__cache__=null},o.prototype.before=function(t,e,n,o){var i=this.__find__(t),r=o||{};if(-1===i)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null},o.prototype.after=function(t,e,n,o){var i=this.__find__(t),r=o||{};if(-1===i)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null},o.prototype.push=function(t,e,n){var o=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null},o.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(t){var o=this.__find__(t);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[o].enabled=!0,n.push(t)},this),this.__cache__=null,n},o.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(t,e)},o.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(t){var o=this.__find__(t);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[o].enabled=!1,n.push(t)},this),this.__cache__=null,n},o.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},t.exports=o},function(t,e,n){"use strict";function o(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}o.prototype.attrIndex=function(t){var e,n,o;if(!this.attrs)return-1;for(n=0,o=(e=this.attrs).length;n<o;n++)if(e[n][0]===t)return n;return-1},o.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},o.prototype.attrSet=function(t,e){var n=this.attrIndex(t),o=[t,e];n<0?this.attrPush(o):this.attrs[n]=o},o.prototype.attrGet=function(t){var e=this.attrIndex(t),n=null;return e>=0&&(n=this.attrs[e][1]),n},o.prototype.attrJoin=function(t,e){var n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e},t.exports=o},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.042 9.367l2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M14.958 9.367l-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm2.5 3V12h11V7.5h-11zM4.061 6H15.94c.586 0 1.061.407 1.061.91v5.68c0 .503-.475.91-1.061.91H4.06c-.585 0-1.06-.407-1.06-.91V6.91C3 6.406 3.475 6 4.061 6zM2 16.5V15h16v1.5z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M18 4.5V3H2v1.5h16zm0 3V6h-5.674v1.5H18zm0 3V9h-5.674v1.5H18zm0 3V12h-5.674v1.5H18zm-8.5-6V12h-6V7.5h6zm.818-1.5H2.682C2.305 6 2 6.407 2 6.91v5.68c0 .503.305.91.682.91h7.636c.377 0 .682-.407.682-.91V6.91c0-.503-.305-.91-.682-.91zM18 16.5V15H2v1.5h16z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm4.5 3V12h7V7.5h-7zM5.758 6h8.484c.419 0 .758.407.758.91v5.681c0 .502-.34.909-.758.909H5.758c-.419 0-.758-.407-.758-.91V6.91c0-.503.34-.91.758-.91zM2 16.5V15h16v1.5z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n class="ck ck-icon ck-button__icon"\n viewBox="0 0 20 20"\n version="1.1"\n id="svg10"\n sodipodi:docname="source.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <defs\n id="defs14" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview12"\n showgrid="false"\n inkscape:zoom="33.37544"\n inkscape:cx="10.656564"\n inkscape:cy="13.670445"\n inkscape:current-layer="svg10" />\n <g\n id="g8"\n style="fill:#000000;fill-rule:evenodd"\n transform="matrix(0.8751128,0,0,0.8751128,4.2423992,5.525391)">\n <g\n id="g6"\n style="fill:#000000">\n <g\n transform="translate(2,5.6)"\n id="g4"\n style="fill:#000000">\n <path\n d="M 10.5,0.1 15.7,4 v 1.3 l -5.6,4 C 10,9.5 9.8,9.5 9.6,9.5 9.3,9.4 9,8.8 9,8.5 L 9.3,8.1 14,4.6 9.5,1.4 9.3,1.2 C 9.2,0.9 9.2,0.6 9.3,0.4 9.5,0.2 9.8,0 10.1,0 a 0.8,0.8 0 0 1 0.4,0.1 z M 5.3,0.1 0,4 v 1.3 l 5.6,4 C 5.7,9.5 5.9,9.5 6.1,9.5 6.4,9.4 6.8,8.8 6.7,8.5 6.7,8.4 6.7,8.2 6.5,8.1 L 1.5,4.6 6.2,1.4 6.4,1.2 C 6.5,0.9 6.5,0.6 6.4,0.4 6.2,0.2 5.9,0 5.6,0 A 0.8,0.8 0 0 0 5.3,0.1 Z"\n id="path2"\n inkscape:connector-curvature="0"\n style="fill:#000000" />\n </g>\n </g>\n </g>\n <metadata\n id="metadata4596">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:title></dc:title>\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <path\n style="stroke-width:0.0390625"\n d="M 1.2772336,0.02277222 V 20.022772 H 6.2381712 V 18.225897 H 3.0741087 V 1.8196472 h 8.2031253 l 3.554687,3.59375 v 3.5546875 h 1.796875 V 4.6712097 L 12.019421,0.02277222 Z"\n id="path2-3"\n inkscape:connector-curvature="0" />\n</svg>\n'},function(t,e,n){var o=n(92);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e,n){var o=n(105);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e,n){"use strict";t.exports=n(137)},function(t,e,n){"use strict";t.exports.encode=n(138),t.exports.decode=n(139),t.exports.format=n(140),t.exports.parse=n(141)},function(t,e){t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},function(t,e){t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},function(t,e,n){"use strict";var o="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",i="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r=new RegExp("^(?:"+o+"|"+i+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),s=new RegExp("^(?:"+o+"|"+i+")");t.exports.HTML_TAG_RE=r,t.exports.HTML_OPEN_CLOSE_TAG_RE=s},function(t,e,n){"use strict";t.exports.tokenize=function(t,e){var n,o,i,r,s=t.pos,a=t.src.charCodeAt(s);if(e)return!1;if(126!==a)return!1;if(i=(o=t.scanDelims(t.pos,!0)).length,r=String.fromCharCode(a),i<2)return!1;for(i%2&&(t.push("text","",0).content=r,i--),n=0;n<i;n+=2)t.push("text","",0).content=r+r,t.delimiters.push({marker:a,jump:n,token:t.tokens.length-1,level:t.level,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0},t.exports.postProcess=function(t){var e,n,o,i,r,s=[],a=t.delimiters,c=t.delimiters.length;for(e=0;e<c;e++)126===(o=a[e]).marker&&-1!==o.end&&(i=a[o.end],(r=t.tokens[o.token]).type="s_open",r.tag="s",r.nesting=1,r.markup="~~",r.content="",(r=t.tokens[i.token]).type="s_close",r.tag="s",r.nesting=-1,r.markup="~~",r.content="","text"===t.tokens[i.token-1].type&&"~"===t.tokens[i.token-1].content&&s.push(i.token-1));for(;s.length;){for(n=(e=s.pop())+1;n<t.tokens.length&&"s_close"===t.tokens[n].type;)n++;e!==--n&&(r=t.tokens[n],t.tokens[n]=t.tokens[e],t.tokens[e]=r)}}},function(t,e,n){"use strict";t.exports.tokenize=function(t,e){var n,o,i=t.pos,r=t.src.charCodeAt(i);if(e)return!1;if(95!==r&&42!==r)return!1;for(o=t.scanDelims(t.pos,42===r),n=0;n<o.length;n++)t.push("text","",0).content=String.fromCharCode(r),t.delimiters.push({marker:r,length:o.length,jump:n,token:t.tokens.length-1,level:t.level,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0},t.exports.postProcess=function(t){var e,n,o,i,r,s,a=t.delimiters;for(e=t.delimiters.length-1;e>=0;e--)95!==(n=a[e]).marker&&42!==n.marker||-1!==n.end&&(o=a[n.end],s=e>0&&a[e-1].end===n.end+1&&a[e-1].token===n.token-1&&a[n.end+1].token===o.token+1&&a[e-1].marker===n.marker,r=String.fromCharCode(n.marker),(i=t.tokens[n.token]).type=s?"strong_open":"em_open",i.tag=s?"strong":"em",i.nesting=1,i.markup=s?r+r:r,i.content="",(i=t.tokens[o.token]).type=s?"strong_close":"em_close",i.tag=s?"strong":"em",i.nesting=-1,i.markup=s?r+r:r,i.content="",s&&(t.tokens[a[e-1].token].content="",t.tokens[a[n.end+1].token].content="",e--))}},function(t,e,n){"use strict";e.a=function(){return!1}},function(t,e,n){"use strict";(function(t){var o=n(4),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=r&&r.exports===i?o.a.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.a=function(t,e){if(e)return t.slice();var n=t.length,o=a?a(n):new t.constructor(n);return t.copy(o),o}}).call(this,n(13)(t))},function(t){t.exports={a:"12.4.0"}},function(t,e){t.exports='<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z" /></svg>\n'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="20" height="20"><path d="M1.586 18.227l.398-2.753.398-2.753 2.355 2.388 2.355 2.355-2.753.365zM14.954 8.01l-7.099 7.065-.763-.796 7.065-7.066-1.592-1.559L5.5 12.721l-.763-.796 7.065-7.066-.796-.796-7.861 7.862 4.71 4.71 7.861-7.828zm3.25-1.56c.398-.397.398-1.094-.033-1.525L15.02 1.775c-.431-.432-1.128-.465-1.526-.034l-.1.1-1.525 1.493 4.71 4.71 1.526-1.493-.033-.033c.033-.033.099-.033.132-.066z"/></svg>\n'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250"><rect rx="4"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 5.7l5.2 3.9v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4 4.7-3.5L11.5 7l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zm-5.2 0L2 9.6v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5L8.2 7l.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9L6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.586 14.633l.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22L2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21l-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.077 15l.991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562l-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7.3 17.37l-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506L13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5L9.375 17H19v1.5H8z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.077 15l.991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M415.462 96.978c-88.1-88.1-230.824-88.1-318.924 0-87.22 87.22-87.22 229.943 0 318.044 88.1 88.1 230.824 88.1 318.924 0 87.22-88.1 87.22-230.824 0-318.044zM246.31 437.047c-24.668 0-44.05-20.263-44.05-44.05 0-24.669 19.382-44.05 44.05-44.05 24.668 0 44.05 19.381 44.05 44.05 0 23.787-20.263 44.05-44.05 44.05zm30.835-154.176v23.787c0 12.334-4.405 16.74-15.858 16.74h-32.597c-11.453 0-15.858-4.406-15.858-16.74v-53.742c0-14.096 14.096-18.5 26.43-22.025 2.643-.88 6.167-1.762 8.81-2.643 16.74-6.167 26.43-13.215 26.43-30.835 0-6.167 0-23.787-29.073-23.787-17.62 0-33.478 7.048-43.17 10.572-5.285 2.643-7.929 3.524-11.453 3.524-5.286 0-10.572-4.405-11.453-9.691L167.9 148.958c-.88-2.643-.88-5.286-.88-7.048 0-21.145 66.075-33.479 88.1-33.479 55.503 0 93.387 36.122 93.387 88.982 0 58.146-44.05 75.767-71.362 85.458z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n class="ck ck-icon ck-button__icon"\n viewBox="0 0 20 20"\n version="1.1"\n id="svg10"\n sodipodi:docname="code-block.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <defs\n id="defs14" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview12"\n showgrid="false"\n inkscape:zoom="33.37544"\n inkscape:cx="10.656564"\n inkscape:cy="13.670445"\n inkscape:current-layer="svg10" />\n <g\n id="g8"\n style="fill:none;fill-rule:evenodd"\n transform="matrix(0.8751128,0,0,0.8751128,1.3360704,0.91121972)">\n <g\n id="g6"\n style="fill:#353535">\n <g\n transform="translate(2,5.6)"\n id="g4">\n <path\n d="M 10.5,0.1 15.7,4 v 1.3 l -5.6,4 C 10,9.5 9.8,9.5 9.6,9.5 9.3,9.4 9,8.8 9,8.5 L 9.3,8.1 14,4.6 9.5,1.4 9.3,1.2 C 9.2,0.9 9.2,0.6 9.3,0.4 9.5,0.2 9.8,0 10.1,0 a 0.8,0.8 0 0 1 0.4,0.1 z M 5.3,0.1 0,4 v 1.3 l 5.6,4 C 5.7,9.5 5.9,9.5 6.1,9.5 6.4,9.4 6.8,8.8 6.7,8.5 6.7,8.4 6.7,8.2 6.5,8.1 L 1.5,4.6 6.2,1.4 6.4,1.2 C 6.5,0.9 6.5,0.6 6.4,0.4 6.2,0.2 5.9,0 5.6,0 A 0.8,0.8 0 0 0 5.3,0.1 Z"\n id="path2"\n inkscape:connector-curvature="0" />\n </g>\n </g>\n </g>\n <path\n style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#353535;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.09228408;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"\n d="M 0.22004104,0.22004104 V 0.76600468 19.779959 H 19.779959 V 0.22004104 Z M 1.3119682,1.3119682 H 18.688032 V 18.688032 H 1.3119682 Z"\n id="rect3722"\n inkscape:connector-curvature="0" />\n <metadata\n id="metadata4596">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:title></dc:title>\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n</svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="20"><path d="M124 334v14c84 139 279 139 362 0v-14c-83-139-278-139-362 0zm181 91c-46 0-83-38-83-84s37-83 83-83c47 0 84 37 84 83s-37 84-84 84zm42-84c0 23-19 42-42 42s-41-19-41-42 18-42 41-42 42 19 42 42zm83-254L312-32H37v512h127v-46H83V14h210l91 92v91h46V87z"/></svg>\n'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.3148 14.7048l2.2237-2.2406c.2661-.2622.6975-.2622.9636 0a.6644.6644 0 0 1 0 .9494l-2.6373 2.6573a.6823.6823 0 0 1-.1115.089c-.2526.1968-.6193.1797-.852-.0512L.6885 14.886a.6352.6352 0 0 1 0-.9032.6471.6471 0 0 1 .9102 0l.7161.722zM7.5 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5c-.414 0-.75-.336-.75-.75zM2.3288 5.7453l2.2097-2.2265c.2661-.2622.6975-.2622.9636 0a.6644.6644 0 0 1 0 .9494L2.8648 7.1256a.6848.6848 0 0 1-.4953.1965.6444.6444 0 0 1-.4682-.187L.6885 5.9125a.6352.6352 0 0 1 0-.9033.6471.6471 0 0 1 .9102 0l.7301.7361zM7.5 5.75A.75.75 0 0 1 8.25 5h9.5a.75.75 0 1 1 0 1.5h-9.5c-.414 0-.75-.336-.75-.75z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n viewBox="0 0 512 512"\n version="1.1"\n id="svg4"\n sodipodi:docname="wysiwyg.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <metadata\n id="metadata10">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs\n id="defs8" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview6"\n showgrid="false"\n inkscape:zoom="1.3037281"\n inkscape:cx="252.52639"\n inkscape:cy="155.86537"\n inkscape:current-layer="svg4" />\n <path\n d="m 166.9714,230.61312 h 185 v 31 h -185 z m 1,-61 h 185 v 32 h -185 z m 0,-61 h 185 v 32 h -185 z m 289,5 -118,-118.0000009 H 63.971404 V 507.61312 H 457.9714 v -394 z m -347,348 V 41.613119 h 210 l 92,92.000001 v 328 z"\n id="path2"\n inkscape:connector-curvature="0"\n sodipodi:nodetypes="cccccccccccccccccccccccccccc" />\n <rect\n style="fill:#000000;fill-opacity:1;stroke:#353535;stroke-opacity:1"\n id="rect832"\n width="184.08746"\n height="112.75357"\n x="169.51387"\n y="313.33896" />\n</svg>\n'},function(t,e,n){var o=n(64);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-placeholder:before,.ck .ck-placeholder:before{content:attr(data-placeholder);pointer-events:none;cursor:text;color:var(--ck-color-engine-placeholder-text)}"},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var i,r=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?t:(i=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:o+r.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")})}},function(t,e,n){var o=n(67);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999);--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border:#47a4f5;--ck-color-focus-shadow:rgba(119,186,248,0.5);--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#5c5c5c;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},function(t,e,n){var o=n(69);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(t,e,n){var o=n(71);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row wrap;align-items:center}.ck.ck-toolbar.ck-toolbar_vertical{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating{flex-wrap:nowrap}.ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar__newline{display:block;width:100%}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar>*{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-toolbar>*{margin-left:var(--ck-spacing-small);margin-right:0}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck{width:100%;margin:0;border-radius:0;border:0}[dir=ltr] .ck.ck-toolbar>:last-child{margin-right:0}[dir=rtl] .ck.ck-toolbar>:last-child{margin-left:0}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar__separator{align-self:stretch;width:1px;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck.ck-toolbar__newline{margin:0}"},function(t,e,n){var o=n(73);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(t,e,n){var o=n(75);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck-tooltip .ck-tooltip__text{display:inline-block}.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0}.ck.ck-tooltip.ck-tooltip_s{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{border-style:solid;left:50%}.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s}'},function(t,e,n){var o=n(77);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button .ck-button__label,.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button .ck-button__label,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;border-color:transparent}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(-1*var(--ck-spacing-small));margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(-1*var(--ck-spacing-small));margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(t,e,n){var o=n(79);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-resizer-size:10px;--ck-resizer-border-width:1px;--ck-resizer-border-radius:2px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-tooltip-offset:10px;--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2}.ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0;outline:1px solid var(--ck-color-resizer)}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all;width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nesw-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset);cursor:nesw-resize}.ck .ck-widget.ck-widget_with-selection-handler{position:relative}.ck .ck-widget.ck-widget_with-selection-handler:hover .ck-widget__selection-handler{visibility:visible}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler{position:absolute}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck-editor__editable>.ck-widget.ck-widget_with-selection-handler:first-child,.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handler:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected:hover .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handler:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected .ck-widget__selection-handler,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected .ck-widget__selection-handler:hover,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover .ck-widget__selection-handler,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover .ck-widget__selection-handler:hover{background:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-read-only .ck-widget{--ck-widget-outline-thickness:0}"},function(t,e,n){var o=n(81);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}'},function(t,e,n){var o=n(83);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(t,e,n){var o=n(85);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(t,e,n){var o=n(87);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(t,e,n){var o=n(89);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(t,e,n){var o=n(91);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(t,e){t.exports=".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}"},function(t,e,n){var o=n(94);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(t,e,n){var o=n(96);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block;will-change:transform}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{transform:translate3d(0,100%,0)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}"},function(t,e,n){var o=n(98);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;border:0;padding:calc(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:hover:not(ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(t,e,n){var o=n(100);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:1.3846153847em}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(2*var(--ck-spacing-large))}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(0.5*var(--ck-border-radius))}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(-1*var(--ck-switch-button-translation)))}"},function(t,e,n){var o=n(102);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-toolbar-dropdown .ck-toolbar{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(t,e,n){var o=n(104);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(t,e){t.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(t,e,n){var o=n(107);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(t,e,n){var o=n(109);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-labeled-input .ck-labeled-input__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-input .ck-labeled-input__status_error{color:var(--ck-color-base-error)}"},function(t,e,n){var o=n(111);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition-property:box-shadow,border;transition:.2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(t,e,n){var o=n(113);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-input{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-input{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}[dir=ltr] .ck.ck-text-alternative-form>:not(:first-child),[dir=rtl] .ck.ck-text-alternative-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-text-alternative-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-text-alternative-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-text-alternative-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-text-alternative-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-text-alternative-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(t,e,n){var o=n(115);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image>img{display:block;margin:0 auto;max-width:100%;min-width:50px}"},function(t,e,n){var o=n(117);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(t,e,n){var o=n(119);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center:not(.image_resized),.ck-content .image-style-align-left:not(.image_resized),.ck-content .image-style-align-right:not(.image_resized),.ck-content .image-style-side:not(.image_resized){max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(t,e,n){var o=n(121);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}"},function(t,e,n){var o=n(123);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-input{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}[dir=ltr] .ck.ck-link-form>:not(:first-child),[dir=rtl] .ck.ck-link-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin-left:0}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(t,e,n){var o=n(125);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(t,e,n){var o=n(127);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-color-table-focused-cell-background:#f5fafe}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(t,e,n){var o=n(129);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px;--ck-insert-table-dropdown-box-border-color:#bfbfbf;--ck-insert-table-dropdown-box-border-active-color:#53a0e4;--ck-insert-table-dropdown-box-active-background:#c7e5ff}.ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-insert-table-dropdown-box-border-color);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-insert-table-dropdown-box-border-active-color);background:var(--ck-insert-table-dropdown-box-active-background)}"},function(t,e,n){var o=n(131);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border-color:#d9d9d9}.ck-content .table table th{font-weight:700;background:#fafafa}"},function(t,e,n){var o=n(133);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=':root{--ck-todo-list-checkmark-size:16px;--ck-color-todo-list-checkmark-background:#00d600;--ck-color-todo-list-checkmark-border:#008a00}.ck .todo-list{list-style:none}.ck .todo-list>li{margin-bottom:5px}.ck .todo-list>li>.todo-list{margin-top:5px}.ck .todo-list__checkmark input[type=checkbox]{display:block;width:100%;height:100%;opacity:0;margin:0}.ck .todo-list__checkmark{cursor:pointer;width:var(--ck-todo-list-checkmark-size);height:var(--ck-todo-list-checkmark-size);position:relative;display:inline-block;left:-23px;margin-right:-16px;top:2px}.ck .todo-list__checkmark:before{content:"";position:absolute;display:block;width:100%;height:100%;border:1px solid var(--ck-color-base-text);border-radius:var(--ck-border-radius);transition:box-shadow .25s ease-in-out,background .25s ease-in-out,border .25s ease-in-out;box-sizing:border-box}.ck .todo-list__checkmark:after{box-sizing:content-box;pointer-events:none;content:"";position:absolute;left:5px;top:3px;display:block;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}.ck .todo-list__checkmark:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck .todo-list__checkmark_checked:before{background:var(--ck-color-todo-list-checkmark-background);border-color:var(--ck-color-todo-list-checkmark-border)}'},function(t,e){},function(t,e,n){"use strict";t.exports=n(136)},function(t,e,n){"use strict";var o=n(2),i=n(144),r=n(148),s=n(149),a=n(157),c=n(171),l=n(184),d=n(26),u=n(186),h={default:n(188),zero:n(189),commonmark:n(190)},f=/^(vbscript|javascript|file|data):/,p=/^data:image\/(gif|png|jpeg|webp);/;function m(t){var e=t.trim().toLowerCase();return!f.test(e)||!!p.test(e)}var g=["http:","https:","mailto:"];function b(t){var e=d.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=u.toASCII(e.hostname)}catch(t){}return d.encode(d.format(e))}function w(t){var e=d.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=u.toUnicode(e.hostname)}catch(t){}return d.decode(d.format(e))}function k(t,e){if(!(this instanceof k))return new k(t,e);e||o.isString(t)||(e=t||{},t="default"),this.inline=new c,this.block=new a,this.core=new s,this.renderer=new r,this.linkify=new l,this.validateLink=m,this.normalizeLink=b,this.normalizeLinkText=w,this.utils=o,this.helpers=o.assign({},i),this.options={},this.configure(t),e&&this.set(e)}k.prototype.set=function(t){return o.assign(this.options,t),this},k.prototype.configure=function(t){var e,n=this;if(o.isString(t)&&!(t=h[e=t]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&n.set(t.options),t.components&&Object.keys(t.components).forEach(function(e){t.components[e].rules&&n[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&n[e].ruler2.enableOnly(t.components[e].rules2)}),this},k.prototype.enable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));var o=t.filter(function(t){return n.indexOf(t)<0});if(o.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this},k.prototype.disable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));var o=t.filter(function(t){return n.indexOf(t)<0});if(o.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this},k.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},k.prototype.parse=function(t,e){if("string"!=typeof t)throw new Error("Input data should be a String");var n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},k.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},k.prototype.parseInline=function(t,e){var n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},k.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=k},function(t){t.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=",bnequiv:"≡",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:"",emsp14:"",emsp:"",ENG:"Ŋ",eng:"ŋ",ensp:"",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩",gvnE:"≩",Hacek:"ˇ",hairsp:"",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨",lvnE:"≨",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:"",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:"",nvap:"≍",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥",nvgt:">",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤",nvlt:"<",nvltrie:"⊴",nvrArr:"⤃",nvrtrie:"⊵",nvsim:"∼",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:"",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓",sqcup:"⊔",sqcups:"⊔",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"",ThinSpace:"",thinsp:"",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊",varsubsetneqq:"⫋",varsupsetneq:"⊋",varsupsetneqq:"⫌",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:"",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂",vnsup:"⊃",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋",vsubne:"⊊",vsupnE:"⫌",vsupne:"⊋",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}},function(t,e,n){"use strict";var o={};function i(t,e,n){var r,s,a,c,l,d="";for("string"!=typeof e&&(n=e,e=i.defaultChars),void 0===n&&(n=!0),l=function(t){var e,n,i=o[t];if(i)return i;for(i=o[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),/^[0-9a-z]$/i.test(n)?i.push(n):i.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e<t.length;e++)i[t.charCodeAt(e)]=t[e];return i}(e),r=0,s=t.length;r<s;r++)if(a=t.charCodeAt(r),n&&37===a&&r+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(r+1,r+3)))d+=t.slice(r,r+3),r+=2;else if(a<128)d+=l[a];else if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&r+1<s&&(c=t.charCodeAt(r+1))>=56320&&c<=57343){d+=encodeURIComponent(t[r]+t[r+1]),r++;continue}d+="%EF%BF%BD"}else d+=encodeURIComponent(t[r]);return d}i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",t.exports=i},function(t,e,n){"use strict";var o={};function i(t,e){var n;return"string"!=typeof e&&(e=i.defaultChars),n=function(t){var e,n,i=o[t];if(i)return i;for(i=o[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),i.push(n);for(e=0;e<t.length;e++)i[n=t.charCodeAt(e)]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return i}(e),t.replace(/(%[a-f0-9]{2})+/gi,function(t){var e,o,i,r,s,a,c,l="";for(e=0,o=t.length;e<o;e+=3)(i=parseInt(t.slice(e+1,e+3),16))<128?l+=n[i]:192==(224&i)&&e+3<o&&128==(192&(r=parseInt(t.slice(e+4,e+6),16)))?(l+=(c=i<<6&1984|63&r)<128?"<EFBFBD><EFBFBD>":String.fromCharCode(c),e+=3):224==(240&i)&&e+6<o&&(r=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),128==(192&r)&&128==(192&s))?(l+=(c=i<<12&61440|r<<6&4032|63&s)<2048||c>=55296&&c<=57343?"<EFBFBD><EFBFBD><EFBFBD>":String.fromCharCode(c),e+=6):240==(248&i)&&e+9<o&&(r=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),a=parseInt(t.slice(e+10,e+12),16),128==(192&r)&&128==(192&s)&&128==(192&a))?((c=i<<18&1835008|r<<12&258048|s<<6&4032|63&a)<65536||c>1114111?l+="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),e+=9):l+="<EFBFBD>";return l})}i.defaultChars=";/?:@&=+$,#",i.componentChars="",t.exports=i},function(t,e,n){"use strict";t.exports=function(t){var e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||""}},function(t,e,n){"use strict";function o(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var i=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(a),l=["%","/","?",";","#"].concat(c),d=["/","?","#"],u=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};o.prototype.parse=function(t,e){var n,o,r,a,c,m=t;if(m=m.trim(),!e&&1===t.split("#").length){var g=s.exec(m);if(g)return this.pathname=g[1],g[2]&&(this.search=g[2]),this}var b=i.exec(m);if(b&&(r=(b=b[0]).toLowerCase(),this.protocol=b,m=m.substr(b.length)),(e||b||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(c="//"===m.substr(0,2))||b&&f[b]||(m=m.substr(2),this.slashes=!0)),!f[b]&&(c||b&&!p[b])){var w,k,_=-1;for(n=0;n<d.length;n++)-1!==(a=m.indexOf(d[n]))&&(-1===_||a<_)&&(_=a);for(-1!==(k=-1===_?m.lastIndexOf("@"):m.lastIndexOf("@",_))&&(w=m.slice(0,k),m=m.slice(k+1),this.auth=w),_=-1,n=0;n<l.length;n++)-1!==(a=m.indexOf(l[n]))&&(-1===_||a<_)&&(_=a);-1===_&&(_=m.length),":"===m[_-1]&&_--;var v=m.slice(0,_);m=m.slice(_),this.parseHost(v),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y){var x=this.hostname.split(/\./);for(n=0,o=x.length;n<o;n++){var C=x[n];if(C&&!C.match(u)){for(var A="",P=0,T=C.length;P<T;P++)C.charCodeAt(P)>127?A+="x":A+=C[P];if(!A.match(u)){var E=x.slice(0,n),S=x.slice(n+1),R=C.match(h);R&&(E.push(R[1]),S.unshift(R[2])),S.length&&(m=S.join(".")+m),this.hostname=E.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var O=m.indexOf("#");-1!==O&&(this.hash=m.substr(O),m=m.slice(0,O));var I=m.indexOf("?");return-1!==I&&(this.search=m.substr(I),m=m.slice(0,I)),m&&(this.pathname=m),p[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this},o.prototype.parseHost=function(t){var e=r.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=function(t,e){if(t&&t instanceof o)return t;var n=new o;return n.parse(t,e),n}},function(t,e,n){"use strict";e.Any=n(27),e.Cc=n(28),e.Cf=n(143),e.P=n(14),e.Z=n(29)},function(t,e){t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(t,e,n){"use strict";e.parseLinkLabel=n(145),e.parseLinkDestination=n(146),e.parseLinkTitle=n(147)},function(t,e,n){"use strict";t.exports=function(t,e,n){var o,i,r,s,a=-1,c=t.posMax,l=t.pos;for(t.pos=e+1,o=1;t.pos<c;){if(93===(r=t.src.charCodeAt(t.pos))&&0===--o){i=!0;break}if(s=t.pos,t.md.inline.skipToken(t),91===r)if(s===t.pos-1)o++;else if(n)return t.pos=l,-1}return i&&(a=t.pos),t.pos=l,a}},function(t,e,n){"use strict";var o=n(2).isSpace,i=n(2).unescapeAll;t.exports=function(t,e,n){var r,s,a=e,c={ok:!1,pos:0,lines:0,str:""};if(60===t.charCodeAt(e)){for(e++;e<n;){if(10===(r=t.charCodeAt(e))||o(r))return c;if(62===r)return c.pos=e+1,c.str=i(t.slice(a+1,e)),c.ok=!0,c;92===r&&e+1<n?e+=2:e++}return c}for(s=0;e<n&&32!==(r=t.charCodeAt(e))&&!(r<32||127===r);)if(92===r&&e+1<n)e+=2;else{if(40===r&&s++,41===r){if(0===s)break;s--}e++}return a===e?c:0!==s?c:(c.str=i(t.slice(a,e)),c.lines=0,c.pos=e,c.ok=!0,c)}},function(t,e,n){"use strict";var o=n(2).unescapeAll;t.exports=function(t,e,n){var i,r,s=0,a=e,c={ok:!1,pos:0,lines:0,str:""};if(e>=n)return c;if(34!==(r=t.charCodeAt(e))&&39!==r&&40!==r)return c;for(e++,40===r&&(r=41);e<n;){if((i=t.charCodeAt(e))===r)return c.pos=e+1,c.lines=s,c.str=o(t.slice(a+1,e)),c.ok=!0,c;10===i?s++:92===i&&e+1<n&&(e++,10===t.charCodeAt(e)&&s++),e++}return c}},function(t,e,n){"use strict";var o=n(2).assign,i=n(2).unescapeAll,r=n(2).escapeHtml,s={};function a(){this.rules=o({},s)}s.code_inline=function(t,e,n,o,i){var s=t[e];return"<code"+i.renderAttrs(s)+">"+r(t[e].content)+"</code>"},s.code_block=function(t,e,n,o,i){var s=t[e];return"<pre"+i.renderAttrs(s)+"><code>"+r(t[e].content)+"</code></pre>\n"},s.fence=function(t,e,n,o,s){var a,c,l,d,u=t[e],h=u.info?i(u.info).trim():"",f="";return h&&(f=h.split(/\s+/g)[0]),0===(a=n.highlight&&n.highlight(u.content,f)||r(u.content)).indexOf("<pre")?a+"\n":h?(c=u.attrIndex("class"),l=u.attrs?u.attrs.slice():[],c<0?l.push(["class",n.langPrefix+f]):l[c][1]+=" "+n.langPrefix+f,d={attrs:l},"<pre><code"+s.renderAttrs(d)+">"+a+"</code></pre>\n"):"<pre><code"+s.renderAttrs(u)+">"+a+"</code></pre>\n"},s.image=function(t,e,n,o,i){var r=t[e];return r.attrs[r.attrIndex("alt")][1]=i.renderInlineAsText(r.children,n,o),i.renderToken(t,e,n)},s.hardbreak=function(t,e,n){return n.xhtmlOut?"<br />\n":"<br>\n"},s.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},s.text=function(t,e){return r(t[e].content)},s.html_block=function(t,e){return t[e].content},s.html_inline=function(t,e){return t[e].content},a.prototype.renderAttrs=function(t){var e,n,o;if(!t.attrs)return"";for(o="",e=0,n=t.attrs.length;e<n;e++)o+=" "+r(t.attrs[e][0])+'="'+r(t.attrs[e][1])+'"';return o},a.prototype.renderToken=function(t,e,n){var o,i="",r=!1,s=t[e];return s.hidden?"":(s.block&&-1!==s.nesting&&e&&t[e-1].hidden&&(i+="\n"),i+=(-1===s.nesting?"</":"<")+s.tag,i+=this.renderAttrs(s),0===s.nesting&&n.xhtmlOut&&(i+=" /"),s.block&&(r=!0,1===s.nesting&&e+1<t.length&&("inline"===(o=t[e+1]).type||o.hidden?r=!1:-1===o.nesting&&o.tag===s.tag&&(r=!1))),i+=r?">\n":">")},a.prototype.renderInline=function(t,e,n){for(var o,i="",r=this.rules,s=0,a=t.length;s<a;s++)void 0!==r[o=t[s].type]?i+=r[o](t,s,e,n,this):i+=this.renderToken(t,s,e);return i},a.prototype.renderInlineAsText=function(t,e,n){for(var o="",i=0,r=t.length;i<r;i++)"text"===t[i].type?o+=t[i].content:"image"===t[i].type&&(o+=this.renderInlineAsText(t[i].children,e,n));return o},a.prototype.render=function(t,e,n){var o,i,r,s="",a=this.rules;for(o=0,i=t.length;o<i;o++)"inline"===(r=t[o].type)?s+=this.renderInline(t[o].children,e,n):void 0!==a[r]?s+=a[t[o].type](t,o,e,n,this):s+=this.renderToken(t,o,e,n);return s},t.exports=a},function(t,e,n){"use strict";var o=n(15),i=[["normalize",n(150)],["block",n(151)],["inline",n(152)],["linkify",n(153)],["replacements",n(154)],["smartquotes",n(155)]];function r(){this.ruler=new o;for(var t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1])}r.prototype.process=function(t){var e,n,o;for(e=0,n=(o=this.ruler.getRules("")).length;e<n;e++)o[e](t)},r.prototype.State=n(156),t.exports=r},function(t,e,n){"use strict";var o=/\r[\n\u0085]?|[\u2424\u2028\u0085]/g,i=/\u0000/g;t.exports=function(t){var e;e=(e=t.src.replace(o,"\n")).replace(i,"<EFBFBD>"),t.src=e}},function(t,e,n){"use strict";t.exports=function(t){var e;t.inlineMode?((e=new t.Token("inline","",0)).content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}},function(t,e,n){"use strict";t.exports=function(t){var e,n,o,i=t.tokens;for(n=0,o=i.length;n<o;n++)"inline"===(e=i[n]).type&&t.md.inline.parse(e.content,t.md,t.env,e.children)}},function(t,e,n){"use strict";var o=n(2).arrayReplaceAt;function i(t){return/^<a[>\s]/i.test(t)}function r(t){return/^<\/a\s*>/i.test(t)}t.exports=function(t){var e,n,s,a,c,l,d,u,h,f,p,m,g,b,w,k,_,v=t.tokens;if(t.md.options.linkify)for(n=0,s=v.length;n<s;n++)if("inline"===v[n].type&&t.md.linkify.pretest(v[n].content))for(g=0,e=(a=v[n].children).length-1;e>=0;e--)if("link_close"!==(l=a[e]).type){if("html_inline"===l.type&&(i(l.content)&&g>0&&g--,r(l.content)&&g++),!(g>0)&&"text"===l.type&&t.md.linkify.test(l.content)){for(h=l.content,_=t.md.linkify.match(h),d=[],m=l.level,p=0,u=0;u<_.length;u++)b=_[u].url,w=t.md.normalizeLink(b),t.md.validateLink(w)&&(k=_[u].text,k=_[u].schema?"mailto:"!==_[u].schema||/^mailto:/i.test(k)?t.md.normalizeLinkText(k):t.md.normalizeLinkText("mailto:"+k).replace(/^mailto:/,""):t.md.normalizeLinkText("http://"+k).replace(/^http:\/\//,""),(f=_[u].index)>p&&((c=new t.Token("text","",0)).content=h.slice(p,f),c.level=m,d.push(c)),(c=new t.Token("link_open","a",1)).attrs=[["href",w]],c.level=m++,c.markup="linkify",c.info="auto",d.push(c),(c=new t.Token("text","",0)).content=k,c.level=m,d.push(c),(c=new t.Token("link_close","a",-1)).level=--m,c.markup="linkify",c.info="auto",d.push(c),p=_[u].lastIndex);p<h.length&&((c=new t.Token("text","",0)).content=h.slice(p),c.level=m,d.push(c)),v[n].children=a=o(a,e,d)}}else for(e--;a[e].level!==l.level&&"link_open"!==a[e].type;)e--}},function(t,e,n){"use strict";var o=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,i=/\((c|tm|r|p)\)/i,r=/\((c|tm|r|p)\)/gi,s={c:"©",r:"®",p:"§",tm:"™"};function a(t,e){return s[e.toLowerCase()]}function c(t){var e,n,o=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||o||(n.content=n.content.replace(r,a)),"link_open"===n.type&&"auto"===n.info&&o--,"link_close"===n.type&&"auto"===n.info&&o++}function l(t){var e,n,i=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||i||o.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(i.test(t.tokens[e].content)&&c(t.tokens[e].children),o.test(t.tokens[e].content)&&l(t.tokens[e].children))}},function(t,e,n){"use strict";var o=n(2).isWhiteSpace,i=n(2).isPunctChar,r=n(2).isMdAsciiPunct,s=/['"]/,a=/['"]/g,c="’";function l(t,e,n){return t.substr(0,e)+n+t.substr(e+1)}function d(t,e){var n,s,d,u,h,f,p,m,g,b,w,k,_,v,y,x,C,A,P,T,E;for(P=[],n=0;n<t.length;n++){for(s=t[n],p=t[n].level,C=P.length-1;C>=0&&!(P[C].level<=p);C--);if(P.length=C+1,"text"===s.type){h=0,f=(d=s.content).length;t:for(;h<f&&(a.lastIndex=h,u=a.exec(d));){if(y=x=!0,h=u.index+1,A="'"===u[0],g=32,u.index-1>=0)g=d.charCodeAt(u.index-1);else for(C=n-1;C>=0&&("softbreak"!==t[C].type&&"hardbreak"!==t[C].type);C--)if("text"===t[C].type){g=t[C].content.charCodeAt(t[C].content.length-1);break}if(b=32,h<f)b=d.charCodeAt(h);else for(C=n+1;C<t.length&&("softbreak"!==t[C].type&&"hardbreak"!==t[C].type);C++)if("text"===t[C].type){b=t[C].content.charCodeAt(0);break}if(w=r(g)||i(String.fromCharCode(g)),k=r(b)||i(String.fromCharCode(b)),_=o(g),(v=o(b))?y=!1:k&&(_||w||(y=!1)),_?x=!1:w&&(v||k||(x=!1)),34===b&&'"'===u[0]&&g>=48&&g<=57&&(x=y=!1),y&&x&&(y=!1,x=k),y||x){if(x)for(C=P.length-1;C>=0&&(m=P[C],!(P[C].level<p));C--)if(m.single===A&&P[C].level===p){m=P[C],A?(T=e.md.options.quotes[2],E=e.md.options.quotes[3]):(T=e.md.options.quotes[0],E=e.md.options.quotes[1]),s.content=l(s.content,u.index,E),t[m.token].content=l(t[m.token].content,m.pos,T),h+=E.length-1,m.token===n&&(h+=T.length-1),f=(d=s.content).length,P.length=C;continue t}y?P.push({token:n,pos:u.index,single:A,level:p}):x&&A&&(s.content=l(s.content,u.index,c))}else A&&(s.content=l(s.content,u.index,c))}}}}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&s.test(t.tokens[e].content)&&d(t.tokens[e].children,t)}},function(t,e,n){"use strict";var o=n(16);function i(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}i.prototype.Token=o,t.exports=i},function(t,e,n){"use strict";var o=n(15),i=[["table",n(158),["paragraph","reference"]],["code",n(159)],["fence",n(160),["paragraph","reference","blockquote","list"]],["blockquote",n(161),["paragraph","reference","blockquote","list"]],["hr",n(162),["paragraph","reference","blockquote","list"]],["list",n(163),["paragraph","reference","blockquote"]],["reference",n(164)],["heading",n(165),["paragraph","reference","blockquote"]],["lheading",n(166)],["html_block",n(167),["paragraph","reference","blockquote"]],["paragraph",n(169)]];function r(){this.ruler=new o;for(var t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1],{alt:(i[t][2]||[]).slice()})}r.prototype.tokenize=function(t,e,n){for(var o,i=this.ruler.getRules(""),r=i.length,s=e,a=!1,c=t.md.options.maxNesting;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n))&&!(t.sCount[s]<t.blkIndent);){if(t.level>=c){t.line=n;break}for(o=0;o<r&&!i[o](t,s,n,!1);o++);t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),(s=t.line)<n&&t.isEmpty(s)&&(a=!0,s++,t.line=s)}},r.prototype.parse=function(t,e,n,o){var i;t&&(i=new this.State(t,e,n,o),this.tokenize(i,i.line,i.lineMax))},r.prototype.State=n(170),t.exports=r},function(t,e,n){"use strict";var o=n(2).isSpace;function i(t,e){var n=t.bMarks[e]+t.blkIndent,o=t.eMarks[e];return t.src.substr(n,o-n)}function r(t){var e,n=[],o=0,i=t.length,r=0,s=0,a=!1,c=0;for(e=t.charCodeAt(o);o<i;)96===e?a?(a=!1,c=o):r%2==0&&(a=!0,c=o):124!==e||r%2!=0||a||(n.push(t.substring(s,o)),s=o+1),92===e?r++:r=0,++o===i&&a&&(a=!1,o=c+1),e=t.charCodeAt(o);return n.push(t.substring(s)),n}t.exports=function(t,e,n,s){var a,c,l,d,u,h,f,p,m,g,b,w;if(e+2>n)return!1;if(u=e+1,t.sCount[u]<t.blkIndent)return!1;if(t.sCount[u]-t.blkIndent>=4)return!1;if((l=t.bMarks[u]+t.tShift[u])>=t.eMarks[u])return!1;if(124!==(a=t.src.charCodeAt(l++))&&45!==a&&58!==a)return!1;for(;l<t.eMarks[u];){if(124!==(a=t.src.charCodeAt(l))&&45!==a&&58!==a&&!o(a))return!1;l++}for(h=(c=i(t,e+1)).split("|"),m=[],d=0;d<h.length;d++){if(!(g=h[d].trim())){if(0===d||d===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(g))return!1;58===g.charCodeAt(g.length-1)?m.push(58===g.charCodeAt(0)?"center":"right"):58===g.charCodeAt(0)?m.push("left"):m.push("")}if(-1===(c=i(t,e).trim()).indexOf("|"))return!1;if(t.sCount[e]-t.blkIndent>=4)return!1;if((f=(h=r(c.replace(/^\||\|$/g,""))).length)>m.length)return!1;if(s)return!0;for((p=t.push("table_open","table",1)).map=b=[e,0],(p=t.push("thead_open","thead",1)).map=[e,e+1],(p=t.push("tr_open","tr",1)).map=[e,e+1],d=0;d<h.length;d++)(p=t.push("th_open","th",1)).map=[e,e+1],m[d]&&(p.attrs=[["style","text-align:"+m[d]]]),(p=t.push("inline","",0)).content=h[d].trim(),p.map=[e,e+1],p.children=[],p=t.push("th_close","th",-1);for(p=t.push("tr_close","tr",-1),p=t.push("thead_close","thead",-1),(p=t.push("tbody_open","tbody",1)).map=w=[e+2,0],u=e+2;u<n&&!(t.sCount[u]<t.blkIndent)&&-1!==(c=i(t,u).trim()).indexOf("|")&&!(t.sCount[u]-t.blkIndent>=4);u++){for(h=r(c.replace(/^\||\|$/g,"")),p=t.push("tr_open","tr",1),d=0;d<f;d++)p=t.push("td_open","td",1),m[d]&&(p.attrs=[["style","text-align:"+m[d]]]),(p=t.push("inline","",0)).content=h[d]?h[d].trim():"",p.children=[],p=t.push("td_close","td",-1);p=t.push("tr_close","tr",-1)}return p=t.push("tbody_close","tbody",-1),p=t.push("table_close","table",-1),b[1]=w[1]=u,t.line=u,!0}},function(t,e,n){"use strict";t.exports=function(t,e,n){var o,i,r;if(t.sCount[e]-t.blkIndent<4)return!1;for(i=o=e+1;o<n;)if(t.isEmpty(o))o++;else{if(!(t.sCount[o]-t.blkIndent>=4))break;i=++o}return t.line=i,(r=t.push("code_block","code",0)).content=t.getLines(e,i,4+t.blkIndent,!0),r.map=[e,t.line],!0}},function(t,e,n){"use strict";t.exports=function(t,e,n,o){var i,r,s,a,c,l,d,u=!1,h=t.bMarks[e]+t.tShift[e],f=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(h+3>f)return!1;if(126!==(i=t.src.charCodeAt(h))&&96!==i)return!1;if(c=h,(r=(h=t.skipChars(h,i))-c)<3)return!1;if(d=t.src.slice(c,h),(s=t.src.slice(h,f)).indexOf(String.fromCharCode(i))>=0)return!1;if(o)return!0;for(a=e;!(++a>=n)&&!((h=c=t.bMarks[a]+t.tShift[a])<(f=t.eMarks[a])&&t.sCount[a]<t.blkIndent);)if(t.src.charCodeAt(h)===i&&!(t.sCount[a]-t.blkIndent>=4||(h=t.skipChars(h,i))-c<r||(h=t.skipSpaces(h))<f)){u=!0;break}return r=t.sCount[e],t.line=a+(u?1:0),(l=t.push("fence","code",0)).info=s,l.content=t.getLines(e+1,a,r,!0),l.markup=d,l.map=[e,t.line],!0}},function(t,e,n){"use strict";var o=n(2).isSpace;t.exports=function(t,e,n,i){var r,s,a,c,l,d,u,h,f,p,m,g,b,w,k,_,v,y,x,C,A=t.lineMax,P=t.bMarks[e]+t.tShift[e],T=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(62!==t.src.charCodeAt(P++))return!1;if(i)return!0;for(c=f=t.sCount[e]+P-(t.bMarks[e]+t.tShift[e]),32===t.src.charCodeAt(P)?(P++,c++,f++,r=!1,_=!0):9===t.src.charCodeAt(P)?(_=!0,(t.bsCount[e]+f)%4==3?(P++,c++,f++,r=!1):r=!0):_=!1,p=[t.bMarks[e]],t.bMarks[e]=P;P<T&&(s=t.src.charCodeAt(P),o(s));)9===s?f+=4-(f+t.bsCount[e]+(r?1:0))%4:f++,P++;for(m=[t.bsCount[e]],t.bsCount[e]=t.sCount[e]+1+(_?1:0),d=P>=T,w=[t.sCount[e]],t.sCount[e]=f-c,k=[t.tShift[e]],t.tShift[e]=P-t.bMarks[e],y=t.md.block.ruler.getRules("blockquote"),b=t.parentType,t.parentType="blockquote",C=!1,h=e+1;h<n&&(t.sCount[h]<t.blkIndent&&(C=!0),!((P=t.bMarks[h]+t.tShift[h])>=(T=t.eMarks[h])));h++)if(62!==t.src.charCodeAt(P++)||C){if(d)break;for(v=!1,a=0,l=y.length;a<l;a++)if(y[a](t,h,n,!0)){v=!0;break}if(v){t.lineMax=h,0!==t.blkIndent&&(p.push(t.bMarks[h]),m.push(t.bsCount[h]),k.push(t.tShift[h]),w.push(t.sCount[h]),t.sCount[h]-=t.blkIndent);break}p.push(t.bMarks[h]),m.push(t.bsCount[h]),k.push(t.tShift[h]),w.push(t.sCount[h]),t.sCount[h]=-1}else{for(c=f=t.sCount[h]+P-(t.bMarks[h]+t.tShift[h]),32===t.src.charCodeAt(P)?(P++,c++,f++,r=!1,_=!0):9===t.src.charCodeAt(P)?(_=!0,(t.bsCount[h]+f)%4==3?(P++,c++,f++,r=!1):r=!0):_=!1,p.push(t.bMarks[h]),t.bMarks[h]=P;P<T&&(s=t.src.charCodeAt(P),o(s));)9===s?f+=4-(f+t.bsCount[h]+(r?1:0))%4:f++,P++;d=P>=T,m.push(t.bsCount[h]),t.bsCount[h]=t.sCount[h]+1+(_?1:0),w.push(t.sCount[h]),t.sCount[h]=f-c,k.push(t.tShift[h]),t.tShift[h]=P-t.bMarks[h]}for(g=t.blkIndent,t.blkIndent=0,(x=t.push("blockquote_open","blockquote",1)).markup=">",x.map=u=[e,0],t.md.block.tokenize(t,e,h),(x=t.push("blockquote_close","blockquote",-1)).markup=">",t.lineMax=A,t.parentType=b,u[1]=t.line,a=0;a<k.length;a++)t.bMarks[a+e]=p[a],t.tShift[a+e]=k[a],t.sCount[a+e]=w[a],t.bsCount[a+e]=m[a];return t.blkIndent=g,!0}},function(t,e,n){"use strict";var o=n(2).isSpace;t.exports=function(t,e,n,i){var r,s,a,c,l=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(42!==(r=t.src.charCodeAt(l++))&&45!==r&&95!==r)return!1;for(s=1;l<d;){if((a=t.src.charCodeAt(l++))!==r&&!o(a))return!1;a===r&&s++}return!(s<3)&&(!!i||(t.line=e+1,(c=t.push("hr","hr",0)).map=[e,t.line],c.markup=Array(s+1).join(String.fromCharCode(r)),!0))}},function(t,e,n){"use strict";var o=n(2).isSpace;function i(t,e){var n,i,r,s;return i=t.bMarks[e]+t.tShift[e],r=t.eMarks[e],42!==(n=t.src.charCodeAt(i++))&&45!==n&&43!==n?-1:i<r&&(s=t.src.charCodeAt(i),!o(s))?-1:i}function r(t,e){var n,i=t.bMarks[e]+t.tShift[e],r=i,s=t.eMarks[e];if(r+1>=s)return-1;if((n=t.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=s)return-1;if(!((n=t.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(r-i>=10)return-1}return r<s&&(n=t.src.charCodeAt(r),!o(n))?-1:r}t.exports=function(t,e,n,o){var s,a,c,l,d,u,h,f,p,m,g,b,w,k,_,v,y,x,C,A,P,T,E,S,R,O,I,M,D=!1,N=!0;if(t.sCount[e]-t.blkIndent>=4)return!1;if(o&&"paragraph"===t.parentType&&t.tShift[e]>=t.blkIndent&&(D=!0),(E=r(t,e))>=0){if(h=!0,R=t.bMarks[e]+t.tShift[e],w=Number(t.src.substr(R,E-R-1)),D&&1!==w)return!1}else{if(!((E=i(t,e))>=0))return!1;h=!1}if(D&&t.skipSpaces(E)>=t.eMarks[e])return!1;if(b=t.src.charCodeAt(E-1),o)return!0;for(g=t.tokens.length,h?(M=t.push("ordered_list_open","ol",1),1!==w&&(M.attrs=[["start",w]])):M=t.push("bullet_list_open","ul",1),M.map=m=[e,0],M.markup=String.fromCharCode(b),_=e,S=!1,I=t.md.block.ruler.getRules("list"),C=t.parentType,t.parentType="list";_<n;){for(T=E,k=t.eMarks[_],u=v=t.sCount[_]+E-(t.bMarks[e]+t.tShift[e]);T<k;){if(9===(s=t.src.charCodeAt(T)))v+=4-(v+t.bsCount[_])%4;else{if(32!==s)break;v++}T++}if((d=(a=T)>=k?1:v-u)>4&&(d=1),l=u+d,(M=t.push("list_item_open","li",1)).markup=String.fromCharCode(b),M.map=f=[e,0],y=t.blkIndent,P=t.tight,A=t.tShift[e],x=t.sCount[e],t.blkIndent=l,t.tight=!0,t.tShift[e]=a-t.bMarks[e],t.sCount[e]=v,a>=k&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,e,n,!0),t.tight&&!S||(N=!1),S=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=y,t.tShift[e]=A,t.sCount[e]=x,t.tight=P,(M=t.push("list_item_close","li",-1)).markup=String.fromCharCode(b),_=e=t.line,f[1]=_,a=t.bMarks[e],_>=n)break;if(t.sCount[_]<t.blkIndent)break;for(O=!1,c=0,p=I.length;c<p;c++)if(I[c](t,_,n,!0)){O=!0;break}if(O)break;if(h){if((E=r(t,_))<0)break}else if((E=i(t,_))<0)break;if(b!==t.src.charCodeAt(E-1))break}return(M=h?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(b),m[1]=_,t.line=_,t.parentType=C,N&&function(t,e){var n,o,i=t.level+2;for(n=e+2,o=t.tokens.length-2;n<o;n++)t.tokens[n].level===i&&"paragraph_open"===t.tokens[n].type&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}(t,g),!0}},function(t,e,n){"use strict";var o=n(2).normalizeReference,i=n(2).isSpace;t.exports=function(t,e,n,r){var s,a,c,l,d,u,h,f,p,m,g,b,w,k,_,v,y=0,x=t.bMarks[e]+t.tShift[e],C=t.eMarks[e],A=e+1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(91!==t.src.charCodeAt(x))return!1;for(;++x<C;)if(93===t.src.charCodeAt(x)&&92!==t.src.charCodeAt(x-1)){if(x+1===C)return!1;if(58!==t.src.charCodeAt(x+1))return!1;break}for(l=t.lineMax,_=t.md.block.ruler.getRules("reference"),m=t.parentType,t.parentType="reference";A<l&&!t.isEmpty(A);A++)if(!(t.sCount[A]-t.blkIndent>3||t.sCount[A]<0)){for(k=!1,u=0,h=_.length;u<h;u++)if(_[u](t,A,l,!0)){k=!0;break}if(k)break}for(C=(w=t.getLines(e,A,t.blkIndent,!1).trim()).length,x=1;x<C;x++){if(91===(s=w.charCodeAt(x)))return!1;if(93===s){p=x;break}10===s?y++:92===s&&++x<C&&10===w.charCodeAt(x)&&y++}if(p<0||58!==w.charCodeAt(p+1))return!1;for(x=p+2;x<C;x++)if(10===(s=w.charCodeAt(x)))y++;else if(!i(s))break;if(!(g=t.md.helpers.parseLinkDestination(w,x,C)).ok)return!1;if(d=t.md.normalizeLink(g.str),!t.md.validateLink(d))return!1;for(a=x=g.pos,c=y+=g.lines,b=x;x<C;x++)if(10===(s=w.charCodeAt(x)))y++;else if(!i(s))break;for(g=t.md.helpers.parseLinkTitle(w,x,C),x<C&&b!==x&&g.ok?(v=g.str,x=g.pos,y+=g.lines):(v="",x=a,y=c);x<C&&(s=w.charCodeAt(x),i(s));)x++;if(x<C&&10!==w.charCodeAt(x)&&v)for(v="",x=a,y=c;x<C&&(s=w.charCodeAt(x),i(s));)x++;return!(x<C&&10!==w.charCodeAt(x))&&(!!(f=o(w.slice(1,p)))&&(!!r||(void 0===t.env.references&&(t.env.references={}),void 0===t.env.references[f]&&(t.env.references[f]={title:v,href:d}),t.parentType=m,t.line=e+y+1,!0)))}},function(t,e,n){"use strict";var o=n(2).isSpace;t.exports=function(t,e,n,i){var r,s,a,c,l=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(35!==(r=t.src.charCodeAt(l))||l>=d)return!1;for(s=1,r=t.src.charCodeAt(++l);35===r&&l<d&&s<=6;)s++,r=t.src.charCodeAt(++l);return!(s>6||l<d&&!o(r))&&(!!i||(d=t.skipSpacesBack(d,l),(a=t.skipCharsBack(d,35,l))>l&&o(t.src.charCodeAt(a-1))&&(d=a),t.line=e+1,(c=t.push("heading_open","h"+String(s),1)).markup="########".slice(0,s),c.map=[e,t.line],(c=t.push("inline","",0)).content=t.src.slice(l,d).trim(),c.map=[e,t.line],c.children=[],(c=t.push("heading_close","h"+String(s),-1)).markup="########".slice(0,s),!0))}},function(t,e,n){"use strict";t.exports=function(t,e,n){var o,i,r,s,a,c,l,d,u,h,f=e+1,p=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(h=t.parentType,t.parentType="paragraph";f<n&&!t.isEmpty(f);f++)if(!(t.sCount[f]-t.blkIndent>3)){if(t.sCount[f]>=t.blkIndent&&(c=t.bMarks[f]+t.tShift[f])<(l=t.eMarks[f])&&(45===(u=t.src.charCodeAt(c))||61===u)&&(c=t.skipChars(c,u),(c=t.skipSpaces(c))>=l)){d=61===u?1:2;break}if(!(t.sCount[f]<0)){for(i=!1,r=0,s=p.length;r<s;r++)if(p[r](t,f,n,!0)){i=!0;break}if(i)break}}return!!d&&(o=t.getLines(e,f,t.blkIndent,!1).trim(),t.line=f+1,(a=t.push("heading_open","h"+String(d),1)).markup=String.fromCharCode(u),a.map=[e,t.line],(a=t.push("inline","",0)).content=o,a.map=[e,t.line-1],a.children=[],(a=t.push("heading_close","h"+String(d),-1)).markup=String.fromCharCode(u),t.parentType=h,!0)}},function(t,e,n){"use strict";var o=n(168),i=n(30).HTML_OPEN_CLOSE_TAG_RE,r=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+o.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,n,o){var i,s,a,c,l=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(l))return!1;for(c=t.src.slice(l,d),i=0;i<r.length&&!r[i][0].test(c);i++);if(i===r.length)return!1;if(o)return r[i][2];if(s=e+1,!r[i][1].test(c))for(;s<n&&!(t.sCount[s]<t.blkIndent);s++)if(l=t.bMarks[s]+t.tShift[s],d=t.eMarks[s],c=t.src.slice(l,d),r[i][1].test(c)){0!==c.length&&s++;break}return t.line=s,(a=t.push("html_block","",0)).map=[e,s],a.content=t.getLines(e,s,t.blkIndent,!0),!0}},function(t,e,n){"use strict";t.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},function(t,e,n){"use strict";t.exports=function(t,e){var n,o,i,r,s,a,c=e+1,l=t.md.block.ruler.getRules("paragraph"),d=t.lineMax;for(a=t.parentType,t.parentType="paragraph";c<d&&!t.isEmpty(c);c++)if(!(t.sCount[c]-t.blkIndent>3||t.sCount[c]<0)){for(o=!1,i=0,r=l.length;i<r;i++)if(l[i](t,c,d,!0)){o=!0;break}if(o)break}return n=t.getLines(e,c,t.blkIndent,!1).trim(),t.line=c,(s=t.push("paragraph_open","p",1)).map=[e,t.line],(s=t.push("inline","",0)).content=n,s.map=[e,t.line],s.children=[],s=t.push("paragraph_close","p",-1),t.parentType=a,!0}},function(t,e,n){"use strict";var o=n(16),i=n(2).isSpace;function r(t,e,n,o){var r,s,a,c,l,d,u,h;for(this.src=t,this.md=e,this.env=n,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.parentType="root",this.level=0,this.result="",h=!1,a=c=d=u=0,l=(s=this.src).length;c<l;c++){if(r=s.charCodeAt(c),!h){if(i(r)){d++,9===r?u+=4-u%4:u++;continue}h=!0}10!==r&&c!==l-1||(10!==r&&c++,this.bMarks.push(a),this.eMarks.push(c),this.tShift.push(d),this.sCount.push(u),this.bsCount.push(0),h=!1,d=0,u=0,a=c+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}r.prototype.push=function(t,e,n){var i=new o(t,e,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i},r.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},r.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},r.prototype.skipSpaces=function(t){for(var e,n=this.src.length;t<n&&(e=this.src.charCodeAt(t),i(e));t++);return t},r.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;for(;t>e;)if(!i(this.src.charCodeAt(--t)))return t+1;return t},r.prototype.skipChars=function(t,e){for(var n=this.src.length;t<n&&this.src.charCodeAt(t)===e;t++);return t},r.prototype.skipCharsBack=function(t,e,n){if(t<=n)return t;for(;t>n;)if(e!==this.src.charCodeAt(--t))return t+1;return t},r.prototype.getLines=function(t,e,n,o){var r,s,a,c,l,d,u,h=t;if(t>=e)return"";for(d=new Array(e-t),r=0;h<e;h++,r++){for(s=0,u=c=this.bMarks[h],l=h+1<e||o?this.eMarks[h]+1:this.eMarks[h];c<l&&s<n;){if(a=this.src.charCodeAt(c),i(a))9===a?s+=4-(s+this.bsCount[h])%4:s++;else{if(!(c-u<this.tShift[h]))break;s++}c++}d[r]=s>n?new Array(s-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return d.join("")},r.prototype.Token=o,t.exports=r},function(t,e,n){"use strict";var o=n(15),i=[["text",n(172)],["newline",n(173)],["escape",n(174)],["backticks",n(175)],["strikethrough",n(31).tokenize],["emphasis",n(32).tokenize],["link",n(176)],["image",n(177)],["autolink",n(178)],["html_inline",n(179)],["entity",n(180)]],r=[["balance_pairs",n(181)],["strikethrough",n(31).postProcess],["emphasis",n(32).postProcess],["text_collapse",n(182)]];function s(){var t;for(this.ruler=new o,t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1]);for(this.ruler2=new o,t=0;t<r.length;t++)this.ruler2.push(r[t][0],r[t][1])}s.prototype.skipToken=function(t){var e,n,o=t.pos,i=this.ruler.getRules(""),r=i.length,s=t.md.options.maxNesting,a=t.cache;if(void 0===a[o]){if(t.level<s)for(n=0;n<r&&(t.level++,e=i[n](t,!0),t.level--,!e);n++);else t.pos=t.posMax;e||t.pos++,a[o]=t.pos}else t.pos=a[o]},s.prototype.tokenize=function(t){for(var e,n,o=this.ruler.getRules(""),i=o.length,r=t.posMax,s=t.md.options.maxNesting;t.pos<r;){if(t.level<s)for(n=0;n<i&&!(e=o[n](t,!1));n++);if(e){if(t.pos>=r)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},s.prototype.parse=function(t,e,n,o){var i,r,s,a=new this.State(t,e,n,o);for(this.tokenize(a),s=(r=this.ruler2.getRules("")).length,i=0;i<s;i++)r[i](a)},s.prototype.State=n(183),t.exports=s},function(t,e,n){"use strict";function o(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}t.exports=function(t,e){for(var n=t.pos;n<t.posMax&&!o(t.src.charCodeAt(n));)n++;return n!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}},function(t,e,n){"use strict";var o=n(2).isSpace;t.exports=function(t,e){var n,i,r=t.pos;if(10!==t.src.charCodeAt(r))return!1;for(n=t.pending.length-1,i=t.posMax,e||(n>=0&&32===t.pending.charCodeAt(n)?n>=1&&32===t.pending.charCodeAt(n-1)?(t.pending=t.pending.replace(/ +$/,""),t.push("hardbreak","br",0)):(t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0)):t.push("softbreak","br",0)),r++;r<i&&o(t.src.charCodeAt(r));)r++;return t.pos=r,!0}},function(t,e,n){"use strict";for(var o=n(2).isSpace,i=[],r=0;r<256;r++)i.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){i[t.charCodeAt(0)]=1}),t.exports=function(t,e){var n,r=t.pos,s=t.posMax;if(92!==t.src.charCodeAt(r))return!1;if(++r<s){if((n=t.src.charCodeAt(r))<256&&0!==i[n])return e||(t.pending+=t.src[r]),t.pos+=2,!0;if(10===n){for(e||t.push("hardbreak","br",0),r++;r<s&&(n=t.src.charCodeAt(r),o(n));)r++;return t.pos=r,!0}}return e||(t.pending+="\\"),t.pos++,!0}},function(t,e,n){"use strict";t.exports=function(t,e){var n,o,i,r,s,a,c=t.pos;if(96!==t.src.charCodeAt(c))return!1;for(n=c,c++,o=t.posMax;c<o&&96===t.src.charCodeAt(c);)c++;for(i=t.src.slice(n,c),r=s=c;-1!==(r=t.src.indexOf("`",s));){for(s=r+1;s<o&&96===t.src.charCodeAt(s);)s++;if(s-r===i.length)return e||((a=t.push("code_inline","code",0)).markup=i,a.content=t.src.slice(c,r).replace(/[ \n]+/g," ").trim()),t.pos=s,!0}return e||(t.pending+=i),t.pos+=i.length,!0}},function(t,e,n){"use strict";var o=n(2).normalizeReference,i=n(2).isSpace;t.exports=function(t,e){var n,r,s,a,c,l,d,u,h,f="",p=t.pos,m=t.posMax,g=t.pos,b=!0;if(91!==t.src.charCodeAt(t.pos))return!1;if(c=t.pos+1,(a=t.md.helpers.parseLinkLabel(t,t.pos,!0))<0)return!1;if((l=a+1)<m&&40===t.src.charCodeAt(l)){for(b=!1,l++;l<m&&(r=t.src.charCodeAt(l),i(r)||10===r);l++);if(l>=m)return!1;for(g=l,(d=t.md.helpers.parseLinkDestination(t.src,l,t.posMax)).ok&&(f=t.md.normalizeLink(d.str),t.md.validateLink(f)?l=d.pos:f=""),g=l;l<m&&(r=t.src.charCodeAt(l),i(r)||10===r);l++);if(d=t.md.helpers.parseLinkTitle(t.src,l,t.posMax),l<m&&g!==l&&d.ok)for(h=d.str,l=d.pos;l<m&&(r=t.src.charCodeAt(l),i(r)||10===r);l++);else h="";(l>=m||41!==t.src.charCodeAt(l))&&(b=!0),l++}if(b){if(void 0===t.env.references)return!1;if(l<m&&91===t.src.charCodeAt(l)?(g=l+1,(l=t.md.helpers.parseLinkLabel(t,l))>=0?s=t.src.slice(g,l++):l=a+1):l=a+1,s||(s=t.src.slice(c,a)),!(u=t.env.references[o(s)]))return t.pos=p,!1;f=u.href,h=u.title}return e||(t.pos=c,t.posMax=a,t.push("link_open","a",1).attrs=n=[["href",f]],h&&n.push(["title",h]),t.md.inline.tokenize(t),t.push("link_close","a",-1)),t.pos=l,t.posMax=m,!0}},function(t,e,n){"use strict";var o=n(2).normalizeReference,i=n(2).isSpace;t.exports=function(t,e){var n,r,s,a,c,l,d,u,h,f,p,m,g,b="",w=t.pos,k=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(l=t.pos+2,(c=t.md.helpers.parseLinkLabel(t,t.pos+1,!1))<0)return!1;if((d=c+1)<k&&40===t.src.charCodeAt(d)){for(d++;d<k&&(r=t.src.charCodeAt(d),i(r)||10===r);d++);if(d>=k)return!1;for(g=d,(h=t.md.helpers.parseLinkDestination(t.src,d,t.posMax)).ok&&(b=t.md.normalizeLink(h.str),t.md.validateLink(b)?d=h.pos:b=""),g=d;d<k&&(r=t.src.charCodeAt(d),i(r)||10===r);d++);if(h=t.md.helpers.parseLinkTitle(t.src,d,t.posMax),d<k&&g!==d&&h.ok)for(f=h.str,d=h.pos;d<k&&(r=t.src.charCodeAt(d),i(r)||10===r);d++);else f="";if(d>=k||41!==t.src.charCodeAt(d))return t.pos=w,!1;d++}else{if(void 0===t.env.references)return!1;if(d<k&&91===t.src.charCodeAt(d)?(g=d+1,(d=t.md.helpers.parseLinkLabel(t,d))>=0?a=t.src.slice(g,d++):d=c+1):d=c+1,a||(a=t.src.slice(l,c)),!(u=t.env.references[o(a)]))return t.pos=w,!1;b=u.href,f=u.title}return e||(s=t.src.slice(l,c),t.md.inline.parse(s,t.md,t.env,m=[]),(p=t.push("image","img",0)).attrs=n=[["src",b],["alt",""]],p.children=m,p.content=s,f&&n.push(["title",f])),t.pos=d,t.posMax=k,!0}},function(t,e,n){"use strict";var o=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,i=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;t.exports=function(t,e){var n,r,s,a,c,l,d=t.pos;return 60===t.src.charCodeAt(d)&&(!((n=t.src.slice(d)).indexOf(">")<0)&&(i.test(n)?(a=(r=n.match(i))[0].slice(1,-1),c=t.md.normalizeLink(a),!!t.md.validateLink(c)&&(e||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=r[0].length,!0)):!!o.test(n)&&(a=(s=n.match(o))[0].slice(1,-1),c=t.md.normalizeLink("mailto:"+a),!!t.md.validateLink(c)&&(e||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=s[0].length,!0))))}},function(t,e,n){"use strict";var o=n(30).HTML_TAG_RE;t.exports=function(t,e){var n,i,r,s=t.pos;return!!t.md.options.html&&(r=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=r)&&(!(33!==(n=t.src.charCodeAt(s+1))&&63!==n&&47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n))&&(!!(i=t.src.slice(s).match(o))&&(e||(t.push("html_inline","",0).content=t.src.slice(s,s+i[0].length)),t.pos+=i[0].length,!0))))}},function(t,e,n){"use strict";var o=n(25),i=n(2).has,r=n(2).isValidEntityCode,s=n(2).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,c=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var n,l,d=t.pos,u=t.posMax;if(38!==t.src.charCodeAt(d))return!1;if(d+1<u)if(35===t.src.charCodeAt(d+1)){if(l=t.src.slice(d).match(a))return e||(n="x"===l[1][0].toLowerCase()?parseInt(l[1].slice(1),16):parseInt(l[1],10),t.pending+=r(n)?s(n):s(65533)),t.pos+=l[0].length,!0}else if((l=t.src.slice(d).match(c))&&i(o,l[1]))return e||(t.pending+=o[l[1]]),t.pos+=l[0].length,!0;return e||(t.pending+="&"),t.pos++,!0}},function(t,e,n){"use strict";t.exports=function(t){var e,n,o,i,r=t.delimiters,s=t.delimiters.length;for(e=0;e<s;e++)if((o=r[e]).close)for(n=e-o.jump-1;n>=0;){if((i=r[n]).open&&i.marker===o.marker&&i.end<0&&i.level===o.level)if(!((i.close||o.open)&&void 0!==i.length&&void 0!==o.length&&(i.length+o.length)%3==0)){o.jump=e-n,o.open=!1,i.end=e,i.jump=0;break}n-=i.jump+1}}},function(t,e,n){"use strict";t.exports=function(t){var e,n,o=0,i=t.tokens,r=t.tokens.length;for(e=n=0;e<r;e++)o+=i[e].nesting,i[e].level=o,"text"===i[e].type&&e+1<r&&"text"===i[e+1].type?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}},function(t,e,n){"use strict";var o=n(16),i=n(2).isWhiteSpace,r=n(2).isPunctChar,s=n(2).isMdAsciiPunct;function a(t,e,n,o){this.src=t,this.env=n,this.md=e,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[]}a.prototype.pushPending=function(){var t=new o("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},a.prototype.push=function(t,e,n){this.pending&&this.pushPending();var i=new o(t,e,n);return n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.pendingLevel=this.level,this.tokens.push(i),i},a.prototype.scanDelims=function(t,e){var n,o,a,c,l,d,u,h,f,p=t,m=!0,g=!0,b=this.posMax,w=this.src.charCodeAt(t);for(n=t>0?this.src.charCodeAt(t-1):32;p<b&&this.src.charCodeAt(p)===w;)p++;return a=p-t,o=p<b?this.src.charCodeAt(p):32,u=s(n)||r(String.fromCharCode(n)),f=s(o)||r(String.fromCharCode(o)),d=i(n),(h=i(o))?m=!1:f&&(d||u||(m=!1)),d?g=!1:u&&(h||f||(g=!1)),e?(c=m,l=g):(c=m&&(!g||u),l=g&&(!m||f)),{can_open:c,can_close:l,length:a}},a.prototype.Token=o,t.exports=a},function(t,e,n){"use strict";function o(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){e&&Object.keys(e).forEach(function(n){t[n]=e[n]})}),t}function i(t){return Object.prototype.toString.call(t)}function r(t){return"[object Function]"===i(t)}function s(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var a={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var c={"http:":{validate:function(t,e,n){var o=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){var o=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?e>=3&&":"===t[e-3]?0:e>=3&&"/"===t[e-3]?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var o=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},l="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",d="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(t){var e=t.re=n(185)(t.__opts__),o=t.__tlds__.slice();function a(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||o.push(l),o.push(e.src_xn),e.src_tlds=o.join("|"),e.email_fuzzy=RegExp(a(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(a(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(a(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(a(e.tpl_host_fuzzy_test),"i");var c=[];function d(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach(function(e){var n=t.__schemas__[e];if(null!==n){var o={validate:null,link:null};if(t.__compiled__[e]=o,function(t){return"[object Object]"===i(t)}(n))return!function(t){return"[object RegExp]"===i(t)}(n.validate)?r(n.validate)?o.validate=n.validate:d(e,n):o.validate=function(t){return function(e,n){var o=e.slice(n);return t.test(o)?o.match(t)[0].length:0}}(n.validate),void(r(n.normalize)?o.normalize=n.normalize:n.normalize?d(e,n):o.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===i(t)}(n)?d(e,n):c.push(e)}}),c.forEach(function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)}),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};var u=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(s).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+u+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+u+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),function(t){t.__index__=-1,t.__text_cache__=""}(t)}function h(t,e){var n=new function(t,e){var n=t.__index__,o=t.__last_index__,i=t.__text_cache__.slice(n,o);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=o+e,this.raw=i,this.text=i,this.url=i}(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function f(t,e){if(!(this instanceof f))return new f(t,e);e||function(t){return Object.keys(t||{}).reduce(function(t,e){return t||a.hasOwnProperty(e)},!1)}(t)&&(e=t,t={}),this.__opts__=o({},a,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=o({},c,t),this.__compiled__={},this.__tlds__=d,this.__tlds_replaced__=!1,this.re={},u(this)}f.prototype.add=function(t,e){return this.__schemas__[t]=e,u(this),this},f.prototype.set=function(t){return this.__opts__=o(this.__opts__,t),this},f.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,n,o,i,r,s,a,c;if(this.re.schema_test.test(t))for((a=this.re.schema_search).lastIndex=0;null!==(e=a.exec(t));)if(i=this.testSchemaAt(t,e[2],a.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c<this.__index__)&&null!==(n=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(r=n.index+n[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&null!==(o=t.match(this.re.email_fuzzy))&&(r=o.index+o[1].length,s=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=s)),this.__index__>=0},f.prototype.pretest=function(t){return this.re.pretest.test(t)},f.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},f.prototype.match=function(t){var e=0,n=[];this.__index__>=0&&this.__text_cache__===t&&(n.push(h(this,e)),e=this.__last_index__);for(var o=e?t.slice(e):t;this.test(o);)n.push(h(this,e)),o=o.slice(this.__last_index__),e+=this.__last_index__;return n.length?n:null},f.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(t,e,n){return t!==n[e-1]}).reverse(),u(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,u(this),this)},f.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},f.prototype.onCompile=function(){},t.exports=f},function(t,e,n){"use strict";t.exports=function(t){var e={};e.src_Any=n(27).source,e.src_Cc=n(28).source,e.src_Z=n(29).source,e.src_P=n(14).source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");return e.src_pseudo_letter="(?:(?![><|]|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(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]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><|]|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+e.src_ZCc+").|\\!(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|[><|]|\\(|"+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}},function(t,e,n){(function(t,o){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(r){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof o&&o;s.global!==s&&s.window!==s&&s.self;var a,c=2147483647,l=36,d=1,u=26,h=38,f=700,p=72,m=128,g="-",b=/^xn--/,w=/[^\x20-\x7E]/,k=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=l-d,y=Math.floor,x=String.fromCharCode;function C(t){throw new RangeError(_[t])}function A(t,e){for(var n=t.length,o=[];n--;)o[n]=e(t[n]);return o}function P(t,e){var n=t.split("@"),o="";return n.length>1&&(o=n[0]+"@",t=n[1]),o+A((t=t.replace(k,".")).split("."),e).join(".")}function T(t){for(var e,n,o=[],i=0,r=t.length;i<r;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<r?56320==(64512&(n=t.charCodeAt(i++)))?o.push(((1023&e)<<10)+(1023&n)+65536):(o.push(e),i--):o.push(e);return o}function E(t){return A(t,function(t){var e="";return t>65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=x(t)}).join("")}function S(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function O(t,e,n){var o=0;for(t=n?y(t/f):t>>1,t+=y(t/e);t>v*u>>1;o+=l)t=y(t/v);return y(o+(v+1)*t/(t+h))}function I(t){var e,n,o,i,r,s,a,h,f,b,w=[],k=t.length,_=0,v=m,x=p;for((n=t.lastIndexOf(g))<0&&(n=0),o=0;o<n;++o)t.charCodeAt(o)>=128&&C("not-basic"),w.push(t.charCodeAt(o));for(i=n>0?n+1:0;i<k;){for(r=_,s=1,a=l;i>=k&&C("invalid-input"),((h=S(t.charCodeAt(i++)))>=l||h>y((c-_)/s))&&C("overflow"),_+=h*s,!(h<(f=a<=x?d:a>=x+u?u:a-x));a+=l)s>y(c/(b=l-f))&&C("overflow"),s*=b;x=O(_-r,e=w.length+1,0==r),y(_/e)>c-v&&C("overflow"),v+=y(_/e),_%=e,w.splice(_++,0,v)}return E(w)}function M(t){var e,n,o,i,r,s,a,h,f,b,w,k,_,v,A,P=[];for(k=(t=T(t)).length,e=m,n=0,r=p,s=0;s<k;++s)(w=t[s])<128&&P.push(x(w));for(o=i=P.length,i&&P.push(g);o<k;){for(a=c,s=0;s<k;++s)(w=t[s])>=e&&w<a&&(a=w);for(a-e>y((c-n)/(_=o+1))&&C("overflow"),n+=(a-e)*_,e=a,s=0;s<k;++s)if((w=t[s])<e&&++n>c&&C("overflow"),w==e){for(h=n,f=l;!(h<(b=f<=r?d:f>=r+u?u:f-r));f+=l)A=h-b,v=l-b,P.push(x(R(b+A%v,0))),h=y(A/v);P.push(x(R(h,0))),r=O(n,_,o==i),n=0,++o}++n,++e}return P.join("")}a={version:"1.4.1",ucs2:{decode:T,encode:E},decode:I,encode:M,toASCII:function(t){return P(t,function(t){return w.test(t)?"xn--"+M(t):t})},toUnicode:function(t){return P(t,function(t){return b.test(t)?I(t.slice(4).toLowerCase()):t})}},void 0===(i=function(){return a}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n(187)(t),n(12))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(t,e,n){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(t,e){var n=!0,o=!1,i=!1;function r(t,e,n){var o=t.attrIndex(e),i=[e,n];o<0?t.attrPush(i):t.attrs[o]=i}function s(t,e){for(var n=t[e].level-1,o=e-1;o>=0;o--)if(t[o].level===n)return o;return-1}function a(t,e){return function(t){return"inline"===t.type}(t[e])&&function(t){return"paragraph_open"===t.type}(t[e-1])&&function(t){return"list_item_open"===t.type}(t[e-2])&&function(t){return 0===t.content.indexOf("[ ] ")||0===t.content.indexOf("[x] ")||0===t.content.indexOf("[X] ")}(t[e])}function c(t,e){if(t.children.unshift(function(t,e){var o=new e("html_inline","",0),i=n?' disabled="" ':"";0===t.content.indexOf("[ ] ")?o.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':0!==t.content.indexOf("[x] ")&&0!==t.content.indexOf("[X] ")||(o.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">');return o}(t,e)),t.children[1].content=t.children[1].content.slice(3),t.content=t.content.slice(3),o)if(i){t.children.pop();var r="task-item-"+Math.ceil(1e7*Math.random()-1e3);t.children[0].content=t.children[0].content.slice(0,-1)+' id="'+r+'">',t.children.push(function(t,e,n){var o=new n("html_inline","",0);return o.content='<label class="task-list-item-label" for="'+e+'">'+t+"</label>",o.attrs=[{for:e}],o}(t.content,r,e))}else t.children.unshift(function(t){var e=new t("html_inline","",0);return e.content="<label>",e}(e)),t.children.push(function(t){var e=new t("html_inline","",0);return e.content="</label>",e}(e))}t.exports=function(t,e){e&&(n=!e.enabled,o=!!e.label,i=!!e.labelAfter),t.core.ruler.after("inline","github-task-lists",function(t){for(var e=t.tokens,o=2;o<e.length;o++)a(e,o)&&(c(e[o],t.Token),r(e[o-2],"class","task-list-item"+(n?"":" enabled")),r(e[s(e,o-2)],"class","contains-task-list"))})}},function(t,e,n){var o=n(193);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-mention-list-max-height:300px}.ck.ck-mentions{max-height:var(--ck-mention-list-max-height);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}.ck.ck-mentions>.ck-list__item{overflow:hidden;flex-shrink:0}"},function(t,e,n){var o=n(195);"string"==typeof o&&(o=[[t.i,o,""]]);var i={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,i);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-color-mention-background:rgba(153,0,48,0.1);--ck-color-mention-text:#990030}.ck-content .mention{background:var(--ck-color-mention-background);color:var(--ck-color-mention-text)}"},function(t,e,n){"use strict";n.r(e);var o=n(4),i=o.a.Symbol,r=Object.prototype,s=r.hasOwnProperty,a=r.toString,c=i?i.toStringTag:void 0;var l=function(t){var e=s.call(t,c),n=t[c];try{t[c]=void 0;var o=!0}catch(t){}var i=a.call(t);return o&&(e?t[c]=n:delete t[c]),i},d=Object.prototype.toString;var u=function(t){return d.call(t)},h="[object Null]",f="[object Undefined]",p=i?i.toStringTag:void 0;var m=function(t){return null==t?void 0===t?f:h:p&&p in Object(t)?l(t):u(t)};var g=function(t,e){return function(n){return t(e(n))}},b=g(Object.getPrototypeOf,Object);var w=function(t){return null!=t&&"object"==typeof t},k="[object Object]",v=Function.prototype,y=Object.prototype,x=v.toString,C=y.hasOwnProperty,A=x.call(Object);var P=function(t){if(!w(t)||m(t)!=k)return!1;var e=b(t);if(null===e)return!0;var n=C.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==A};var T=function(){this.__data__=[],this.size=0};var E=function(t,e){return t===e||t!=t&&e!=e};var S=function(t,e){for(var n=t.length;n--;)if(E(t[n][0],e))return n;return-1},R=Array.prototype.splice;var O=function(t){var e=this.__data__,n=S(e,t);return!(n<0||(n==e.length-1?e.pop():R.call(e,n,1),--this.size,0))};var I=function(t){var e=this.__data__,n=S(e,t);return n<0?void 0:e[n][1]};var M=function(t){return S(this.__data__,t)>-1};var D=function(t,e){var n=this.__data__,o=S(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function N(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=T,N.prototype.delete=O,N.prototype.get=I,N.prototype.has=M,N.prototype.set=D;var V=N;var F=function(){this.__data__=new V,this.size=0};var B=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};var L=function(t){return this.__data__.get(t)};var z=function(t){return this.__data__.has(t)};var q=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},j="[object AsyncFunction]",H="[object Function]",U="[object GeneratorFunction]",$="[object Proxy]";var W=function(t){if(!q(t))return!1;var e=m(t);return e==H||e==U||e==j||e==$},G=o.a["__core-js_shared__"],K=function(){var t=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var J=function(t){return!!K&&K in t},Z=Function.prototype.toString;var Q=function(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Y=/^\[object .+?Constructor\]$/,X=Function.prototype,tt=Object.prototype,et=X.toString,nt=tt.hasOwnProperty,ot=RegExp("^"+et.call(nt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var it=function(t){return!(!q(t)||J(t))&&(W(t)?ot:Y).test(Q(t))};var rt=function(t,e){return null==t?void 0:t[e]};var st=function(t,e){var n=rt(t,e);return it(n)?n:void 0},at=st(o.a,"Map"),ct=st(Object,"create");var lt=function(){this.__data__=ct?ct(null):{},this.size=0};var dt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ut="__lodash_hash_undefined__",ht=Object.prototype.hasOwnProperty;var ft=function(t){var e=this.__data__;if(ct){var n=e[t];return n===ut?void 0:n}return ht.call(e,t)?e[t]:void 0},pt=Object.prototype.hasOwnProperty;var mt=function(t){var e=this.__data__;return ct?void 0!==e[t]:pt.call(e,t)},gt="__lodash_hash_undefined__";var bt=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ct&&void 0===e?gt:e,this};function wt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}wt.prototype.clear=lt,wt.prototype.delete=dt,wt.prototype.get=ft,wt.prototype.has=mt,wt.prototype.set=bt;var kt=wt;var _t=function(){this.size=0,this.__data__={hash:new kt,map:new(at||V),string:new kt}};var vt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var yt=function(t,e){var n=t.__data__;return vt(e)?n["string"==typeof e?"string":"hash"]:n.map};var xt=function(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e};var Ct=function(t){return yt(this,t).get(t)};var At=function(t){return yt(this,t).has(t)};var Pt=function(t,e){var n=yt(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function Tt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Tt.prototype.clear=_t,Tt.prototype.delete=xt,Tt.prototype.get=Ct,Tt.prototype.has=At,Tt.prototype.set=Pt;var Et=Tt,St=200;var Rt=function(t,e){var n=this.__data__;if(n instanceof V){var o=n.__data__;if(!at||o.length<St-1)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Et(o)}return n.set(t,e),this.size=n.size,this};function Ot(t){var e=this.__data__=new V(t);this.size=e.size}Ot.prototype.clear=F,Ot.prototype.delete=B,Ot.prototype.get=L,Ot.prototype.has=z,Ot.prototype.set=Rt;var It=Ot;var Mt=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););return t},Dt=function(){try{var t=st(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Nt=function(t,e,n){"__proto__"==e&&Dt?Dt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Vt=Object.prototype.hasOwnProperty;var Ft=function(t,e,n){var o=t[e];Vt.call(t,e)&&E(o,n)&&(void 0!==n||e in t)||Nt(t,e,n)};var Bt=function(t,e,n,o){var i=!n;n||(n={});for(var r=-1,s=e.length;++r<s;){var a=e[r],c=o?o(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),i?Nt(n,a,c):Ft(n,a,c)}return n};var Lt=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},zt="[object Arguments]";var qt=function(t){return w(t)&&m(t)==zt},jt=Object.prototype,Ht=jt.hasOwnProperty,Ut=jt.propertyIsEnumerable,$t=qt(function(){return arguments}())?qt:function(t){return w(t)&&Ht.call(t,"callee")&&!Ut.call(t,"callee")},Wt=Array.isArray,Gt=n(6),Kt=9007199254740991,Jt=/^(?:0|[1-9]\d*)$/;var Zt=function(t,e){var n=typeof t;return!!(e=null==e?Kt:e)&&("number"==n||"symbol"!=n&&Jt.test(t))&&t>-1&&t%1==0&&t<e},Qt=9007199254740991;var Yt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Qt},Xt={};Xt["[object Float32Array]"]=Xt["[object Float64Array]"]=Xt["[object Int8Array]"]=Xt["[object Int16Array]"]=Xt["[object Int32Array]"]=Xt["[object Uint8Array]"]=Xt["[object Uint8ClampedArray]"]=Xt["[object Uint16Array]"]=Xt["[object Uint32Array]"]=!0,Xt["[object Arguments]"]=Xt["[object Array]"]=Xt["[object ArrayBuffer]"]=Xt["[object Boolean]"]=Xt["[object DataView]"]=Xt["[object Date]"]=Xt["[object Error]"]=Xt["[object Function]"]=Xt["[object Map]"]=Xt["[object Number]"]=Xt["[object Object]"]=Xt["[object RegExp]"]=Xt["[object Set]"]=Xt["[object String]"]=Xt["[object WeakMap]"]=!1;var te=function(t){return w(t)&&Yt(t.length)&&!!Xt[m(t)]};var ee=function(t){return function(e){return t(e)}},ne=n(5),oe=ne.a&&ne.a.isTypedArray,ie=oe?ee(oe):te,re=Object.prototype.hasOwnProperty;var se=function(t,e){var n=Wt(t),o=!n&&$t(t),i=!n&&!o&&Object(Gt.a)(t),r=!n&&!o&&!i&&ie(t),s=n||o||i||r,a=s?Lt(t.length,String):[],c=a.length;for(var l in t)!e&&!re.call(t,l)||s&&("length"==l||i&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Zt(l,c))||a.push(l);return a},ae=Object.prototype;var ce=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ae)},le=g(Object.keys,Object),de=Object.prototype.hasOwnProperty;var ue=function(t){if(!ce(t))return le(t);var e=[];for(var n in Object(t))de.call(t,n)&&"constructor"!=n&&e.push(n);return e};var he=function(t){return null!=t&&Yt(t.length)&&!W(t)};var fe=function(t){return he(t)?se(t):ue(t)};var pe=function(t,e){return t&&Bt(e,fe(e),t)};var me=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},ge=Object.prototype.hasOwnProperty;var be=function(t){if(!q(t))return me(t);var e=ce(t),n=[];for(var o in t)("constructor"!=o||!e&&ge.call(t,o))&&n.push(o);return n};var we=function(t){return he(t)?se(t,!0):be(t)};var ke=function(t,e){return t&&Bt(e,we(e),t)},_e=n(34);var ve=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e};var ye=function(t,e){for(var n=-1,o=null==t?0:t.length,i=0,r=[];++n<o;){var s=t[n];e(s,n,t)&&(r[i++]=s)}return r};var xe=function(){return[]},Ce=Object.prototype.propertyIsEnumerable,Ae=Object.getOwnPropertySymbols,Pe=Ae?function(t){return null==t?[]:(t=Object(t),ye(Ae(t),function(e){return Ce.call(t,e)}))}:xe;var Te=function(t,e){return Bt(t,Pe(t),e)};var Ee=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t},Se=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Ee(e,Pe(t)),t=b(t);return e}:xe;var Re=function(t,e){return Bt(t,Se(t),e)};var Oe=function(t,e,n){var o=e(t);return Wt(t)?o:Ee(o,n(t))};var Ie=function(t){return Oe(t,fe,Pe)};var Me=function(t){return Oe(t,we,Se)},De=st(o.a,"DataView"),Ne=st(o.a,"Promise"),Ve=st(o.a,"Set"),Fe=st(o.a,"WeakMap"),Be=Q(De),Le=Q(at),ze=Q(Ne),qe=Q(Ve),je=Q(Fe),He=m;(De&&"[object DataView]"!=He(new De(new ArrayBuffer(1)))||at&&"[object Map]"!=He(new at)||Ne&&"[object Promise]"!=He(Ne.resolve())||Ve&&"[object Set]"!=He(new Ve)||Fe&&"[object WeakMap]"!=He(new Fe))&&(He=function(t){var e=m(t),n="[object Object]"==e?t.constructor:void 0,o=n?Q(n):"";if(o)switch(o){case Be:return"[object DataView]";case Le:return"[object Map]";case ze:return"[object Promise]";case qe:return"[object Set]";case je:return"[object WeakMap]"}return e});var Ue=He,$e=Object.prototype.hasOwnProperty;var We=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&$e.call(t,"index")&&(n.index=t.index,n.input=t.input),n},Ge=o.a.Uint8Array;var Ke=function(t){var e=new t.constructor(t.byteLength);return new Ge(e).set(new Ge(t)),e};var Je=function(t,e){var n=e?Ke(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)},Ze=/\w*$/;var Qe=function(t){var e=new t.constructor(t.source,Ze.exec(t));return e.lastIndex=t.lastIndex,e},Ye=i?i.prototype:void 0,Xe=Ye?Ye.valueOf:void 0;var tn=function(t){return Xe?Object(Xe.call(t)):{}};var en=function(t,e){var n=e?Ke(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},nn="[object Boolean]",on="[object Date]",rn="[object Map]",sn="[object Number]",an="[object RegExp]",cn="[object Set]",ln="[object String]",dn="[object Symbol]",un="[object ArrayBuffer]",hn="[object DataView]",fn="[object Float32Array]",pn="[object Float64Array]",mn="[object Int8Array]",gn="[object Int16Array]",bn="[object Int32Array]",wn="[object Uint8Array]",kn="[object Uint8ClampedArray]",_n="[object Uint16Array]",vn="[object Uint32Array]";var yn=function(t,e,n){var o=t.constructor;switch(e){case un:return Ke(t);case nn:case on:return new o(+t);case hn:return Je(t,n);case fn:case pn:case mn:case gn:case bn:case wn:case kn:case _n:case vn:return en(t,n);case rn:return new o;case sn:case ln:return new o(t);case an:return Qe(t);case cn:return new o;case dn:return tn(t)}},xn=Object.create,Cn=function(){function t(){}return function(e){if(!q(e))return{};if(xn)return xn(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var An=function(t){return"function"!=typeof t.constructor||ce(t)?{}:Cn(b(t))},Pn="[object Map]";var Tn=function(t){return w(t)&&Ue(t)==Pn},En=ne.a&&ne.a.isMap,Sn=En?ee(En):Tn,Rn="[object Set]";var On=function(t){return w(t)&&Ue(t)==Rn},In=ne.a&&ne.a.isSet,Mn=In?ee(In):On,Dn=1,Nn=2,Vn=4,Fn="[object Arguments]",Bn="[object Function]",Ln="[object GeneratorFunction]",zn="[object Object]",qn={};qn[Fn]=qn["[object Array]"]=qn["[object ArrayBuffer]"]=qn["[object DataView]"]=qn["[object Boolean]"]=qn["[object Date]"]=qn["[object Float32Array]"]=qn["[object Float64Array]"]=qn["[object Int8Array]"]=qn["[object Int16Array]"]=qn["[object Int32Array]"]=qn["[object Map]"]=qn["[object Number]"]=qn[zn]=qn["[object RegExp]"]=qn["[object Set]"]=qn["[object String]"]=qn["[object Symbol]"]=qn["[object Uint8Array]"]=qn["[object Uint8ClampedArray]"]=qn["[object Uint16Array]"]=qn["[object Uint32Array]"]=!0,qn["[object Error]"]=qn[Bn]=qn["[object WeakMap]"]=!1;var jn=function t(e,n,o,i,r,s){var a,c=n&Dn,l=n&Nn,d=n&Vn;if(o&&(a=r?o(e,i,r,s):o(e)),void 0!==a)return a;if(!q(e))return e;var u=Wt(e);if(u){if(a=We(e),!c)return ve(e,a)}else{var h=Ue(e),f=h==Bn||h==Ln;if(Object(Gt.a)(e))return Object(_e.a)(e,c);if(h==zn||h==Fn||f&&!r){if(a=l||f?{}:An(e),!c)return l?Re(e,ke(a,e)):Te(e,pe(a,e))}else{if(!qn[h])return r?e:{};a=yn(e,h,c)}}s||(s=new It);var p=s.get(e);if(p)return p;s.set(e,a),Mn(e)?e.forEach(function(i){a.add(t(i,n,o,i,e,s))}):Sn(e)&&e.forEach(function(i,r){a.set(r,t(i,n,o,r,e,s))});var m=d?l?Me:Ie:l?keysIn:fe,g=u?void 0:m(e);return Mt(g||e,function(i,r){g&&(i=e[r=i]),Ft(a,r,t(i,n,o,r,e,s))}),a},Hn=1,Un=4;var $n=function(t,e){return jn(t,Hn|Un,e="function"==typeof e?e:void 0)};var Wn=function(t){return w(t)&&1===t.nodeType&&!P(t)};class Gn{constructor(t,e){this._config={},e&&this.define(e),t&&this._setObjectToTarget(this._config,t)}set(t,e){this._setToTarget(this._config,t,e)}define(t,e){this._setToTarget(this._config,t,e,!0)}get(t){return this._getFromSource(this._config,t)}_setToTarget(t,e,n,o=!1){if(P(e))return void this._setObjectToTarget(t,e,o);const i=e.split(".");e=i.pop();for(const e of i)P(t[e])||(t[e]={}),t=t[e];if(P(n))return P(t[e])||(t[e]={}),t=t[e],void this._setObjectToTarget(t,n,o);o&&void 0!==t[e]||(t[e]=n)}_getFromSource(t,e){const n=e.split(".");e=n.pop();for(const e of n){if(!P(t[e])){t=null;break}t=t[e]}return t?function(t){return $n(t,Kn)}(t[e]):void 0}_setObjectToTarget(t,e,n){Object.keys(e).forEach(o=>{this._setToTarget(t,o,e[o],n)})}}function Kn(t){return Wn(t)?t:void 0}var Jn=n(0);var Zn=function(){return function t(){t.called=!0}};class Qn{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=Zn(),this.off=Zn()}}function Yn(){let t="e";for(let e=0;e<8;e++)t+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t}var Xn={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};n(7);const to=Symbol("listeningTo"),eo=Symbol("emitterId");var no={on(t,e,n={}){this.listenTo(this,t,e,n)},once(t,e,n){let o=!1;this.listenTo(this,t,function(t,...n){o||(o=!0,t.off(),e.call(this,t,...n))},n)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,n,o={}){let i,r;this[to]||(this[to]={});const s=this[to];io(t)||oo(t);const a=io(t);(i=s[a])||(i=s[a]={emitter:t,callbacks:{}}),(r=i.callbacks[e])||(r=i.callbacks[e]=[]),r.push(n),function(t,e){const n=ro(t);if(n[e])return;let o=e,i=null;const r=[];for(;""!==o&&!n[o];)n[o]={callbacks:[],childEvents:[]},r.push(n[o]),i&&n[o].childEvents.push(i),i=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const t of r)t.callbacks=n[o].callbacks.slice();n[o].childEvents.push(i)}}(t,e);const c=so(t,e),l=Xn.get(o.priority),d={callback:n,priority:l};for(const t of c){let e=!1;for(let n=0;n<t.length;n++)if(t[n].priority<l){t.splice(n,0,d),e=!0;break}e||t.push(d)}},stopListening(t,e,n){const o=this[to];let i=t&&io(t);const r=o&&i&&o[i],s=r&&e&&r.callbacks[e];if(!(!o||t&&!r||e&&!s))if(n)co(t,e,n);else if(s){for(;n=s.pop();)co(t,e,n);delete r.callbacks[e]}else if(r){for(e in r.callbacks)this.stopListening(t,e);delete o[i]}else{for(i in o)this.stopListening(o[i].emitter);delete this[to]}},fire(t,...e){const n=t instanceof Qn?t:new Qn(this,t),o=n.name;let i=function t(e,n){let o;if(!e._events||!(o=e._events[n])||!o.callbacks.length)return n.indexOf(":")>-1?t(e,n.substr(0,n.lastIndexOf(":"))):null;return o.callbacks}(this,o);if(n.path.push(this),i){const t=[n,...e];i=Array.from(i);for(let e=0;e<i.length&&(i[e].callback.apply(this,t),n.off.called&&(delete n.off.called,co(this,o,i[e].callback)),!n.stop.called);e++);}if(this._delegations){const t=this._delegations.get(o),i=this._delegations.get("*");t&&ao(t,n,e),i&&ao(i,n,e)}return n.return},delegate(...t){return{to:(e,n)=>{this._delegations||(this._delegations=new Map),t.forEach(t=>{const o=this._delegations.get(t);o?o.set(e,n):this._delegations.set(t,new Map([[e,n]]))})}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const n=this._delegations.get(t);n&&n.delete(e)}else this._delegations.delete(t);else this._delegations.clear()}};function oo(t,e){t[eo]||(t[eo]=e||Yn())}function io(t){return t[eo]}function ro(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function so(t,e){const n=ro(t)[e];if(!n)return[];let o=[n.callbacks];for(let e=0;e<n.childEvents.length;e++){const i=so(t,n.childEvents[e]);o=o.concat(i)}return o}function ao(t,e,n){for(let[o,i]of t){i?"function"==typeof i&&(i=i(e.name)):i=e.name;const t=new Qn(e.source,i);t.path=[...e.path],o.fire(t,...n)}}function co(t,e,n){const o=so(t,e);for(const t of o)for(let e=0;e<t.length;e++)t[e].callback==n&&(t.splice(e,1),e--)}function lo(t,...e){e.forEach(e=>{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(n=>{if(n in t.prototype)return;const o=Object.getOwnPropertyDescriptor(e,n);o.enumerable=!1,Object.defineProperty(t.prototype,n,o)})})}function uo(t,e){const n=Math.min(t.length,e.length);for(let o=0;o<n;o++)if(t[o]!=e[o])return o;return t.length==e.length?"same":t.length<e.length?"prefix":"extension"}var ho=4;var fo=function(t){return jn(t,ho)};class po{constructor(){this.parent=null}get index(){let t;if(!this.parent)return null;if(-1==(t=this.parent.getChildIndex(this)))throw new Jn.b("view-node-not-found-in-parent: The node's parent does not contain this node.",this);return t}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}get document(){return this.parent instanceof po?this.parent.document:null}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.index),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),o=t.getAncestors(e);let i=0;for(;n[i]==o[i]&&n[i];)i++;return 0===i?null:n[i-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),o=uo(e,n);switch(o){case"prefix":return!0;case"extension":return!1;default:return e[o]<n[o]}}isAfter(t){return this!=t&&(this.root===t.root&&!this.isBefore(t))}_remove(){this.parent._removeChildren(this.index)}_fireChange(t,e){this.fire("change:"+t,e),this.parent&&this.parent._fireChange(t,e)}toJSON(){const t=fo(this);return delete t.parent,t}is(t){return"node"==t||"view:node"==t}}lo(po,no);class mo extends po{constructor(t){super(),this._textData=t}is(t){return"text"==t||"view:text"==t||super.is(t)}get data(){return this._textData}get _data(){return this.data}set _data(t){this._fireChange("text",this),this._textData=t}isSimilar(t){return t instanceof mo&&(this===t||this.data===t.data)}_clone(){return new mo(this.data)}}class go{constructor(t,e,n){if(this.textNode=t,e<0||e>t.data.length)throw new Jn.b("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this);if(n<0||e+n>t.data.length)throw new Jn.b("view-textproxy-wrong-length: Given length value is incorrect.",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"textProxy"==t||"view:textProxy"==t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this.textNode:this.parent;for(;null!==n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}}function bo(t){const e=new Map;for(const n in t)e.set(n,t[n]);return e}function wo(t){return!(!t||!t[Symbol.iterator])}class ko{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const n=_o(e,t);if(n)return{element:e,pattern:t,match:n}}return null}matchAll(...t){const e=[];for(const n of t)for(const t of this._patterns){const o=_o(n,t);o&&e.push({element:n,pattern:t,match:o})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function _o(t,e){if("function"==typeof e)return e(t);const n={};return e.name&&(n.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e}(e.name,t.name),!n.name)?null:e.attributes&&(n.attributes=function(t,e){const n=[];for(const o in t){const i=t[o];if(!e.hasAttribute(o))return null;{const t=e.getAttribute(o);if(!0===i)n.push(o);else if(i instanceof RegExp){if(!i.test(t))return null;n.push(o)}else{if(t!==i)return null;n.push(o)}}}return n}(e.attributes,t),!n.attributes)?null:!(e.classes&&(n.classes=function(t,e){const n=[];for(const o of t)if(o instanceof RegExp){const t=e.getClassNames();for(const e of t)o.test(e)&&n.push(e);if(0===n.length)return null}else{if(!e.hasClass(o))return null;n.push(o)}return n}(e.classes,t),!n.classes))&&(!(e.styles&&(n.styles=function(t,e){const n=[];for(const o in t){const i=t[o];if(!e.hasStyle(o))return null;{const t=e.getStyle(o);if(i instanceof RegExp){if(!i.test(t))return null;n.push(o)}else{if(t!==i)return null;n.push(o)}}}return n}(e.styles,t),!n.styles))&&n)}class vo extends po{constructor(t,e,n){if(super(),this.name=t,this._attrs=function(t){t=P(t)?bo(t):new Map(t);for(const[e,n]of t)null===n?t.delete(e):"string"!=typeof n&&t.set(e,String(n));return t}(e),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");xo(this._classes,t),this._attrs.delete("class")}this._styles=new Map,this._attrs.has("style")&&(yo(this._styles,this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(t,e=null){const n=t.replace(/^view:/,"");return e?"element"==n&&e==this.name:"element"==n||n==this.name||super.is(t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.size>0&&(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.size>0&&(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"!=t)return this._attrs.get(t);if(this._styles.size>0){let t="";for(const[e,n]of this._styles)t+=`${e}:${n};`;return t}}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?this._styles.size>0:this._attrs.has(t)}isSimilar(t){if(!(t instanceof vo))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,n]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==n)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const[e,n]of this._styles)if(!t._styles.has(e)||t._styles.get(e)!==n)return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.get(t)}getStyleNames(){return this._styles.keys()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new ko(...t);let n=this.parent;for(;n;){if(e.match(n))return n;n=n.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=Array.from(this._styles).map(t=>`${t[0]}:${t[1]}`).sort().join(";"),n=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(""==e?"":` style="${e}"`)+(""==n?"":` ${n}`)}_clone(t=!1){const e=[];if(t)for(const n of this.getChildren())e.push(n._clone(t));const n=new this.constructor(this.name,this._attrs,e);return n._classes=new Set(this._classes),n._styles=new Map(this._styles),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let n=0;const o=function(t){if("string"==typeof t)return[new mo(t)];wo(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new mo(t):t instanceof go?new mo(t.data):t)}(e);for(const e of o)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n<t+e;n++)this._children[n].parent=null;return this._children.splice(t,e)}_setAttribute(t,e){e=String(e),this._fireChange("attributes",this),"class"==t?xo(this._classes,e):"style"==t?yo(this._styles,e):this._attrs.set(t,e)}_removeAttribute(t){return this._fireChange("attributes",this),"class"==t?this._classes.size>0&&(this._classes.clear(),!0):"style"==t?this._styles.size>0&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._classes.add(t))}_removeClass(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._classes.delete(t))}_setStyle(t,e){if(this._fireChange("attributes",this),P(t)){const e=Object.keys(t);for(const n of e)this._styles.set(n,t[n])}else this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._styles.delete(t))}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function yo(t,e){let n=null,o=0,i=0,r=null;if(t.clear(),""!==e){";"!=e.charAt(e.length-1)&&(e+=";");for(let s=0;s<e.length;s++){const a=e.charAt(s);if(null===n)switch(a){case":":r||(r=e.substr(o,s-o),i=s+1);break;case'"':case"'":n=a;break;case";":{const n=e.substr(i,s-i);r&&t.set(r.trim(),n.trim()),r=null,o=s+1;break}}else a===n&&(n=null)}}}function xo(t,e){const n=e.split(/\s+/);t.clear(),n.forEach(e=>t.add(e))}class Co extends vo{constructor(t,e,n){super(t,e,n),this.getFillerOffset=Ao}is(t,e=null){const n=t&&t.replace(/^view:/,"");return e?"containerElement"==n&&e==this.name||super.is(t,e):"containerElement"==n||super.is(t)}}function Ao(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}var Po=function(t){return t};var To=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},Eo=Math.max;var So=function(t,e,n){return e=Eo(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=Eo(o.length-e,0),s=Array(r);++i<r;)s[i]=o[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=o[i];return a[e]=n(s),To(t,this,a)}};var Ro=function(t){return function(){return t}},Oo=Dt?function(t,e){return Dt(t,"toString",{configurable:!0,enumerable:!1,value:Ro(e),writable:!0})}:Po,Io=800,Mo=16,Do=Date.now;var No=function(t){var e=0,n=0;return function(){var o=Do(),i=Mo-(o-n);if(n=o,i>0){if(++e>=Io)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Oo);var Vo=function(t,e){return No(So(t,e,Po),t+"")};var Fo=function(t,e,n){if(!q(n))return!1;var o=typeof e;return!!("number"==o?he(n)&&Zt(e,n.length):"string"==o&&e in n)&&E(n[e],t)};var Bo=function(t){return Vo(function(e,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(i--,r):void 0,s&&Fo(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++o<i;){var a=n[o];a&&t(e,a,o,r)}return e})}(function(t,e){Bt(e,we(e),t)});const Lo=Symbol("observableProperties"),zo=Symbol("boundObservables"),qo=Symbol("boundProperties"),jo={set(t,e){if(q(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);Uo(this);const n=this[Lo];if(t in this&&!n.has(t))throw new Jn.b("observable-set-cannot-override: Cannot override an existing property.",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>n.get(t),set(e){const o=n.get(t);let i=this.fire("set:"+t,t,e,o);void 0===i&&(i=e),o===i&&n.has(t)||(n.set(t,i),this.fire("change:"+t,t,i,o))}}),this[t]=e},bind(...t){if(!t.length||!Go(t))throw new Jn.b("observable-bind-wrong-properties: All properties must be strings.",this);if(new Set(t).size!==t.length)throw new Jn.b("observable-bind-duplicate-properties: Properties must be unique.",this);Uo(this);const e=this[qo];t.forEach(t=>{if(e.has(t))throw new Jn.b("observable-bind-rebind: Cannot bind the same property more that once.",this)});const n=new Map;return t.forEach(t=>{const o={property:t,to:[]};e.set(t,o),n.set(t,o)}),{to:$o,toMany:Wo,_observable:this,_bindProperties:t,_to:[],_bindings:n}},unbind(...t){if(!(Lo in this))return;const e=this[qo],n=this[zo];if(t.length){if(!Go(t))throw new Jn.b("observable-unbind-wrong-properties: Properties must be strings.",this);t.forEach(t=>{const o=e.get(t);if(!o)return;let i,r,s,a;o.to.forEach(t=>{i=t[0],r=t[1],s=n.get(i),(a=s[r]).delete(o),a.size||delete s[r],Object.keys(s).length||(n.delete(i),this.stopListening(i,"change"))}),e.delete(t)})}else n.forEach((t,e)=>{this.stopListening(e,"change")}),n.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new Jn.b("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",this,{object:this,methodName:t});this.on(t,(t,n)=>{t.return=e.apply(this,n)}),this[t]=function(...e){return this.fire(t,e)}}};Bo(jo,no);var Ho=jo;function Uo(t){Lo in t||(Object.defineProperty(t,Lo,{value:new Map}),Object.defineProperty(t,zo,{value:new Map}),Object.defineProperty(t,qo,{value:new Map}))}function $o(...t){const e=function(...t){if(!t.length)throw new Jn.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null);const e={to:[]};let n;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach(t=>{if("string"==typeof t)n.properties.push(t);else{if("object"!=typeof t)throw new Jn.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null);n={observable:t,properties:[]},e.to.push(n)}}),e}(...t),n=Array.from(this._bindings.keys()),o=n.length;if(!e.callback&&e.to.length>1)throw new Jn.b("observable-bind-to-no-callback: Binding multiple observables only possible with callback.",this);if(o>1&&e.callback)throw new Jn.b("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.",this);e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==o)throw new Jn.b("observable-bind-to-properties-length: The number of properties must match.",this);t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(n[0]).callback=e.callback),function(t,e){e.forEach(e=>{const n=t[zo];let o;n.get(e.observable)||t.listenTo(e.observable,"change",(i,r)=>{(o=n.get(e.observable)[r])&&o.forEach(e=>{Ko(t,e.property)})})})}(this._observable,this._to),function(t){let e;t._bindings.forEach((n,o)=>{t._to.forEach(i=>{e=i.properties[n.callback?0:t._bindProperties.indexOf(o)],n.to.push([i.observable,e]),function(t,e,n,o){const i=t[zo],r=i.get(n),s=r||{};s[o]||(s[o]=new Set);s[o].add(e),r||i.set(n,s)}(t._observable,n,i.observable,e)})})}(this),this._bindProperties.forEach(t=>{Ko(this._observable,t)})}function Wo(t,e,n){if(this._bindings.size>1)throw new Jn.b("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().",this);this.to(...function(t,e){const n=t.map(t=>[t,e]);return Array.prototype.concat.apply([],n)}(t,e),n)}function Go(t){return t.every(t=>"string"==typeof t)}function Ko(t,e){const n=t[qo].get(e);let o;o=n.callback?n.callback.apply(t,n.to.map(t=>t[0][t[1]])):(o=n.to[0])[0][o[1]],t.hasOwnProperty(e)?t[e]=o:t.set(e,o)}const Jo=Symbol("document");class Zo extends Co{constructor(t,e,n){super(t,e,n),this.set("isReadOnly",!1),this.set("isFocused",!1)}is(t,e=null){const n=t&&t.replace(/^view:/,"");return e?"editableElement"==n&&e==this.name||super.is(t,e):"editableElement"==n||super.is(t)}destroy(){this.stopListening()}get document(){return this.getCustomProperty(Jo)}set _document(t){if(this.getCustomProperty(Jo))throw new Jn.b("view-editableelement-document-already-set: View document is already set.",this);this._setCustomProperty(Jo,t),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}}lo(Zo,Ho);const Qo=Symbol("rootName");class Yo extends Zo{constructor(t){super(t),this.rootName="main"}is(t,e=null){const n=t.replace(/^view:/,"");return e?"rootElement"==n&&e==this.name||super.is(t,e):"rootElement"==n||super.is(t)}get rootName(){return this.getCustomProperty(Qo)}set rootName(t){this._setCustomProperty(Qo,t)}set _name(t){this.name=t}}class Xo{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new Jn.b("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new Jn.b("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=ti._createAt(t.startPosition):this.position=ti._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,n,o;do{o=this.position,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,n=t.parent;if(null===n.parent&&t.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let o;if(n instanceof mo){if(t.isAtEnd)return this.position=ti._createAfter(n),this._next();o=n.data[t.offset]}else o=n.getChild(t.offset);if(o instanceof vo)return this.shallow?t.offset++:t=new ti(o,0),this.position=t,this._formatReturnValue("elementStart",o,e,t,1);if(o instanceof mo){if(this.singleCharacters)return t=new ti(o,0),this.position=t,this._next();{let n,i=o.data.length;return o==this._boundaryEndParent?(i=this.boundaries.end.offset,n=new go(o,0,i),t=ti._createAfter(n)):(n=new go(o,0,o.data.length),t.offset++),this.position=t,this._formatReturnValue("text",n,e,t,i)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{o=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-t.offset}const i=new go(n,t.offset,o);return t.offset+=o,this.position=t,this._formatReturnValue("text",i,e,t,o)}return t=ti._createAfter(n),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,e,t)}_previous(){let t=this.position.clone();const e=this.position,n=t.parent;if(null===n.parent&&0===t.offset)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let o;if(n instanceof mo){if(t.isAtStart)return this.position=ti._createBefore(n),this._previous();o=n.data[t.offset-1]}else o=n.getChild(t.offset-1);if(o instanceof vo)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",o,e,t,1)):(t=new ti(o,o.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,e,t));if(o instanceof mo){if(this.singleCharacters)return t=new ti(o,o.data.length),this.position=t,this._previous();{let n,i=o.data.length;if(o==this._boundaryStartParent){const e=this.boundaries.start.offset;i=(n=new go(o,e,o.data.length-e)).data.length,t=ti._createBefore(n)}else n=new go(o,0,o.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",n,e,t,i)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const e=n===this._boundaryStartParent?this.boundaries.start.offset:0;o=t.offset-e}t.offset-=o;const i=new go(n,t.offset,o);return this.position=t,this._formatReturnValue("text",i,e,t,o)}return t=ti._createBefore(n),this.position=t,this._formatReturnValue("elementStart",n,e,t,1)}_formatReturnValue(t,e,n,o,i){return e instanceof go&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=ti._createAfter(e.textNode):(o=ti._createAfter(e.textNode),this.position=o)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=ti._createBefore(e.textNode):(o=ti._createBefore(e.textNode),this.position=o))),{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:o,length:i}}}}class ti{constructor(t,e){this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const t=this.parent.is("text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof Zo);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=ti._createAt(this),n=e.offset+t;return e.offset=n<0?0:n,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new Xo(e);return n.skip(t),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let o=0;for(;e[o]==n[o]&&e[o];)o++;return 0===o?null:e[o-1]}is(t){return"position"==t||"view:position"==t}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],n=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),n.push(t.offset);const o=uo(e,n);switch(o){case"prefix":return"before";case"extension":return"after";default:return e[o]<n[o]?"before":"after"}}getWalker(t={}){return t.startPosition=this,new Xo(t)}clone(){return new ti(this.parent,this.offset)}static _createAt(t,e){if(t instanceof ti)return new this(t.parent,t.offset);{const n=t;if("end"==e)e=n.is("text")?n.data.length:n.childCount;else{if("before"==e)return this._createBefore(n);if("after"==e)return this._createAfter(n);if(0!==e&&!e)throw new Jn.b("view-createPositionAt-offset-required: View#createPositionAt() requires the offset when the first parameter is a view item.",n)}return new ti(n,e)}}static _createAfter(t){if(t.is("textProxy"))return new ti(t.textNode,t.offsetInText+t.data.length);if(!t.parent)throw new Jn.b("view-position-after-root: You can not make position after root.",t,{root:t});return new ti(t.parent,t.index+1)}static _createBefore(t){if(t.is("textProxy"))return new ti(t.textNode,t.offsetInText);if(!t.parent)throw new Jn.b("view-position-before-root: You can not make position before root.",t,{root:t});return new ti(t.parent,t.index)}}class ei{constructor(t,e=null){this.start=t.clone(),this.end=e?e.clone():t.clone()}*[Symbol.iterator](){yield*new Xo({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let t=this.start.getLastMatchingPosition(ni,{direction:"backward"}),e=this.end.getLastMatchingPosition(ni);return t.parent.is("text")&&t.isAtStart&&(t=ti._createBefore(t.parent)),e.parent.is("text")&&e.isAtEnd&&(e=ti._createAfter(e.parent)),new ei(t,e)}getTrimmed(){let t=this.start.getLastMatchingPosition(ni);if(t.isAfter(this.end)||t.isEqual(this.end))return new ei(t,t);let e=this.end.getLastMatchingPosition(ni,{direction:"backward"});const n=t.nodeAfter,o=e.nodeBefore;return n&&n.is("text")&&(t=new ti(n,0)),o&&o.is("text")&&(e=new ti(o,o.data.length)),new ei(t,e)}isEqual(t){return this==t||this.start.isEqual(t.start)&&this.end.isEqual(t.end)}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const n=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),o=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return n&&o}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new ei(this.start,t.start)),this.containsPosition(t.end)&&e.push(new ei(t.end,this.end))):e.push(this.clone()),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,n=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(n=t.end),new ei(e,n)}return null}getWalker(t={}){return t.boundaries=this,new Xo(t)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}clone(){return new ei(this.start,this.end)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new Xo(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new Xo(t);yield e.position;for(const t of e)yield t.nextPosition}is(t){return"range"==t||"view:range"==t}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}static _createFromParentsAndOffsets(t,e,n,o){return new this(new ti(t,e),new ti(n,o))}static _createFromPositionAndShift(t,e){const n=t,o=t.getShiftedBy(e);return e>0?new this(n,o):new this(o,n)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(ti._createBefore(t),e)}}function ni(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function oi(t){let e=0;for(const n of t)e++;return e}class ii{constructor(t=null,e,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const o of t._ranges)if(e.isEqual(o)){n=!0;break}if(!n)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=oi(this.getRanges());if(e!=oi(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let n=!1;for(let o of t.getRanges())if(o=o.getTrimmed(),e.start.isEqual(o.start)&&e.end.isEqual(o.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){if(1!==this.rangeCount)return null;const t=this.getFirstRange();let e=t.start.nodeAfter,n=t.end.nodeBefore;return t.start.parent.is("text")&&t.start.isAtEnd&&t.start.parent.nextSibling&&(e=t.start.parent.nextSibling),t.end.parent.is("text")&&t.end.isAtStart&&t.end.parent.previousSibling&&(n=t.end.parent.previousSibling),e instanceof vo&&e==n?e:null}setTo(t,e,n){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof ii||t instanceof ri)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof ei)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof ti)this._setRanges([new ei(t)]),this._setFakeOptions(e);else if(t instanceof po){const o=!!n&&!!n.backward;let i;if(void 0===e)throw new Jn.b("view-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.",this);i="in"==e?ei._createIn(t):"on"==e?ei._createOn(t):new ei(ti._createAt(t,e)),this._setRanges([i],o),this._setFakeOptions(n)}else{if(!wo(t))throw new Jn.b("view-selection-setTo-not-selectable: Cannot set selection to given place.",this);this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new Jn.b("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",this);const n=ti._createAt(t,e);if("same"==n.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==n.compareWith(o)?this._addRange(new ei(n,o),!0):this._addRange(new ei(o,n)),this.fire("change")}is(t){return"selection"==t||"view:selection"==t}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof ei))throw new Jn.b("view-selection-add-range-not-range: Selection range set to an object that is not an instance of view.Range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new Jn.b("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",this,{addedRange:t,intersectingRange:e});this._ranges.push(new ei(t.start,t.end))}}lo(ii,no);class ri{constructor(t=null,e,n){this._selection=new ii,this._selection.delegate("change").to(this),this._selection.setTo(t,e,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}is(t){return"selection"==t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setFocus(t,e){this._selection.setFocus(t,e)}}lo(ri,no);class si{constructor(t={}){this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[]}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,e){let n;const o=this._idProperty;if(o in t){if("string"!=typeof(n=t[o]))throw new Jn.b("collection-add-invalid-id",this);if(this.get(n))throw new Jn.b("collection-add-item-already-exists",this)}else t[o]=n=Yn();if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new Jn.b("collection-add-item-invalid-index",this);return this._items.splice(e,0,t),this._itemMap.set(n,t),this.fire("add",t,e),this}get(t){let e;if("string"==typeof t)e=this._itemMap.get(t);else{if("number"!=typeof t)throw new Jn.b("collection-get-invalid-arg: Index or id must be given.",this);e=this._items[t]}return e||null}has(t){if("string"==typeof t)return this._itemMap.has(t);{const e=t[this._idProperty];return this._itemMap.has(e)}}getIndex(t){let e;return e="string"==typeof t?this._itemMap.get(t):t,this._items.indexOf(e)}remove(t){let e,n,o,i=!1;const r=this._idProperty;if("string"==typeof t?(n=t,i=!(o=this._itemMap.get(n)),o&&(e=this._items.indexOf(o))):"number"==typeof t?(e=t,i=!(o=this._items[e]),o&&(n=o[r])):(n=(o=t)[r],i=-1==(e=this._items.indexOf(o))||!this._itemMap.get(n)),i)throw new Jn.b("collection-remove-404: Item not found.",this);this._items.splice(e,1),this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(s),this.fire("remove",o,e),o}map(t,e){return this._items.map(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(t){if(this._bindToCollection)throw new Jn.b("collection-bind-to-rebind: The collection cannot be bound more than once.",this);return this._bindToCollection=t,{as:t=>{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,n=(n,o,i)=>{const r=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(o);if(r&&s)this._bindToExternalToInternalMap.set(o,s),this._bindToInternalToExternalMap.set(s,o);else{const n=t(o);if(!n)return void this._skippedIndexesFromExternal.push(i);let r=i;for(const t of this._skippedIndexesFromExternal)i>t&&r--;for(const t of e._skippedIndexesFromExternal)r>=t&&r++;this._bindToExternalToInternalMap.set(o,n),this._bindToInternalToExternalMap.set(n,o),this.add(n,r);for(let t=0;t<e._skippedIndexesFromExternal.length;t++)r<=e._skippedIndexesFromExternal[t]&&e._skippedIndexesFromExternal[t]++}};for(const t of e)n(0,t,e.getIndex(t));this.listenTo(e,"add",n),this.listenTo(e,"remove",(t,e,n)=>{const o=this._bindToExternalToInternalMap.get(e);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(n<e&&t.push(e-1),n>e&&t.push(e),t),[])})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}lo(si,no);class ai{constructor(){this.selection=new ri,this.roots=new si({idProperty:"rootName"}),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(e=n(t))break}while(e)}}lo(ai,Ho);const ci=10;class li extends vo{constructor(t,e,n){super(t,e,n),this.getFillerOffset=di,this._priority=ci,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new Jn.b("attribute-element-get-elements-with-same-id-no-id: Cannot get elements with the same id for an attribute element without id.",this);return new Set(this._clonesGroup)}is(t,e=null){const n=t&&t.replace(/^view:/,"");return e?"attributeElement"==n&&e==this.name||super.is(t,e):"attributeElement"==n||super.is(t)}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function di(){if(ui(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(ui(t)>1)return null;t=t.parent}return!t||ui(t)>1?null:this.childCount}function ui(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length}li.DEFAULT_PRIORITY=ci;class hi extends vo{constructor(t,e,n){super(t,e,n),this.getFillerOffset=fi}is(t,e=null){const n=t.replace(/^view:/,"");return e?"emptyElement"==n&&e==this.name||super.is(t,e):"emptyElement"==n||super.is(t)}_insertChild(t,e){if(e&&(e instanceof po||Array.from(e).length>0))throw new Jn.b("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.",[this,e])}}function fi(){return null}const pi=navigator.userAgent.toLowerCase();var mi={isMac:function(t){return t.indexOf("macintosh")>-1}(pi),isEdge:function(t){return!!t.match(/edge\/(\d+.?\d*)/)}(pi),isGecko:function(t){return!!t.match(/gecko\/\d+/)}(pi),isSafari:function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(pi),isAndroid:function(t){return t.indexOf("android")>-1}(pi),features:{isRegExpUnicodePropertySupported:function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t}()}};const gi={"⌘":"ctrl","⇧":"shift","⌥":"alt"},bi={ctrl:"⌘",shift:"⇧",alt:"⌥"},wi=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let e=65;e<=90;e++){const n=String.fromCharCode(e);t[n.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}();function ki(t){let e;if("string"==typeof t){if(!(e=wi[t.toLowerCase()]))throw new Jn.b("keyboard-unknown-key: Unknown key name.",null,{key:t})}else e=t.keyCode+(t.altKey?wi.alt:0)+(t.ctrlKey?wi.ctrl:0)+(t.shiftKey?wi.shift:0);return e}function _i(t){return"string"==typeof t&&(t=vi(t)),t.map(t=>"string"==typeof t?ki(t):t).reduce((t,e)=>e+t,0)}function vi(t){return t.split(/\s*\+\s*/)}class yi extends vo{constructor(t,e,n){super(t,e,n),this.getFillerOffset=Ci}is(t,e=null){const n=t.replace(/^view:/,"");return e?"uiElement"==n&&e==this.name||super.is(t,e):"uiElement"==n||super.is(t)}_insertChild(t,e){if(e&&(e instanceof po||Array.from(e).length>0))throw new Jn.b("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.",this)}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}function xi(t){t.document.on("keydown",(e,n)=>(function(t,e,n){if(e.keyCode==wi.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),o=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(o||e.shiftKey){const e=t.focusNode,i=t.focusOffset,r=n.domPositionToView(e,i);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(s){const e=n.viewPositionToDom(a);o?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}})(0,n,t.domConverter))}function Ci(){return null}class Ai{constructor(t){this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"==t||"view:documentFragment"==t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let n=0;const o=function(t){if("string"==typeof t)return[new mo(t)];wo(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new mo(t):t instanceof go?new mo(t.data):t)}(e);for(const e of o)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n<t+e;n++)this._children[n].parent=null;return this._children.splice(t,e)}_fireChange(t,e){this.fire("change:"+t,e)}}lo(Ai,no);class Pi{constructor(t){this.document=t,this._cloneGroups=new Map}setSelection(t,e,n){this.document.selection._setTo(t,e,n)}setSelectionFocus(t,e){this.document.selection._setFocus(t,e)}createText(t){return new mo(t)}createAttributeElement(t,e,n={}){const o=new li(t,e);return n.priority&&(o._priority=n.priority),n.id&&(o._id=n.id),o}createContainerElement(t,e){return new Co(t,e)}createEditableElement(t,e){const n=new Zo(t,e);return n._document=this.document,n}createEmptyElement(t,e){return new hi(t,e)}createUIElement(t,e,n){const o=new yi(t,e);return n&&(o.render=n),o}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){P(t)&&void 0===n&&(n=e),n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof ti?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new Jn.b("view-writer-break-non-container-element: Trying to break an element which is not a container element.",this.document);if(!e.parent)throw new Jn.b("view-writer-break-root: Trying to break root element.",this.document);if(t.isAtStart)return ti._createBefore(e);if(!t.isAtEnd){const n=e._clone(!1);this.insert(ti._createAfter(e),n);const o=new ei(t,ti._createAt(e,"end")),i=new ti(n,0);this.move(o,i)}return ti._createAfter(e)}mergeAttributes(t){const e=t.offset,n=t.parent;if(n.is("text"))return t;if(n.is("attributeElement")&&0===n.childCount){const t=n.parent,e=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new ti(t,e))}const o=n.getChild(e-1),i=n.getChild(e);if(!o||!i)return t;if(o.is("text")&&i.is("text"))return Oi(o,i);if(o.is("attributeElement")&&i.is("attributeElement")&&o.isSimilar(i)){const t=o.childCount;return o._appendChild(i.getChildren()),i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new ti(o,t))}return t}mergeContainers(t){const e=t.nodeBefore,n=t.nodeAfter;if(!(e&&n&&e.is("containerElement")&&n.is("containerElement")))throw new Jn.b("view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.",this.document);const o=e.getChild(e.childCount-1),i=o instanceof mo?ti._createAt(o,"end"):ti._createAt(e,"end");return this.move(ei._createIn(n),ti._createAt(e,"end")),this.remove(ei._createOn(n)),i}insert(t,e){(function t(e,n){for(const o of e){if(!Ii.some(t=>o instanceof t))throw new Jn.b("view-writer-insert-invalid-node",n);o.is("text")||t(o.getChildren(),n)}})(e=wo(e)?[...e]:[e],this.document);const n=Ti(t);if(!n)throw new Jn.b("view-writer-invalid-position-container",this.document);const o=this._breakAttributes(t,!0),i=n._insertChild(o.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const r=o.getShiftedBy(i),s=this.mergeAttributes(o);if(0===i)return new ei(s,s);{s.isEqual(o)||r.offset--;const t=this.mergeAttributes(r);return new ei(s,t)}}remove(t){const e=t instanceof ei?t:ei._createOn(t);if(Di(e,this.document),e.isCollapsed)return new Ai;const{start:n,end:o}=this._breakAttributesRange(e,!0),i=n.parent,r=o.offset-n.offset,s=i._removeChildren(n.offset,r);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(n);return e.start=a,e.end=a.clone(),new Ai(s)}clear(t,e){Di(t,this.document);const n=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of n){const n=o.item;let i;if(n.is("element")&&e.isSimilar(n))i=ei._createOn(n);else if(!o.nextPosition.isAfter(t.start)&&n.is("textProxy")){const t=n.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(i=ei._createIn(t))}i&&(i.end.isAfter(t.end)&&(i.end=t.end),i.start.isBefore(t.start)&&(i.start=t.start),this.remove(i))}}move(t,e){let n;if(e.isAfter(t.end)){const o=(e=this._breakAttributes(e,!0)).parent,i=o.childCount;t=this._breakAttributesRange(t,!0),n=this.remove(t),e.offset+=o.childCount-i}else n=this.remove(t);return this.insert(e,n)}wrap(t,e){if(!(e instanceof li))throw new Jn.b("view-writer-wrap-invalid-attribute",this.document);if(Di(t,this.document),t.isCollapsed){let n=t.start;n.parent.is("element")&&!function(t){return Array.from(t.getChildren()).some(t=>!t.is("uiElement"))}(n.parent)&&(n=n.getLastMatchingPosition(t=>t.item.is("uiElement"))),n=this._wrapPosition(n,e);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(t.start)&&this.setSelection(n),new ei(n)}return this._wrapRange(t,e)}unwrap(t,e){if(!(e instanceof li))throw new Jn.b("view-writer-unwrap-invalid-attribute",this.document);if(Di(t,this.document),t.isCollapsed)return t;const{start:n,end:o}=this._breakAttributesRange(t,!0),i=n.parent,r=this._unwrapChildren(i,n.offset,o.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new ei(s,a)}rename(t,e){const n=new Co(t,e.getAttributes());return this.insert(ti._createAfter(e),n),this.move(ei._createIn(e),ti._createAt(n,0)),this.remove(ei._createOn(e)),n}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return ti._createAt(t,e)}createPositionAfter(t){return ti._createAfter(t)}createPositionBefore(t){return ti._createBefore(t)}createRange(t,e){return new ei(t,e)}createRangeOn(t){return ei._createOn(t)}createRangeIn(t){return ei._createIn(t)}createSelection(t,e,n){return new ii(t,e,n)}_wrapChildren(t,e,n,o){let i=e;const r=[];for(;i<n;){const e=t.getChild(i),n=e.is("text"),s=e.is("attributeElement"),a=e.is("emptyElement"),c=e.is("uiElement");if(s&&this._wrapAttributeElement(o,e))r.push(new ti(t,i));else if(n||a||c||s&&Ei(o,e)){const n=o._clone();e._remove(),n._appendChild(e),t._insertChild(i,n),this._addToClonedElementsGroup(n),r.push(new ti(t,i))}else s&&this._wrapChildren(e,0,e.childCount,o);i++}let s=0;for(const t of r){if(t.offset-=s,t.offset==e)continue;this.mergeAttributes(t).isEqual(t)||(s++,n--)}return ei._createFromParentsAndOffsets(t,e,t,n)}_unwrapChildren(t,e,n,o){let i=e;const r=[];for(;i<n;){const e=t.getChild(i);if(e.is("attributeElement"))if(e.isSimilar(o)){const o=e.getChildren(),s=e.childCount;e._remove(),t._insertChild(i,o),this._removeFromClonedElementsGroup(e),r.push(new ti(t,i),new ti(t,i+s)),i+=s,n+=s-1}else this._unwrapAttributeElement(o,e)?(r.push(new ti(t,i),new ti(t,i+1)),i++):(this._unwrapChildren(e,0,e.childCount,o),i++);else i++}let s=0;for(const t of r){if(t.offset-=s,t.offset==e||t.offset==n)continue;this.mergeAttributes(t).isEqual(t)||(s++,n--)}return ei._createFromParentsAndOffsets(t,e,t,n)}_wrapRange(t,e){const{start:n,end:o}=this._breakAttributesRange(t,!0),i=n.parent,r=this._wrapChildren(i,n.offset,o.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new ei(s,a)}_wrapPosition(t,e){if(e.isSimilar(t.parent))return Si(t.clone());t.parent.is("text")&&(t=Ri(t));const n=this.createAttributeElement();n._priority=Number.POSITIVE_INFINITY,n.isSimilar=(()=>!1),t.parent._insertChild(t.offset,n);const o=new ei(t,t.getShiftedBy(1));this.wrap(o,e);const i=new ti(n.parent,n.index);n._remove();const r=i.nodeBefore,s=i.nodeAfter;return r instanceof mo&&s instanceof mo?Oi(r,s):Si(i)}_wrapAttributeElement(t,e){if(!Ni(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&e.hasAttribute(n)&&e.getAttribute(n)!==t.getAttribute(n))return!1;for(const n of t.getStyleNames())if(e.hasStyle(n)&&e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&(e.hasAttribute(n)||this.setAttribute(n,t.getAttribute(n),e));for(const n of t.getStyleNames())e.hasStyle(n)||this.setStyle(n,t.getStyle(n),e);for(const n of t.getClassNames())e.hasClass(n)||this.addClass(n,e);return!0}_unwrapAttributeElement(t,e){if(!Ni(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&(!e.hasAttribute(n)||e.getAttribute(n)!==t.getAttribute(n)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const n of t.getStyleNames())if(!e.hasStyle(n)||e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const n=t.start,o=t.end;if(Di(t,this.document),t.isCollapsed){const n=this._breakAttributes(t.start,e);return new ei(n,n)}const i=this._breakAttributes(o,e),r=i.parent.childCount,s=this._breakAttributes(n,e);return i.offset+=i.parent.childCount-r,new ei(s,i)}_breakAttributes(t,e=!1){const n=t.offset,o=t.parent;if(t.parent.is("emptyElement"))throw new Jn.b("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new Jn.b("view-writer-cannot-break-ui-element",this.document);if(!e&&o.is("text")&&Mi(o.parent))return t.clone();if(Mi(o))return t.clone();if(o.is("text"))return this._breakAttributes(Ri(t),e);if(n==o.childCount){const t=new ti(o.parent,o.index+1);return this._breakAttributes(t,e)}if(0===n){const t=new ti(o.parent,o.index);return this._breakAttributes(t,e)}{const t=o.index+1,i=o._clone();o.parent._insertChild(t,i),this._addToClonedElementsGroup(i);const r=o.childCount-n,s=o._removeChildren(n,r);i._appendChild(s);const a=new ti(o.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let n=this._cloneGroups.get(e);n||(n=new Set,this._cloneGroups.set(e,n)),n.add(t),t._clonesGroup=n}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const n=this._cloneGroups.get(e);n&&n.delete(t)}}function Ti(t){let e=t.parent;for(;!Mi(e);){if(!e)return;e=e.parent}return e}function Ei(t,e){return t.priority<e.priority||!(t.priority>e.priority)&&t.getIdentity()<e.getIdentity()}function Si(t){const e=t.nodeBefore;if(e&&e.is("text"))return new ti(e,e.data.length);const n=t.nodeAfter;return n&&n.is("text")?new ti(n,0):t}function Ri(t){if(t.offset==t.parent.data.length)return new ti(t.parent.parent,t.parent.index+1);if(0===t.offset)return new ti(t.parent.parent,t.parent.index);const e=t.parent.data.slice(t.offset);return t.parent._data=t.parent.data.slice(0,t.offset),t.parent.parent._insertChild(t.parent.index+1,new mo(e)),new ti(t.parent.parent,t.parent.index+1)}function Oi(t,e){const n=t.data.length;return t._data+=e.data,e._remove(),new ti(t,n)}const Ii=[mo,li,Co,hi,yi];function Mi(t){return t&&(t.is("containerElement")||t.is("documentFragment"))}function Di(t,e){const n=Ti(t.start),o=Ti(t.end);if(!n||!o||n!==o)throw new Jn.b("view-writer-invalid-range-container",e)}function Ni(t,e){return null===t.id&&null===e.id}function Vi(t){return"[object Text]"==Object.prototype.toString.call(t)}const Fi=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},Bi=t=>t.createTextNode(" "),Li=7;let zi="";for(let t=0;t<Li;t++)zi+="";function qi(t){return Vi(t)&&t.data.substr(0,Li)===zi}function ji(t){return t.data.length==Li&&qi(t)}function Hi(t){return qi(t)?t.data.slice(Li):t.data}const Ui=new WeakMap;function $i(t,e){let n=Ui.get(e);return n||(n=e(window.document),Ui.set(e,n)),t.isEqualNode(n)}function Wi(t,e){if(e.keyCode==wi.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,n=t.getRangeAt(0).startOffset;qi(e)&&n<=Li&&t.collapse(e,0)}}}function Gi(t,e,n,o=!1){n=n||function(t,e){return t===e},Array.isArray(t)||(t=Array.from(t)),Array.isArray(e)||(e=Array.from(e));const i=function(t,e,n){const o=Ki(t,e,n);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const i=Ji(t,o),r=Ji(e,o),s=Ki(i,r,n),a=t.length-s,c=e.length-s;return{firstIndex:o,lastIndexOld:a,lastIndexNew:c}}(t,e,n);return o?function(t,e){const{firstIndex:n,lastIndexOld:o,lastIndexNew:i}=t;if(-1===n)return Array(e).fill("equal");let r=[];n>0&&(r=r.concat(Array(n).fill("equal")));i-n>0&&(r=r.concat(Array(i-n).fill("insert")));o-n>0&&(r=r.concat(Array(o-n).fill("delete")));i<e&&(r=r.concat(Array(e-i).fill("equal")));return r}(i,e.length):function(t,e){const n=[],{firstIndex:o,lastIndexOld:i,lastIndexNew:r}=e;r-o>0&&n.push({index:o,type:"insert",values:t.slice(o,r)});i-o>0&&n.push({index:o+(r-o),type:"delete",howMany:i-o});return n}(e,i)}function Ki(t,e,n){for(let o=0;o<Math.max(t.length,e.length);o++)if(void 0===t[o]||void 0===e[o]||!n(t[o],e[o]))return o;return-1}function Ji(t,e){return t.slice(e).reverse()}function Zi(t,e,n){n=n||function(t,e){return t===e};const o=t.length,i=e.length;if(o>200||i>200||o+i>300)return Zi.fastDiff(t,e,n,!0);let r,s;if(i<o){const n=t;t=e,e=n,r="delete",s="insert"}else r="insert",s="delete";const a=t.length,c=e.length,l=c-a,d={},u={};function h(o){const i=(void 0!==u[o-1]?u[o-1]:-1)+1,l=void 0!==u[o+1]?u[o+1]:-1,h=i>l?-1:1;d[o+h]&&(d[o]=d[o+h].slice(0)),d[o]||(d[o]=[]),d[o].push(i>l?r:s);let f=Math.max(i,l),p=f-o;for(;p<a&&f<c&&n(t[p],e[f]);)p++,f++,d[o].push("equal");return f}let f,p=0;do{for(f=-p;f<l;f++)u[f]=h(f);for(f=l+p;f>l;f--)u[f]=h(f);u[l]=h(l),p++}while(u[l]!==c);return d[l].slice(1)}function Qi(t,e,n){t.insertBefore(n,t.childNodes[e]||null)}function Yi(t){const e=t.parentNode;e&&e.removeChild(t)}function Xi(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}Zi.fastDiff=Gi;class tr{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new Jn.b("view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.",this);this.markedChildren.add(e)}}}render(){let t;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(t){const e=this.domConverter.viewPositionToDom(t),n=e.parent.ownerDocument;qi(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=er(n,e.parent,e.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=this.domConverter.mapViewToDom(t).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),i=this._diffNodeLists(n,o),r=this._findReplaceActions(i,n,o);if(-1!==r.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const i of r)if("replace"===i){const i=e.equal+e.insert,r=e.equal+e.delete,s=t.getChild(i);s&&!s.is("uiElement")&&this._updateElementMappings(s,n[r]),Yi(o[i]),e.equal++}else e[i]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("text")?ti._createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Vi(e.parent)&&qi(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!qi(t))throw new Jn.b("view-renderer-filler-was-lost: The inline filler node was lost.",this);ji(t)?t.parentNode.removeChild(t):t.data=t.data.substr(Li),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,n=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor(t=>t.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(n===e.getFillerOffset())return!1;const o=t.nodeBefore,i=t.nodeAfter;return!(o instanceof mo||i instanceof mo)}_updateText(t,e){const n=this.domConverter.findCorrespondingDomText(t),o=this.domConverter.viewToDom(t,n.ownerDocument),i=n.data;let r=o.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(r=zi+r),i!=r){const t=Gi(i,r);for(const e of t)"insert"===e.type?n.insertData(e.index,e.values.join("")):n.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.attributes).map(t=>t.name),o=t.getAttributeKeys();for(const n of o)e.setAttribute(n,t.getAttribute(n));for(const o of n)t.hasAttribute(o)||e.removeAttribute(o)}_updateChildren(t,e){const n=this.domConverter.mapViewToDom(t);if(!n)return;const o=e.inlineFillerPosition,i=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,n.ownerDocument,{bind:!0,inlineFillerPosition:o}));o&&o.parent===t&&er(n.ownerDocument,r,o.offset);const s=this._diffNodeLists(i,r);let a=0;const c=new Set;for(const t of s)"insert"===t?(Qi(n,a,r[a]),a++):"delete"===t?(c.add(i[a]),Yi(i[a])):(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const t of c)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return Zi(t=function(t,e){const n=Array.from(t);if(0==n.length||!e)return n;n[n.length-1]==e&&n.pop();return n}(t,this._fakeSelectionContainer),e,function(t,e,n){if(e===n)return!0;if(Vi(e)&&Vi(n))return e.data===n.data;if($i(e,t)&&$i(n,t))return!0;return!1}.bind(null,this.domConverter.blockFiller))}_findReplaceActions(t,e,n){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let o=[],i=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?r.push(n[s.equal+s.insert]):"delete"===a?i.push(e[s.equal+s.delete]):((o=o.concat(Zi(i,r,nr).map(t=>"equal"===t?"replace":t))).push("equal"),i=[],r=[]),s[a]++;return o.concat(Zi(i,r,nr).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;let n=this._fakeSelectionContainer;n||(this._fakeSelectionContainer=n=e.createElement("div"),Object.assign(n.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),n.textContent=" "),n.parentElement&&n.parentElement==t||t.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const o=e.getSelection(),i=e.createRange();o.removeAllRanges(),i.selectNodeContents(n),o.addRange(i),this.domConverter.bindFakeSelection(n,this.selection)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.focus(),e.collapse(n.parent,n.offset),e.extend(o.parent,o.offset),mi.isGecko&&function(t,e){const n=t.parent;if(n.nodeType!=Node.ELEMENT_NODE||t.offset!=n.childNodes.length-1)return;const o=n.childNodes[t.offset];o&&"BR"==o.tagName&&e.addRange(e.getRangeAt(0))}(o,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,n=this.domConverter.mapDomToView(e);e&&n&&t.getSelection().removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function er(t,e,n){const o=e instanceof Array?e:e.childNodes,i=o[n];if(Vi(i))return i.data=zi+i.data,i;{const i=t.createTextNode(zi);return Array.isArray(e)?o.splice(n,0,i):Qi(e,n,i),i}}function nr(t,e){return Xi(t)&&Xi(e)&&!Vi(t)&&!Vi(e)&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}lo(tr,Ho);var or={window:window,document:document};function ir(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function rr(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}class sr{constructor(t={}){this.blockFiller=t.blockFiller||Fi,this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new ii(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of Array.from(t.childNodes))this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,n={}){if(t.is("text")){const n=this._processDataFromViewText(t);return e.createTextNode(n)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let o;if(t.is("documentFragment"))o=e.createDocumentFragment(),n.bind&&this.bindDocumentFragments(o,t);else{if(t.is("uiElement"))return o=t.render(e),n.bind&&this.bindElements(o,t),o;o=e.createElement(t.name),n.bind&&this.bindElements(o,t);for(const e of t.getAttributeKeys())o.setAttribute(e,t.getAttribute(e))}if(n.withChildren||void 0===n.withChildren)for(const i of this.viewChildrenToDom(t,e,n))o.appendChild(i);return o}}*viewChildrenToDom(t,e,n={}){const o=t.getFillerOffset&&t.getFillerOffset();let i=0;for(const r of t.getChildren())o===i&&(yield this.blockFiller(e)),yield this.viewToDom(r,e,n),i++;o===i&&(yield this.blockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),n=this.viewPositionToDom(t.end),o=document.createRange();return o.setStart(e.parent,e.offset),o.setEnd(n.parent,n.offset),o}viewPositionToDom(t){const e=t.parent;if(e.is("text")){const n=this.findCorrespondingDomText(e);if(!n)return null;let o=t.offset;return qi(n)&&(o+=Li),{parent:n,offset:o}}{let n,o,i;if(0===t.offset){if(!(n=this.mapViewToDom(e)))return null;i=n.childNodes[0]}else{const e=t.nodeBefore;if(!(o=e.is("text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore)))return null;n=o.parentNode,i=o.nextSibling}if(Vi(i)&&qi(i))return{parent:i,offset:Li};return{parent:n,offset:o?ir(o)+1:0}}}domToView(t,e={}){if($i(t,this.blockFiller))return null;const n=this.getParentUIElement(t,this._domToViewMapping);if(n)return n;if(Vi(t)){if(ji(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new mo(e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let n;if(this.isDocumentFragment(t))n=new Ai,e.bind&&this.bindDocumentFragments(t,n);else{const o=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();n=new vo(o),e.bind&&this.bindElements(t,n);const i=t.attributes;for(let t=i.length-1;t>=0;t--)n._setAttribute(i[t].name,i[t].value)}if(e.withChildren||void 0===e.withChildren)for(const o of this.domChildrenToView(t,e))n._appendChild(o);return n}}*domChildrenToView(t,e={}){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n],i=this.domToView(o,e);null!==i&&(yield i)}}domSelectionToView(t){if(1===t.rangeCount){let e=t.getRangeAt(0).startContainer;Vi(e)&&(e=e.parentNode);const n=this.fakeSelectionToView(e);if(n)return n}const e=this.isDomSelectionBackward(t),n=[];for(let e=0;e<t.rangeCount;e++){const o=t.getRangeAt(e),i=this.domRangeToView(o);i&&n.push(i)}return new ii(n,{backward:e})}domRangeToView(t){const e=this.domPositionToView(t.startContainer,t.startOffset),n=this.domPositionToView(t.endContainer,t.endOffset);return e&&n?new ei(e,n):null}domPositionToView(t,e){if($i(t,this.blockFiller))return this.domPositionToView(t.parentNode,ir(t));const n=this.mapDomToView(t);if(n&&n.is("uiElement"))return ti._createBefore(n);if(Vi(t)){if(ji(t))return this.domPositionToView(t.parentNode,ir(t));const n=this.findCorrespondingViewText(t);let o=e;return n?(qi(t)&&(o=(o-=Li)<0?0:o),new ti(n,o)):null}if(0===e){const e=this.mapDomToView(t);if(e)return new ti(e,0)}else{const n=t.childNodes[e-1],o=Vi(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(o&&o.parent)return new ti(o.parent,o.index+1)}return null}mapDomToView(t){return this.getParentUIElement(t)||this._domToViewMapping.get(t)}findCorrespondingViewText(t){if(ji(t))return null;const e=this.getParentUIElement(t);if(e)return e;const n=t.previousSibling;if(n){if(!this.isElement(n))return null;const t=this.mapDomToView(n);if(t){return t.nextSibling instanceof mo?t.nextSibling:null}}else{const e=this.mapDomToView(t.parentNode);if(e){const t=e.getChild(0);return t instanceof mo?t:null}}return null}mapViewToDom(t){return this._viewToDomMapping.get(t)}findCorrespondingDomText(t){const e=t.previousSibling;return e&&this.mapViewToDom(e)?this.mapViewToDom(e).nextSibling:!e&&t.parent&&this.mapViewToDom(t.parent)?this.mapViewToDom(t.parent).childNodes[0]:null}focus(t){const e=this.mapViewToDom(t);if(e&&e.ownerDocument.activeElement!==e){const{scrollX:t,scrollY:n}=or.window,o=[];cr(e,t=>{const{scrollLeft:e,scrollTop:n}=t;o.push([e,n])}),e.focus(),cr(e,t=>{const[e,n]=o.shift();t.scrollLeft=e,t.scrollTop=n}),or.window.scrollTo(t,n)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const n=e.collapsed;return e.detach(),n}getParentUIElement(t){const e=rr(t);for(e.pop();e.length;){const t=e.pop(),n=this._domToViewMapping.get(t);if(n&&n.is("uiElement"))return n}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}_isDomSelectionPositionCorrect(t,e){if(Vi(t)&&qi(t)&&e<Li)return!1;if(this.isElement(t)&&qi(t.childNodes[e]))return!1;const n=this.mapDomToView(t);return!n||!n.is("uiElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const n=this._getTouchingViewTextNode(t,!1);!(n&&this._nodeEndsWithSpace(n))&&n||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){const n=this._getTouchingViewTextNode(t,!0);" "!=e.charAt(e.length-2)&&n&&" "!=n.data.charAt(0)||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(ar(t,this.preElements))return Hi(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(t,!1),o=this._getTouchingInlineDomNode(t,!0),i=this._checkShouldLeftTrimDomText(n),r=this._checkShouldRightTrimDomText(t,o);return i&&(e=e.replace(/^ /,"")),r&&(e=e.replace(/ $/,"")),e=(e=Hi(new Text(e))).replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(e)||!o||o.data&&" "==o.data.charAt(0))&&(e=e.replace(/\u00A0$/," ")),i&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t){return!t||(!!Wn(t)||/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!qi(t)}_getTouchingViewTextNode(t,e){const n=new Xo({startPosition:e?ti._createAfter(t):ti._createBefore(t),direction:e?"forward":"backward"});for(const t of n){if(t.item.is("containerElement"))return null;if(t.item.is("br"))return null;if(t.item.is("textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const n=e?"nextNode":"previousNode",o=t.ownerDocument,i=rr(t)[0],r=o.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>Vi(t)?NodeFilter.FILTER_ACCEPT:"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=t;const s=r[n]();if(null!==s){const e=function(t,e){const n=rr(t),o=rr(e);let i=0;for(;n[i]==o[i]&&n[i];)i++;return 0===i?null:n[i-1]}(t,s);if(e&&!ar(t,this.blockElements,e)&&!ar(s,this.blockElements,e))return s}return null}}function ar(t,e,n){let o=rr(t);return n&&(o=o.slice(o.indexOf(n)+1)),o.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function cr(t,e){for(;t&&t!=or.document;)e(t),t=t.parentNode}function lr(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}var dr=Bo({},no,{listenTo(t,...e){if(Xi(t)||lr(t)){const n=this._getProxyEmitter(t)||new ur(t);n.attach(...e),t=n}no.listenTo.call(this,t,...e)},stopListening(t,e,n){if(Xi(t)||lr(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}no.stopListening.call(this,t,e,n),t instanceof ur&&t.detach(e)},_getProxyEmitter(t){return function(t,e){return t[to]&&t[to][e]?t[to][e].emitter:null}(this,hr(t))}});class ur{constructor(t){oo(this,hr(t)),this._domNode=t}}function hr(t){return t["data-ck-expando"]||(t["data-ck-expando"]=Yn())}Bo(ur.prototype,no,{attach(t,e,n={}){if(this._domListeners&&this._domListeners[t])return;const o=this._createDomListener(t,!!n.useCapture);this._domNode.addEventListener(t,o,!!n.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[t]=o},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const n=e=>{this.fire(t,e)};return n.removeListener=(()=>{this._domNode.removeEventListener(t,n,e),delete this._domListeners[t]}),n}});class fr{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}lo(fr,dr);var pr="__lodash_hash_undefined__";var mr=function(t){return this.__data__.set(t,pr),this};var gr=function(t){return this.__data__.has(t)};function br(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Et;++e<n;)this.add(t[e])}br.prototype.add=br.prototype.push=mr,br.prototype.has=gr;var wr=br;var kr=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1};var _r=function(t,e){return t.has(e)},vr=1,yr=2;var xr=function(t,e,n,o,i,r){var s=n&vr,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var l=r.get(t);if(l&&r.get(e))return l==e;var d=-1,u=!0,h=n&yr?new wr:void 0;for(r.set(t,e),r.set(e,t);++d<a;){var f=t[d],p=e[d];if(o)var m=s?o(p,f,d,e,t,r):o(f,p,d,t,e,r);if(void 0!==m){if(m)continue;u=!1;break}if(h){if(!kr(e,function(t,e){if(!_r(h,e)&&(f===t||i(f,t,n,o,r)))return h.push(e)})){u=!1;break}}else if(f!==p&&!i(f,p,n,o,r)){u=!1;break}}return r.delete(t),r.delete(e),u};var Cr=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,o){n[++e]=[o,t]}),n};var Ar=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n},Pr=1,Tr=2,Er="[object Boolean]",Sr="[object Date]",Rr="[object Error]",Or="[object Map]",Ir="[object Number]",Mr="[object RegExp]",Dr="[object Set]",Nr="[object String]",Vr="[object Symbol]",Fr="[object ArrayBuffer]",Br="[object DataView]",Lr=i?i.prototype:void 0,zr=Lr?Lr.valueOf:void 0;var qr=function(t,e,n,o,i,r,s){switch(n){case Br:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Fr:return!(t.byteLength!=e.byteLength||!r(new Ge(t),new Ge(e)));case Er:case Sr:case Ir:return E(+t,+e);case Rr:return t.name==e.name&&t.message==e.message;case Mr:case Nr:return t==e+"";case Or:var a=Cr;case Dr:var c=o&Pr;if(a||(a=Ar),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;o|=Tr,s.set(t,e);var d=xr(a(t),a(e),o,i,r,s);return s.delete(t),d;case Vr:if(zr)return zr.call(t)==zr.call(e)}return!1},jr=1,Hr=Object.prototype.hasOwnProperty;var Ur=function(t,e,n,o,i,r){var s=n&jr,a=Ie(t),c=a.length;if(c!=Ie(e).length&&!s)return!1;for(var l=c;l--;){var d=a[l];if(!(s?d in e:Hr.call(e,d)))return!1}var u=r.get(t);if(u&&r.get(e))return u==e;var h=!0;r.set(t,e),r.set(e,t);for(var f=s;++l<c;){var p=t[d=a[l]],m=e[d];if(o)var g=s?o(m,p,d,e,t,r):o(p,m,d,t,e,r);if(!(void 0===g?p===m||i(p,m,n,o,r):g)){h=!1;break}f||(f="constructor"==d)}if(h&&!f){var b=t.constructor,w=e.constructor;b!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(h=!1)}return r.delete(t),r.delete(e),h},$r=1,Wr="[object Arguments]",Gr="[object Array]",Kr="[object Object]",Jr=Object.prototype.hasOwnProperty;var Zr=function(t,e,n,o,i,r){var s=Wt(t),a=Wt(e),c=s?Gr:Ue(t),l=a?Gr:Ue(e),d=(c=c==Wr?Kr:c)==Kr,u=(l=l==Wr?Kr:l)==Kr,h=c==l;if(h&&Object(Gt.a)(t)){if(!Object(Gt.a)(e))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new It),s||ie(t)?xr(t,e,n,o,i,r):qr(t,e,c,n,o,i,r);if(!(n&$r)){var f=d&&Jr.call(t,"__wrapped__"),p=u&&Jr.call(e,"__wrapped__");if(f||p){var m=f?t.value():t,g=p?e.value():e;return r||(r=new It),i(m,g,n,o,r)}}return!!h&&(r||(r=new It),Ur(t,e,n,o,i,r))};var Qr=function t(e,n,o,i,r){return e===n||(null==e||null==n||!w(e)&&!w(n)?e!=e&&n!=n:Zr(e,n,o,i,t,r))};var Yr=function(t,e,n){var o=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===o?Qr(t,e,void 0,n):!!o};class Xr extends fr{constructor(t){super(t),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=t.domConverter,this.renderer=t._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(t){this._domElements.push(t),this.isEnabled&&this._mutationObserver.observe(t,this._config)}enable(){super.enable();for(const t of this._domElements)this._mutationObserver.observe(t,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(t){if(0===t.length)return;const e=this.domConverter,n=new Map,o=new Set;for(const n of t)if("childList"===n.type){const t=e.mapDomToView(n.target);if(t&&t.is("uiElement"))continue;t&&!this._isBogusBrMutation(n)&&o.add(t)}for(const i of t){const t=e.mapDomToView(i.target);if((!t||!t.is("uiElement"))&&"characterData"===i.type){const t=e.findCorrespondingViewText(i.target);t&&!o.has(t.parent)?n.set(t,{type:"text",oldText:t.data,newText:Hi(i.target),node:t}):!t&&qi(i.target)&&o.add(e.mapDomToView(i.target.parentNode))}}const i=[];for(const t of n.values())this.renderer.markToSync("text",t.node),i.push(t);for(const t of o){const n=e.mapViewToDom(t),o=Array.from(t.getChildren()),r=Array.from(e.domChildrenToView(n,{withChildren:!1}));Yr(o,r,a)||(this.renderer.markToSync("children",t),i.push({type:"children",oldChildren:o,newChildren:r,node:t}))}const r=t[0].target.ownerDocument.getSelection();let s=null;if(r&&r.anchorNode){const t=e.domPositionToView(r.anchorNode,r.anchorOffset),n=e.domPositionToView(r.focusNode,r.focusOffset);t&&n&&(s=new ii(t)).setFocus(n)}function a(t,e){if(!Array.isArray(t))return t===e||!(!t.is("text")||!e.is("text"))&&t.data===e.data}this.document.fire("mutations",i,s),this.view.forceRender()}_isBogusBrMutation(t){let e=null;return null===t.nextSibling&&0===t.removedNodes.length&&1==t.addedNodes.length&&(e=this.domConverter.domToView(t.addedNodes[0],{withChildren:!1})),e&&e.is("element","br")}}class ts{constructor(t,e,n){this.view=t,this.document=t.document,this.domEvent=e,this.domTarget=e.target,Bo(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class es extends fr{constructor(t){super(t),this.useCapture=!1}observe(t){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach(e=>{this.listenTo(t,e,(t,e)=>{this.isEnabled&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,n){this.isEnabled&&this.document.fire(t,new ts(this.view,e,n))}}class ns extends es{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey||t.metaKey,shiftKey:t.shiftKey,get keystroke(){return ki(this)}})}}var os=function(){return o.a.Date.now()},is="[object Symbol]";var rs=function(t){return"symbol"==typeof t||w(t)&&m(t)==is},ss=NaN,as=/^\s+|\s+$/g,cs=/^[-+]0x[0-9a-f]+$/i,ls=/^0b[01]+$/i,ds=/^0o[0-7]+$/i,us=parseInt;var hs=function(t){if("number"==typeof t)return t;if(rs(t))return ss;if(q(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=q(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(as,"");var n=ls.test(t);return n||ds.test(t)?us(t.slice(2),n?2:8):cs.test(t)?ss:+t},fs="Expected a function",ps=Math.max,ms=Math.min;var gs=function(t,e,n){var o,i,r,s,a,c,l=0,d=!1,u=!1,h=!0;if("function"!=typeof t)throw new TypeError(fs);function f(e){var n=o,r=i;return o=i=void 0,l=e,s=t.apply(r,n)}function p(t){var n=t-c;return void 0===c||n>=e||n<0||u&&t-l>=r}function m(){var t=os();if(p(t))return g(t);a=setTimeout(m,function(t){var n=e-(t-c);return u?ms(n,r-(t-l)):n}(t))}function g(t){return a=void 0,h&&o?f(t):(o=i=void 0,s)}function b(){var t=os(),n=p(t);if(o=arguments,i=this,c=t,n){if(void 0===a)return function(t){return l=t,a=setTimeout(m,e),d?f(t):s}(c);if(u)return clearTimeout(a),a=setTimeout(m,e),f(c)}return void 0===a&&(a=setTimeout(m,e)),s}return e=hs(e)||0,q(n)&&(d=!!n.leading,r=(u="maxWait"in n)?ps(hs(n.maxWait)||0,e):r,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,o=c=i=a=void 0},b.flush=function(){return void 0===a?s:g(os())},b};class bs extends fr{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=gs(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("keydown",(e,n)=>{t.selection.isFake&&function(t){return t==wi.arrowright||t==wi.arrowleft||t==wi.arrowup||t==wi.arrowdown}(n.keyCode)&&this.isEnabled&&(n.preventDefault(),this._handleSelectionMove(n.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,n=new ii(e.getRanges(),{backward:e.isBackward,fake:!1});t!=wi.arrowleft&&t!=wi.arrowup||n.setTo(n.getFirstPosition()),t!=wi.arrowright&&t!=wi.arrowdown||n.setTo(n.getLastPosition());const o={oldSelection:e,newSelection:n,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}class ws extends fr{constructor(t){super(t),this.mutationObserver=t.getObserver(Xr),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=gs(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",()=>{this._handleSelectionChange(e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t){if(!this.isEnabled||!this.document.isFocused&&!this.document.isReadOnly)return;this.mutationObserver.flush();const e=t.defaultView.getSelection(),n=this.domConverter.domSelectionToView(e);if(!(this.selection.isEqual(n)&&this.domConverter.isDomSelectionCorrect(e)||++this._loopbackCounter>60))if(this.selection.isSimilar(n))this.view.forceRender();else{const t={oldSelection:this.selection,newSelection:n,domSelection:e};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class ks extends es{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.forceRender(),50)}),e.on("blur",(n,o)=>{const i=e.selection.editableElement;null!==i&&i!==o.target||(e.isFocused=!1,t.forceRender())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class _s extends es{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}}class vs extends es{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}}function ys(t){return"[object Range]"==Object.prototype.toString.apply(t)}function xs(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const Cs=["top","right","bottom","left","width","height"];class As{constructor(t){const e=ys(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),Wn(t)||e)Ps(this,e?As.getDomRangeRects(t)[0]:t.getBoundingClientRect());else if(lr(t)){const{innerWidth:e,innerHeight:n}=t;Ps(this,{top:0,right:e,bottom:n,left:0,width:e,height:n})}else Ps(this,t)}clone(){return new As(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new As(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!Ts(t)){let n=t.parentNode||t.commonAncestorContainer;for(;n&&!Ts(n);){const t=new As(n),o=e.getIntersection(t);if(!o)return null;o.getArea()<e.getArea()&&(e=o),n=n.parentNode}}return e}isEqual(t){for(const e of Cs)if(this[e]!==t[e])return!1;return!0}contains(t){const e=this.getIntersection(t);return!(!e||!e.isEqual(t))}excludeScrollbarsAndBorders(){const t=this._source;let e,n;if(lr(t))e=t.innerWidth-t.document.documentElement.clientWidth,n=t.innerHeight-t.document.documentElement.clientHeight;else{const o=xs(this._source);e=t.offsetWidth-t.clientWidth,n=t.offsetHeight-t.clientHeight,this.moveBy(o.left,o.top)}return this.width-=e,this.right-=e,this.height-=n,this.bottom-=n,this}static getDomRangeRects(t){const e=[],n=Array.from(t.getClientRects());if(n.length)for(const t of n)e.push(new As(t));else{let n=t.startContainer;Vi(n)&&(n=n.parentNode);const o=new As(n.getBoundingClientRect());o.right=o.left,o.width=0,e.push(o)}return e}}function Ps(t,e){for(const n of Cs)t[n]=e[n]}function Ts(t){return!!Wn(t)&&t===t.ownerDocument.body}function Es({target:t,viewportOffset:e=0}){const n=Ns(t);let o=n,i=null;for(;o;){let r;Rs(r=Vs(o==n?t:i),()=>Fs(t,o));const s=Fs(t,o);if(Ss(o,s,e),o.parent!=o){if(i=o.frameElement,o=o.parent,!i)return}else o=null}}function Ss(t,e,n){const o=e.clone().moveBy(0,n),i=e.clone().moveBy(0,-n),r=new As(t).excludeScrollbarsAndBorders();if(![i,o].every(t=>r.contains(t))){let{scrollX:s,scrollY:a}=t;Is(i,r)?a-=r.top-e.top+n:Os(o,r)&&(a+=e.bottom-r.bottom+n),Ms(e,r)?s-=r.left-e.left+n:Ds(e,r)&&(s+=e.right-r.right+n),t.scrollTo(s,a)}}function Rs(t,e){const n=Ns(t);let o,i;for(;t!=n.document.body;)i=e(),(o=new As(t).excludeScrollbarsAndBorders()).contains(i)||(Is(i,o)?t.scrollTop-=o.top-i.top:Os(i,o)&&(t.scrollTop+=i.bottom-o.bottom),Ms(i,o)?t.scrollLeft-=o.left-i.left:Ds(i,o)&&(t.scrollLeft+=i.right-o.right)),t=t.parentNode}function Os(t,e){return t.bottom>e.bottom}function Is(t,e){return t.top<e.top}function Ms(t,e){return t.left<e.left}function Ds(t,e){return t.right>e.right}function Ns(t){return ys(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function Vs(t){if(ys(t)){let e=t.commonAncestorContainer;return Vi(e)&&(e=e.parentNode),e}return t.parentNode}function Fs(t,e){const n=Ns(t),o=new As(t);if(n===e)return o;{let t=n;for(;t!=e;){const e=t.frameElement,n=new As(e).excludeScrollbarsAndBorders();o.moveBy(n.left,n.top),t=t.parent}}return o}Object.assign({},{scrollViewportToShowTarget:Es,scrollAncestorsToShowTarget:function(t){Rs(Vs(t),()=>new As(t))}});class Bs{constructor(){this.document=new ai,this.domConverter=new sr,this.domRoots=new Map,this.set("isRenderingInProgress",!1),this._renderer=new tr(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Pi(this.document),this.addObserver(Xr),this.addObserver(ws),this.addObserver(ks),this.addObserver(ns),this.addObserver(bs),this.addObserver(_s),mi.isAndroid&&this.addObserver(vs),function(t){t.document.on("keydown",Wi)}(this),xi(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(t,e="main"){const n=this.document.getRoot(e);n._name=t.tagName.toLowerCase();const o={};for(const{name:e,value:i}of Array.from(t.attributes))o[e]=i,"class"===e?this._writer.addClass(i.split(" "),n):this._writer.setAttribute(e,i,n);this._initialDomRootAttributes.set(t,o);const i=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};i(),this.domRoots.set(e,t),this.domConverter.bindElements(t,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(t.ownerDocument),n.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),n.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),n.on("change:text",(t,e)=>this._renderer.markToSync("text",e)),n.on("change:isReadOnly",()=>this.change(i)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const n of this._observers.values())n.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:t})=>e.removeAttribute(t));const n=this._initialDomRootAttributes.get(e);for(const t in n)e.setAttribute(t,n[t]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,n]of this.domRoots)e.observe(n,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&Es({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new Jn.b("cannot-change-view-tree: Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behavior and inconsistency between the DOM and the view.",this);if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return ti._createAt(t,e)}createPositionAfter(t){return ti._createAfter(t)}createPositionBefore(t){return ti._createBefore(t)}createRange(t,e){return new ei(t,e)}createRangeOn(t){return ei._createOn(t)}createRangeIn(t){return ei._createIn(t)}createSelection(t,e,n){return new ii(t,e,n)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}function Ls(t){return P(t)?bo(t):new Map(t)}lo(Bs,Ho);class zs{constructor(t){this.parent=null,this._attrs=Ls(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new Jn.b("model-node-not-found-in-parent: The node's parent does not contain this node.",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new Jn.b("model-node-not-found-in-parent: The node's parent does not contain this node.",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}get document(){return this.root==this?null:this.root.document||null}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),o=t.getAncestors(e);let i=0;for(;n[i]==o[i]&&n[i];)i++;return 0===i?null:n[i-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),o=uo(e,n);switch(o){case"prefix":return!0;case"extension":return!1;default:return e[o]<n[o]}}isAfter(t){return this!=t&&(this.root===t.root&&!this.isBefore(t))}hasAttribute(t){return this._attrs.has(t)}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const t={};return this._attrs.size&&(t.attributes=Array.from(this._attrs).reduce((t,e)=>(t[e[0]]=e[1],t),{})),t}is(t){return"node"==t||"model:node"==t}_clone(){return new zs(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=Ls(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}class qs extends zs{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"text"==t||"model:text"==t||super.is(t)}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new qs(this.data,this.getAttributes())}static fromJSON(t){return new qs(t.data,t.attributes)}}class js{constructor(t,e,n){if(this.textNode=t,e<0||e>t.offsetSize)throw new Jn.b("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this);if(n<0||e+n>t.offsetSize)throw new Jn.b("model-textproxy-wrong-length: Given length value is incorrect.",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"textProxy"==t||"model:textProxy"==t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Hs{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new Jn.b("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const n of this._nodes){if(t>=e&&t<e+n.offsetSize)return this.getNodeIndex(n);e+=n.offsetSize}if(e!=t)throw new Jn.b("model-nodelist-offset-out-of-bounds: Given offset cannot be found in the node list.",this,{offset:t,nodeList:this});return this.length}_insertNodes(t,e){for(const t of e)if(!(t instanceof zs))throw new Jn.b("model-nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.",this);this._nodes.splice(t,0,...e)}_removeNodes(t,e=1){return this._nodes.splice(t,e)}toJSON(){return this._nodes.map(t=>t.toJSON())}}class Us extends zs{constructor(t,e,n){super(e),this.name=t,this._children=new Hs,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){const n=t.replace(/^model:/,"");return e?"element"==n&&e==this.name:"element"==n||n==this.name||super.is(t)}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new Us(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){if("string"==typeof t)return[new qs(t)];wo(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new qs(t):t instanceof js?new qs(t.data,t.getAttributes()):t)}(e);for(const t of n)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n)t.parent=null;return n}static fromJSON(t){let e=null;if(t.children){e=[];for(const n of t.children)n.name?e.push(Us.fromJSON(n)):e.push(qs.fromJSON(n))}return new Us(t.name,t.attributes,e)}}class $s{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new Jn.b("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new Jn.b("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=Ks._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,n,o,i;do{o=this.position,i=this._visitedParent,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=o,this._visitedParent=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),n=this._visitedParent;if(null===n.parent&&e.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const o=e.textNode?e.textNode:e.nodeAfter;if(o instanceof Us)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=o),this.position=e,Ws("elementStart",o,t,e,1);if(o instanceof qs){let i;if(this.singleCharacters)i=1;else{let t=o.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<t&&(t=this.boundaries.end.offset),i=t-e.offset}const r=e.offset-o.startOffset,s=new js(o,r,i);return e.offset+=i,this.position=e,Ws("text",s,t,e,i)}return e.path.pop(),e.offset++,this.position=e,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():Ws("elementEnd",n,t,e)}_previous(){const t=this.position,e=this.position.clone(),n=this._visitedParent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};const o=e.textNode?e.textNode:e.nodeBefore;if(o instanceof Us)return e.offset--,this.shallow?(this.position=e,Ws("elementStart",o,t,e,1)):(e.path.push(o.maxOffset),this.position=e,this._visitedParent=o,this.ignoreElementEnd?this._previous():Ws("elementEnd",o,t,e));if(o instanceof qs){let i;if(this.singleCharacters)i=1;else{let t=o.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>t&&(t=this.boundaries.start.offset),i=e.offset-t}const r=e.offset-o.startOffset,s=new js(o,r-i,i);return e.offset-=i,this.position=e,Ws("text",s,t,e,i)}return e.path.pop(),this.position=e,this._visitedParent=n.parent,Ws("elementStart",n,t,e,1)}}function Ws(t,e,n,o,i){return{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:o,length:i}}}var Gs=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};class Ks{constructor(t,e,n="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new Jn.b("model-position-root-invalid: Position root invalid.",t);if(!(e instanceof Array)||0===e.length)throw new Jn.b("model-position-path-incorrect-format: Position path must be an array with at least one item.",t,{path:e});e=t.getPath().concat(e),t=t.root,this.root=t,this.path=e,this.stickiness=n}get offset(){return Gs(this.path)}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;e<this.path.length-1;e++)if(!(t=t.getChild(t.offsetToIndex(this.path[e]))))throw new Jn.b("model-position-path-incorrect: The position's path is incorrect.",this,{position:this});if(t.is("text"))throw new Jn.b("model-position-path-incorrect: The position's path is incorrect.",this,{position:this});return t}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){const t=this.parent.getChild(this.index);return t instanceof qs&&t.startOffset<this.offset?t:null}get nodeAfter(){return null===this.textNode?this.parent.getChild(this.index):null}get nodeBefore(){return null===this.textNode?this.parent.getChild(this.index-1):null}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(t){if(this.root!=t.root)return"different";const e=uo(this.path,t.path);switch(e){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[e]<t.path[e]?"before":"after"}}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new $s(e);return n.skip(t),n.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonPath(t){if(this.root!=t.root)return[];const e=uo(this.path,t.path),n="string"==typeof e?Math.min(this.path.length,t.path.length):e;return this.path.slice(0,n)}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let o=0;for(;e[o]==n[o]&&e[o];)o++;return 0===o?null:e[o-1]}getShiftedBy(t){const e=this.clone(),n=e.offset+t;return e.offset=n<0?0:n,e}isAfter(t){return"after"==this.compareWith(t)}isBefore(t){return"before"==this.compareWith(t)}isEqual(t){return"same"==this.compareWith(t)}isTouching(t){let e=null,n=null;switch(this.compareWith(t)){case"same":return!0;case"before":e=Ks._createAt(this),n=Ks._createAt(t);break;case"after":e=Ks._createAt(t),n=Ks._createAt(this);break;default:return!1}let o=e.parent;for(;e.path.length+n.path.length;){if(e.isEqual(n))return!0;if(e.path.length>n.path.length){if(e.offset!==o.maxOffset)return!1;e.path=e.path.slice(0,-1),o=o.parent,e.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}is(t){return"position"==t||"model:position"==t}hasSameParentAs(t){if(this.root!==t.root)return!1;return"same"==uo(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=Ks._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let n;return e.containsPosition(this)||e.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?Ks._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}_getTransformedByDeletion(t,e){const n=Ks._createAt(this);if(this.root!=t.root)return n;if("same"==uo(t.getParentPath(),this.getParentPath())){if(t.offset<this.offset){if(t.offset+e>this.offset)return null;n.offset-=e}}else if("prefix"==uo(t.getParentPath(),this.getParentPath())){const o=t.path.length-1;if(t.offset<=this.path[o]){if(t.offset+e>this.path[o])return null;n.path[o]-=e}}return n}_getTransformedByInsertion(t,e){const n=Ks._createAt(this);if(this.root!=t.root)return n;if("same"==uo(t.getParentPath(),this.getParentPath()))(t.offset<this.offset||t.offset==this.offset&&"toPrevious"!=this.stickiness)&&(n.offset+=e);else if("prefix"==uo(t.getParentPath(),this.getParentPath())){const o=t.path.length-1;t.offset<=this.path[o]&&(n.path[o]+=e)}return n}_getTransformedByMove(t,e,n){if(e=e._getTransformedByDeletion(t,n),t.isEqual(e))return Ks._createAt(this);const o=this._getTransformedByDeletion(t,n);return null===o||t.isEqual(this)&&"toNext"==this.stickiness||t.getShiftedBy(n).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(t,e):o._getTransformedByInsertion(e,n)}_getCombined(t,e){const n=t.path.length-1,o=Ks._createAt(e);return o.stickiness=this.stickiness,o.offset=o.offset+this.path[n]-t.offset,o.path=o.path.concat(this.path.slice(n+1)),o}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(t,e,n="toNone"){if(t instanceof Ks)return new Ks(t.root,t.path,t.stickiness);{const o=t;if("end"==e)e=o.maxOffset;else{if("before"==e)return this._createBefore(o,n);if("after"==e)return this._createAfter(o,n);if(0!==e&&!e)throw new Jn.b("model-createPositionAt-offset-required: Model#createPositionAt() requires the offset when the first parameter is a model item.",[this,t])}if(!o.is("element")&&!o.is("documentFragment"))throw new Jn.b("model-position-parent-incorrect: Position parent have to be a element or document fragment.",[this,t]);const i=o.getPath();return i.push(e),new this(o.root,i,n)}}static _createAfter(t,e){if(!t.parent)throw new Jn.b("model-position-after-root: You cannot make a position after root.",[this,t],{root:t});return this._createAt(t.parent,t.endOffset,e)}static _createBefore(t,e){if(!t.parent)throw new Jn.b("model-position-before-root: You cannot make a position before root.",t,{root:t});return this._createAt(t.parent,t.startOffset,e)}static fromJSON(t,e){if("$graveyard"===t.root){const n=new Ks(e.graveyard,t.path);return n.stickiness=t.stickiness,n}if(!e.getRoot(t.root))throw new Jn.b("model-position-fromjson-no-root: Cannot create position for document. Root with specified name does not exist.",e,{rootName:t.root});return new Ks(e.getRoot(t.root),t.path,t.stickiness)}}class Js{constructor(t,e=null){this.start=Ks._createAt(t),this.end=e?Ks._createAt(e):Ks._createAt(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new $s({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==uo(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const n=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),o=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return n&&o}containsItem(t){const e=Ks._createBefore(t);return this.containsPosition(e)||this.start.isEqual(e)}is(t){return"range"==t||"model:range"==t}isEqual(t){return this.start.isEqual(t.start)&&this.end.isEqual(t.end)}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new Js(this.start,t.start)),this.containsPosition(t.end)&&e.push(new Js(t.end,this.end))):e.push(new Js(this.start,this.end)),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,n=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(n=t.end),new Js(e,n)}return null}getMinimalFlatRanges(){const t=[],e=this.start.getCommonPath(this.end).length,n=Ks._createAt(this.start);let o=n.parent;for(;n.path.length>e+1;){const e=o.maxOffset-n.offset;0!==e&&t.push(new Js(n,n.getShiftedBy(e))),n.path=n.path.slice(0,-1),n.offset++,o=o.parent}for(;n.path.length<=this.end.path.length;){const e=this.end.path[n.path.length-1],o=e-n.offset;0!==o&&t.push(new Js(n,n.getShiftedBy(o))),n.offset=e,n.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new $s(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new $s(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new $s(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new Js(this.start,this.end)]}getTransformedByOperations(t){const e=[new Js(this.start,this.end)];for(const n of t)for(let t=0;t<e.length;t++){const o=e[t].getTransformedByOperation(n);e.splice(t,1,...o),t+=o.length-1}for(let t=0;t<e.length;t++){const n=e[t];for(let o=t+1;o<e.length;o++){const t=e[o];(n.containsRange(t)||t.containsRange(n)||n.isEqual(t))&&e.splice(o,1)}}return e}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(t,e=!1){return this._getTransformedByInsertion(t.position,t.howMany,e)}_getTransformedByMoveOperation(t,e=!1){const n=t.sourcePosition,o=t.howMany,i=t.targetPosition;return this._getTransformedByMove(n,i,o,e)}_getTransformedBySplitOperation(t){const e=this.start._getTransformedBySplitOperation(t);let n=this.end._getTransformedBySplitOperation(t);return this.end.isEqual(t.insertionPosition)&&(n=this.end.getShiftedBy(1)),e.root!=n.root&&(n=this.end.getShiftedBy(-1)),new Js(e,n)}_getTransformedByMergeOperation(t){if(this.start.isEqual(t.targetPosition)&&this.end.isEqual(t.deletionPosition))return new Js(this.start);let e=this.start._getTransformedByMergeOperation(t),n=this.end._getTransformedByMergeOperation(t);return e.root!=n.root&&(n=this.end.getShiftedBy(-1)),e.isAfter(n)?(t.sourcePosition.isBefore(t.targetPosition)?(e=Ks._createAt(n)).offset=0:(t.deletionPosition.isEqual(e)||(n=t.deletionPosition),e=t.targetPosition),new Js(e,n)):new Js(e,n)}_getTransformedByInsertion(t,e,n=!1){if(n&&this.containsPosition(t))return[new Js(this.start,t),new Js(t.getShiftedBy(e),this.end._getTransformedByInsertion(t,e))];{const n=new Js(this.start,this.end);return n.start=n.start._getTransformedByInsertion(t,e),n.end=n.end._getTransformedByInsertion(t,e),[n]}}_getTransformedByMove(t,e,n,o=!1){if(this.isCollapsed){const o=this.start._getTransformedByMove(t,e,n);return[new Js(o)]}const i=Js._createFromPositionAndShift(t,n),r=e._getTransformedByDeletion(t,n);if(this.containsPosition(e)&&!o&&(i.containsPosition(this.start)||i.containsPosition(this.end))){const o=this.start._getTransformedByMove(t,e,n),i=this.end._getTransformedByMove(t,e,n);return[new Js(o,i)]}let s;const a=this.getDifference(i);let c=null;const l=this.getIntersection(i);if(1==a.length?c=new Js(a[0].start._getTransformedByDeletion(t,n),a[0].end._getTransformedByDeletion(t,n)):2==a.length&&(c=new Js(this.start,this.end._getTransformedByDeletion(t,n))),s=c?c._getTransformedByInsertion(r,n,null!==l||o):[],l){const t=new Js(l.start._getCombined(i.start,r),l.end._getCombined(i.start,r));2==s.length?s.splice(1,0,t):s.push(t)}return s}_getTransformedByDeletion(t,e){let n=this.start._getTransformedByDeletion(t,e),o=this.end._getTransformedByDeletion(t,e);return null==n&&null==o?null:(null==n&&(n=t),null==o&&(o=t),new Js(n,o))}static _createFromPositionAndShift(t,e){const n=t,o=t.getShiftedBy(e);return e>0?new this(n,o):new this(o,n)}static _createIn(t){return new this(Ks._createAt(t,0),Ks._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(Ks._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new Jn.b("range-create-from-ranges-empty-array: At least one range has to be passed.",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const n=t.indexOf(e),o=new this(e.start,e.end);if(n>0)for(let e=n-1;t[e].end.isEqual(o.start);e++)o.start=Ks._createAt(t[e].start);for(let e=n+1;e<t.length&&t[e].start.isEqual(o.end);e++)o.end=Ks._createAt(t[e].end);return o}static fromJSON(t,e){return new this(Ks.fromJSON(t.start,e),Ks.fromJSON(t.end,e))}}class Zs{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",(t,e)=>{if(e.viewPosition)return;const n=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this._findPositionIn(n,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const n=this.findMappedViewAncestor(e.viewPosition),o=this._viewToModelMapping.get(n),i=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,n);e.modelPosition=Ks._createAt(o,i)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);if(this._viewToModelMapping.delete(t),this._elementToMarkerNames.has(t))for(const e of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(e);this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const n=this._markerNameToElements.get(e)||new Set;n.add(t);const o=this._elementToMarkerNames.get(t)||new Set;o.add(e),this._markerNameToElements.set(e,n),this._elementToMarkerNames.set(t,o)}unbindElementFromMarkerName(t,e){const n=this._markerNameToElements.get(e);n&&(n.delete(t),0==n.size&&this._markerNameToElements.delete(e));const o=this._elementToMarkerNames.get(t);o&&(o.delete(e),0==o.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new Js(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new ei(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const n=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())n.add(e);else n.add(t);return n}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,n){if(n!=t){return this._toModelOffset(t.parent,t.index,n)+this._toModelOffset(t,e,t)}if(t.is("text"))return e;let o=0;for(let n=0;n<e;n++)o+=this.getModelLength(t.getChild(n));return o}getModelLength(t){if(this._viewToModelLengthCallbacks.get(t.name)){return this._viewToModelLengthCallbacks.get(t.name)(t)}if(this._viewToModelMapping.has(t))return 1;if(t.is("text"))return t.data.length;if(t.is("uiElement"))return 0;{let e=0;for(const n of t.getChildren())e+=this.getModelLength(n);return e}}_findPositionIn(t,e){let n,o=0,i=0,r=0;if(t.is("text"))return new ti(t,e);for(;i<e;)n=t.getChild(r),i+=o=this.getModelLength(n),r++;return i==e?this._moveViewPositionToTextNode(new ti(t,r)):this._findPositionIn(n,e-(i-o))}_moveViewPositionToTextNode(t){const e=t.nodeBefore,n=t.nodeAfter;return e instanceof mo?new ti(e,e.data.length):n instanceof mo?new ti(n,0):t}}lo(Zs,no);class Qs{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(t,e){e=Ys(e),t instanceof js&&(t=this._getSymbolForTextProxy(t)),this._consumable.has(t)||this._consumable.set(t,new Map),this._consumable.get(t).set(e,!0)}consume(t,e){return e=Ys(e),t instanceof js&&(t=this._getSymbolForTextProxy(t)),!!this.test(t,e)&&(this._consumable.get(t).set(e,!1),!0)}test(t,e){e=Ys(e),t instanceof js&&(t=this._getSymbolForTextProxy(t));const n=this._consumable.get(t);if(void 0===n)return null;const o=n.get(e);return void 0===o?null:o}revert(t,e){e=Ys(e),t instanceof js&&(t=this._getSymbolForTextProxy(t));const n=this.test(t,e);return!1===n?(this._consumable.get(t).set(e,!0),!0):!0!==n&&null}_getSymbolForTextProxy(t){let e=null;const n=this._textProxyRegistry.get(t.startOffset);if(n){const o=n.get(t.endOffset);o&&(e=o.get(t.parent))}return e||(e=this._addSymbolForTextProxy(t.startOffset,t.endOffset,t.parent)),e}_addSymbolForTextProxy(t,e,n){const o=Symbol("textProxySymbol");let i,r;return(i=this._textProxyRegistry.get(t))||(i=new Map,this._textProxyRegistry.set(t,i)),(r=i.get(e))||(r=new Map,i.set(e,r)),r.set(n,o),o}}function Ys(t){const e=t.split(":");return e.length>1?e[0]+":"+e[1]:e[0]}class Xs{constructor(t){this.conversionApi=Bo({dispatcher:this},t)}convertChanges(t,e,n){for(const e of t.getMarkersToRemove())this.convertMarkerRemove(e.name,e.range,n);for(const e of t.getChanges())"insert"==e.type?this.convertInsert(Js._createFromPositionAndShift(e.position,e.length),n):"remove"==e.type?this.convertRemove(e.position,e.length,e.name,n):this.convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,n);for(const t of this.conversionApi.mapper.flushUnboundMarkerNames()){const o=e.get(t).getRange();this.convertMarkerRemove(t,o,n),this.convertMarkerAdd(t,o,n)}for(const e of t.getMarkersToAdd())this.convertMarkerAdd(e.name,e.range,n)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of t){const t=e.item,n={item:t,range:Js._createFromPositionAndShift(e.previousPosition,e.length)};this._testAndFire("insert",n);for(const e of t.getAttributeKeys())n.attributeKey=e,n.attributeOldValue=null,n.attributeNewValue=t.getAttribute(e),this._testAndFire(`attribute:${e}`,n)}this._clearConversionApi()}convertRemove(t,e,n,o){this.conversionApi.writer=o,this.fire("remove:"+n,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,n,o,i){this.conversionApi.writer=i,this.conversionApi.consumable=this._createConsumableForRange(t,`attribute:${e}`);for(const i of t){const t={item:i.item,range:Js._createFromPositionAndShift(i.previousPosition,i.length),attributeKey:e,attributeOldValue:n,attributeNewValue:o};this._testAndFire(`attribute:${e}`,t)}this._clearConversionApi()}convertSelection(t,e,n){const o=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(t,o),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of o){const n=e.getRange();if(!ta(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const o={item:t,markerName:e.name,markerRange:n};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,o,this.conversionApi)}for(const e of t.getAttributeKeys()){const n={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey+":$text",n,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,n){if(!e.root.document||"$graveyard"==e.root.rootName)return;this.conversionApi.writer=n;const o="addMarker:"+t,i=new Qs;if(i.add(e,o),this.conversionApi.consumable=i,this.fire(o,{markerName:t,markerRange:e},this.conversionApi),i.test(e,o)){this.conversionApi.consumable=this._createConsumableForRange(e,o);for(const n of e.getItems()){if(!this.conversionApi.consumable.test(n,o))continue;const i={item:n,range:Js._createOn(n),markerName:t,markerRange:e};this.fire(o,i,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(t,e,n){e.root.document&&"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=n,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_createInsertConsumable(t){const e=new Qs;for(const n of t){const t=n.item;e.add(t,"insert");for(const n of t.getAttributeKeys())e.add(t,"attribute:"+n)}return e}_createConsumableForRange(t,e){const n=new Qs;for(const o of t.getItems())n.add(o,e);return n}_createSelectionConsumable(t,e){const n=new Qs;n.add(t,"selection");for(const o of e)n.add(t,"addMarker:"+o.name);for(const e of t.getAttributeKeys())n.add(t,"attribute:"+e);return n}_testAndFire(t,e){if(!this.conversionApi.consumable.test(e.item,t))return;const n=e.item.name||"$text";this.fire(t+":"+n,e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}}function ta(t,e,n){const o=e.getRange(),i=Array.from(t.getAncestors());return i.shift(),i.reverse(),!i.some(t=>{if(o.containsItem(t)){return!!n.toViewElement(t).getCustomProperty("addHighlight")}})}lo(Xs,no);class ea{constructor(t,e,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,n)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const o of t._ranges)if(e.isEqual(o)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new Js(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new Js(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new Js(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(t,e,n){if(null===t)this._setRanges([]);else if(t instanceof ea)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof Js)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof Ks)this._setRanges([new Js(t)]);else if(t instanceof zs){const o=!!n&&!!n.backward;let i;if("in"==e)i=Js._createIn(t);else if("on"==e)i=Js._createOn(t);else{if(void 0===e)throw new Jn.b("model-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.",[this,t]);i=new Js(Ks._createAt(t,e))}this._setRanges([i],o)}else{if(!wo(t))throw new Jn.b("model-selection-setTo-not-selectable: Cannot set the selection to the given place.",[this,t]);this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const n=(t=Array.from(t)).some(e=>{if(!(e instanceof Js))throw new Jn.b("model-selection-set-ranges-not-range: Selection range set to an object that is not an instance of model.Range.",[this,t]);return this._ranges.every(t=>!t.isEqual(e))});if(t.length!==this._ranges.length||n){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new Jn.b("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",[this,t]);const n=Ks._createAt(t,e);if("same"==n.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(o)?(this._pushRange(new Js(n,o)),this._lastRangeBackward=!0):(this._pushRange(new Js(o,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){if(1!==this.rangeCount)return null;const t=this.getFirstRange(),e=t.start.nodeAfter,n=t.end.nodeBefore;return e instanceof Us&&e==n?e:null}is(t){return"selection"==t||"model:selection"==t}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const n=oa(e.start,t);n&&(yield n);for(const n of e.getWalker())"elementEnd"==n.type&&na(n.item,t)&&(yield n.item);const o=oa(e.end,t);o&&!e.end.isTouching(Ks._createAt(o,0))&&(yield o)}}*getTopMostBlocks(){const t=Array.from(this.getSelectedBlocks());for(const e of t){const n=ia(e);n&&t.includes(n)||(yield e)}}containsEntireContent(t=this.anchor.root){const e=Ks._createAt(t,0),n=Ks._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new Js(t.start,t.end))}_checkRange(t){for(let e=0;e<this._ranges.length;e++)if(t.isIntersecting(this._ranges[e]))throw new Jn.b("model-selection-range-intersects: Trying to add a range that intersects with another range in the selection.",[this,t],{addedRange:t,intersectingRange:this._ranges[e]})}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function na(t,e){return!e.has(t)&&(e.add(t),t.document.model.schema.isBlock(t)&&t.parent)}function oa(t,e){const n=t.parent.document.model.schema,o=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const r=o.find(t=>!i&&(!(i=n.isLimit(t))&&na(t,e)));return o.forEach(t=>e.add(t)),r}function ia(t){const e=t.document.model.schema;let n=t.parent;for(;n;){if(e.isBlock(n))return n;n=n.parent}}lo(ea,no);class ra extends Js{constructor(t,e){super(t,e),function(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&function(t){const e=this.getTransformedByOperation(t),n=Js._createFromRanges(e),o=!n.isEqual(this),i=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let r=null;if(o){"$graveyard"==n.root.rootName&&(r="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",e,{deletionPosition:r})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:r})}.call(this,n)},{priority:"low"})}.call(this)}detach(){this.stopListening()}is(t){return"liveRange"==t||"model:liveRange"==t||super.is(t)}toRange(){return new Js(this.start,this.end)}static fromRange(t){return new ra(t.start,t.end)}}lo(ra,no);const sa="selection:";class aa{constructor(t){this._selection=new ca(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getTopMostBlocks(){return this._selection.getTopMostBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}is(t){return"selection"==t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return sa+t}static _isStoreAttributeKey(t){return t.startsWith(sa)}}lo(aa,no);class ca extends ea{constructor(t){super(),this.markers=new si({idProperty:"name"}),this._model=t.model,this._document=t,this._attributePriority=new Map,this._fixGraveyardRangesData=[],this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this.listenTo(this._model,"applyOperation",(t,e)=>{const n=e[0];if(n.isDocumentOperation&&"marker"!=n.type&&"rename"!=n.type&&"noop"!=n.type){for(;this._fixGraveyardRangesData.length;){const{liveRange:t,sourcePosition:e}=this._fixGraveyardRangesData.shift();this._fixGraveyardSelection(t,e)}this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1}))}},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new Jn.b("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",this,{range:t})}),this.listenTo(this._model.markers,"update",()=>this._updateMarkers()),this.listenTo(this._document,"change",(t,e)=>{!function(t,e){const n=t.document.differ;for(const o of n.getChanges()){if("insert"!=o.type)continue;const n=o.position.parent,i=o.length===n.maxOffset;i&&t.enqueueChange(e,t=>{const e=Array.from(n.getAttributeKeys()).filter(t=>t.startsWith(sa));for(const o of e)t.removeAttribute(o,n)})}}(this._model,e)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t<this._ranges.length;t++)this._ranges[t].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(t,e,n){super.setTo(t,e,n),this._updateAttributes(!0)}setFocus(t,e){super.setFocus(t,e),this._updateAttributes(!0)}setAttribute(t,e){if(this._setAttribute(t,e)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}removeAttribute(t){if(this._removeAttribute(t)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}overrideGravity(){const t=Yn();return this._overriddenGravityRegister.add(t),1===this._overriddenGravityRegister.size&&this._updateAttributes(!0),t}restoreGravity(t){if(!this._overriddenGravityRegister.has(t))throw new Jn.b("document-selection-gravity-wrong-restore: Attempting to restore the selection gravity for an unknown UID.",this,{uid:t});this._overriddenGravityRegister.delete(t),this.isGravityOverridden||this._updateAttributes(!0)}_popRange(){this._ranges.pop().detach()}_pushRange(t){const e=this._prepareRange(t);e&&this._ranges.push(e)}_prepareRange(t){if(this._checkRange(t),t.root==this._document.graveyard)return;const e=ra.fromRange(t);return e.on("change:range",(t,n,o)=>{this._hasChangedRange=!0,e.root==this._document.graveyard&&this._fixGraveyardRangesData.push({liveRange:e,sourcePosition:o.deletionPosition})}),e}_updateMarkers(){const t=[];for(const e of this._model.markers){const n=e.getRange();for(const o of this.getRanges())n.containsRange(o,!o.isCollapsed)&&t.push(e)}for(const e of t)this.markers.has(e)||this.markers.add(e);for(const e of Array.from(this.markers))t.includes(e)||this.markers.remove(e)}_updateAttributes(t){const e=Ls(this._getSurroundingAttributes()),n=Ls(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const o=[];for(const[t,e]of this.getAttributes())n.has(t)&&n.get(t)===e||o.push(t);for(const[t]of n)this.hasAttribute(t)||o.push(t);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(t,e,n=!0){const o=n?"normal":"low";return("low"!=o||"normal"!=this._attributePriority.get(t))&&(super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,o),!0))}_removeAttribute(t,e=!0){const n=e?"normal":"low";return("low"!=n||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,n),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,n]of this.getAttributes())t.get(e)!==n&&this._removeAttribute(e,!1);for(const[n,o]of t){this._setAttribute(n,o,!1)&&e.add(n)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith(sa)){yield[e.substr(sa.length),t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let n=null;if(this.isCollapsed){const e=t.textNode?t.textNode:t.nodeBefore,o=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(n=la(e)),n||(n=la(o)),!this.isGravityOverridden&&!n){let t=e;for(;t&&!n;)n=la(t=t.previousSibling)}if(!n){let t=o;for(;t&&!n;)n=la(t=t.nextSibling)}n||(n=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const o of t){if(o.item.is("element")&&e.isObject(o.item))break;if("text"==o.type){n=o.item.getAttributes();break}}}return n}_fixGraveyardSelection(t,e){const n=e.clone(),o=this._model.schema.getNearestSelectionRange(n),i=this._ranges.indexOf(t);if(this._ranges.splice(i,1),t.detach(),o){const t=this._prepareRange(o);this._ranges.splice(i,0,t)}}}function la(t){return t instanceof js||t instanceof qs?t.getAttributes():null}class da{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}var ua=1,ha=4;var fa=function(t){return jn(t,ua|ha)};class pa extends da{elementToElement(t){return this.add(function(t){return(t=fa(t)).view=ga(t.view,"container"),e=>{e.on("insert:"+t.model,function(t){return(e,n,o)=>{const i=t(n.item,o.writer);if(!i)return;if(!o.consumable.consume(n.item,"insert"))return;const r=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(n.item,i),o.writer.insert(r,i)}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}attributeToElement(t){return this.add(function(t){let e="attribute:"+((t=fa(t)).model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=ga(t.view[e],"attribute");else t.view=ga(t.view,"attribute");const n=ba(t);return o=>{o.on(e,function(t){return(e,n,o)=>{const i=t(n.attributeOldValue,o.writer),r=t(n.attributeNewValue,o.writer);if(!i&&!r)return;if(!o.consumable.consume(n.item,e.name))return;const s=o.writer,a=s.document.selection;if(n.item instanceof ea||n.item instanceof aa)s.wrap(a.getFirstRange(),r);else{let t=o.mapper.toViewRange(n.range);null!==n.attributeOldValue&&i&&(t=s.unwrap(t,i)),null!==n.attributeNewValue&&r&&s.wrap(t,r)}}}(n),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){let e="attribute:"+((t=fa(t)).model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=wa(t.view[e]);else t.view=wa(t.view);const n=ba(t);return o=>{o.on(e,function(t){return(e,n,o)=>{const i=t(n.attributeOldValue,n),r=t(n.attributeNewValue,n);if(!i&&!r)return;if(!o.consumable.consume(n.item,e.name))return;const s=o.mapper.toViewElement(n.item),a=o.writer;if(!s)throw new Jn.b("conversion-attribute-to-attribute-on-text: Trying to convert text node's attribute with attribute-to-attribute converter.",[n,o]);if(null!==n.attributeOldValue&&i)if("class"==i.key){const t=Array.isArray(i.value)?i.value:[i.value];for(const e of t)a.removeClass(e,s)}else if("style"==i.key){const t=Object.keys(i.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(i.key,s);if(null!==n.attributeNewValue&&r)if("class"==r.key){const t=Array.isArray(r.value)?r.value:[r.value];for(const e of t)a.addClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)a.setStyle(e,r.value[e],s)}else a.setAttribute(r.key,r.value,s)}}(n),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){return(t=fa(t)).view=ga(t.view,"ui"),e=>{e.on("addMarker:"+t.model,function(t){return(e,n,o)=>{n.isOpening=!0;const i=t(n,o.writer);n.isOpening=!1;const r=t(n,o.writer);if(!i||!r)return;const s=n.markerRange;if(s.isCollapsed&&!o.consumable.consume(s,e.name))return;for(const t of s)if(!o.consumable.consume(t.item,e.name))return;const a=o.mapper,c=o.writer;c.insert(a.toViewPosition(s.start),i),o.mapper.bindElementToMarker(i,n.markerName),s.isCollapsed||(c.insert(a.toViewPosition(s.end),r),o.mapper.bindElementToMarker(r,n.markerName)),e.stop()}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t.view,(t,e,n)=>{const o=n.mapper.markerNameToElements(e.markerName);if(o){for(const t of o)n.mapper.unbindElementFromMarkerName(t,e.markerName),n.writer.clear(n.writer.createRangeOn(t),t);n.writer.clearClonedElementsGroup(e.markerName),t.stop()}}),{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{e.on("addMarker:"+t.model,function(t){return(e,n,o)=>{if(!n.item)return;if(!(n.item instanceof ea||n.item instanceof aa||n.item.is("textProxy")))return;const i=ka(t,n,o);if(!i)return;if(!o.consumable.consume(n.item,e.name))return;const r=ma(i),s=o.writer,a=s.document.selection;if(n.item instanceof ea||n.item instanceof aa)s.wrap(a.getFirstRange(),r,a);else{const t=o.mapper.toViewRange(n.range),e=s.wrap(t,r);for(const t of e.getItems())if(t.is("attributeElement")&&t.isSimilar(r)){o.mapper.bindElementToMarker(t,n.markerName);break}}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,function(t){return(e,n,o)=>{if(!n.item)return;if(!(n.item instanceof Us))return;const i=ka(t,n,o);if(!i)return;if(!o.consumable.test(n.item,e.name))return;const r=o.mapper.toViewElement(n.item);if(r&&r.getCustomProperty("addHighlight")){o.consumable.consume(n.item,e.name);for(const t of Js._createIn(n.item))o.consumable.consume(t.item,e.name);r.getCustomProperty("addHighlight")(r,i,o.writer),o.mapper.bindElementToMarker(r,n.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,function(t){return(e,n,o)=>{if(n.markerRange.isCollapsed)return;const i=ka(t,n,o);if(!i)return;const r=ma(i),s=o.mapper.markerNameToElements(n.markerName);if(s){for(const t of s)o.mapper.unbindElementFromMarkerName(t,n.markerName),t.is("attributeElement")?o.writer.unwrap(o.writer.createRangeOn(t),r):t.getCustomProperty("removeHighlight")(t,i.id,o.writer);o.writer.clearClonedElementsGroup(n.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}}function ma(t){const e=new li("span",t.attributes);return t.classes&&e._addClass(t.classes),t.priority&&(e._priority=t.priority),e._id=t.id,e}function ga(t,e){return"function"==typeof t?t:(n,o)=>(function(t,e,n){"string"==typeof t&&(t={name:t});let o;const i=Object.assign({},t.attributes);if("container"==n)o=e.createContainerElement(t.name,i);else if("attribute"==n){const n={priority:t.priority||li.DEFAULT_PRIORITY};o=e.createAttributeElement(t.name,i,n)}else o=e.createUIElement(t.name,i);if(t.styles){const n=Object.keys(t.styles);for(const i of n)e.setStyle(i,t.styles[i],o)}if(t.classes){const n=t.classes;if("string"==typeof n)e.addClass(n,o);else for(const t of n)e.addClass(t,o)}return o})(t,o,e)}function ba(t){return t.model.values?(e,n)=>{const o=t.view[e];return o?o(e,n):null}:t.view}function wa(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function ka(t,e,n){const o="function"==typeof t?t(e,n):t;return o?(o.priority||(o.priority=10),o.id||(o.id=e.markerName),o):null}class _a extends da{elementToElement(t){return this.add(va(t))}elementToAttribute(t){return this.add(function(t){xa(t=fa(t));const e=Ca(t,!1),n=ya(t),o=n?"element:"+n:"element";return n=>{n.on(o,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){let e=null;("string"==typeof(t=fa(t)).view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let n;if("class"==e||"style"==e){const o="class"==e?"classes":"styles";n={[o]:t.view.value}}else{const o=void 0===t.view.value?/[\s\S]*/:t.view.value;n={attributes:{[e]:o}}}t.view.name&&(n.name=t.view.name);return t.view=n,e}(t));xa(t,e);const n=Ca(t,!0);return e=>{e.on("element",n,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return this.add(function(t){return function(t){const e=t.model;t.model=((t,n)=>{const o="string"==typeof e?e:e(t);return n.createElement("$marker",{"data-name":o})})}(t=fa(t)),va(t)}(t))}}function va(t){const e=function(t){const e=t.view?new ko(t.view):null;return(n,o,i)=>{let r={};if(e){const t=e.match(o.viewItem);if(!t)return;r=t.match}r.name=!0;const s=function(t,e,n){return t instanceof Function?t(e,n):n.createElement(t)}(t.model,o.viewItem,i.writer);if(!s)return;if(!i.consumable.test(o.viewItem,r))return;const a=i.splitToAllowedParent(s,o.modelCursor);if(!a)return;i.writer.insert(s,a.position),i.convertChildren(o.viewItem,i.writer.createPositionAt(s,0)),i.consumable.consume(o.viewItem,r);const c=i.getSplitParts(s);o.modelRange=new Js(i.writer.createPositionBefore(s),i.writer.createPositionAfter(c[c.length-1])),a.cursorParent?o.modelCursor=i.writer.createPositionAt(a.cursorParent,0):o.modelCursor=o.modelRange.end}}(t=fa(t)),n=ya(t),o=n?"element:"+n:"element";return n=>{n.on(o,e,{priority:t.converterPriority||"normal"})}}function ya(t){return"string"==typeof t.view?t.view:"object"==typeof t.view&&"string"==typeof t.view.name?t.view.name:null}function xa(t,e=null){const n=null===e||(t=>t.getAttribute(e)),o="object"!=typeof t.model?t.model:t.model.key,i="object"!=typeof t.model||void 0===t.model.value?n:t.model.value;t.model={key:o,value:i}}function Ca(t,e){const n=new ko(t.view);return(o,i,r)=>{const s=n.match(i.viewItem);if(!s)return;const a=t.model.key,c="function"==typeof t.model.value?t.model.value(i.viewItem):t.model.value;null!==c&&(!function(t){if("object"==typeof t.view&&!ya(t))return!1;return!t.view.classes&&!t.view.attributes&&!t.view.styles}(t)?delete s.match.name:s.match.name=!0,r.consumable.test(i.viewItem,s.match)&&(i.modelRange||(i=Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor))),function(t,e,n,o){let i=!1;for(const r of Array.from(t.getItems({shallow:n})))o.schema.checkAttribute(r,e.key)&&(o.writer.setAttribute(e.key,e.value,r),i=!0);return i}(i.modelRange,{key:a,value:c},e,r)&&r.consumable.consume(i.viewItem,s.match)))}}class Aa{constructor(t){this.model=t,this.view=new Bs,this.mapper=new Zs,this.downcastDispatcher=new Xs({mapper:this.mapper});const e=this.model.document,n=e.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(e,"change",()=>{this.view.change(t=>{this.downcastDispatcher.convertChanges(e.differ,o,t),this.downcastDispatcher.convertSelection(n,o,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(n,o)=>{const i=o.newSelection,r=new ea,s=[];for(const t of i.getRanges())s.push(e.toModelRange(t));r.setTo(s,{backward:i.isBackward}),r.isEqual(t.document.selection)||t.change(t=>{t.setSelection(r)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,n)=>{if(!n.consumable.consume(e.item,"insert"))return;const o=n.writer,i=n.mapper.toViewPosition(e.range.start),r=o.createText(e.item.data);o.insert(i,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,n)=>{const o=n.mapper.toViewPosition(e.position),i=e.position.getShiftedBy(e.length),r=n.mapper.toViewPosition(i,{isPhantom:!0}),s=n.writer.createRange(o,r),a=n.writer.remove(s.getTrimmed());for(const t of n.writer.createRangeIn(a).getItems())n.mapper.unbindViewElement(t)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const o=n.writer,i=o.document.selection;for(const t of i.getRanges())t.isCollapsed&&t.end.parent.document&&n.writer.mergeAttributes(t.start);o.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const o=e.selection;if(o.isCollapsed)return;if(!n.consumable.consume(o,"selection"))return;const i=[];for(const t of o.getRanges()){const e=n.mapper.toViewRange(t);i.push(e)}n.writer.setSelection(i,{backward:o.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const o=e.selection;if(!o.isCollapsed)return;if(!n.consumable.consume(o,"selection"))return;const i=n.writer,r=o.getFirstPosition(),s=n.mapper.toViewPosition(r),a=i.breakAttributes(s);i.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(t=>{if("$graveyard"==t.rootName)return null;const e=new Yo(t.name);return e.rootName=t.rootName,e._document=this.view.document,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}lo(Aa,Ho);class Pa{constructor(t,e=[]){this._editor=t,this._availablePlugins=new Map,this._plugins=new Map;for(const t of e)this._availablePlugins.set(t,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){const e="plugincollection-plugin-not-loaded: The requested plugin is not loaded.";let n=t;throw"function"==typeof t&&(n=t.pluginName||t.name),new Jn.b(e,this._editor,{plugin:n})}return e}has(t){return this._plugins.has(t)}init(t,e=[]){const n=this,o=this._editor,i=new Set,r=[],s=h(t),a=h(e),c=function(t){const e=[];for(const n of t)u(n)||e.push(n);return e.length?e:null}(t);if(c){const t="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";return console.error(Object(Jn.a)(t),{plugins:c}),Promise.reject(new Jn.b(t,this._editor,{plugins:c}))}return Promise.all(s.map(l)).then(()=>d(r,"init")).then(()=>d(r,"afterInit")).then(()=>r);function l(t){if(!a.includes(t)&&!n._plugins.has(t)&&!i.has(t))return function(t){return new Promise(s=>{i.add(t),t.requires&&t.requires.forEach(n=>{const i=u(n);if(e.includes(i))throw new Jn.b("plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.",o,{plugin:i,requiredBy:t});l(i)});const a=new t(o);n._add(t,a),r.push(a),s()})}(t).catch(e=>{throw console.error(Object(Jn.a)("plugincollection-load: It was not possible to load the plugin."),{plugin:t}),e})}function d(t,e){return t.reduce((t,n)=>n[e]?t.then(n[e].bind(n)):t,Promise.resolve())}function u(t){return"function"==typeof t?t:n._availablePlugins.get(t)}function h(t){return t.map(t=>u(t)).filter(t=>!!t)}}destroy(){const t=Array.from(this).map(([,t])=>t).filter(t=>"function"==typeof t.destroy).map(t=>t.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const n=t.pluginName;if(n){if(this._plugins.has(n))throw new Jn.b("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t});this._plugins.set(n,e)}}}lo(Pa,no);class Ta{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const n=this.get(t);if(!n)throw new Jn.b("commandcollection-command-not-found: Command does not exist.",this,{commandName:t});n.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}function Ea(t,e){const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;return 1===n&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]),0!==n&&function(t,e){return t in window.CKEDITOR_TRANSLATIONS&&e in window.CKEDITOR_TRANSLATIONS[t]}(t,e)?window.CKEDITOR_TRANSLATIONS[t][e].replace(/ \[context: [^\]]+\]$/,""):e.replace(/ \[context: [^\]]+\]$/,"")}window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Sa=["ar","fa","he","ku","ug"];class Ra{constructor(t={}){this.uiLanguage=t.uiLanguage||"en",this.contentLanguage=t.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Oa(this.uiLanguage),this.contentLanguageDirection=Oa(this.contentLanguage),this.t=((...t)=>this._t(...t))}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e){let n=Ea(this.uiLanguage,t);return e&&(n=n.replace(/%(\d+)/g,(t,n)=>n<e.length?e[n]:t)),n}}function Oa(t){return Sa.includes(t)?"rtl":"ltr"}class Ia{constructor(){this._consumables=new Map}add(t,e){let n;t.is("text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?n=this._consumables.get(t):(n=new Ma,this._consumables.set(t,n)),n.add(e))}test(t,e){const n=this._consumables.get(t);return void 0===n?null:t.is("text")||t.is("documentFragment")?n:n.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const n=this._consumables.get(t);void 0!==n&&(t.is("text")||t.is("documentFragment")?this._consumables.set(t,!0):n.revert(e))}static consumablesFromElement(t){const e={name:!0,attributes:[],classes:[],styles:[]},n=t.getAttributeKeys();for(const t of n)"style"!=t&&"class"!=t&&e.attributes.push(t);const o=t.getClassNames();for(const t of o)e.classes.push(t);const i=t.getStyleNames();for(const t of i)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new Ia),t.is("text"))return e.add(t),e;t.is("element")&&e.add(t,Ia.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const n of t.getChildren())e=Ia.createFrom(n,e);return e}}class Ma{constructor(){this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const n=this._test(e,t[e]);if(!0!==n)return n}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const n=Wt(e)?e:[e],o=this._consumables[t];for(const e of n){if("attributes"===t&&("class"===e||"style"===e))throw new Jn.b("viewconsumable-invalid-attribute: Classes and styles should be handled separately.",this);o.set(e,!0)}}_test(t,e){const n=Wt(e)?e:[e],o=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e){const t=o.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",n=this._test(t,[...this._consumables[t].keys()]);if(!0!==n)return n}return!0}_consume(t,e){const n=Wt(e)?e:[e],o=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e)o.set(e,!1);else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const n=Wt(e)?e:[e],o=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e){!1===o.get(e)&&o.set(e,!0)}else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class Da{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new Na(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new Na(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new Jn.b("schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new Jn.b("schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("text")||t.is("textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!(!e||!e.isObject)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const n=this.getDefinition(t.last);return!!n&&n.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof Ks){const e=t.nodeBefore,n=t.nodeAfter;if(!(e instanceof Us))throw new Jn.b("schema-check-merge-no-element-before: The node before the merge position must be an element.",this);if(!(n instanceof Us))throw new Jn.b("schema-check-merge-no-element-after: The node after the merge position must be an element.",this);return this.checkMerge(e,n)}for(const n of e.getChildren())if(!this.checkChild(t,n))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[n,o])=>{if(!o)return;const i=t(n,o);"boolean"==typeof i&&(e.stop(),e.return=i)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[n,o])=>{const i=t(n,o);"boolean"==typeof i&&(e.stop(),e.return=i)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;if(t instanceof Ks)e=t.parent;else{e=(t instanceof Js?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const n=e.getCommonAncestor();return t?t.getCommonAncestor(n,{includeSelf:!0}):n},null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const n=[...t.getFirstPosition().getAncestors(),new qs("",t.getAttributes())];return this.checkAttribute(n,e)}{const n=t.getRanges();for(const t of n)for(const n of t)if(this.checkAttribute(n.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const n of t)yield*this._getValidRangesForRange(n,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new Js(t);let n,o;"both"!=e&&"backward"!=e||(n=new $s({startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(o=new $s({startPosition:t}));for(const t of function*(t,e){let n=!1;for(;!n;){if(n=!0,t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}}}(n,o)){const e=t.walker==n?"elementEnd":"elementStart",o=t.value;if(o.type==e&&this.isObject(o.item))return Js._createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new Js(o.nextPosition)}return null}findAllowedParent(t,e){let n=t.parent;for(;n;){if(this.checkChild(n,e))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(t,e){for(const n of t){for(const t of n.getAttributeKeys())this.checkAttribute(n,t)||e.removeAttribute(t,n);n.is("element")&&this.removeDisallowedAttributes(n.getChildren(),e)}}createContext(t){return new Na(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,n=Object.keys(e);for(const o of n)t[o]=Va(e[o],o);for(const e of n)Fa(t,e);for(const e of n)Ba(t,e);for(const e of n)La(t,e),za(t,e);for(const e of n)qa(t,e),ja(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,n=e.length-1){const o=e.getItem(n);if(t.allowIn.includes(o.name)){if(0==n)return!0;{const t=this.getDefinition(o);return this._checkContextMatch(t,e,n-1)}}return!1}*_getValidRangesForRange(t,e){let n=t.start,o=t.start;for(const i of t.getItems({shallow:!0}))i.is("element")&&(yield*this._getValidRangesForRange(Js._createIn(i),e)),this.checkAttribute(i,e)||(n.isEqual(o)||(yield new Js(n,o)),n=Ks._createAfter(i)),o=Ks._createAfter(i);n.isEqual(o)||(yield new Js(n,o))}}lo(Da,Ho);class Na{constructor(t){if(t instanceof Na)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map($a)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new Na([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}}function Va(t,e){const n={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(t,e){for(const n of t){const t=Object.keys(n).filter(t=>t.startsWith("is"));for(const o of t)e[o]=n[o]}}(t,n),Ha(t,n,"allowIn"),Ha(t,n,"allowContentOf"),Ha(t,n,"allowWhere"),Ha(t,n,"allowAttributes"),Ha(t,n,"allowAttributesOf"),Ha(t,n,"inheritTypesFrom"),function(t,e){for(const n of t){const t=n.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,n),n}function Fa(t,e){for(const n of t[e].allowContentOf)if(t[n]){Ua(t,n).forEach(t=>{t.allowIn.push(e)})}delete t[e].allowContentOf}function Ba(t,e){for(const n of t[e].allowWhere){const o=t[n];if(o){const n=o.allowIn;t[e].allowIn.push(...n)}}delete t[e].allowWhere}function La(t,e){for(const n of t[e].allowAttributesOf){const o=t[n];if(o){const n=o.allowAttributes;t[e].allowAttributes.push(...n)}}delete t[e].allowAttributesOf}function za(t,e){const n=t[e];for(const e of n.inheritTypesFrom){const o=t[e];if(o){const t=Object.keys(o).filter(t=>t.startsWith("is"));for(const e of t)e in n||(n[e]=o[e])}}delete n.inheritTypesFrom}function qa(t,e){const n=t[e],o=n.allowIn.filter(e=>t[e]);n.allowIn=Array.from(new Set(o))}function ja(t,e){const n=t[e];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Ha(t,e,n){for(const o of t)"string"==typeof o[n]?e[n].push(o[n]):Array.isArray(o[n])&&e[n].push(...o[n])}function Ua(t,e){const n=t[e];return function(t){return Object.keys(t).map(e=>t[e])}(t).filter(t=>t.allowIn.includes(n.name))}function $a(t){return"string"==typeof t?{name:t,*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}class Wa{constructor(t={}){this._splitParts=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(t,e,n=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let n;for(const o of new Na(t)){const t={};for(const e of o.getAttributeKeys())t[e]=o.getAttribute(e);const i=e.createElement(o.name,t);n&&e.append(i,n),n=Ks._createAt(i,0)}return n}(n,e),this.conversionApi.writer=e,this.conversionApi.consumable=Ia.createFrom(t),this.conversionApi.store={};const{modelRange:o}=this._convertItem(t,this._modelCursor),i=e.createDocumentFragment();if(o){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,i);i.markers=function(t,e){const n=new Set,o=new Map,i=Js._createIn(t).getItems();for(const t of i)"$marker"==t.name&&n.add(t);for(const t of n){const n=t.getAttribute("data-name"),i=e.createPositionBefore(t);o.has(n)?o.get(n).end=i.clone():o.set(n,new Js(i.clone())),e.remove(t)}return o}(i,e)}return this._modelCursor=null,this._splitParts.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,i}_convertItem(t,e){const n=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,n,this.conversionApi):t.is("text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof Js))throw new Jn.b("view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(t,e){const n=new Js(e);let o=e;for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,o);t.modelRange instanceof Js&&(n.end=t.modelRange.end,o=t.modelCursor)}return{modelRange:n,modelCursor:o}}_splitToAllowedParent(t,e){const n=this.conversionApi.schema.findAllowedParent(e,t);if(!n)return null;if(n===e.parent)return{position:e};if(this._modelCursor.parent.getAncestors().includes(n))return null;const o=this.conversionApi.writer.split(e,n),i=[];for(const t of o.range.getWalker())if("elementEnd"==t.type)i.push(t.item);else{const e=i.pop(),n=t.item;this._registerSplitPair(e,n)}return{position:o.position,cursorParent:o.range.end.parent}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const n=this._splitParts.get(t);this._splitParts.set(e,n),n.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t]}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}lo(Wa,no);class Ga{constructor(t,e){this.model=t,this.processor=e,this.mapper=new Zs,this.downcastDispatcher=new Xs({mapper:this.mapper}),this.downcastDispatcher.on("insert:$text",(t,e,n)=>{if(!n.consumable.consume(e.item,"insert"))return;const o=n.writer,i=n.mapper.toViewPosition(e.range.start),r=o.createText(e.item.data);o.insert(i,r)},{priority:"lowest"}),this.upcastDispatcher=new Wa({schema:t.schema}),this.upcastDispatcher.on("text",(t,e,n)=>{if(n.schema.checkChild(e.modelCursor,"$text")&&n.consumable.consume(e.viewItem)){const t=n.writer.createText(e.viewItem.data);n.writer.insert(t,e.modelCursor),e.modelRange=Js._createFromPositionAndShift(e.modelCursor,t.offsetSize),e.modelCursor=e.modelRange.end}},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:o}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=o}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:o}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=o}},{priority:"lowest"}),this.decorate("init"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"})}get(t){const{rootName:e="main",trim:n="empty"}=t||{};if(!this._checkIfRootsExists([e]))throw new Jn.b("datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.",this);const o=this.model.document.getRoot(e);return"empty"!==n||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o):""}stringify(t){const e=this.toView(t);return this.processor.toData(e)}toView(t){this.mapper.clearBindings();const e=Js._createIn(t),n=new Ai,o=new Pi(new ai);if(this.mapper.bindElements(t,n),this.downcastDispatcher.convertInsert(e,o),!t.is("documentFragment")){const e=function(t){const e=[],n=t.root.document;if(!n)return[];const o=Js._createIn(t);for(const t of n.model.markers){const n=o.getIntersection(t.getRange());n&&e.push([t.name,n])}return e}(t);for(const[t,n]of e)this.downcastDispatcher.convertMarkerAdd(t,n,o)}return n}init(t){if(this.model.document.version)throw new Jn.b("datacontroller-init-document-not-empty: Trying to set initial data to not empty document.",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new Jn.b("datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.",this);return this.model.enqueueChange("transparent",t=>{for(const n of Object.keys(e)){const o=this.model.document.getRoot(n);t.insert(this.parse(e[n],o),o,0)}}),Promise.resolve()}set(t){let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new Jn.b("datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.",this);this.model.enqueueChange("transparent",t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const n of Object.keys(e)){const o=this.model.document.getRoot(n);t.remove(t.createRangeIn(o)),t.insert(this.parse(e[n],o),o,0)}})}parse(t,e="$root"){const n=this.processor.toView(t);return this.toModel(n,e)}toModel(t,e="$root"){return this.model.change(n=>this.upcastDispatcher.convert(t,n,e))}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}lo(Ga,Ho);class Ka{constructor(t,e){this._helpers=new Map,this._downcast=Array.isArray(t)?t:[t],this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Array.isArray(e)?e:[e],this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const n=this._downcast.includes(e);if(!this._upcast.includes(e)&&!n)throw new Jn.b("conversion-add-alias-dispatcher-not-registered: Trying to register and alias for a dispatcher that nas not been registered.",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:n})}for(t){if(!this._helpers.has(t))throw new Jn.b("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:n}of Ja(t))this.for("upcast").elementToElement({model:e,view:n,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:n}of Ja(t))this.for("upcast").elementToAttribute({view:n,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:n}of Ja(t))this.for("upcast").attributeToAttribute({view:n,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:n}){if(this._helpers.has(t))throw new Jn.b("conversion-group-exists: Trying to register a group name that has already been registered.",this);const o=n?new pa(e):new _a(e);this._helpers.set(t,o)}}function*Ja(t){if(t.model.values)for(const e of t.model.values){yield*Za({key:t.model.key,value:e},t.view[e],t.upcastAlso?t.upcastAlso[e]:void 0)}else yield*Za(t.model,t.view,t.upcastAlso)}function*Za(t,e,n){if(yield{model:t,view:e},n){n=Array.isArray(n)?n:[n];for(const e of n)yield{model:t,view:e}}}class Qa{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class Ya{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class Xa{constructor(t){this.markers=new Map,this._children=new Hs,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"==t||"model:documentFragment"==t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const n of t)n.name?e.push(Us.fromJSON(n)):e.push(qs.fromJSON(n));return new Xa(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){if("string"==typeof t)return[new qs(t)];wo(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new qs(t):t instanceof js?new qs(t.data,t.getAttributes()):t)}(e);for(const t of n)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n)t.parent=null;return n}}function tc(t,e){const n=(e=oc(e)).reduce((t,e)=>t+e.offsetSize,0),o=t.parent;rc(t);const i=t.index;return o._insertChild(i,e),ic(o,i+e.length),ic(o,i),new Js(t,t.getShiftedBy(n))}function ec(t){if(!t.isFlat)throw new Jn.b("operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.",this);const e=t.start.parent;rc(t.start),rc(t.end);const n=e._removeChildren(t.start.index,t.end.index-t.start.index);return ic(e,t.start.index),n}function nc(t,e){if(!t.isFlat)throw new Jn.b("operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.",this);const n=ec(t);return tc(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),n)}function oc(t){const e=[];t instanceof Array||(t=[t]);for(let n=0;n<t.length;n++)if("string"==typeof t[n])e.push(new qs(t[n]));else if(t[n]instanceof js)e.push(new qs(t[n].data,t[n].getAttributes()));else if(t[n]instanceof Xa||t[n]instanceof Hs)for(const o of t[n])e.push(o);else t[n]instanceof zs&&e.push(t[n]);for(let t=1;t<e.length;t++){const n=e[t],o=e[t-1];n instanceof qs&&o instanceof qs&&sc(n,o)&&(e.splice(t-1,2,new qs(o.data+n.data,o.getAttributes())),t--)}return e}function ic(t,e){const n=t.getChild(e-1),o=t.getChild(e);if(n&&o&&n.is("text")&&o.is("text")&&sc(n,o)){const i=new qs(n.data+o.data,n.getAttributes());t._removeChildren(e-1,2),t._insertChild(e-1,i)}}function rc(t){const e=t.textNode,n=t.parent;if(e){const o=t.offset-e.startOffset,i=e.index;n._removeChildren(i,1);const r=new qs(e.data.substr(0,o),e.getAttributes()),s=new qs(e.data.substr(o),e.getAttributes());n._insertChild(i,[r,s])}}function sc(t,e){const n=t.getAttributes(),o=e.getAttributes();for(const t of n){if(t[1]!==e.getAttribute(t[0]))return!1;o.next()}return o.next().done}var ac=function(t,e){return Qr(t,e)};class cc extends Ya{constructor(t,e,n,o,i){super(i),this.range=t.clone(),this.key=e,this.oldValue=void 0===n?null:n,this.newValue=void 0===o?null:o}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new cc(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new cc(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const t=super.toJSON();return t.range=this.range.toJSON(),t}_validate(){if(!this.range.isFlat)throw new Jn.b("attribute-operation-range-not-flat: The range to change is not flat.",this);for(const t of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!ac(t.getAttribute(this.key),this.oldValue))throw new Jn.b("attribute-operation-wrong-old-value: Changed node has different attribute value than operation's old attribute value.",this,{item:t,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&t.hasAttribute(this.key))throw new Jn.b("attribute-operation-attribute-exists: The attribute with given key already exists.",this,{node:t,key:this.key})}}_execute(){ac(this.oldValue,this.newValue)||function(t,e,n){rc(t.start),rc(t.end);for(const o of t.getItems({shallow:!0})){const t=o.is("textProxy")?o.textNode:o;null!==n?t._setAttribute(e,n):t._removeAttribute(e),ic(t.parent,t.index)}ic(t.end.parent,t.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(t,e){return new cc(Js.fromJSON(t.range,e),t.key,t.oldValue,t.newValue,t.baseVersion)}}class lc extends Ya{constructor(t,e){super(null),this.sourcePosition=t.clone(),this.howMany=e}get type(){return"detach"}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t}_validate(){if(this.sourcePosition.root.document)throw new Jn.b("detach-operation-on-document-node: Cannot detach document node.",this)}_execute(){ec(Js._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class dc extends Ya{constructor(t,e,n,o){super(o),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toNext",this.howMany=e,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const t=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,t,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent,n=this.sourcePosition.offset,o=this.targetPosition.offset;if(n+this.howMany>t.maxOffset)throw new Jn.b("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.",this);if(t===e&&n<o&&o<n+this.howMany)throw new Jn.b("move-operation-range-into-itself: Trying to move a range of nodes to the inside of that range.",this);if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==uo(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const t=this.sourcePosition.path.length-1;if(this.targetPosition.path[t]>=n&&this.targetPosition.path[t]<n+this.howMany)throw new Jn.b("move-operation-node-into-itself: Trying to move a range of nodes into one of nodes from that range.",this)}}_execute(){nc(Js._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t.targetPosition=this.targetPosition.toJSON(),t}static get className(){return"MoveOperation"}static fromJSON(t,e){const n=Ks.fromJSON(t.sourcePosition,e),o=Ks.fromJSON(t.targetPosition,e);return new this(n,t.howMany,o,t.baseVersion)}}class uc extends Ya{constructor(t,e,n){super(n),this.position=t.clone(),this.position.stickiness="toNone",this.nodes=new Hs(oc(e)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const t=new Hs([...this.nodes].map(t=>t._clone(!0))),e=new uc(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new Ks(t,[0]);return new dc(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffset<this.position.offset)throw new Jn.b("insert-operation-position-invalid: Insertion position is invalid.",this)}_execute(){const t=this.nodes;this.nodes=new Hs([...t].map(t=>t._clone(!0))),tc(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const n=[];for(const e of t.nodes)e.name?n.push(Us.fromJSON(e)):n.push(qs.fromJSON(e));const o=new uc(Ks.fromJSON(t.position,e),n,t.baseVersion);return o.shouldReceiveAttributes=t.shouldReceiveAttributes,o}}class hc extends Ya{constructor(t,e,n,o,i,r){super(r),this.name=t,this.oldRange=e?e.clone():null,this.newRange=n?n.clone():null,this.affectsData=i,this._markers=o}get type(){return"marker"}clone(){return new hc(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new hc(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new hc(t.name,t.oldRange?Js.fromJSON(t.oldRange,e):null,t.newRange?Js.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class fc extends Ya{constructor(t,e,n,o){super(o),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=n}get type(){return"rename"}clone(){return new fc(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new fc(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof Us))throw new Jn.b("rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.",this);if(t.name!==this.oldName)throw new Jn.b("rename-operation-wrong-name: Element to change has different name than operation's old name.",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new fc(Ks.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class pc extends Ya{constructor(t,e,n,o,i){super(i),this.root=t,this.key=e,this.oldValue=n,this.newValue=o}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new pc(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new pc(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new Jn.b("rootattribute-operation-not-a-root: The element to change is not a root element.",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new Jn.b("rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation's old attribute value.",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new Jn.b("rootattribute-operation-attribute-exists: The attribute with given key already exists.",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new Jn.b("rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.",this,{rootName:t.root});return new pc(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class mc extends Ya{constructor(t,e,n,o,i){super(i),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=o.clone()}get type(){return"merge"}get deletionPosition(){return new Ks(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Js(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),n=new Ks(this.sourcePosition.root,e)._getTransformedByMergeOperation(this),o=new gc(t,this.howMany,this.graveyardPosition,this.baseVersion+1);return o.insertionPosition=n,o}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new Jn.b("merge-operation-source-position-invalid: Merge source position is invalid.",this);if(!e.parent)throw new Jn.b("merge-operation-target-position-invalid: Merge target position is invalid.",this);if(this.howMany!=t.maxOffset)throw new Jn.b("merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.",this)}_execute(){const t=this.sourcePosition.parent;nc(Js._createIn(t),this.targetPosition),nc(Js._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const n=Ks.fromJSON(t.sourcePosition,e),o=Ks.fromJSON(t.targetPosition,e),i=Ks.fromJSON(t.graveyardPosition,e);return new this(n,t.howMany,o,i,t.baseVersion)}}class gc extends Ya{constructor(t,e,n,o){super(o),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=gc.getInsertionPosition(t),this.insertionPosition.stickiness="toNone",this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new Ks(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Js(this.splitPosition,t)}clone(){const t=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return t.insertionPosition=this.insertionPosition,t}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new Ks(t,[0]);return new mc(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset<e)throw new Jn.b("split-operation-position-invalid: Split position is invalid.",this);if(!t.parent)throw new Jn.b("split-operation-split-in-root: Cannot split root element.",this);if(this.howMany!=t.maxOffset-this.splitPosition.offset)throw new Jn.b("split-operation-how-many-invalid: Split operation specifies wrong number of nodes to move.",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new Jn.b("split-operation-graveyard-position-invalid: Graveyard position invalid.",this)}_execute(){const t=this.splitPosition.parent;if(this.graveyardPosition)nc(Js._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const e=t._clone();tc(this.insertionPosition,e)}nc(new Js(Ks._createAt(t,this.splitPosition.offset),Ks._createAt(t,t.maxOffset)),this.moveTargetPosition)}toJSON(){const t=super.toJSON();return t.splitPosition=this.splitPosition.toJSON(),t.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(t.graveyardPosition=this.graveyardPosition.toJSON()),t}static get className(){return"SplitOperation"}static getInsertionPosition(t){const e=t.path.slice(0,-1);return e[e.length-1]++,new Ks(t.root,e)}static fromJSON(t,e){const n=Ks.fromJSON(t.splitPosition,e),o=Ks.fromJSON(t.insertionPosition,e),i=t.graveyardPosition?Ks.fromJSON(t.graveyardPosition,e):null,r=new this(n,t.howMany,i,t.baseVersion);return r.insertionPosition=o,r}}class bc extends Us{constructor(t,e,n="main"){super(e),this._doc=t,this.rootName=n}get document(){return this._doc}is(t,e){const n=t.replace("model:","");return e?"rootElement"==n&&e==this.name||super.is(t,e):"rootElement"==n||super.is(t)}toJSON(){return this.rootName}}class wc{constructor(t,e){this.model=t,this.batch=e}createText(t,e){return new qs(t,e)}createElement(t,e){return new Us(t,e)}createDocumentFragment(){return new Xa}insert(t,e,n=0){if(this._assertWriterUsedCorrectly(),t instanceof qs&&""==t.data)return;const o=Ks._createAt(e,n);if(t.parent){if(xc(t.root,o.root))return void this.move(Js._createOn(t),o);if(t.root.document)throw new Jn.b("model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree. It is forbidden to move a node that was already in a document outside of it.",this);this.remove(t)}const i=o.root.document?o.root.document.version:null,r=new uc(o,t,i);if(t instanceof qs&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),t instanceof Xa)for(const[e,n]of t.markers){const t=Ks._createAt(n.root,0),i={range:new Js(n.start._getCombined(t,o),n.end._getCombined(t,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(e)?this.updateMarker(e,i):this.addMarker(e,i)}}insertText(t,e,n,o){e instanceof Xa||e instanceof Us||e instanceof Ks?this.insert(this.createText(t),e,n):this.insert(this.createText(t,e),n,o)}insertElement(t,e,n,o){e instanceof Xa||e instanceof Us||e instanceof Ks?this.insert(this.createElement(t),e,n):this.insert(this.createElement(t,e),n,o)}append(t,e){this.insert(t,e,"end")}appendText(t,e,n){e instanceof Xa||e instanceof Us?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),n,"end")}appendElement(t,e,n){e instanceof Xa||e instanceof Us?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),n,"end")}setAttribute(t,e,n){if(this._assertWriterUsedCorrectly(),n instanceof Js){const o=n.getMinimalFlatRanges();for(const n of o)kc(this,t,e,n)}else _c(this,t,e,n)}setAttributes(t,e){for(const[n,o]of Ls(t))this.setAttribute(n,o,e)}removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof Js){const n=e.getMinimalFlatRanges();for(const e of n)kc(this,t,null,e)}else _c(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=t=>{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof Js)for(const n of t.getItems())e(n);else e(t)}move(t,e,n){if(this._assertWriterUsedCorrectly(),!(t instanceof Js))throw new Jn.b("writer-move-invalid-range: Invalid range to move.",this);if(!t.isFlat)throw new Jn.b("writer-move-range-not-flat: Range to move is not flat.",this);const o=Ks._createAt(e,n);if(o.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!xc(t.root,o.root))throw new Jn.b("writer-move-different-document: Range is going to be moved between different documents.",this);const i=t.root.document?t.root.document.version:null,r=new dc(t.start,t.end.offset-t.start.offset,o,i);this.batch.addOperation(r),this.model.applyOperation(r)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof Js?t:Js._createOn(t)).getMinimalFlatRanges().reverse();for(const t of e)this._addOperationForAffectedMarkers("move",t),yc(t.start,t.end.offset-t.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,n=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof Us))throw new Jn.b("writer-merge-no-element-before: Node before merge position must be an element.",this);if(!(n instanceof Us))throw new Jn.b("writer-merge-no-element-after: Node after merge position must be an element.",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,n){return this.model.createPositionFromPath(t,e,n)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(t,e,n){return this.model.createSelection(t,e,n)}_mergeDetached(t){const e=t.nodeBefore,n=t.nodeAfter;this.move(Js._createIn(n),Ks._createAt(e,"end")),this.remove(n)}_merge(t){const e=Ks._createAt(t.nodeBefore,"end"),n=Ks._createAt(t.nodeAfter,0),o=t.root.document.graveyard,i=new Ks(o,[0]),r=t.root.document.version,s=new mc(n,t.nodeAfter.maxOffset,e,i,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof Us))throw new Jn.b("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.",this);const n=t.root.document?t.root.document.version:null,o=new fc(Ks._createBefore(t),t.name,e,n);this.batch.addOperation(o),this.model.applyOperation(o)}split(t,e){this._assertWriterUsedCorrectly();let n,o,i=t.parent;if(!i.parent)throw new Jn.b("writer-split-element-no-parent: Element with no parent can not be split.",this);if(e||(e=i.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new Jn.b("writer-split-invalid-limit-element: Limit element is not a position ancestor.",this);do{const e=i.root.document?i.root.document.version:null,r=i.maxOffset-t.offset,s=new gc(t,r,null,e);this.batch.addOperation(s),this.model.applyOperation(s),n||o||(n=i,o=t.parent.nextSibling),i=(t=this.createPositionAfter(t.parent)).parent}while(i!==e);return{position:t,range:new Js(Ks._createAt(n,"end"),Ks._createAt(o,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new Jn.b("writer-wrap-range-not-flat: Range to wrap is not flat.",this);const n=e instanceof Us?e:new Us(e);if(n.childCount>0)throw new Jn.b("writer-wrap-element-not-empty: Element to wrap with is not empty.",this);if(null!==n.parent)throw new Jn.b("writer-wrap-element-attached: Element to wrap with is already attached to tree model.",this);this.insert(n,t.start);const o=new Js(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(o,Ks._createAt(n,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new Jn.b("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.",this);this.move(Js._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new Jn.b("writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.",this);const n=e.usingOperation,o=e.range,i=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new Jn.b("writer-addMarker-marker-exists: Marker with provided name already exists.",this);if(!o)throw new Jn.b("writer-addMarker-no-range: Range parameter is required when adding a new marker.",this);return n?(vc(this,t,null,o,i),this.model.markers.get(t)):this.model.markers._set(t,o,n,i)}updateMarker(t,e){this._assertWriterUsedCorrectly();const n="string"==typeof t?t:t.name,o=this.model.markers.get(n);if(!o)throw new Jn.b("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.",this);if(!e)return void this.model.markers._refresh(o);const i="boolean"==typeof e.usingOperation,r="boolean"==typeof e.affectsData,s=r?e.affectsData:o.affectsData;if(!i&&!e.range&&!r)throw new Jn.b("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.",this);const a=o.getRange(),c=e.range?e.range:a;i&&e.usingOperation!==o.managedUsingOperations?e.usingOperation?vc(this,n,null,c,s):(vc(this,n,a,null,s),this.model.markers._set(n,c,void 0,s)):o.managedUsingOperations?vc(this,n,a,c,s):this.model.markers._set(n,c,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new Jn.b("writer-removeMarker-no-marker: Trying to remove marker which does not exist.",this);const n=this.model.markers.get(e);n.managedUsingOperations?vc(this,e,n.getRange(),null,n.affectsData):this.model.markers._remove(e)}setSelection(t,e,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,n)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,n]of Ls(t))this._setSelectionAttribute(e,n)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const o=aa._getStoreAttributeKey(t);this.setAttribute(o,e,n.anchor.parent)}n._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const n=aa._getStoreAttributeKey(t);this.removeAttribute(n,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new Jn.b("writer-incorrect-use: Trying to use a writer outside the change() block.",this)}_addOperationForAffectedMarkers(t,e){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const o=n.getRange();let i=!1;if("move"==t)i=e.containsPosition(o.start)||e.start.isEqual(o.start)||e.containsPosition(o.end)||e.end.isEqual(o.end);else{const t=e.nodeBefore,n=e.nodeAfter,r=o.start.parent==t&&o.start.isAtEnd,s=o.end.parent==n&&0==o.end.offset,a=o.end.nodeAfter==n,c=o.start.nodeAfter==n;i=r||s||a||c}i&&this.updateMarker(n.name,{range:o})}}}function kc(t,e,n,o){const i=t.model,r=i.document;let s,a,c,l=o.start;for(const t of o.getWalker({shallow:!0}))c=t.item.getAttribute(e),s&&a!=c&&(a!=n&&d(),l=s),s=t.nextPosition,a=c;function d(){const o=new Js(l,s),c=o.root.document?r.version:null,d=new cc(o,e,a,n,c);t.batch.addOperation(d),i.applyOperation(d)}s instanceof Ks&&s!=l&&a!=n&&d()}function _c(t,e,n,o){const i=t.model,r=i.document,s=o.getAttribute(e);let a,c;if(s!=n){if(o.root===o){const t=o.document?r.version:null;c=new pc(o,e,s,n,t)}else{const i=(a=new Js(Ks._createBefore(o),t.createPositionAfter(o))).root.document?r.version:null;c=new cc(a,e,s,n,i)}t.batch.addOperation(c),i.applyOperation(c)}}function vc(t,e,n,o,i){const r=t.model,s=r.document,a=new hc(e,n,o,r.markers,i,s.version);t.batch.addOperation(a),r.applyOperation(a)}function yc(t,e,n,o){let i;if(t.root.document){const n=o.document,r=new Ks(n.graveyard,[0]);i=new dc(t,e,r,n.version)}else i=new lc(t,e);n.addOperation(i),o.applyOperation(i)}function xc(t,e){return t===e||t instanceof bc&&e instanceof bc}class Cc{constructor(t){this._markerCollection=t,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize);const e=Js._createOn(t);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}this._cachedChanges=null}bufferOperation(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),n=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),n||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=Js._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const n=t.graveyardPosition.parent;this._markInsert(n,t.graveyardPosition.offset,1);const o=t.targetPosition.parent;this._isInInsertedElement(o)||this._markInsert(o,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,n,o){const i=this._changedMarkers.get(t);i?(i.newRange=n,i.affectsData=o,null==i.oldRange&&null==i.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:n,affectsData:o})}getMarkersToRemove(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.oldRange&&t.push({name:e,range:n.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.newRange&&t.push({name:e,range:n.newRange});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(t=>({name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}}))}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const e=[];for(const t of this._changesInElement.keys()){const n=this._changesInElement.get(t).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offset<e.offset?-1:1),o=this._elementSnapshots.get(t),i=Ac(t.getChildren()),r=Pc(o.length,n);let s=0,a=0;for(const n of r)if("i"===n)e.push(this._getInsertDiff(t,s,i[s].name)),s++;else if("r"===n)e.push(this._getRemoveDiff(t,s,o[a].name)),a++;else if("a"===n){const n=i[s].attributes,r=o[a].attributes;let c;if("$text"==i[s].name)c=new Js(Ks._createAt(t,s),Ks._createAt(t,s+1));else{const e=t.offsetToIndex(s);c=new Js(Ks._createAt(t,s),Ks._createAt(t.getChild(e),0))}e.push(...this._getAttributesDiff(c,r,n)),s++,a++}else s++,a++}e.sort((t,e)=>t.position.root!=e.position.root?t.position.root.rootName<e.position.root.rootName?-1:1:t.position.isEqual(e.position)?t.changeCount-e.changeCount:t.position.isBefore(e.position)?-1:1);for(let t=1;t<e.length;t++){const n=e[t-1],o=e[t],i="remove"==n.type&&"remove"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.isEqual(o.position),r="insert"==n.type&&"insert"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.parent==o.position.parent&&n.position.offset+n.length==o.position.offset,s="attribute"==n.type&&"attribute"==o.type&&n.position.parent==o.position.parent&&n.range.isFlat&&o.range.isFlat&&n.position.offset+n.length==o.position.offset&&n.attributeKey==o.attributeKey&&n.attributeOldValue==o.attributeOldValue&&n.attributeNewValue==o.attributeNewValue;(i||r||s)&&(e[t-1].length++,s&&(e[t-1].range.end=e[t-1].range.end.getShiftedBy(1)),e.splice(t,1),t--)}for(const t of e)delete t.changeCount,"attribute"==t.type&&(delete t.position,delete t.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e.slice(),this._cachedChanges=e.slice().filter(Tc),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(t,e,n){const o={type:"insert",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,o)}_markRemove(t,e,n){const o={type:"remove",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,o),this._removeAllNestedChanges(t,e,n)}_markAttribute(t){const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const n=this._getChangesForElement(t);this._handleChange(e,n),n.push(e);for(let t=0;t<n.length;t++)n[t].howMany<1&&(n.splice(t,1),t--)}_getChangesForElement(t){let e;return this._changesInElement.has(t)?e=this._changesInElement.get(t):(e=[],this._changesInElement.set(t,e)),e}_makeSnapshot(t){this._elementSnapshots.has(t)||this._elementSnapshots.set(t,Ac(t.getChildren()))}_handleChange(t,e){t.nodesToHandle=t.howMany;for(const n of e){const o=t.offset+t.howMany,i=n.offset+n.howMany;if("insert"==t.type&&("insert"==n.type&&(t.offset<=n.offset?n.offset+=t.howMany:t.offset<i&&(n.howMany+=t.nodesToHandle,t.nodesToHandle=0)),"remove"==n.type&&t.offset<n.offset&&(n.offset+=t.howMany),"attribute"==n.type))if(t.offset<=n.offset)n.offset+=t.howMany;else if(t.offset<i){const i=n.howMany;n.howMany=t.offset-n.offset,e.unshift({type:"attribute",offset:o,howMany:i-n.howMany,count:this._changeCount++})}if("remove"==t.type){if("insert"==n.type)if(o<=n.offset)n.offset-=t.howMany;else if(o<=i)if(t.offset<n.offset){const e=o-n.offset;n.offset=t.offset,n.howMany-=e,t.nodesToHandle-=e}else n.howMany-=t.nodesToHandle,t.nodesToHandle=0;else if(t.offset<=n.offset)t.nodesToHandle-=n.howMany,n.howMany=0;else if(t.offset<i){const e=i-t.offset;n.howMany-=e,t.nodesToHandle-=e}if("remove"==n.type&&(o<=n.offset?n.offset-=t.howMany:t.offset<n.offset&&(t.nodesToHandle+=n.howMany,n.howMany=0)),"attribute"==n.type)if(o<=n.offset)n.offset-=t.howMany;else if(t.offset<n.offset){const e=o-n.offset;n.offset=t.offset,n.howMany-=e}else if(t.offset<i)if(o<=i){const o=n.howMany;n.howMany=t.offset-n.offset;const i=o-n.howMany-t.nodesToHandle;e.unshift({type:"attribute",offset:t.offset,howMany:i,count:this._changeCount++})}else n.howMany-=i-t.offset}if("attribute"==t.type){if("insert"==n.type)if(t.offset<n.offset&&o>n.offset){if(o>i){const t={type:"attribute",offset:i,howMany:o-i,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=n.offset&&t.offset<i&&(o>i?(t.nodesToHandle=o-i,t.offset=i):t.nodesToHandle=0);if("remove"==n.type&&t.offset<n.offset&&o>n.offset){const i={type:"attribute",offset:n.offset,howMany:o-n.offset,count:this._changeCount++};this._handleChange(i,e),e.push(i),t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==n.type&&(t.offset>=n.offset&&o<=i?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=n.offset&&o>=i&&(n.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,n){return{type:"insert",position:Ks._createAt(t,e),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,n){return{type:"remove",position:Ks._createAt(t,e),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,n){const o=[];n=new Map(n);for(const[i,r]of e){const e=n.has(i)?n.get(i):null;e!==r&&o.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:i,attributeOldValue:r,attributeNewValue:e,changeCount:this._changeCount++}),n.delete(i)}for(const[e,i]of n)o.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:i,changeCount:this._changeCount++});return o}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const n=this._changesInElement.get(e),o=t.startOffset;if(n)for(const t of n)if("insert"==t.type&&o>=t.offset&&o<t.offset+t.howMany)return!0;return this._isInInsertedElement(e)}_removeAllNestedChanges(t,e,n){const o=new Js(Ks._createAt(t,e),Ks._createAt(t,e+n));for(const t of o.getItems({shallow:!0}))t.is("element")&&(this._elementSnapshots.delete(t),this._changesInElement.delete(t),this._removeAllNestedChanges(t,0,t.maxOffset))}}function Ac(t){const e=[];for(const n of t)if(n.is("text"))for(let t=0;t<n.data.length;t++)e.push({name:"$text",attributes:new Map(n.getAttributes())});else e.push({name:n.name,attributes:new Map(n.getAttributes())});return e}function Pc(t,e){const n=[];let o=0,i=0;for(const t of e){if(t.offset>o){for(let e=0;e<t.offset-o;e++)n.push("e");i+=t.offset-o}if("insert"==t.type){for(let e=0;e<t.howMany;e++)n.push("i");o=t.offset+t.howMany}else if("remove"==t.type){for(let e=0;e<t.howMany;e++)n.push("r");o=t.offset,i+=t.howMany}else n.push(..."a".repeat(t.howMany).split("")),o=t.offset+t.howMany,i+=t.howMany}if(i<t)for(let e=0;e<t-i-o;e++)n.push("e");return n}function Tc(t){const e=t.position&&"$graveyard"==t.position.root.rootName,n=t.range&&"$graveyard"==t.range.root.rootName;return!e&&!n}class Ec{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(t){this._operations.includes(t)||this._operations.push(t)}getOperations(t=0,e=Number.POSITIVE_INFINITY){return t<0?[]:this._operations.slice(t,e)}getOperation(t){return this._operations[t]}setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t)}isUndoingOperation(t){return this._undoPairs.has(t)}isUndoneOperation(t){return this._undoneOperations.has(t)}getUndoneOperation(t){return this._undoPairs.get(t)}}function Sc(t,e){return function(t){return!!t&&1==t.length&&/[\ud800-\udbff]/.test(t)}(t.charAt(e-1))&&function(t){return!!t&&1==t.length&&/[\udc00-\udfff]/.test(t)}(t.charAt(e))}function Rc(t,e){return function(t){return!!t&&1==t.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t)}(t.charAt(e))}const Oc="$graveyard";class Ic{constructor(t){this.model=t,this.version=0,this.history=new Ec(this),this.selection=new aa(this),this.roots=new si({idProperty:"rootName"}),this.differ=new Cc(t.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Oc),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new Jn.b("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",this,{operation:n})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&(this.version++,this.history.addOperation(n))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(t,e,n,o)=>{this.differ.bufferMarkerChange(e.name,n,o,e.affectsData),null===n&&e.on("change",(t,n)=>{this.differ.bufferMarkerChange(e.name,n,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot(Oc)}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new Jn.b("model-document-createRoot-name-exists: Root with specified name already exists.",this,{name:e});const n=new bc(this,t,e);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>t!=Oc)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=fo(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,n=e.schema,o=e.createPositionFromPath(t,[0]);return n.getNearestSelectionRange(o)||e.createRange(o)}_validateSelectionRange(t){return Mc(t.start)&&Mc(t.end)}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(this.selection.refresh(),e=n(t))break}while(e)}}function Mc(t){const e=t.textNode;if(e){const n=e.data,o=t.offset-e.startOffset;return!Sc(n,o)&&!Rc(n,o)}return!0}lo(Ic,no);class Dc{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,n=!1,o=!1){const i=t instanceof Nc?t.name:t,r=this._markers.get(i);if(r){const t=r.getRange();let s=!1;return t.isEqual(e)||(r._attachLiveRange(ra.fromRange(e)),s=!0),n!=r.managedUsingOperations&&(r._managedUsingOperations=n,s=!0),"boolean"==typeof o&&o!=r.affectsData&&(r._affectsData=o,s=!0),s&&this.fire("update:"+i,r,t,e),r}const s=ra.fromRange(e),a=new Nc(i,s,n,o);return this._markers.set(i,a),this.fire("update:"+i,a,null,e),a}_remove(t){const e=t instanceof Nc?t.name:t,n=this._markers.get(e);return!!n&&(this._markers.delete(e),this.fire("update:"+e,n,n.getRange(),null),this._destroyMarker(n),!0)}_refresh(t){const e=t instanceof Nc?t.name:t,n=this._markers.get(e);if(!n)throw new Jn.b("markercollection-refresh-marker-not-exists: Marker with provided name does not exists.",this);const o=n.getRange();this.fire("update:"+e,n,o,o,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}lo(Dc,no);class Nc{constructor(t,e,n,o){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=n,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._affectsData}getStart(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new Jn.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.toRange()}is(t){return"marker"==t||"model:marker"==t}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}lo(Nc,no);class Vc extends Ks{constructor(t,e,n="toNone"){if(super(t,e,n),!this.root.is("rootElement"))throw new Jn.b("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.",t);(function(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&function(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}.call(this,n)},{priority:"low"})}).call(this)}detach(){this.stopListening()}is(t){return"livePosition"==t||"model:livePosition"==t||super.is(t)}toPosition(){return new Ks(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}lo(Vc,no);class Fc{constructor(t,e,n){this.model=t,this.writer=e,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(t,e){t=Array.from(t);for(let n=0;n<t.length;n++){const o=t[n];this._handleNode(o,{isFirst:0===n&&e.isFirst,isLast:n===t.length-1&&e.isLast})}this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}getSelectionRange(){return this.nodeToSelect?Js._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Js(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(t,e){if(this.schema.isObject(t))return void this._handleObject(t,e);this._checkAndSplitToAllowedPosition(t,e)?(this._insert(t),this._mergeSiblingsOf(t,e)):this._handleDisallowedNode(t,e)}_handleObject(t,e){this._checkAndSplitToAllowedPosition(t)?this._insert(t):this._tryAutoparagraphing(t,e)}_handleDisallowedNode(t,e){t.is("element")?this.handleNodes(t.getChildren(),e):this._tryAutoparagraphing(t,e)}_insert(t){if(!this.schema.checkChild(this.position,t))throw new Jn.b("insertcontent-wrong-position: Given node cannot be inserted on the given position.",this,{node:t,position:this.position});const e=Vc.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this.writer.insert(t,this.position),this.position=e.toPosition(),e.detach(),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=t:this.nodeToSelect=null,this._filterAttributesOf.push(t)}_setAffectedBoundaries(t){this._affectedStart||(this._affectedStart=Vc.fromPosition(t,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(t)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Vc.fromPosition(t,"toNext"))}_mergeSiblingsOf(t,e){if(!(t instanceof Us))return;const n=this._canMergeLeft(t,e),o=this._canMergeRight(t,e),i=Vc._createBefore(t);i.stickiness="toNext";const r=Vc._createAfter(t);if(r.stickiness="toNext",n){const t=Vc.fromPosition(this.position);t.stickiness="toNext",this._affectedStart.isEqual(i)&&(this._affectedStart.detach(),this._affectedStart=Vc._createAt(i.nodeBefore,"end","toPrevious")),this.writer.merge(i),i.isEqual(this._affectedEnd)&&e.isLast&&(this._affectedEnd.detach(),this._affectedEnd=Vc._createAt(i.nodeBefore,"end","toNext")),this.position=t.toPosition(),t.detach()}if(o){if(!this.position.isEqual(r))throw new Jn.b("insertcontent-invalid-insertion-position",this);this.position=Ks._createAt(r.nodeBefore,"end");const t=Vc.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(r)&&(this._affectedEnd.detach(),this._affectedEnd=Vc._createAt(r.nodeBefore,"end","toNext")),this.writer.merge(r),r.getShiftedBy(-1).isEqual(this._affectedStart)&&e.isFirst&&(this._affectedStart.detach(),this._affectedStart=Vc._createAt(r.nodeBefore,0,"toPrevious")),this.position=t.toPosition(),t.detach()}(n||o)&&this._filterAttributesOf.push(this.position.parent),i.detach(),r.detach()}_canMergeLeft(t,e){const n=t.previousSibling;return e.isFirst&&n instanceof Us&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(n,t)}_canMergeRight(t,e){const n=t.nextSibling;return e.isLast&&n instanceof Us&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(t,n)}_tryAutoparagraphing(t,e){const n=this.writer.createElement("paragraph");this._getAllowedIn(n,this.position.parent)&&this.schema.checkChild(n,t)&&(n._appendChild(t),this._handleNode(n,e))}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(t,this.position.parent);if(!e)return!1;for(;e!=this.position.parent;){if(this.schema.isLimit(this.position.parent))return!1;if(this.position.isAtStart){const t=this.position.parent;this.position=this.writer.createPositionBefore(t),t.isEmpty&&t.parent===e&&this.writer.remove(t)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const t=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=t,this.canMergeWith.add(this.position.nodeAfter)}}return!0}_getAllowedIn(t,e){return this.schema.checkChild(e,t)?e:e.parent?this._getAllowedIn(t,e.parent):null}}function Bc(t,e,n={}){if(e.isCollapsed)return;const o=e.getFirstRange();if("$graveyard"==o.root.rootName)return;const i=t.schema;t.change(t=>{if(!n.doNotResetEntireContent&&function(t,e){const n=t.getLimitElement(e);if(!e.containsEntireContent(n))return!1;const o=e.getFirstRange();if(o.start.parent==o.end.parent)return!1;return t.checkChild(n,"paragraph")}(i,e))return void function(t,e){const n=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(n)),Lc(t,t.createPositionAt(n,0),e)}(t,e);const r=o.start,s=Vc.fromPosition(o.end,"toNext");if(o.start.isTouching(o.end)||t.remove(o),n.leaveUnmerged||(!function t(e,n,o){const i=n.parent;const r=o.parent;if(i==r)return;if(e.model.schema.isLimit(i)||e.model.schema.isLimit(r))return;if(!function(t,e,n){const o=new Js(t,e);for(const t of o.getWalker())if(n.isLimit(t.item))return!1;return!0}(n,o,e.model.schema))return;n=e.createPositionAfter(i);o=e.createPositionBefore(r);o.isEqual(n)||e.insert(r,n);e.merge(n);for(;o.parent.isEmpty;){const t=o.parent;o=e.createPositionBefore(t),e.remove(t)}t(e,n,o)}(t,r,s),i.removeDisallowedAttributes(r.parent.getChildren(),t)),zc(t,e,r),function(t,e){const n=t.checkChild(e,"$text"),o=t.checkChild(e,"paragraph");return!n&&o}(i,r)){const o=i.getNearestSelectionRange(r);n.doNotAutoparagraph&&o?zc(t,e,o):Lc(t,r,e)}s.detach()})}function Lc(t,e,n){const o=t.createElement("paragraph");t.insert(o,e),zc(t,n,t.createPositionAt(o,0))}function zc(t,e,n){e instanceof aa?t.setSelection(n):e.setTo(n)}const qc=' ,.?!:;"-()';function jc(t,e,n={}){const o=t.schema,i="backward"!=n.direction,r=n.unit?n.unit:"character",s=e.focus,a=new $s({boundaries:function(t,e){const n=t.root,o=Ks._createAt(n,e?"end":0);return e?new Js(t,o):new Js(o,t)}(s,i),singleCharacters:!0,direction:i?"forward":"backward"}),c={walker:a,schema:o,isForward:i,unit:r};let l;for(;l=a.next();){if(l.done)return;const n=Hc(c,l.value);if(n)return void(e instanceof aa?t.change(t=>{t.setSelectionFocus(n)}):e.setFocus(n))}}function Hc(t,e){if("text"==e.type)return"word"===t.unit?function(t,e){let n=t.position.textNode;if(n){let o=t.position.offset-n.startOffset;for(;!Uc(n.data,o,e)&&!$c(n,o,e);){t.next();const i=e?t.position.nodeAfter:t.position.nodeBefore;if(i&&i.is("text")){const o=i.data.charAt(e?0:i.data.length-1);qc.includes(o)||(t.next(),n=t.position.textNode)}o=t.position.offset-n.startOffset}}return t.position}(t.walker,t.isForward):function(t,e){const n=t.position.textNode;if(n){const o=n.data;let i=t.position.offset-n.startOffset;for(;Sc(o,i)||"character"==e&&Rc(o,i);)t.next(),i=t.position.offset-n.startOffset}return t.position}(t.walker,t.unit,t.isForward);if(e.type==(t.isForward?"elementStart":"elementEnd")){if(t.schema.isObject(e.item))return Ks._createAt(e.item,t.isForward?"after":"before");if(t.schema.checkChild(e.nextPosition,"$text"))return e.nextPosition}else{if(t.schema.isLimit(e.item))return void t.walker.skip(()=>!0);if(t.schema.checkChild(e.nextPosition,"$text"))return e.nextPosition}}function Uc(t,e,n){const o=e+(n?0:-1);return qc.includes(t.charAt(o))}function $c(t,e,n){return e===(n?t.endOffset:0)}function Wc(t,e){const n=[];Array.from(t.getItems({direction:"backward"})).map(t=>e.createRangeOn(t)).filter(e=>{return(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))}).forEach(t=>{n.push(t.start.parent),e.remove(t)}),n.forEach(t=>{let n=t;for(;n.parent&&n.isEmpty;){const t=e.createRangeOn(n);n=n.parent,e.remove(t)}})}function Gc(t){t.document.registerPostFixer(e=>(function(t,e){const n=e.document.selection,o=e.schema,i=[];let r=!1;for(const t of n.getRanges()){const e=Kc(t,o);e?(i.push(e),r=!0):i.push(t)}if(r){let e=i;if(i.length>1){const t=i[0].start,n=i[i.length-1].end;e=[new Js(t,n)]}t.setSelection(e,{backward:n.isBackward})}})(e,t))}function Kc(t,e){return t.isCollapsed?function(t,e){const n=t.start,o=e.getNearestSelectionRange(n);if(!o)return null;const i=o.start;if(n.isEqual(i))return null;if(i.nodeAfter&&e.isLimit(i.nodeAfter))return new Js(i,Ks._createAfter(i.nodeAfter));return new Js(i)}(t,e):function(t,e){const n=t.start,o=t.end,i=e.checkChild(n,"$text"),r=e.checkChild(o,"$text"),s=e.getLimitElement(n),a=e.getLimitElement(o);if(s===a){if(i&&r)return null;if(function(t,e,n){const o=t.nodeAfter&&!n.isLimit(t.nodeAfter)||n.checkChild(t,"$text"),i=e.nodeBefore&&!n.isLimit(e.nodeBefore)||n.checkChild(e,"$text");return o||i}(n,o,e)){const t=n.nodeAfter&&e.isObject(n.nodeAfter),i=t?null:e.getNearestSelectionRange(n,"forward"),r=o.nodeBefore&&e.isObject(o.nodeBefore),s=r?null:e.getNearestSelectionRange(o,"backward"),a=i?i.start:n,c=s?s.start:o;return new Js(a,c)}}const c=s&&!s.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const t=n.nodeAfter&&o.nodeBefore&&n.nodeAfter.parent===o.nodeBefore.parent,i=c&&(!t||!Zc(n.nodeAfter,e)),r=l&&(!t||!Zc(o.nodeBefore,e));let d=n,u=o;return i&&(d=Ks._createBefore(Jc(s,e))),r&&(u=Ks._createAfter(Jc(a,e))),new Js(d,u)}return null}(t,e)}function Jc(t,e){let n=t,o=n;for(;e.isLimit(o)&&o.parent;)n=o,o=o.parent;return n}function Zc(t,e){return t&&e.isObject(t)}class Qc{constructor(){this.markers=new Dc,this.document=new Ic(this),this.schema=new Da,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker"),this.schema.addChildCheck((t,e)=>{if("$marker"===e.name)return!0}),Gc(this)}change(t){return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Qa,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}enqueueChange(t,e){"string"==typeof t?t=new Qa(t):"function"==typeof t&&(e=t,t=new Qa),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}applyOperation(t){t._execute()}insertContent(t,e,n){return function(t,e,n,o){return t.change(i=>{let r;const s=(r=n?n instanceof ea||n instanceof aa?n:i.createSelection(n,o):t.document.selection).getFirstPosition();r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0});const a=new Fc(t,i,s);let c;c=e.is("documentFragment")?e.getChildren():[e],a.handleNodes(c,{isFirst:!0,isLast:!0});const l=a.getSelectionRange();l&&(r instanceof aa?i.setSelection(l):r.setTo(l));const d=a.getAffectedRange()||t.createRange(s);return a.destroy(),d})}(this,t,e,n)}deleteContent(t,e){Bc(this,t,e)}modifySelection(t,e){jc(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const n=t.createDocumentFragment(),o=e.getFirstRange();if(!o||o.isCollapsed)return n;const i=o.start.root,r=o.start.getCommonPath(o.end),s=i.getNodeByPath(r);let a;const c=(a=o.start.parent==o.end.parent?o:t.createRange(t.createPositionAt(s,o.start.path[r.length]),t.createPositionAt(s,o.end.path[r.length]+1))).end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("textProxy")?t.appendText(e.data,e.getAttributes(),n):t.append(e._clone(!0),n);if(a!=o){const e=o._getTransformedByMove(a.start,t.createPositionAt(n,0),c)[0],i=t.createRange(t.createPositionAt(n,0),e.start);Wc(t.createRange(e.end,t.createPositionAt(n,"end")),t),Wc(i,t)}return n})}(this,t)}hasContent(t,e){const n=t instanceof Us?Js._createIn(t):t;if(n.isCollapsed)return!1;for(const t of this.markers.getMarkersIntersectingRange(n))if(t.affectsData)return!0;const{ignoreWhitespaces:o=!1}=e||{};for(const t of n.getItems())if(t.is("textProxy")){if(!o)return!0;if(-1!==t.data.search(/\S/))return!0}else if(this.schema.isObject(t))return!0;return!1}createPositionFromPath(t,e,n){return new Ks(t,e,n)}createPositionAt(t,e){return Ks._createAt(t,e)}createPositionAfter(t){return Ks._createAfter(t)}createPositionBefore(t){return Ks._createBefore(t)}createRange(t,e){return new Js(t,e)}createRangeIn(t){return Js._createIn(t)}createRangeOn(t){return Js._createOn(t)}createSelection(t,e,n){return new ea(t,e,n)}createBatch(t){return new Qa(t)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new wc(this,e);const n=this._pendingChanges[0].callback(this._currentWriter);t.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}lo(Qc,Ho);class Yc{constructor(){this._listener=Object.create(dr)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+ki(e),e)})}set(t,e,n={}){const o=_i(t),i=n.priority;this._listener.listenTo(this._listener,"_keydown:"+o,(t,n)=>{e(n,()=>{n.preventDefault(),n.stopPropagation(),t.stop()}),t.return=!0},{priority:i})}press(t){return!!this._listener.fire("_keydown:"+ki(t),t)}destroy(){this._listener.stopListening()}}class Xc extends Yc{constructor(t){super(),this.editor=t}set(t,e,n={}){if("string"==typeof e){const t=e;e=((e,n)=>{this.editor.execute(t),n()})}super.set(t,e,n)}}class tl{constructor(t){const e=this.constructor.builtinPlugins;this.config=new Gn(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.plugins=new Pa(this,e),this.commands=new Ta;const n=this.config.get("language")||{};this.locale=new Ra({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new Qc,this.data=new Ga(this.model),this.editing=new Aa(this.model),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Ka([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Xc(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this.config,e=t.get("plugins")||[],n=t.get("removePlugins")||[],o=t.get("extraPlugins")||[];return this.plugins.init(e.concat(o),n)}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})}execute(...t){this.commands.execute(...t)}}lo(tl,Ho);var el={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}};class nl{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class ol{constructor(){this._domParser=new DOMParser,this._domConverter=new sr({blockFiller:Bi}),this._htmlWriter=new nl}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),n=e.createDocumentFragment(),o=e.body.childNodes;for(;o.length>0;)n.appendChild(o[0]);return n}}class il{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){if(this.has(t))throw new Jn.b("componentfactory-item-exists: The item already exists in the component factory.",this,{name:t});this._components.set(rl(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new Jn.b("componentfactory-item-missing: The required component is not registered in the factory.",this,{name:t});return this._components.get(rl(t)).callback(this.editor.locale)}has(t){return this._components.has(rl(t))}}function rl(t){return String(t).toLowerCase()}class sl{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new Jn.b("focusTracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}lo(sl,dr),lo(sl,Ho);class al{constructor(t){this.editor=t,this.componentFactory=new il(t),this.focusTracker=new sl,this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}lo(al,no);n(63);const cl=new WeakMap;function ll(t){const{view:e,element:n,text:o,isDirectHost:i=!0}=t,r=e.document;cl.has(r)||(cl.set(r,new Map),r.registerPostFixer(t=>ul(r,t))),cl.get(r).set(n,{text:o,isDirectHost:i}),e.change(t=>ul(r,t))}function dl(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}function ul(t,e){const n=cl.get(t);let o=!1;for(const[t,i]of n)hl(e,t,i)&&(o=!0);return o}function hl(t,e,n){const{text:o,isDirectHost:i}=n,r=i?e:function(t){if(1===t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}(e);let s=!1;return!!r&&(n.hostElement=r,r.getAttribute("data-placeholder")!==o&&(t.setAttribute("data-placeholder",o,r),s=!0),!function(t){const e=t.document;if(!e)return!1;const n=!Array.from(t.getChildren()).some(t=>!t.is("uiElement"));if(!e.isFocused&&n)return!0;const o=e.selection.anchor;return!(!n||!o||o.parent===t)}(r)?dl(t,r)&&(s=!0):function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,r)&&(s=!0),s)}class fl extends al{constructor(t,e){super(t),this.view=e,this._toolbarConfig=function(t){return Array.isArray(t)?{items:t}:t?Object.assign({items:[]},t):{items:[]}}(t.config.get("toolbar"))}init(){const t=this.editor,e=this.view,n=t.editing.view,o=e.editable,i=n.document.getRoot();e.editable.name=i.rootName,e.render();const r=o.element;this.setEditableElement(o.name,r),this.focusTracker.add(r),e.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(r),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view.toolbar;e.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:t,originKeystrokeHandler:e,originFocusTracker:n,toolbar:o,beforeFocus:i,afterBlur:r}){n.add(o.element),e.set("Alt+F10",(t,e)=>{n.isFocused&&!o.focusTracker.isFocused&&(i&&i(),o.focus(),e())}),o.keystrokes.set("Esc",(e,n)=>{o.focusTracker.isFocused&&(t.focus(),r&&r(),n())})}({origin:t.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e})}_initPlaceholder(){const t=this.editor,e=t.editing.view,n=e.document.getRoot(),o=t.sourceElement,i=t.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder");i&&ll({view:e,element:n,text:i,isDirectHost:!1})}}class pl extends si{constructor(t){super({idProperty:"viewUid"}),this.on("add",(t,e,n)=>{e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[n])}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this.locale=t,this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t}delegate(...t){if(!t.length||!function(t){return t.every(t=>"string"==typeof t)}(t))throw new Jn.b("ui-viewcollection-delegate-wrong-events: All event names must be strings.",this);return{to:e=>{for(const n of this)for(const o of t)n.delegate(o).to(e);this.on("add",(n,o)=>{for(const n of t)o.delegate(n).to(e)}),this.on("remove",(n,o)=>{for(const n of t)o.stopDelegating(n,e)})}}}}const ml="http://www.w3.org/1999/xhtml";class gl{constructor(t){Object.assign(this,Al(Cl(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new Jn.b("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const n of e.children)Rl(n)?yield n:Ol(n)&&(yield*t(n))}(this)}static bind(t,e){return{to:(n,o)=>new wl({eventNameOrFunction:n,attribute:n,observable:t,emitter:e,callback:o}),if:(n,o,i)=>new kl({observable:t,emitter:e,attribute:n,valueIfTrue:o,callback:i})}}static extend(t,e){if(t._isRendered)throw new Jn.b("template-extend-render: Attempting to extend a template which has already been rendered.",[this,t]);!function t(e,n){n.attributes&&(e.attributes||(e.attributes={}),El(e.attributes,n.attributes));n.eventListeners&&(e.eventListeners||(e.eventListeners={}),El(e.eventListeners,n.eventListeners));n.text&&e.text.push(...n.text);if(n.children&&n.children.length){if(e.children.length!=n.children.length)throw new Jn.b("ui-template-extend-children-mismatch: The number of children in extended definition does not match.",e);let o=0;for(const i of n.children)t(e.children[o++],i)}}(t,Al(Cl(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text)throw new Jn.b('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.',this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||ml,this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),_l(this.text)?this._bindToObservable({schema:this.text,updater:function(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,n,o,i;if(!this.attributes)return;const r=t.node,s=t.revertData;for(e in this.attributes)if(o=r.getAttribute(e),n=this.attributes[e],s&&(s.attributes[e]=o),i=q(n[0])&&n[0].ns?n[0].ns:null,_l(n)){const a=i?n[0].value:n;s&&Ml(e)&&a.unshift(o),this._bindToObservable({schema:a,updater:yl(r,e,i),data:t})}else"style"==e&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],t):(s&&o&&Ml(e)&&n.unshift(o),Sl(n=n.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce(Tl,""))||r.setAttributeNS(i,e,n))}_renderStyleAttribute(t,e){const n=e.node;for(const o in t){const i=t[o];_l(i)?this._bindToObservable({schema:[i],updater:xl(n,o),data:e}):n.style[o]=i}}_renderElementChildren(t){const e=t.node,n=t.intoFragment?document.createDocumentFragment():e,o=t.isApplying;let i=0;for(const r of this.children)if(Il(r)){if(!o){r.setParent(e);for(const t of r)n.appendChild(t.element)}}else if(Rl(r))o||(r.isRendered||r.render(),n.appendChild(r.element));else if(Xi(r))n.appendChild(r);else if(o){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),r._renderNode({node:n.childNodes[i++],isApplying:!0,revertData:e})}else n.appendChild(r.render());t.intoFragment&&e.appendChild(n)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const n=this.eventListeners[e].map(n=>{const[o,i]=e.split("@");return n.activateDomEventListener(o,i,t)});t.revertData&&t.revertData.bindings.push(n)}}_bindToObservable({schema:t,updater:e,data:n}){const o=n.revertData;vl(t,e,n);const i=t.filter(t=>!Sl(t)).filter(t=>t.observable).map(o=>o.activateAttributeListener(t,e,n));o&&o.bindings.push(i)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)t.textContent=e.text;else{for(const n in e.attributes){const o=e.attributes[n];null===o?t.removeAttribute(n):t.setAttribute(n,o)}for(let n=0;n<e.children.length;++n)this._revertTemplateFromNode(t.childNodes[n],e.children[n])}}}lo(gl,no);class bl{constructor(t){Object.assign(this,t)}getValue(t){const e=this.observable[this.attribute];return this.callback?this.callback(e,t):e}activateAttributeListener(t,e,n){const o=()=>vl(t,e,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,o),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,o)}}}class wl extends bl{activateDomEventListener(t,e,n){const o=(t,n)=>{e&&!n.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,t,o),()=>{this.emitter.stopListening(n.node,t,o)}}}class kl extends bl{getValue(t){return!Sl(super.getValue(t))&&(this.valueIfTrue||!0)}}function _l(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(_l):t instanceof bl)}function vl(t,e,{node:n}){let o=function(t,e){return t.map(t=>t instanceof bl?t.getValue(e):t)}(t,n);Sl(o=1==t.length&&t[0]instanceof kl?o[0]:o.reduce(Tl,""))?e.remove():e.set(o)}function yl(t,e,n){return{set(o){t.setAttributeNS(n,e,o)},remove(){t.removeAttributeNS(n,e)}}}function xl(t,e){return{set(n){t.style[e]=n},remove(){t.style[e]=null}}}function Cl(t){return $n(t,t=>{if(t&&(t instanceof bl||Ol(t)||Rl(t)||Il(t)))return t})}function Al(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){Array.isArray(t.text)||(t.text=[t.text])}(t),t.on&&(t.eventListeners=function(t){for(const e in t)Pl(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=[].concat(t[e].value)),Pl(t,e)}(t.attributes);const e=[];if(t.children)if(Il(t.children))e.push(t.children);else for(const n of t.children)Ol(n)||Rl(n)||Xi(n)?e.push(n):e.push(new gl(n));t.children=e}return t}function Pl(t,e){Array.isArray(t[e])||(t[e]=[t[e]])}function Tl(t,e){return Sl(e)?t:Sl(t)?e:`${t} ${e}`}function El(t,e){for(const n in e)t[n]?t[n].push(...e[n]):t[n]=e[n]}function Sl(t){return!t&&0!==t}function Rl(t){return t instanceof Dl}function Ol(t){return t instanceof gl}function Il(t){return t instanceof pl}function Ml(t){return"class"==t||"style"==t}n(66);class Dl{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new si,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,n)=>{n.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=gl.bind(this,this)}createCollection(){const t=new pl;return this._viewCollections.add(t),t}registerChild(t){wo(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){wo(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new gl(t)}extendTemplate(t){gl.extend(this.template,t)}render(){if(this.isRendered)throw new Jn.b("ui-view-render-already-rendered: This View has already been rendered.",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}lo(Dl,dr),lo(Dl,Ho);n(68);class Nl extends Dl{constructor(t){super(t),this.body=this.createCollection()}render(){super.render(),this._renderBodyCollection()}destroy(){return this._bodyCollectionContainer.remove(),super.destroy()}_renderBodyCollection(){const t=this.locale,e=this._bodyCollectionContainer=new gl({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:t.uiLanguageDirection},children:this.body}).render();document.body.appendChild(e)}}class Vl extends Dl{constructor(t,e,n){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const t=this._editingView;function e(e){t.change(n=>{const o=t.document.getRoot(e.name);n.addClass(e.isFocused?"ck-focused":"ck-blurred",o),n.removeClass(e.isFocused?"ck-blurred":"ck-focused",o)})}t.isRenderingInProgress?function n(o){t.once("change:isRenderingInProgress",(t,i,r)=>{r?n(o):e(o)})}(this):e(this)}}class Fl extends Vl{constructor(t,e,n){super(t,e,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView,e=this.t;t.change(n=>{const o=t.document.getRoot(this.name);n.setAttribute("aria-label",e("am",[this.name]),o)})}}class Bl{constructor(t){if(Object.assign(this,t),t.actions&&t.keystrokeHandler)for(const e in t.actions){let n=t.actions[e];"string"==typeof n&&(n=[n]);for(const o of n)t.keystrokeHandler.set(o,(t,n)=>{this[e](),n()})}}get first(){return this.focusables.find(Ll)||null}get last(){return this.focusables.filter(Ll).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,n)=>{const o=e.element===this.focusTracker.focusedElement;return o&&(t=n),o}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,n=this.focusables.length;if(!n)return null;if(null===e)return this[1===t?"first":"last"];let o=(e+n+t)%n;do{const e=this.focusables.get(o);if(Ll(e))return e;o=(o+n+t)%n}while(o!==e);return null}}function Ll(t){return!(!t.focus||"none"==or.window.getComputedStyle(t.element).display)}class zl extends Dl{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}n(70);class ql extends Dl{constructor(t){super(t);const e=this.bindTemplate,n=this.t;this.set("ariaLabel",n("ac")),this.items=this.createCollection(),this.focusTracker=new sl,this.keystrokes=new Yc,this.set("isVertical",!1),this.set("class"),this._focusCycler=new Bl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar",e.if("isVertical","ck-toolbar_vertical"),e.to("class")],role:"toolbar","aria-label":e.to("ariaLabel")},children:this.items,on:{mousedown:function(t){return t.bindTemplate.to(e=>{e.target===t.element&&e.preventDefault()})}(this)}})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){t.map(t=>{"|"==t?this.items.add(new zl):e.has(t)?this.items.add(e.create(t)):console.warn(Object(Jn.a)("toolbarview-item-unavailable: The requested toolbar item is unavailable."),{name:t})})}}class jl extends Nl{constructor(t,e,n){super(t),this.toolbar=new ql(t),this.editable=new Fl(t,e,n),gl.extend(this.toolbar.template,{attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:t.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}class Hl extends tl{constructor(t,e){super(e),Wn(t)&&(this.sourceElement=t,function(t){const e=t.sourceElement;if(e){if(e.ckeditorInstance)throw new Jn.b("editor-source-element-already-used: The DOM element cannot be used to create multiple editor instances.",t);e.ckeditorInstance=t,t.once("destroy",()=>{delete e.ckeditorInstance})}}(this)),this.data.processor=new ol,this.model.document.createRoot();const n=new jl(this.locale,this.editing.view,this.sourceElement);this.ui=new fl(this,n)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&function(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}(this.sourceElement,t)})}static create(t,e={}){return new Promise(n=>{const o=Wn(t);if(o&&"TEXTAREA"===t.tagName)throw new Jn.b("editor-wrong-element: This type of editor cannot be initialized inside <textarea> element.",null);const i=new this(t,e);n(i.initPlugins().then(()=>{i.ui.init()}).then(()=>{if(!o&&e.initialData)throw new Jn.b("editor-create-initial-data: The config.initialData option cannot be used together with initial data passed in Editor.create().",null);const n=e.initialData||function(t){return Wn(t)?function(t){return t instanceof HTMLTextAreaElement?t.value:t.innerHTML}(t):t}(t);return i.data.init(n)}).then(()=>i.fire("ready")).then(()=>i))})}}lo(Hl,el);n(72);class Ul extends Dl{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:t.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}n(74);class $l extends Dl{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}n(76);class Wl extends Dl{constructor(t){super(t);const e=this.bindTemplate,n=Yn();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new Ul,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.to("isOn",t=>!!this.isToggleable&&String(t))},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView)}focus(){this.element.focus()}_createTooltipView(){const t=new $l;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new Dl,n=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:`ck-editor__aria-label_${t}`},children:[{text:this.bindTemplate.to("label")}]}),e}_getTooltipString(t,e,n){return t?"string"==typeof t?t:(n&&(n=function(t){return mi.isMac?vi(t).map(t=>bi[t.toLowerCase()]||t).reduce((t,e)=>t.slice(-1)in gi?t+e:t+"+"+e):t}(n)),t instanceof Function?t(e,n):`${e}${n?` (${n})`:""}`):""}}class Gl{constructor(t){this.editor=t}destroy(){this.stopListening()}}lo(Gl,Ho);class Kl{constructor(){this._stack=[]}add(t,e){const n=this._stack,o=n[0];this._insertDescriptor(t);const i=n[0];o===i||Jl(o,i)||this.fire("change:top",{oldDescriptor:o,newDescriptor:i,writer:e})}remove(t,e){const n=this._stack,o=n[0];this._removeDescriptor(t);const i=n[0];o===i||Jl(o,i)||this.fire("change:top",{oldDescriptor:o,newDescriptor:i,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(e=>e.id===t.id);if(Jl(t,e[n]))return;n>-1&&e.splice(n,1);let o=0;for(;e[o]&&Zl(e[o],t);)o++;e.splice(o,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(e=>e.id===t);n>-1&&e.splice(n,1)}}function Jl(t,e){return t&&e&&t.priority==e.priority&&Ql(t.classes)==Ql(e.classes)}function Zl(t,e){return t.priority>e.priority||!(t.priority<e.priority)&&Ql(t.classes)>Ql(e.classes)}function Ql(t){return Array.isArray(t)?t.sort().join(","):t}lo(Kl,no);var Yl=n(36),Xl=n.n(Yl);const td="ck-widget",ed="ck-widget_selected";function nd(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function od(t,e,n={}){return mi.isEdge||e.setAttribute("contenteditable","false",t),e.addClass(td,t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=ad,n.label&&function(t,e,n){n.setCustomProperty("widgetLabel",e,t)}(t,n.label,e),n.hasSelectionHandler&&function(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handler"},function(t){const e=this.toDomElement(t),n=new Ul;return n.set("content",Xl.a),n.render(),e.appendChild(n.element),e});e.insert(e.createPositionAt(t,0),n),e.addClass(["ck-widget_with-selection-handler"],t)}(t,e),function(t,e,n,o){const i=new Kl;i.on("change:top",(e,i)=>{i.oldDescriptor&&o(t,i.oldDescriptor,i.writer),i.newDescriptor&&n(t,i.newDescriptor,i.writer)}),e.setCustomProperty("addHighlight",(t,e,n)=>i.add(e,n),t),e.setCustomProperty("removeHighlight",(t,e,n)=>i.remove(e,n),t)}(t,e,(t,e,n)=>n.addClass(o(e.classes),t),(t,e,n)=>n.removeClass(o(e.classes),t)),t;function o(t){return Array.isArray(t)?t:[t]}}function id(t){const e=t.getCustomProperty("widgetLabel");return e?"function"==typeof e?e():e:""}function rd(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),mi.isEdge||(e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(n,o,i)=>{e.setAttribute("contenteditable",i?"false":"true",t)})),t.on("change:isFocused",(n,o,i)=>{i?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}function sd(t,e){const n=t.getSelectedElement();if(n&&e.schema.isBlock(n))return e.createPositionAfter(n);const o=t.getSelectedBlocks().next().value;if(o){if(o.isEmpty)return e.createPositionAt(o,0);const n=e.createPositionAfter(o);return t.focus.isTouching(n)?n:e.createPositionBefore(o)}return t.focus}function ad(){return null}class cd extends Gl{static get pluginName(){return"OPMacroToc"}static get buttonName(){return"insertToc"}init(){const t=this.editor,e=t.model,n=t.conversion;e.schema.register("op-macro-toc",{allowWhere:"$block",isBlock:!0,isLimit:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"toc"},model:"op-macro-toc"}),n.for("editingDowncast").elementToElement({model:"op-macro-toc",view:(t,e)=>od(this.createTocViewElement(e),e,{label:this.label})}),n.for("dataDowncast").elementToElement({model:"op-macro-toc",view:(t,e)=>this.createTocDataElement(e)}),t.ui.componentFactory.add(cd.buttonName,e=>{const n=new Wl(e);return n.set({label:this.label,withText:!0}),n.on("execute",()=>{t.model.change(e=>{const n=e.createElement("op-macro-toc",{});t.model.insertContent(n,t.model.document.selection)})}),n})}get label(){return window.I18n.t("js.editor.macro.toc")}createTocViewElement(t){const e=t.createText(this.label),n=t.createContainerElement("div",{class:"macro -toc"});return t.insert(t.createPositionAt(n,0),e),n}createTocDataElement(t){return t.createContainerElement("macro",{class:"toc"})}}const ld=Symbol("isOPEmbeddedTable");function dd(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(ld)&&nd(t)}(e))}function ud(t,e){return hd(t).services[e]}function hd(t){return _.get(t.config,"_config.openProject.pluginContext")}function fd(t){return _.get(t.config,"_config.openProject.context.resource")}function pd(t,e){return ud(t,"pathHelperService")}class md extends Gl{static get pluginName(){return"EmbeddedTableEditing"}static get buttonName(){return"insertEmbeddedTable"}init(){const t=this.editor,e=t.model,n=t.conversion,o=hd(t);this.text={button:window.I18n.t("js.editor.macro.embedded_table.button"),macro_text:window.I18n.t("js.editor.macro.embedded_table.text")},e.schema.register("op-macro-embedded-table",{allowWhere:"$block",allowAttributes:["opEmbeddedTableQuery"],isBlock:!0,isObject:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"embedded-table"},model:(t,e)=>{const n=t.getAttribute("data-query-props");return e.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:n?JSON.parse(n):{}})}}),n.for("editingDowncast").elementToElement({model:"op-macro-embedded-table",view:(t,e)=>(function(t,e,n){return e.setCustomProperty(ld,!0,t),od(t,e,{label:"your label here"})})(this.createEmbeddedTableView(e),e,this.label)}),n.for("dataDowncast").elementToElement({model:"op-macro-embedded-table",view:(t,e)=>this.createEmbeddedTableDataElement(t,e)}),t.ui.componentFactory.add(md.buttonName,e=>{const n=new Wl(e);return n.set({label:this.text.button,withText:!0}),n.on("execute",()=>o.runInZone(()=>{o.services.externalQueryConfiguration.show({},e=>t.model.change(n=>{const o=n.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:e});t.model.insertContent(o,t.model.document.selection)}))})),n})}createEmbeddedTableView(t){const e=t.createText(this.text.macro_text),n=t.createContainerElement("div",{class:"macro -embedded-table"});return t.insert(t.createPositionAt(n,0),e),n}createEmbeddedTableDataElement(t,e){const n=t.getAttribute("opEmbeddedTableQuery")||{};return e.createContainerElement("macro",{class:"embedded-table","data-query-props":JSON.stringify(n)})}}class gd extends es{constructor(t){super(t),this.domEventType="mousedown"}onDomEvent(t){this.fire(t.type,t)}}n(78);const bd=_i("Ctrl+A");class wd extends Gl{static get pluginName(){return"Widget"}init(){const t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,e,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const o=n.writer,i=o.document.selection,r=i.getSelectedElement();let s=null;for(const t of i.getRanges())for(const e of t){const t=e.item;nd(t)&&!kd(t,s)&&(o.addClass(ed,t),this._previouslySelected.add(t),s=t,t==r&&o.setSelection(i.getRanges(),{fake:!0,label:id(r)}))}},{priority:"low"}),t.addObserver(gd),this.listenTo(e,"mousedown",(...t)=>this._onMousedown(...t)),this.listenTo(e,"keydown",(...t)=>this._onKeydown(...t),{priority:"high"}),this.listenTo(e,"delete",(t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())},{priority:"high"})}_onMousedown(t,e){const n=this.editor,o=n.editing.view,i=o.document;let r=e.target;if(function(t){for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(nd(t))return!1;t=t.parent}return!1}(r)){if(mi.isSafari&&e.domEvent.detail>=3){const t=n.editing.mapper.toModelElement(r);this.editor.model.change(n=>{e.preventDefault(),n.setSelection(t,"in")})}return}if(!nd(r)&&!(r=r.findAncestor(nd)))return;e.preventDefault(),i.isFocused||o.focus();const s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_onKeydown(t,e){const n=e.keyCode,o=n==wi.arrowdown||n==wi.arrowright;let i=!1;!function(t){return t==wi.arrowright||t==wi.arrowleft||t==wi.arrowup||t==wi.arrowdown}(n)?!function(t){return ki(t)==bd}(e)?n===wi.enter&&(i=this._handleEnterKey(e.shiftKey)):i=this._selectAllNestedEditableContent()||this._selectAllContent():i=this._handleArrowKeys(o),i&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change(t=>{let o=e.anchor.parent;for(;o.isEmpty;){const e=o;o=e.parent,t.remove(e)}this._setSelectionOverElement(n)}),!0):void 0}_handleArrowKeys(t){const e=this.editor.model,n=e.schema,o=e.document.selection,i=o.getSelectedElement();if(i&&n.isObject(i)){const i=t?o.getLastPosition():o.getFirstPosition(),r=n.getNearestSelectionRange(i,t?"forward":"backward");return r&&e.change(t=>{t.setSelection(r)}),!0}if(!o.isCollapsed)return;const r=this._getObjectElementNextToSelection(t);return r&&n.isObject(r)?(this._setSelectionOverElement(r),!0):void 0}_handleEnterKey(t){const e=this.editor.model,n=e.document.selection.getSelectedElement();if(function(t,e){return t&&e.isObject(t)&&!e.isInline(t)}(n,e.schema))return e.change(o=>{let i=o.createPositionAt(n,t?"before":"after");const r=o.createElement("paragraph");if(e.schema.isBlock(n.parent)){const t=e.schema.findAllowedParent(i,r);i=o.split(i,t).position}o.insert(r,i),o.setSelection(r,"in")}),!0}_selectAllNestedEditableContent(){const t=this.editor.model,e=t.document.selection,n=t.schema.getLimitElement(e);return e.getFirstRange().root!=n&&(t.change(t=>{t.setSelection(t.createRangeIn(n))}),!0)}_selectAllContent(){const t=this.editor.model,e=this.editor.editing,n=e.view.document.selection.getSelectedElement();if(n&&nd(n)){const o=e.mapper.toModelElement(n.parent);return t.change(t=>{t.setSelection(t.createRangeIn(o))}),!0}return!1}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,o=e.document.selection,i=e.createSelection(o);e.modifySelection(i,{direction:t?"forward":"backward"});const r=t?i.focus.nodeBefore:i.focus.nodeAfter;return r&&n.isObject(r)?r:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(ed,e);this._previouslySelected.clear()}}function kd(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}function _d({element:t,target:e,positions:n,limiter:o,fitInViewport:i}){W(e)&&(e=e()),W(o)&&(o=o());const r=function(t){for(;t&&"html"!=t.tagName.toLowerCase();){if("static"!=or.window.getComputedStyle(t).position)return t;t=t.parentElement}return null}(t.parentElement),s=new As(t),a=new As(e);let c,l;if(o||i){const t=o&&new As(o).getVisible(),e=i&&new As(or.window);[l,c]=function(t,e,n,o,i){let r,s,a=0,c=0;const l=n.getArea();return t.some(t=>{const[d,u]=vd(t,e,n);let h,f;if(o)if(i){const t=o.getIntersection(i);h=t?t.getIntersectionArea(u):0}else h=o.getIntersectionArea(u);function p(){c=f,a=h,r=u,s=d}return i&&(f=i.getIntersectionArea(u)),i&&!o?f>c&&p():!i&&o?h>a&&p():f>c&&h>=a?p():f>=c&&h>a&&p(),h===l}),r?[s,r]:null}(n,a,s,t,e)||vd(n[0],a,s)}else[l,c]=vd(n[0],a,s);let{left:d,top:u}=yd(c);if(r){const t=yd(new As(r)),e=xs(r);d-=t.left,u-=t.top,d+=r.scrollLeft,u+=r.scrollTop,d-=e.left,u-=e.top}return{left:d,top:u,name:l}}function vd(t,e,n){const{left:o,top:i,name:r}=t(e,n);return[r,n.clone().moveTo(o,i)]}function yd({left:t,top:e}){const{scrollX:n,scrollY:o}=or.window;return{left:t+n,top:e+o}}function xd(t){return e=>e+t}n(80);const Cd=xd("px"),Ad=or.document.body;class Pd extends Dl{constructor(t){super(t);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>`ck-balloon-panel_${t}`),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",Cd),left:e.to("left",Cd)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=Pd.defaultPositions,n=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast],limiter:Ad,fitInViewport:!0},t),o=Pd._getOptimalPosition(n),i=parseInt(o.left),r=parseInt(o.top),s=o.name;Object.assign(this,{top:r,left:i,position:s})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=(()=>{this.isVisible?this._startPinning(t):this._stopPinning()}),this._startPinning(t),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(t){this.attachTo(t);const e=Td(t.target),n=t.limiter?Td(t.limiter):Ad;this.listenTo(or.document,"scroll",(o,i)=>{const r=i.target,s=e&&r.contains(e),a=n&&r.contains(n);!s&&!a&&e&&n||this.attachTo(t)},{useCapture:!0}),this.listenTo(or.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(or.document,"scroll"),this.stopListening(or.window,"resize")}}function Td(t){return Wn(t)?t:ys(t)?t.commonAncestorContainer:"function"==typeof t?Td(t()):null}function Ed(t,e){return t.top-e.height-Pd.arrowVerticalOffset}function Sd(t){return t.bottom+Pd.arrowVerticalOffset}Pd.arrowHorizontalOffset=25,Pd.arrowVerticalOffset=10,Pd._getOptimalPosition=_d,Pd.defaultPositions={northArrowSouth:(t,e)=>({top:Ed(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthEast:(t,e)=>({top:Ed(t,e),left:t.left+t.width/2-e.width+Pd.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:Ed(t,e),left:t.left+t.width/2-Pd.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouth:(t,e)=>({top:Ed(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthWest:(t,e)=>({top:Ed(t,e),left:t.left-Pd.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthEast:(t,e)=>({top:Ed(t,e),left:t.left-e.width+Pd.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouth:(t,e)=>({top:Ed(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthEast:(t,e)=>({top:Ed(t,e),left:t.right-e.width+Pd.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:Ed(t,e),left:t.right-Pd.arrowHorizontalOffset,name:"arrow_sw"}),southArrowNorth:(t,e)=>({top:Sd(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthEast:(t,e)=>({top:Sd(t),left:t.left+t.width/2-e.width+Pd.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:Sd(t),left:t.left+t.width/2-Pd.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorth:(t,e)=>({top:Sd(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthWest:(t,e)=>({top:Sd(t),left:t.left-Pd.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthEast:(t,e)=>({top:Sd(t),left:t.left-e.width+Pd.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorth:(t,e)=>({top:Sd(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthEast:(t,e)=>({top:Sd(t),left:t.right-e.width+Pd.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:Sd(t),left:t.right-Pd.arrowHorizontalOffset,name:"arrow_nw"})};var Rd=n(37),Od=n.n(Rd),Id=n(38),Md=n.n(Id);n(82),n(84);const Dd=xd("px");class Nd extends Gl{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t),this.positionLimiter=(()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null}),this.set("visibleView",null),this.view=new Pd(t.locale),t.ui.view.body.add(this.view),t.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this.hasView(t.view))throw new Jn.b("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const n=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),n.set(t.view,t),this._viewToStack.set(t.view,n),n===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new Jn.b("contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(1===e.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),1===e.size?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new Jn.b("contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new Vd(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>1),t.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(t,n)=>{if(n<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("aq",[o,n])}),t.buttonNextView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),t.buttonPrevView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),t}_createFakePanelsView(){const t=new Fd(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>{return!e&&t>=2?Math.min(t-1,2):0}),t.listenTo(this.view,"change:top",()=>t.updatePosition()),t.listenTo(this.view,"change:left",()=>t.updatePosition()),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:n=!0,singleViewMode:o=!1}){this.view.class=e,this.view.withArrow=n,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t}}class Vd extends Dl{constructor(t){super(t);const e=t.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new sl,this.buttonPrevView=this._createButtonView(e("ar"),Od.a),this.buttonNextView=this._createButtonView(e("as"),Md.a),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",t=>t?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const n=new Wl(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n}}class Fd extends Dl{constructor(t,e){super(t);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",t=>t?"":"ck-hidden")],style:{top:n.to("top",Dd),left:n.to("left",Dd),width:n.to("width",Dd),height:n.to("height",Dd)}},children:this.content}),this.on("change:numberOfPanels",(t,e,n,o)=>{n>o?this._addPanels(n-o):this._removePanels(o-n),this.updatePosition()})}_addPanels(t){for(;t--;){const t=new Dl;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(t){for(;t--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:n,height:o}=new As(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:n,height:o})}}}var Bd=n(39),Ld=n.n(Bd);function zd(t,e,n){t.ui.componentFactory.add(e,e=>{const o=new Wl(e);return o.set({label:I18n.t("js.button_edit"),icon:Ld.a,tooltip:!0}),o.on("execute",()=>{const e=t.model.document.selection.getSelectedElement();e&&n(e)}),o})}const qd="ck-toolbar-container";function jd(t,e,n,o){const i=e.config.get(n+".toolbar");if(!i||!i.length)return;const r=e.plugins.get("ContextualBalloon"),s=new ql(e.locale);function a(){e.ui.focusTracker.isFocused&&o(e.editing.view.document.selection)?l()?function(t,e){const n=t.plugins.get("ContextualBalloon");if(e(t.editing.view.document.selection)){const e=Hd(t);n.updatePosition(e)}}(e,o):r.hasView(s)||r.add({view:s,position:Hd(e),balloonClassName:qd}):c()}function c(){l()&&r.remove(s)}function l(){return r.visibleView==s}s.fillFromConfig(i,e.ui.componentFactory),t.listenTo(e.editing.view,"render",a),t.listenTo(e.ui.focusTracker,"change:isFocused",a,{priority:"low"})}function Hd(t){const e=t.editing.view,n=Pd.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class Ud extends Gl{static get requires(){return[Nd]}static get pluginName(){return"EmbeddedTableToolbar"}init(){const t=this.editor,e=this.editor.model,n=hd(t);zd(t,"opEditEmbeddedTableQuery",t=>{const o=n.services.externalQueryConfiguration,i=t.getAttribute("opEmbeddedTableQuery")||{};n.runInZone(()=>{o.show(i,n=>e.change(e=>{e.setAttribute("opEmbeddedTableQuery",n,t)}))})})}afterInit(){jd(this,this.editor,"OPMacroEmbeddedTable",dd)}}const $d=Symbol("isWpButtonMacroSymbol");function Wd(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty($d)&&nd(t)}(e))}class Gd extends Gl{static get pluginName(){return"OPMacroWpButtonEditing"}static get buttonName(){return"insertWorkPackageButton"}init(){const t=this.editor,e=t.model,n=t.conversion,o=hd(t);e.schema.register("op-macro-wp-button",{allowWhere:["$block"],allowAttributes:["type","classes"],isBlock:!0,isLimit:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"create_work_package_link"},model:(t,e)=>{const n=t.getAttribute("data-type")||"",o=t.getAttribute("data-classes")||"";return e.createElement("op-macro-wp-button",{type:n,classes:o})}}),n.for("editingDowncast").elementToElement({model:"op-macro-wp-button",view:(t,e)=>this.createMacroViewElement(t,e)}),n.for("dataDowncast").elementToElement({model:"op-macro-wp-button",view:(t,e)=>{return e.createContainerElement("macro",{class:"create_work_package_link","data-type":t.getAttribute("type")||"","data-classes":t.getAttribute("classes")||""})}}),t.ui.componentFactory.add(Gd.buttonName,e=>{const n=new Wl(e);return n.set({label:window.I18n.t("js.editor.macro.work_package_button.button"),withText:!0}),n.on("execute",()=>{o.services.macros.configureWorkPackageButton().then(e=>t.model.change(n=>{const o=n.createElement("op-macro-wp-button",{});n.setAttribute("type",e.type,o),n.setAttribute("classes",e.classes,o),t.model.insertContent(o,t.model.document.selection)}))}),n})}macroLabel(t){return t?window.I18n.t("js.editor.macro.work_package_button.with_type",{typename:t}):window.I18n.t("js.editor.macro.work_package_button.without_type")}createMacroViewElement(t,e){t.getAttribute("type");const n=t.getAttribute("classes")||"",o=this.macroLabel(),i=e.createText(o),r=e.createContainerElement("span",{class:"macro -create_work_package_link "+n});return e.insert(e.createPositionAt(r,0),i),function(t,e,n){return e.setCustomProperty($d,!0,t),od(t,e,{label:n})}(r,e,{label:o})}}class Kd extends Gl{static get requires(){return[Nd]}static get pluginName(){return"OPMacroWpButtonToolbar"}init(){const t=this.editor,e=(this.editor.model,hd(t));zd(t,"opEditWpMacroButton",n=>{const o=e.services.macros,i=n.getAttribute("type"),r=n.getAttribute("classes");o.configureWorkPackageButton(i,r).then(e=>t.model.change(t=>{t.setAttribute("classes",e.classes,n),t.setAttribute("type",e.type,n)}))})}afterInit(){jd(this,this.editor,"OPMacroWpButton",Wd)}}class Jd extends Gl{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new si({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new Jn.b("pendingactions-add-invalid-message: The message must be a string.",this);const e=Object.create(Ho);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Zd{constructor(){const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=(t=>{this.loaded=t.loaded})}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((n,o)=>{e.onload=(()=>{const t=e.result;this._data=t,n(t)}),e.onerror=(()=>{o("error")}),e.onabort=(()=>{o("aborted")}),this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}lo(Zd,Ho);class Qd extends Gl{static get pluginName(){return"FileRepository"}static get requires(){return[Jd]}init(){this.loaders=new si,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return console.warn(Object(Jn.a)("filerepository-no-upload-adapter: Upload adapter is not defined.")),null;const e=new Yd(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(t=>{this._loadersMap.set(t,e)}),e.file.catch(()=>{}),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof Yd?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((t,n)=>{t===e&&this._loadersMap.delete(n)})}_updatePendingAction(){const t=this.editor.plugins.get(Jd);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,n=t=>`${e("i")} ${parseInt(t)}%.`;this._pendingAction=t.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else t.remove(this._pendingAction),this._pendingAction=null}}lo(Qd,Ho);class Yd{constructor(t,e){this.id=Yn(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new Zd,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new Jn.b("filerepository-read-wrong-status: You cannot call read if the status is different than idle.",this);return this.status="reading",this._filePromiseWrapper.promise.then(t=>this._reader.read(t)).then(t=>(this.status="idle",t)).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:t})}upload(){if("idle"!=this.status)throw new Jn.b("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.",this);return this.status="uploading",this._filePromiseWrapper.promise.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==t?this._reader.abort():"uploading"==t&&this._adapter.abort&&this._adapter.abort():this._filePromiseWrapper.rejecter("aborted"),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(t){const e={};return e.promise=new Promise((n,o)=>{e.resolver=n,e.rejecter=o,e.isFulfilled=!1,t.then(t=>{e.isFulfilled=!0,n(t)}).catch(t=>{e.isFulfilled=!0,o(t)})}),e}}lo(Yd,Ho);class Xd{constructor(t,e,n){this.loader=t,this.resource=e,this.editor=n}upload(){const t=this.resource;if(!t||!t.uploadAttachments){const e=t?t.name:"Missing context";return console.warn(`uploadAttachments not present on context: ${e}`),Promise.reject("You're not allowed to upload attachments on this resource.")}return this.loader.file.then(e=>t.uploadAttachments([e]).then(t=>(this.editor.model.fire("op:attachment-added",t),this.buildResponse(t[0]))).catch(t=>{console.error("Failed upload %O",t)}))}buildResponse(t){return{default:t.uploadUrl}}abort(){return!1}}class tu extends Dl{constructor(t){super(t),this.buttonView=new Wl(t),this._fileInputView=new eu(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class eu extends Dl{constructor(t){super(t),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}var nu=n(40),ou=n.n(nu);function iu(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}function ru(t){return new Promise((e,n)=>{const o=t.getAttribute("src");fetch(o).then(t=>t.blob()).then(t=>{const i=function(t,e){return t.type?t.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}(t,o),r=function(t,e,n){try{return new File([t],e,{type:n})}catch(t){return null}}(t,`image.${i.replace("image/","")}`,i);r?e(r):n()}).catch(n)})}class su extends Gl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageUpload",n=>{const o=new tu(n),i=t.commands.get("imageUpload");return o.set({acceptedType:"image/*",allowMultipleFiles:!0}),o.buttonView.set({label:e("bg"),icon:ou.a,tooltip:!0}),o.buttonView.bind("isEnabled").to(i),o.on("done",(e,n)=>{const o=Array.from(n).filter(iu);o.length&&t.execute("imageUpload",{file:o})}),o})}}var au=n(41),cu=n.n(au);n(86),n(88),n(90);class lu extends Gl{constructor(t){super(t),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent(cu.a)}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(t,e,n){const o=this.editor,i=e.item,r=i.getAttribute("uploadId");if(!n.consumable.consume(e.item,t.name))return;const s=o.plugins.get(Qd),a=r?e.attributeNewValue:null,c=this.placeholder,l=o.editing.mapper.toViewElement(i),d=n.writer;if("reading"==a)return du(l,d),void uu(c,l,d);if("uploading"==a){const t=s.loaders.get(r);return du(l,d),void(t?(hu(l,d),function(t,e,n,o){const i=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty("progressBar",!0,e),e}(e);e.insert(e.createPositionAt(t,"end"),i),n.on("change:uploadedPercent",(t,e,n)=>{o.change(t=>{t.setStyle("width",n+"%",i)})})}(l,d,t,o.editing.view),function(t,e,n){if(n.data){const o=t.getChild(0);e.setAttribute("src",n.data,o)}}(l,d,t)):uu(c,l,d))}"complete"==a&&s.loaders.get(r)&&!mi.isEdge&&function(t,e,n){const o=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),o),setTimeout(()=>{n.change(t=>t.remove(t.createRangeOn(o)))},3e3)}(l,d,o.editing.view),function(t,e){pu(t,e,"progressBar")}(l,d),hu(l,d),function(t,e){e.removeClass("ck-appear",t)}(l,d)}}function du(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function uu(t,e,n){e.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",e);const o=e.getChild(0);o.getAttribute("src")!==t&&n.setAttribute("src",t,o),fu(e,"placeholder")||n.insert(n.createPositionAfter(o),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty("placeholder",!0,e),e}(n))}function hu(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),pu(t,e,"placeholder")}function fu(t,e){for(const n of t.getChildren())if(n.getCustomProperty(e))return n}function pu(t,e,n){const o=fu(t,n);o&&e.remove(e.createRangeOn(o))}class mu extends Gl{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e=`show:${t.type}`+(t.namespace?`:${t.namespace}`:"");this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class gu{createDocumentFragment(t){return new Ai(t)}createElement(t,e,n){return new vo(t,e,n)}createText(t){return new mo(t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,n){return n._insertChild(t,e)}removeChildren(t,e,n){return n._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const n=t.parent;if(n){const o=n.getChildIndex(t);return this.removeChildren(o,1,n),this.insertChild(o,e,n),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const n=e.getChildIndex(t);this.remove(t),this.insertChild(n,t.getChildren(),e)}}rename(t,e){const n=new vo(t,e.getAttributes(),e.getChildren());return this.replace(e,n)?n:null}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){P(t)&&void 0===n&&(n=e),n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return ti._createAt(t,e)}createPositionAfter(t){return ti._createAfter(t)}createPositionBefore(t){return ti._createBefore(t)}createRange(t,e){return new ei(t,e)}createRangeOn(t){return ei._createOn(t)}createRangeIn(t){return ei._createIn(t)}createSelection(t,e,n){return new ii(t,e,n)}}class bu{constructor(t){this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",wu,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",wu),this.refresh())}execute(){}destroy(){this.stopListening()}}function wu(t){t.return=!1,t.stop()}function ku(t){const e=t.getSelectedElement();return e&&function(t){return!!t.getCustomProperty("image")&&nd(t)}(e)?e:null}function _u(t){return!!t&&t.is("image")}function vu(t,e,n={}){const o=t.createElement("image",n),i=sd(e.document.selection,e);e.insertContent(o,i),o.parent&&t.setSelection(o,"on")}function yu(t){const e=t.schema,n=t.document.selection;return function(t,e,n){const o=function(t,e){const n=sd(t,e).parent;if(n.isEmpty&&!n.is("$root"))return n.parent;return n}(t,n);return e.checkChild(o,"image")}(n,e,t)&&!function(t,e){const n=t.getSelectedElement();return n&&e.isObject(n)}(n,e)&&function(t){return[...t.focus.getAncestors()].every(t=>!t.is("image"))}(n)}lo(bu,Ho);class xu extends bu{refresh(){this.isEnabled=yu(this.editor.model)}execute(t){const e=this.editor,n=e.model,o=e.plugins.get(Qd);n.change(e=>{const i=Array.isArray(t.file)?t.file:[t.file];for(const t of i)Cu(e,n,o,t)})}}function Cu(t,e,n,o){const i=n.createLoader(o);i&&vu(t,e,{uploadId:i.id})}class Au extends Gl{static get requires(){return[Qd,mu]}init(){const t=this.editor,e=t.model.document,n=t.model.schema,o=t.conversion,i=t.plugins.get(Qd);n.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),t.commands.add("imageUpload",new xu(t)),o.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(e,n)=>{if(function(t){return Array.from(t.types).includes("text/html")&&""!==t.getData("text/html")}(n.dataTransfer))return;const o=Array.from(n.dataTransfer.files).filter(t=>!!t&&iu(t)),i=n.targetRanges.map(e=>t.editing.mapper.toModelRange(e));t.model.change(n=>{n.setSelection(i),o.length&&(e.stop(),t.model.enqueueChange("default",()=>{t.execute("imageUpload",{file:o})}))})}),t.plugins.has("Clipboard")&&this.listenTo(t.plugins.get("Clipboard"),"inputTransformation",(e,n)=>{const o=Array.from(t.editing.view.createRangeIn(n.content)).filter(t=>(function(t){return!(!t.is("element","img")||!t.getAttribute("src"))&&(t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||t.getAttribute("src").match(/^blob:/g))})(t.item)&&!t.item.getAttribute("uploadProcessed")).map(t=>({promise:ru(t.item),imageElement:t.item}));if(!o.length)return;const r=new gu;for(const t of o){r.setAttribute("uploadProcessed",!0,t.imageElement);const e=i.createLoader(t.promise);e&&(r.setAttribute("src","",t.imageElement),r.setAttribute("uploadId",e.id,t.imageElement))}}),t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()}),e.on("change",()=>{const n=e.differ.getChanges({includeChangesInGraveyard:!0});for(const e of n)if("insert"==e.type&&"$text"!=e.name){const n=e.position.nodeAfter,o="$graveyard"==e.position.root.rootName;for(const e of Pu(t,n)){const t=e.getAttribute("uploadId");if(!t)continue;const n=i.loaders.get(t);n&&(o?n.abort():"idle"==n.status&&this._readAndUpload(n,e))}}})}_readAndUpload(t,e){const n=this.editor,o=n.model,i=n.locale.t,r=n.plugins.get(Qd),s=n.plugins.get(mu);return o.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)}),t.read().then(()=>{const i=t.upload();if(mi.isSafari){const t=n.editing.mapper.toViewElement(e).getChild(0);n.editing.view.once("render",()=>{if(!t.parent)return;const e=n.editing.view.domConverter.mapViewToDom(t.parent);if(!e)return;const o=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=o})}return o.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)}),i}).then(t=>{o.enqueueChange("transparent",n=>{n.setAttributes({uploadStatus:"complete",src:t.default},e),this._parseAndSetSrcsetAttributeOnImage(t,e,n)}),a()}).catch(n=>{if("error"!==t.status&&"aborted"!==t.status)throw n;"error"==t.status&&n&&s.showWarning(n,{title:i("ap"),namespace:"upload"}),a(),o.enqueueChange("transparent",t=>{t.remove(e)})});function a(){o.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e),t.removeAttribute("uploadStatus",e)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let o=0;const i=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e))return o=Math.max(o,e),!0}).map(e=>`${t[e]} ${e}w`).join(", ");""!=i&&n.setAttribute("srcset",{data:i,width:o},e)}}function Pu(t,e){return Array.from(t.model.createRangeOn(e)).filter(t=>t.item.is("image")).map(t=>t.item)}class Tu extends Gl{static get pluginName(){return"ImageUpload"}static get requires(){return[Au,su,lu]}}const Eu=Symbol("isWpButtonMacroSymbol");function Su(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(Eu)&&nd(t)}(e))}class Ru extends Gl{static get pluginName(){return"OPChildPagesEditing"}static get buttonName(){return"insertChildPages"}init(){const t=this.editor,e=t.model,n=t.conversion;e.schema.register("op-macro-child-pages",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),n.for("upcast").elementToElement({view:{name:"macro",classes:"child_pages"},model:(t,e)=>{const n=t.getAttribute("data-page")||"",o="true"==t.getAttribute("data-include-parent");return e.createElement("op-macro-child-pages",{page:n,includeParent:o})}}),n.for("editingDowncast").elementToElement({model:"op-macro-child-pages",view:(t,e)=>this.createMacroViewElement(t,e)}).add(t=>t.on("attribute:page",this.modelAttributeToView.bind(this))).add(t=>t.on("attribute:includeParent",this.modelAttributeToView.bind(this))),n.for("dataDowncast").elementToElement({model:"op-macro-child-pages",view:(t,e)=>{return e.createContainerElement("macro",{class:"child_pages","data-page":t.getAttribute("page")||"","data-include-parent":t.getAttribute("includeParent")||""})}}),t.ui.componentFactory.add(Ru.buttonName,e=>{const n=new Wl(e);return n.set({label:window.I18n.t("js.editor.macro.child_pages.button"),withText:!0}),n.on("execute",()=>{t.model.change(e=>{const n=e.createElement("op-macro-child-pages",{});t.model.insertContent(n,t.model.document.selection)})}),n})}modelAttributeToView(t,e,n){const o=e.item;if(!o.is("op-macro-child-pages"))return;n.consumable.consume(e.item,t.name);const i=n.mapper.toViewElement(o);n.writer.remove(n.writer.createRangeIn(i)),this.setPlaceholderContent(n.writer,o,i)}macroLabel(){return window.I18n.t("js.editor.macro.child_pages.text")}pageLabel(t){return t&&t.length>0?t:window.I18n.t("js.editor.macro.child_pages.this_page")}includeParentText(t){return t?` (${window.I18n.t("js.editor.macro.child_pages.include_parent")})`:""}createMacroViewElement(t,e){const n=e.createContainerElement("div",{class:"macro -child_pages"});return this.setPlaceholderContent(e,t,n),function(t,e,n){return e.setCustomProperty(Eu,!0,t),od(t,e,{label:n})}(n,e,{label:this.macroLabel()})}setPlaceholderContent(t,e,n){const o=e.getAttribute("page"),i=e.getAttribute("includeParent"),r=this.macroLabel(),s=this.pageLabel(o),a=t.createContainerElement("span",{class:"macro-value"});let c=[t.createText(`${r} `)];t.insert(t.createPositionAt(a,0),t.createText(`${s}`)),c.push(a),c.push(t.createText(this.includeParentText(i))),t.insert(t.createPositionAt(n,0),c)}}class Ou extends Gl{static get requires(){return[Nd]}static get pluginName(){return"OPChildPagesToolbar"}init(){const t=this.editor,e=this.editor.model,n=hd(t);zd(t,"opEditChildPagesMacroButton",t=>{const o=n.services.macros,i=t.getAttribute("page"),r=t.getAttribute("includeParent"),s=i&&i.length>0?i:"";o.configureChildPages(s,r).then(n=>e.change(e=>{e.setAttribute("page",n.page,t),e.setAttribute("includeParent",n.includeParent,t)}))})}afterInit(){jd(this,this.editor,"OPChildPages",Su)}}class Iu{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],n=t.items?Array.from(t.items):[];if(e.length)return e;return n.filter(t=>"file"===t.kind).map(t=>t.getAsFile())}(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}}class Mu extends es{constructor(t){super(t);const e=this.document;function n(t,n){n.preventDefault();const o=n.dropRange?[n.dropRange]:Array.from(e.selection.getRanges()),i=new Qn(e,"clipboardInput");e.fire(i,{dataTransfer:n.dataTransfer,targetRanges:o}),i.stop.called&&n.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(e,"paste",n,{priority:"low"}),this.listenTo(e,"drop",n,{priority:"low"})}onDomEvent(t){const e={dataTransfer:new Iu(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"==t.type&&(e.dropRange=function(t,e){const n=e.target.ownerDocument,o=e.clientX,i=e.clientY;let r;n.caretRangeFromPoint&&n.caretRangeFromPoint(o,i)?r=n.caretRangeFromPoint(o,i):e.rangeParent&&((r=n.createRange()).setStart(e.rangeParent,e.rangeOffset),r.collapse(!0));return r?t.domConverter.domRangeToView(r):t.document.selection.getFirstRange()}(this.view,t)),this.fire(t.type,t,e)}}const Du=["figcaption","li"];class Nu extends Gl{static get pluginName(){return"Clipboard"}init(){const t=this.editor,e=t.model.document,n=t.editing.view,o=n.document;function i(n,i){const r=i.dataTransfer;i.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));o.fire("clipboardOutput",{dataTransfer:r,content:s,method:n.name})}this._htmlDataProcessor=new ol,n.addObserver(Mu),this.listenTo(o,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(t,e)=>{const o=e.dataTransfer;let i="";o.getData("text/html")?i=function(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(o.getData("text/html")):o.getData("text/plain")&&(i=function(t){return(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"</p><p>").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).indexOf("</p><p>")>-1&&(t=`<p>${t}</p>`),t}(o.getData("text/plain"))),i=this._htmlDataProcessor.toView(i),this.fire("inputTransformation",{content:i,dataTransfer:o}),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,e)=>{if(!e.content.isEmpty){const t=this.editor.data,n=this.editor.model,o=t.toModel(e.content,"$clipboardHolder");if(0==o.childCount)return;n.insertContent(o)}},{priority:"low"}),this.listenTo(o,"copy",i,{priority:"low"}),this.listenTo(o,"cut",(e,n)=>{t.isReadOnly?n.preventDefault():i(e,n)},{priority:"low"}),this.listenTo(o,"clipboardOutput",(n,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",function t(e){let n="";if(e.is("text")||e.is("textProxy"))n=e.data;else if(e.is("img")&&e.hasAttribute("alt"))n=e.getAttribute("alt");else{let o=null;for(const i of e.getChildren()){const e=t(i);o&&(o.is("containerElement")||i.is("containerElement"))&&(Du.includes(o.name)||Du.includes(i.name)?n+="\n":n+="\n\n"),n+=e,o=i}}return n}(o.content))),"cut"==o.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}function*Vu(t,e){for(const n of e)n&&t.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}class Fu extends bu{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n,o){const i=n.isCollapsed,r=n.getFirstRange(),s=r.start.parent,a=r.end.parent;if(o.isLimit(s)||o.isLimit(a))return void(i||s!=a||t.deleteContent(n));if(i){const t=Vu(e.model.schema,n.getAttributes());Bu(e,r.start),e.setSelectionAttribute(t)}else{const o=!(r.start.isAtStart&&r.end.isAtEnd),i=s==a;t.deleteContent(n,{leaveUnmerged:o}),o&&(i?Bu(e,n.focus):e.setSelection(a,0))}}(this.editor.model,n,e.selection,t.schema),this.fire("afterExecute",{writer:n})})}}function Bu(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class Lu extends fr{constructor(t){super(t);const e=this.document;e.on("keydown",(t,n)=>{if(this.isEnabled&&n.keyCode==wi.enter){let o;e.once("enter",t=>o=t,{priority:"highest"}),e.fire("enter",new ts(e,n.domEvent,{isSoft:n.shiftKey})),o&&o.stop.called&&t.stop()}})}observe(){}}class zu extends Gl{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Lu),t.commands.add("enter",new Fu(t)),this.listenTo(n,"enter",(n,o)=>{o.preventDefault(),o.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class qu extends bu{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n){const o=n.isCollapsed,i=n.getFirstRange(),r=i.start.parent,s=i.end.parent,a=r==s;if(o){const o=Vu(t.schema,n.getAttributes());ju(e,i.end),e.removeSelectionAttribute(n.getAttributeKeys()),e.setSelectionAttribute(o)}else{const o=!(i.start.isAtStart&&i.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:o}),a?ju(e,n.focus):o&&e.setSelection(s,0)}}(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const n=e.anchor;if(!n||!t.checkChild(n,"softBreak"))return!1;const o=e.getFirstRange(),i=o.start.parent,r=o.end.parent;if((Hu(i,t)||Hu(r,t))&&i!==r)return!1;return!0}(t.schema,e.selection)}}function ju(t,e){const n=t.createElement("softBreak");t.insert(n,e),t.setSelection(n,"after")}function Hu(t,e){return!t.is("rootElement")&&(e.isLimit(t)||Hu(t.parent,e))}class Uu extends Gl{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,o=t.editing.view,i=o.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(t,e)=>e.createEmptyElement("br")}),o.addObserver(Lu),t.commands.add("shiftEnter",new qu(t)),this.listenTo(i,"enter",(e,n)=>{n.preventDefault(),n.isSoft&&(t.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"})}}class $u{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=((t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)}),this._selectionChangeCallback=(()=>{this._reset()}),this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class Wu extends bu{constructor(t,e){super(t),this._buffer=new $u(t.model,e),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,o=t.text||"",i=o.length,r=t.range||n.selection.getFirstRange(),s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{const a=r.isCollapsed;this._buffer.lock(),e.deleteContent(e.createSelection(r)),o&&e.insertContent(t.createText(o,n.selection.getAttributes()),r.start),s?t.setSelection(s):a&&t.setSelection(r.start.getShiftedBy(i)),this._buffer.unlock(),this._buffer.input(i),this._batches.add(this._buffer.batch)})}}function Gu(t){let e=null;const n=t.model,o=t.editing.view,i=t.commands.get("input");function r(t){const r=n.document,a=o.document.isComposing,c=e&&e.isEqual(r.selection);e=null,i.isEnabled&&(function(t){if(t.ctrlKey)return!0;return Ku.includes(t.keyCode)}(t)||r.selection.isCollapsed||a&&229===t.keyCode||!a&&229===t.keyCode&&c||s())}function s(){const t=i.buffer;t.lock(),n.enqueueChange(t.batch,()=>{n.deleteContent(n.document.selection)}),t.unlock()}mi.isAndroid?o.document.on("beforeinput",(t,e)=>r(e),{priority:"lowest"}):o.document.on("keydown",(t,e)=>r(e),{priority:"lowest"}),o.document.on("compositionstart",function(){const t=n.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;s()},{priority:"lowest"}),o.document.on("compositionend",()=>{e=n.createSelection(n.document.selection)},{priority:"lowest"})}const Ku=[ki("arrowUp"),ki("arrowRight"),ki("arrowDown"),ki("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++)Ku.push(t);function Ju(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const n=[];let o,i=0;return t.forEach(t=>{"equal"==t?(r(),i++):"insert"==t?(s("insert")?o.values.push(e[i]):(r(),o={type:"insert",index:i,values:[e[i]]}),i++):s("delete")?o.howMany++:(r(),o={type:"delete",index:i,howMany:1})}),r(),n;function r(){o&&(n.push(o),o=null)}function s(t){return o&&o.type==t}}(Zi(t.oldChildren,t.newChildren,Zu),t.newChildren);if(e.length>1)return;const n=e[0];return n.values[0]&&n.values[0].is("text")?n:void 0}function Zu(t,e){return t&&t.is("text")&&e&&e.is("text")?t.data===e.data:t===e}class Qu{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!Ju(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const n of t)this._handleTextMutation(n,e),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(t,e){const n=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!n)return;const o=this.editor.editing.view.domConverter.mapViewToDom(n),i=new sr,r=this.editor.data.toModel(i.domToView(o)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const a=Array.from(r.getChildren()),c=Array.from(s.getChildren()),l=a[a.length-1],d=c[c.length-1];l&&l.is("softBreak")&&d&&!d.is("softBreak")&&a.pop();const u=this.editor.model.schema;if(!Yu(a,u)||!Yu(c,u))return;const h=a.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," "),f=c.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," ");if(f===h)return;const p=Zi(f,h),{firstChangeAt:m,insertions:g,deletions:b}=Xu(p);let w=null;e&&(w=this.editing.mapper.toModelRange(e.getFirstRange()));const k=h.substr(m,g),_=this.editor.model.createRange(this.editor.model.createPositionAt(s,m),this.editor.model.createPositionAt(s,m+b));this.editor.execute("input",{text:k,range:_,resultRange:w})}_handleTextMutation(t,e){if("text"!=t.type)return;const n=t.newText.replace(/\u00A0/g," "),o=t.oldText.replace(/\u00A0/g," ");if(o===n)return;const i=Zi(o,n),{firstChangeAt:r,insertions:s,deletions:a}=Xu(i);let c=null;e&&(c=this.editing.mapper.toModelRange(e.getFirstRange()));const l=this.editing.view.createPositionAt(t.node,r),d=this.editing.mapper.toModelPosition(l),u=this.editor.model.createRange(d,d.getShiftedBy(a)),h=n.substr(r,s);this.editor.execute("input",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=Ju(t),n=this.editing.view.createPositionAt(t.node,e.index),o=this.editing.mapper.toModelPosition(n),i=e.values[0].data;this.editor.execute("input",{text:i.replace(/\u00A0/g," "),range:this.editor.model.createRange(o)})}}function Yu(t,e){return t.every(t=>e.isInline(t))}function Xu(t){let e=null,n=null;for(let o=0;o<t.length;o++){"equal"!=t[o]&&(e=null===e?o:e,n=o)}let o=0,i=0;for(let r=e;r<=n;r++)"insert"!=t[r]&&o++,"delete"!=t[r]&&i++;return{insertions:i,deletions:o,firstChangeAt:e}}class th extends Gl{static get pluginName(){return"Input"}init(){const t=this.editor,e=new Wu(t,t.config.get("typing.undoStep")||20);t.commands.add("input",e),Gu(t),function(t){t.editing.view.document.on("mutations",(e,n,o)=>{new Qu(t).handle(n,o)})}(t)}isInput(t){return this.editor.commands.get("input")._batches.has(t)}}class eh extends bu{constructor(t,e){super(t),this.direction=e,this._buffer=new $u(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const i=o.createSelection(t.selection||n.selection),r=i.isCollapsed;if(i.isCollapsed&&e.modifySelection(i,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))return void this._replaceEntireContentWithParagraph(o);if(i.isCollapsed)return;let s=0;i.getFirstRange().getMinimalFlatRanges().forEach(t=>{s+=oi(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(i,{doNotResetEntireContent:r}),this._buffer.input(s),o.setSelection(i),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,o=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(o)))return!1;if(!e.schema.checkChild(o,"paragraph"))return!1;const i=o.getChild(0);return!i||"paragraph"!==i.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,o=e.schema.getLimitElement(n),i=t.createElement("paragraph");t.remove(t.createRangeIn(o)),t.insert(i,o),t.setSelection(i,0)}}class nh extends fr{constructor(t){super(t);const e=t.document;let n=0;function o(t,n,o){let i;e.once("delete",t=>i=t,{priority:Number.POSITIVE_INFINITY}),e.fire("delete",new ts(e,n,o)),i&&i.stop.called&&t.stop()}e.on("keyup",(t,e)=>{e.keyCode!=wi.delete&&e.keyCode!=wi.backspace||(n=0)}),e.on("keydown",(t,e)=>{const i={};if(e.keyCode==wi.delete)i.direction="forward",i.unit="character";else{if(e.keyCode!=wi.backspace)return;i.direction="backward",i.unit="codePoint"}const r=mi.isMac?e.altKey:e.ctrlKey;i.unit=r?"word":i.unit,i.sequence=++n,o(t,e.domEvent,i)}),mi.isAndroid&&e.on("beforeinput",(e,n)=>{if("deleteContentBackward"!=n.domEvent.inputType)return;const i={unit:"codepoint",direction:"backward",sequence:1},r=n.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(i.selectionToRemove=t.domConverter.domSelectionToView(r)),o(e,n.domEvent,i)})}observe(){}}class oh extends Gl{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document;if(e.addObserver(nh),t.commands.add("forwardDelete",new eh(t,"forward")),t.commands.add("delete",new eh(t,"backward")),this.listenTo(n,"delete",(n,o)=>{const i={unit:o.unit,sequence:o.sequence};if(o.selectionToRemove){const e=t.model.createSelection(),n=[];for(const e of o.selectionToRemove.getRanges())n.push(t.editing.mapper.toModelRange(e));e.setTo(n),i.selection=e}t.execute("forward"==o.direction?"forwardDelete":"delete",i),o.preventDefault(),e.scrollToTheSelection()}),mi.isAndroid){let t=null;this.listenTo(n,"delete",(e,n)=>{const o=n.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(e,n)=>{if(t){const e=n.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}})}}}class ih extends Gl{static get requires(){return[th,oh]}static get pluginName(){return"Typing"}}class rh extends Ya{get type(){return"noop"}clone(){return new rh(this.baseVersion)}getReversed(){return new rh(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const sh=new Map;function ah(t,e,n){let o=sh.get(t);o||(o=new Map,sh.set(t,o)),o.set(e,n)}function ch(t){return[t]}function lh(t,e,n={}){const o=function(t,e){const n=sh.get(t);return n&&n.has(e)?n.get(e):ch}(t.constructor,e.constructor);try{return o(t=t.clone(),e,n)}catch(t){throw t}}function dh(t,e,n){t=t.slice(),e=e.slice();const o=new uh(n.document,n.useRelations,n.forceWeakRemove);o.setOriginalOperations(t),o.setOriginalOperations(e);const i=o.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:i};const r=new WeakMap;for(const e of t)r.set(e,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a<t.length;){const n=t[a],i=r.get(n);if(i==e.length){a++;continue}const s=e[i],c=lh(n,s,o.getContext(n,s,!0)),l=lh(s,n,o.getContext(s,n,!1));o.updateRelation(n,s),o.setOriginalOperations(c,n),o.setOriginalOperations(l,s);for(const t of c)r.set(t,i+l.length);t.splice(a,1,...c),e.splice(i,1,...l)}if(n.padWithNoOps){const n=t.length-s.originalOperationsACount,o=e.length-s.originalOperationsBCount;fh(t,o-n),fh(e,n-o)}return hh(t,s.nextBaseVersionB),hh(e,s.nextBaseVersionA),{operationsA:t,operationsB:e,originalOperations:i}}class uh{constructor(t,e,n=!1){this.originalOperations=new Map,this._history=t.history,this._useRelations=e,this._forceWeakRemove=!!n,this._relations=new Map}setOriginalOperations(t,e=null){const n=e?this.originalOperations.get(e):null;for(const e of t)this.originalOperations.set(e,n||e)}updateRelation(t,e){switch(t.constructor){case dc:switch(e.constructor){case mc:t.targetPosition.isEqual(e.sourcePosition)||e.movedRange.containsPosition(t.targetPosition)?this._setRelation(t,e,"insertAtSource"):t.targetPosition.isEqual(e.deletionPosition)?this._setRelation(t,e,"insertBetween"):t.targetPosition.isAfter(e.sourcePosition)&&this._setRelation(t,e,"moveTargetAfter");break;case dc:t.targetPosition.isEqual(e.sourcePosition)||t.targetPosition.isBefore(e.sourcePosition)?this._setRelation(t,e,"insertBefore"):this._setRelation(t,e,"insertAfter")}break;case gc:switch(e.constructor){case mc:t.splitPosition.isBefore(e.sourcePosition)&&this._setRelation(t,e,"splitBefore");break;case dc:(t.splitPosition.isEqual(e.sourcePosition)||t.splitPosition.isBefore(e.sourcePosition))&&this._setRelation(t,e,"splitBefore")}break;case mc:switch(e.constructor){case mc:t.targetPosition.isEqual(e.sourcePosition)||this._setRelation(t,e,"mergeTargetNotMoved"),t.sourcePosition.isEqual(e.targetPosition)&&this._setRelation(t,e,"mergeSourceNotMoved"),t.sourcePosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeSameElement");break;case gc:t.sourcePosition.isEqual(e.splitPosition)&&this._setRelation(t,e,"splitAtSource")}break;case hc:{const n=t.newRange;if(!n)return;switch(e.constructor){case dc:{const o=Js._createFromPositionAndShift(e.sourcePosition,e.howMany),i=o.containsPosition(n.start)||o.start.isEqual(n.start),r=o.containsPosition(n.end)||o.end.isEqual(n.end);!i&&!r||o.containsRange(n)||this._setRelation(t,e,{side:i?"left":"right",path:i?n.start.path.slice():n.end.path.slice()});break}case mc:{const o=n.start.isEqual(e.targetPosition),i=n.start.isEqual(e.deletionPosition),r=n.end.isEqual(e.deletionPosition),s=n.end.isEqual(e.sourcePosition);(o||i||r||s)&&this._setRelation(t,e,{wasInLeftElement:o,wasStartBeforeMergedElement:i,wasEndBeforeMergedElement:r,wasInRightElement:s});break}}break}}}getContext(t,e,n){return{aIsStrong:n,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(t){const e=this.originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(t,e){const n=this.originalOperations.get(e),o=this._history.getUndoneOperation(n);if(!o)return null;const i=this.originalOperations.get(t),r=this._relations.get(i);return r&&r.get(o)||null}_setRelation(t,e,n){const o=this.originalOperations.get(t),i=this.originalOperations.get(e);let r=this._relations.get(o);r||(r=new Map,this._relations.set(o,r)),r.set(i,n)}}function hh(t,e){for(const n of t)n.baseVersion=e++}function fh(t,e){for(let n=0;n<e;n++)t.push(new rh(0))}function ph(t,e,n){const o=t.nodes.getNode(0).getAttribute(e);if(o==n)return null;const i=new Js(t.position,t.position.getShiftedBy(t.howMany));return new cc(i,e,o,n,0)}function mh(t,e){return null===t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)}function gh(t,e){const n=[];for(let o=0;o<t.length;o++){const i=t[o],r=new dc(i.start,i.end.offset-i.start.offset,e,0);n.push(r);for(let e=o+1;e<t.length;e++)t[e]=t[e]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];e=e._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return n}ah(cc,cc,(t,e,n)=>{if(t.key===e.key){const o=t.range.getDifference(e.range).map(e=>new cc(e,t.key,t.oldValue,t.newValue,0)),i=t.range.getIntersection(e.range);return i&&n.aIsStrong&&o.push(new cc(i,e.key,e.newValue,t.newValue,0)),0==o.length?[new rh(0)]:o}return[t]}),ah(cc,uc,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const n=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(e=>new cc(e,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const o=ph(e,t.key,t.oldValue);o&&n.unshift(o)}return n}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),ah(cc,mc,(t,e)=>{const n=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&n.push(Js._createFromPositionAndShift(e.graveyardPosition,1));const o=t.range._getTransformedByMergeOperation(e);return o.isCollapsed||n.push(o),n.map(e=>new cc(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),ah(cc,dc,(t,e)=>{return function(t,e){const n=Js._createFromPositionAndShift(e.sourcePosition,e.howMany);let o=null,i=[];n.containsRange(t,!0)?o=t:t.start.hasSameParentAs(n.start)?(i=t.getDifference(n),o=t.getIntersection(n)):i=[t];const r=[];for(let t of i){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const n=e.getMovedRangeStart(),o=t.start.hasSameParentAs(n);t=t._getTransformedByInsertion(n,e.howMany,o),r.push(...t)}o&&r.push(o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]);return r}(t.range,e).map(e=>new cc(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),ah(cc,gc,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const n=t.clone();return n.range=new Js(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,n]}return t.range=t.range._getTransformedBySplitOperation(e),[t]}),ah(uc,cc,(t,e)=>{const n=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const o=ph(t,e.key,e.newValue);o&&n.push(o)}return n}),ah(uc,uc,(t,e,n)=>t.position.isEqual(e.position)&&n.aIsStrong?[t]:(t.position=t.position._getTransformedByInsertOperation(e),[t])),ah(uc,dc,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),ah(uc,gc,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t])),ah(uc,mc,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t])),ah(hc,uc,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t])),ah(hc,hc,(t,e,n)=>{if(t.name==e.name){if(!n.aIsStrong)return[new rh(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]}),ah(hc,mc,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t])),ah(hc,dc,(t,e,n)=>{if(t.oldRange&&(t.oldRange=Js._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(n.abRelation){const o=Js._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==n.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.start.path=n.abRelation.path,t.newRange.end=o.end,[t];if("right"==n.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=o.start,t.newRange.end.path=n.abRelation.path,[t]}t.newRange=Js._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]}),ah(hc,gc,(t,e,n)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(n.abRelation){const o=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&n.abRelation.wasStartBeforeMergedElement?t.newRange.start=Ks._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!n.abRelation.wasInLeftElement&&(t.newRange.start=Ks._createAt(e.moveTargetPosition)),t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasInRightElement?t.newRange.end=Ks._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?t.newRange.end=Ks._createAt(e.insertionPosition):t.newRange.end=o.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]}),ah(mc,uc,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t])),ah(mc,mc,(t,e,n)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(n.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),t.sourcePosition=new Ks(e.graveyardPosition.root,n),t.howMany=0,[t]}return[new rh(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!n.bWasUndone&&"splitAtSource"!=n.abRelation){const o="$graveyard"==t.targetPosition.root.rootName,i="$graveyard"==e.targetPosition.root.rootName;if(i&&!o||!(o&&!i)&&n.aIsStrong){const n=e.targetPosition._getTransformedByMergeOperation(e),o=t.targetPosition._getTransformedByMergeOperation(e);return[new dc(n,t.howMany,o,0)]}return[new rh(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&n.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),ah(mc,dc,(t,e,n)=>{const o=Js._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!n.bWasUndone&&!n.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition)?[new rh(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])}),ah(mc,gc,(t,e,n)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const o=0!=e.howMany,i=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(o||i||"mergeTargetNotMoved"==n.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==n.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==n.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}),ah(dc,uc,(t,e)=>{const n=Js._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=n.start,t.howMany=n.end.offset-n.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]}),ah(dc,dc,(t,e,n)=>{const o=Js._createFromPositionAndShift(t.sourcePosition,t.howMany),i=Js._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,s=n.aIsStrong,a=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?a=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(a=!1),r=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),mh(t,e)&&mh(e,t))return[e.getReversed()];if(o.containsPosition(e.targetPosition)&&o.containsRange(i,!0))return o.start=o.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),o.end=o.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),gh([o],r);if(i.containsPosition(t.targetPosition)&&i.containsRange(o,!0))return o.start=o.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),o.end=o.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),gh([o],r);const c=uo(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return o.start=o.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),o.end=o.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),gh([o],r);"remove"!=t.type||"remove"==e.type||n.aWasUndone||n.forceWeakRemove?"remove"==t.type||"remove"!=e.type||n.bWasUndone||n.forceWeakRemove||(s=!1):s=!0;const l=[],d=o.getDifference(i);for(const t of d){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const n="same"==uo(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),o=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,n);l.push(...o)}const u=o.getIntersection(i);return null!==u&&s&&(u.start=u.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),u.end=u.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===l.length?l.push(u):1==l.length?i.start.isBefore(o.start)||i.start.isEqual(o.start)?l.unshift(u):l.push(u):l.splice(1,0,u)),0===l.length?[new rh(t.baseVersion)]:gh(l,r)}),ah(dc,gc,(t,e,n)=>{let o=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(o=t.targetPosition._getTransformedBySplitOperation(e));const i=Js._createFromPositionAndShift(t.sourcePosition,t.howMany);if(i.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=o,[t];if(i.start.hasSameParentAs(e.splitPosition)&&i.containsPosition(e.splitPosition)){let t=new Js(e.splitPosition,i.end);return t=t._getTransformedBySplitOperation(e),gh([new Js(i.start,e.splitPosition),t],o)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==n.abRelation&&(o=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==n.abRelation&&(o=t.targetPosition);const r=[i._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const o=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);t.howMany>1&&o&&!n.aWasUndone&&r.push(Js._createFromPositionAndShift(e.insertionPosition,1))}return gh(r,o)}),ah(dc,mc,(t,e,n)=>{const o=Js._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition))if("remove"!=t.type||n.forceWeakRemove){if(1==t.howMany)return n.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new rh(0)]}else if(!n.aWasUndone){const n=[];let o=e.graveyardPosition.clone(),i=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(n.push(new dc(t.sourcePosition,t.howMany-1,t.targetPosition,0)),o=o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),i=i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const r=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),s=new dc(o,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Ks(s.targetPosition.root,a);i=i._getTransformedByMove(o,r,1);const l=new dc(i,e.howMany,c,0);return n.push(s),n.push(l),n}const i=Js._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]}),ah(fc,uc,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t])),ah(fc,mc,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t])),ah(fc,dc,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),ah(fc,fc,(t,e,n)=>{if(t.position.isEqual(e.position)){if(!n.aIsStrong)return[new rh(0)];t.oldName=e.newName}return[t]}),ah(fc,gc,(t,e)=>{if("same"==uo(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){return[t,new fc(t.position.getShiftedBy(1),t.oldName,t.newName,0)]}return t.position=t.position._getTransformedBySplitOperation(e),[t]}),ah(pc,pc,(t,e,n)=>{if(t.root===e.root&&t.key===e.key){if(!n.aIsStrong||t.newValue===e.newValue)return[new rh(0)];t.oldValue=e.newValue}return[t]}),ah(gc,uc,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset<e.position.offset&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByInsertOperation(e),t.insertionPosition=gc.getInsertionPosition(t.splitPosition),[t])),ah(gc,mc,(t,e,n)=>{if(!t.graveyardPosition&&!n.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const o=new Ks(e.graveyardPosition.root,n),i=gc.getInsertionPosition(new Ks(e.graveyardPosition.root,n)),r=new gc(o,0,null,0);return r.insertionPosition=i,t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=gc.getInsertionPosition(t.splitPosition),t.graveyardPosition=r.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[r,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=gc.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),ah(gc,dc,(t,e,n)=>{const o=Js._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const i=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);if(!n.bWasUndone&&i){const n=t.splitPosition._getTransformedByMoveOperation(e),o=t.graveyardPosition._getTransformedByMoveOperation(e),i=o.path.slice();i.push(0);const r=new Ks(o.root,i);return[new dc(n,t.howMany,r,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.splitPosition)){const n=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=n,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany),t.splitPosition=e.sourcePosition.clone(),t.insertionPosition=gc.getInsertionPosition(t.splitPosition),[t]}return!t.splitPosition.isEqual(e.targetPosition)||"insertAtSource"!=n.baRelation&&"splitBefore"!=n.abRelation?(e.sourcePosition.isEqual(e.targetPosition)||(t.splitPosition.hasSameParentAs(e.sourcePosition)&&t.splitPosition.offset<=e.sourcePosition.offset&&(t.howMany-=e.howMany),t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany)),t.splitPosition.stickiness="toNone",t.splitPosition=t.splitPosition._getTransformedByMoveOperation(e),t.splitPosition.stickiness="toNext",t.graveyardPosition?t.insertionPosition=t.insertionPosition._getTransformedByMoveOperation(e):t.insertionPosition=gc.getInsertionPosition(t.splitPosition),[t]):(t.howMany+=e.howMany,t.splitPosition=t.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),t.insertionPosition=gc.getInsertionPosition(t.splitPosition),[t])}),ah(gc,gc,(t,e,n)=>{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new rh(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new rh(0)];if("splitBefore"==n.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const o="$graveyard"==t.splitPosition.root.rootName,i="$graveyard"==e.splitPosition.root.rootName;if(i&&!o||!(o&&!i)&&n.aIsStrong){const n=[];return e.howMany&&n.push(new dc(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&n.push(new dc(t.splitPosition,t.howMany,t.moveTargetPosition,0)),n}return[new rh(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.baRelation){const n=e.insertionPosition.path.slice();n.push(0);const o=new Ks(e.insertionPosition.root,n);return[t,new dc(t.insertionPosition,1,o,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset<e.splitPosition.offset&&(t.howMany-=e.howMany),t.splitPosition=t.splitPosition._getTransformedBySplitOperation(e),t.insertionPosition=gc.getInsertionPosition(t.splitPosition),[t]});class bh extends bu{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh()}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const o=this.editor.model,i=o.document,r=[];for(const e of t){const t=wh(e,n).find(t=>t.start.root!=i.graveyard);t&&r.push(t)}r.length&&o.change(t=>{t.setSelection(r,{backward:e})})}_undo(t,e){const n=this.editor.model,o=n.document;this._createdBatches.add(e);const i=t.operations.slice().filter(t=>t.isDocumentOperation);i.reverse();for(const t of i){const i=t.baseVersion+1,r=Array.from(o.history.getOperations(i)),s=dh([t.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const i of s)e.addOperation(i),n.applyOperation(i),o.history.setOperationAsUndone(t,i)}}}function wh(t,e){const n=t.getTransformedByOperations(e);n.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];e.end.isTouching(o.start)&&(e.end=o.end,n.splice(t,1),t--)}return n}class kh extends bh{execute(t=null){const e=t?this._stack.findIndex(e=>e.batch==t):this._stack.length-1,n=this._stack.splice(e,1)[0],o=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(o,()=>{this._undo(n.batch,o);const t=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,t),this.fire("revert",n.batch,o)}),this.refresh()}}class _h extends bh{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,()=>{const n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(n);this._restoreSelection(t.selection.ranges,t.selection.isBackward,o),this._undo(t.batch,e)}),this.refresh()}}class vh extends Gl{constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new kh(t),this._redoCommand=new _h(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const n=e[0];if(!n.isDocumentOperation)return;const o=n.batch,i=this._redoCommand._createdBatches.has(o),r=this._undoCommand._createdBatches.has(o);this._batchRegistry.has(o)||"transparent"==o.type&&!i&&!r||(i?this._undoCommand.addBatch(o):r||(this._undoCommand.addBatch(o),this._redoCommand.clearStack()),this._batchRegistry.add(o))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,e,n)=>{this._redoCommand.addBatch(n)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var yh=n(17),xh=n.n(yh),Ch=n(18),Ah=n.n(Ch);class Ph extends Gl{init(){const t=this.editor,e=t.locale,n=t.t,o="ltr"==e.uiLanguageDirection?xh.a:Ah.a,i="ltr"==e.uiLanguageDirection?Ah.a:xh.a;this._addButton("undo",n("be"),"CTRL+Z",o),this._addButton("redo",n("bf"),"CTRL+Y",i)}_addButton(t,e,n,o){const i=this.editor;i.ui.componentFactory.add(t,r=>{const s=i.commands.get(t),a=new Wl(r);return a.set({label:e,icon:o,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>i.execute(t)),a})}}class Th extends Gl{static get requires(){return[vh,Ph]}static get pluginName(){return"Undo"}}const Eh="ckCsrfToken",Sh=40,Rh="abcdefghijklmnopqrstuvwxyz0123456789";function Oh(){let t=function(t){t=t.toLowerCase();const e=document.cookie.split(";");for(const n of e){const e=n.split("="),o=decodeURIComponent(e[0].trim().toLowerCase());if(o===t)return decodeURIComponent(e[1])}return null}(Eh);return t&&t.length==Sh||(t=function(t){let e="";const n=new Uint8Array(t);window.crypto.getRandomValues(n);for(let t=0;t<n.length;t++){const o=Rh.charAt(n[t]%Rh.length);e+=Math.random()>.5?o.toUpperCase():o}return e}(Sh),function(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path=/"}(Eh,t)),t}class Ih{constructor(t,e,n){this.loader=t,this.url=e,this.t=n}upload(){return this.loader.file.then(t=>new Promise((e,n)=>{this._initRequest(),this._initListeners(e,n,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,n){const o=this.xhr,i=this.loader,r=(0,this.t)("a")+` ${n.name}.`;o.addEventListener("error",()=>e(r)),o.addEventListener("abort",()=>e()),o.addEventListener("load",()=>{const n=o.response;if(!n||!n.uploaded)return e(n&&n.error&&n.error.message?n.error.message:r);t({default:n.url})}),o.upload&&o.upload.addEventListener("progress",t=>{t.lengthComputable&&(i.uploadTotal=t.total,i.uploaded=t.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",Oh()),this.xhr.send(e)}}class Mh{constructor(t,e,n){let o,i=null;"function"==typeof n?o=n:(i=t.commands.get(n),o=(()=>{t.execute(n)})),t.model.document.on("change",(n,r)=>{if(i&&!i.isEnabled)return;if("transparent"==r.type)return;const s=Array.from(t.model.document.differ.getChanges()),a=s[0];if(1!=s.length||"insert"!==a.type||"$text"!=a.name||1!=a.length)return;const c=a.position.textNode||a.position.nodeAfter;if(!c.parent.is("paragraph"))return;const l=e.exec(c.data);l&&t.model.enqueueChange(t=>{const e=t.createPositionAt(c.parent,0),n=t.createPositionAt(c.parent,l[0].length),i=new ra(e,n);!1!==o({match:l})&&t.remove(i),i.detach()})})}}class Dh{constructor(t,e,n){let o,i,r,s;e instanceof RegExp?o=e:r=e,"string"==typeof n?i=n:s=n,r=r||(t=>{let e;const n=[],i=[];for(;null!==(e=o.exec(t))&&!(e&&e.length<4);){let{index:t,1:o,2:r,3:s}=e;const a=o+r+s,c=[t+=e[0].length-a.length,t+o.length],l=[t+o.length+r.length,t+o.length+r.length+s.length];n.push(c),n.push(l),i.push([t+o.length,t+o.length+r.length])}return{remove:n,format:i}}),s=s||((e,n)=>{const o=t.model.schema.getValidRanges(n,i);for(const t of o)e.setAttribute(i,!0,t);e.removeSelectionAttribute(i)}),t.model.document.on("change",(e,n)=>{if("transparent"==n.type)return;const o=t.model.document.selection;if(!o.isCollapsed)return;const i=Array.from(t.model.document.differ.getChanges()),a=i[0];if(1!=i.length||"insert"!==a.type||"$text"!=a.name||1!=a.length)return;const c=o.focus.parent,l=function(t){return Array.from(t.getChildren()).reduce((t,e)=>t+e.data,"")}(c).slice(0,o.focus.offset),d=r(l),u=Nh(c,d.format,t.model),h=Nh(c,d.remove,t.model);u.length&&h.length&&t.model.enqueueChange(t=>{if(!1!==s(t,u))for(const e of h.reverse())t.remove(e)})})}}function Nh(t,e,n){return e.filter(t=>void 0!==t[0]&&void 0!==t[1]).map(e=>n.createRange(n.createPositionAt(t,e[0]),n.createPositionAt(t,e[1])))}function Vh(t,e){return(n,o)=>{if(!t.commands.get(e).isEnabled)return!1;const i=t.model.schema.getValidRanges(o,e);for(const t of i)n.setAttribute(e,!0,t);n.removeSelectionAttribute(e)}}class Fh extends bu{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,o=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(n.isCollapsed)o?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const i=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const e of i)o?t.setAttribute(this.attributeKey,o,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const t of n.getRanges())for(const n of t.getItems())if(e.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}const Bh="bold";class Lh extends Gl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Bh}),t.model.schema.setAttributeProperties(Bh,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:Bh,view:"strong",upcastAlso:["b",{styles:{"font-weight":"bold"}}]}),t.commands.add(Bh,new Fh(t,Bh)),t.keystrokes.set("CTRL+B",Bh)}}var zh=n(42),qh=n.n(zh);const jh="bold";class Hh extends Gl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(jh,n=>{const o=t.commands.get(jh),i=new Wl(n);return i.set({label:e("d"),icon:qh.a,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>t.execute(jh)),i})}}const Uh="code";class $h extends Gl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Uh}),t.model.schema.setAttributeProperties(Uh,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:Uh,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),t.commands.add(Uh,new Fh(t,Uh))}}var Wh=n(43),Gh=n.n(Wh);n(23);const Kh="code";class Jh extends Gl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Kh,n=>{const o=t.commands.get(Kh),i=new Wl(n);return i.set({label:e("f"),icon:Gh.a,tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>t.execute(Kh)),i})}}const Zh="strikethrough";class Qh extends Gl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Zh}),t.model.schema.setAttributeProperties(Zh,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:Zh,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(Zh,new Fh(t,Zh)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}var Yh=n(44),Xh=n.n(Yh);const tf="strikethrough";class ef extends Gl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(tf,n=>{const o=t.commands.get(tf),i=new Wl(n);return i.set({label:e("e"),icon:Xh.a,keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>t.execute(tf)),i})}}const nf="italic";class of extends Gl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:nf}),t.model.schema.setAttributeProperties(nf,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:nf,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(nf,new Fh(t,nf)),t.keystrokes.set("CTRL+I",nf)}}var rf=n(45),sf=n.n(rf);const af="italic";class cf extends Gl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(af,n=>{const o=t.commands.get(af),i=new Wl(n);return i.set({label:e("g"),icon:sf.a,keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>t.execute(af)),i})}}function lf(t){const e=t.next();return e.done?null:e.value}class df extends bu{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.schema,o=e.document.selection,i=Array.from(o.getTopMostBlocks()),r=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(r){const e=i.filter(t=>uf(t)||ff(n,t));this._applyQuote(t,e)}else this._removeQuote(t,i.filter(uf))})}_getValue(){const t=lf(this.editor.model.document.selection.getTopMostBlocks());return!(!t||!uf(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=lf(t.getSelectedBlocks());return!!n&&ff(e,n)}_removeQuote(t,e){hf(t,e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const n=t.createPositionBefore(e.start.parent);return void t.move(e,n)}e.end.isAtEnd||t.split(e.end);const n=t.createPositionAfter(e.end.parent);t.move(e,n)})}_applyQuote(t,e){const n=[];hf(t,e).reverse().forEach(e=>{let o=uf(e.start);o||(o=t.createElement("blockQuote"),t.wrap(e,o)),n.push(o)}),n.reverse().reduce((e,n)=>e.nextSibling==n?(t.merge(t.createPositionAfter(e)),e):n)}}function uf(t){return"blockQuote"==t.parent.name?t.parent:null}function hf(t,e){let n,o=0;const i=[];for(;o<e.length;){const r=e[o],s=e[o+1];n||(n=t.createPositionBefore(r)),s&&r.nextSibling==s||(i.push(t.createRange(n,t.createPositionAfter(r))),n=null),o++}return i}function ff(t,e){const n=t.checkChild(e.parent,"blockQuote"),o=t.checkChild(["$root","blockQuote"],e);return n&&o}class pf extends Gl{init(){const t=this.editor,e=t.model.schema;t.commands.add("blockQuote",new df(t)),e.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),e.addChildCheck((t,e)=>{if(t.endsWith("blockQuote")&&"blockQuote"==e.name)return!1}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(n=>{const o=t.model.document.differ.getChanges();for(const t of o)if("insert"==t.type){const o=t.position.nodeAfter;if(!o)continue;if(o.is("blockQuote")&&o.isEmpty)return n.remove(o),!0;if(o.is("blockQuote")&&!e.checkChild(t.position,o))return n.unwrap(o),!0;if(o.is("element")){const t=n.createRangeIn(o);for(const o of t.getItems())if(o.is("blockQuote")&&!e.checkChild(n.createPositionBefore(o),o))return n.unwrap(o),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("blockQuote")&&e.isEmpty)return n.remove(e),!0}return!1})}afterInit(){const t=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,n)=>{const o=this.editor.model.document,i=o.selection.getLastPosition().parent;o.selection.isCollapsed&&i.isEmpty&&t.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),n.preventDefault(),e.stop())})}}var mf=n(46),gf=n.n(mf);n(93);class bf extends Gl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",n=>{const o=t.commands.get("blockQuote"),i=new Wl(n);return i.set({label:e("bj"),icon:gf.a,tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(i,"execute",()=>t.execute("blockQuote")),i})}}class wf extends bu{refresh(){const t=this.editor.model,e=lf(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("paragraph"),this.isEnabled=!!e&&kf(e,t.schema)}execute(t={}){const e=this.editor.model,n=e.document;e.change(o=>{const i=(t.selection||n.selection).getSelectedBlocks();for(const t of i)!t.is("paragraph")&&kf(t,e.schema)&&o.rename(t,"paragraph")})}}function kf(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class _f extends Gl{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model,n=t.data;t.commands.add("paragraph",new wf(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,e)=>_f.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,converterPriority:"low"}),n.upcastDispatcher.on("element",(t,e,n)=>{n.consumable.test(e.viewItem,{name:e.viewItem.name})&&yf(e.viewItem,e.modelCursor,n.schema)&&Object.assign(e,vf(e.viewItem,e.modelCursor,n))},{priority:"low"}),n.upcastDispatcher.on("text",(t,e,n)=>{e.modelRange||yf(e.viewItem,e.modelCursor,n.schema)&&Object.assign(e,vf(e.viewItem,e.modelCursor,n))},{priority:"lowest"}),e.document.registerPostFixer(t=>this._autoparagraphEmptyRoots(t)),t.data.on("ready",()=>{e.enqueueChange("transparent",t=>this._autoparagraphEmptyRoots(t))},{priority:"lowest"})}_autoparagraphEmptyRoots(t){const e=this.editor.model;for(const n of e.document.getRootNames()){const o=e.document.getRoot(n);if(o.isEmpty&&"$graveyard"!=o.rootName&&e.schema.checkChild(o,"paragraph"))return t.insertElement("paragraph",o),!0}}}function vf(t,e,n){const o=n.writer.createElement("paragraph");return n.writer.insert(o,e),n.convertItem(t,n.writer.createPositionAt(o,0))}function yf(t,e,n){const o=n.createContext(e);return!!n.checkChild(o,"paragraph")&&!!n.checkChild(o.push("paragraph"),t)}_f.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);class xf extends bu{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=lf(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>Cf(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,n=e.document,o=t.value;e.change(t=>{const i=Array.from(n.selection.getSelectedBlocks()).filter(t=>Cf(t,o,e.schema));for(const e of i)e.is(o)||t.rename(e,o)})}}function Cf(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t)}const Af="paragraph";class Pf extends Gl{constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[_f]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const o of e)o.model!==Af&&(t.model.schema.register(o.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(o),n.push(o.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new xf(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,o)=>{const i=t.model.document.selection.getFirstPosition().parent;n.some(t=>i.is(t.model))&&!i.is(Af)&&0===i.childCount&&o.writer.rename(i,Af)})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:Xn.get("low")+1})}}class Tf{constructor(t,e){e&&Bo(this,e),t&&this.set(t)}}lo(Tf,Ho);class Ef extends Dl{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",t=>`ck-dropdown__panel_${t}`),e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}n(95);class Sf extends Dl{constructor(t,e,n){super(t);const o=this.bindTemplate;this.buttonView=e,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("panelPosition","auto"),this.focusTracker=new sl,this.keystrokes=new Yc,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",t=>!t)]},children:[e,n]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=Sf._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);const t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:t,southWest:e,northEast:n,northWest:o}=Sf.defaultPanelPositions;return"ltr"===this.locale.uiLanguageDirection?[t,e,n,o]:[e,t,o,n]}}Sf.defaultPanelPositions={southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.bottom-e.height,left:t.left-e.width+t.width,name:"nw"})},Sf._getOptimalPosition=_d;var Rf=n(47),Of=n.n(Rf);class If extends Wl{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new Ul;return t.content=Of.a,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}n(97);class Mf extends Dl{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new sl,this.keystrokes=new Yc,this._focusCycler=new Bl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Df extends Dl{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Nf extends Dl{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}n(99);class Vf extends Wl{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new Dl;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}function Ff({emitter:t,activator:e,callback:n,contextElements:o}){t.listenTo(document,"mousedown",(t,{target:i})=>{if(e()){for(const t of o)if(t.contains(i))return;n()}})}n(101),n(103);function Bf(t,e=If){const n=new e(t),o=new Ef(t),i=new Sf(t,n,o);return n.bind("isEnabled").to(i),n instanceof If?n.bind("isOn").to(i,"isOpen"):n.arrowView.bind("isOn").to(i,"isOpen"),function(t){(function(t){t.on("render",()=>{Ff({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof Vf||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,n)=>{t.isOpen&&(t.panelView.focus(),n())}),t.keystrokes.set("arrowup",(e,n)=>{t.isOpen&&(t.panelView.focusLast(),n())})}(t)}(i),i}function Lf(t,e){const n=t.locale,o=t.listView=new Mf(n);o.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new Nf(n);if("button"===t||"switchbutton"===t){const o=new Df(n);let i;return(i="button"===t?new Wl(n):new Vf(n)).bind(...Object.keys(e)).to(e),i.delegate("execute").to(o),o.children.add(i),o}}),t.panelView.children.add(o),o.items.delegate("execute").to(t)}n(24);class zf extends Gl{init(){const t=this.editor,e=t.t,n=function(t){const e=t.t,n={Paragraph:e("bk"),"Heading 1":e("bl"),"Heading 2":e("bm"),"Heading 3":e("bn"),"Heading 4":e("bo"),"Heading 5":e("bp"),"Heading 6":e("bq")};return t.config.get("heading.options").map(t=>{const e=n[t.title];return e&&e!=t.title&&(t.title=e),t})}(t),o=e("bh"),i=e("bi");t.ui.componentFactory.add("heading",e=>{const r={},s=new si,a=t.commands.get("heading"),c=t.commands.get("paragraph"),l=[a];for(const t of n){const e={type:"button",model:new Tf({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(c,"value"),e.model.set("commandName","paragraph"),l.push(c)):(e.model.bind("isOn").to(a,"value",e=>e===t.model),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),r[t.model]=t.title}const d=Bf(e);return Lf(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:i}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(l,"isEnabled",(...t)=>t.some(t=>t)),d.buttonView.bind("label").to(a,"value",c,"value",(t,e)=>{const n=t||e&&"paragraph";return r[n]?r[n]:o}),this.listenTo(d,"execute",e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()}),d})}}class qf extends fr{constructor(t){super(t),this._observedElements=new Set}observe(t,e){this.document.getRoot(e).on("change:children",(e,n)=>{this.view.once("render",()=>this._updateObservedElements(t,n))})}_updateObservedElements(t,e){if(!e.is("element")||e.is("attributeElement"))return;const n=this.view.domConverter.mapViewToDom(e);if(n){for(const t of n.querySelectorAll("img"))this._observedElements.has(t)||(this.listenTo(t,"load",(t,e)=>this._fireEvents(e)),this._observedElements.add(t));for(const e of this._observedElements)t.contains(e)||(this.stopListening(e),this._observedElements.delete(e))}}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}destroy(){this._observedElements.clear(),super.destroy()}}function jf(t){return n=>{n.on(`attribute:${t}:image`,e)};function e(t,e,n){if(!n.consumable.consume(e.item,t.name))return;const o=n.writer,i=n.mapper.toViewElement(e.item).getChild(0);null!==e.attributeNewValue?o.setAttribute(e.attributeKey,e.attributeNewValue,i):o.removeAttribute(e.attributeKey,i)}}class Hf extends bu{refresh(){this.isEnabled=yu(this.editor.model)}execute(t){const e=this.editor.model;e.change(n=>{const o=Array.isArray(t.source)?t.source:[t.source];for(const t of o)vu(n,e,{src:t})})}}class Uf extends Gl{init(){const t=this.editor,e=t.model.schema,n=t.t,o=t.conversion;t.editing.view.addObserver(qf),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),o.for("dataDowncast").elementToElement({model:"image",view:(t,e)=>$f(e)}),o.for("editingDowncast").elementToElement({model:"image",view:(t,e)=>(function(t,e,n){return e.setCustomProperty("image",!0,t),od(t,e,{label:function(){const e=t.getChild(0).getAttribute("alt");return e?`${e} ${n}`:n}})})($f(e),e,n("an"))}),o.for("downcast").add(jf("src")).add(jf("alt")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,n){if(!n.consumable.consume(e.item,t.name))return;const o=n.writer,i=n.mapper.toViewElement(e.item).getChild(0);if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(o.removeAttribute("srcset",i),o.removeAttribute("sizes",i),t.width&&o.removeAttribute("width",i))}else{const t=e.attributeNewValue;t.data&&(o.setAttribute("srcset",t.data,i),o.setAttribute("sizes","100vw",i),t.width&&o.setAttribute("width",t.width,i))}}}()),o.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(t,e)=>e.createElement("image",{src:t.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}}).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,n){if(!n.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const o=Array.from(e.viewItem.getChildren()).find(t=>t.is("img"));if(!o||!o.hasAttribute("src")||!n.consumable.test(o,{name:!0}))return;const i=n.convertItem(o,e.modelCursor),r=lf(i.modelRange.getItems());r&&(n.convertChildren(e.viewItem,n.writer.createPositionAt(r,0)),e.modelRange=i.modelRange,e.modelCursor=i.modelCursor)}}()),t.commands.add("imageInsert",new Hf(t))}}function $f(t){const e=t.createEmptyElement("img"),n=t.createContainerElement("figure",{class:"image"});return t.insert(t.createPositionAt(n,0),e),n}class Wf extends bu{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=_u(t),_u(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,n=e.document.selection.getSelectedElement();e.change(e=>{e.setAttribute("alt",t.newValue,n)})}}class Gf extends Gl{init(){this.editor.commands.add("imageTextAlternative",new Wf(this.editor))}}n(106);class Kf extends Dl{constructor(t){super(t),this.set("text"),this.set("for");const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],for:e.to("for")},children:[{text:e.to("text")}]})}}n(108);class Jf extends Dl{constructor(t,e){super(t);const n=`ck-input-${Yn()}`,o=`ck-status-${Yn()}`;this.set("label"),this.set("value"),this.set("isReadOnly",!1),this.set("errorText",null),this.set("infoText",null),this.labelView=this._createLabelView(n),this.inputView=this._createInputView(e,n,o),this.statusView=this._createStatusView(o),this.bind("_statusText").to(this,"errorText",this,"infoText",(t,e)=>t||e);const i=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input",i.if("isReadOnly","ck-disabled")]},children:[this.labelView,this.inputView,this.statusView]})}_createLabelView(t){const e=new Kf(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createInputView(t,e,n){const o=new t(this.locale,n);return o.id=e,o.ariaDescribedById=n,o.bind("value").to(this),o.bind("isReadOnly").to(this),o.bind("hasError").to(this,"errorText",t=>!!t),o.on("input",()=>{this.errorText=null}),o}_createStatusView(t){const e=new Dl(this.locale),n=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input__status",n.if("errorText","ck-labeled-input__status_error"),n.if("_statusText","ck-hidden",t=>!t)],id:t,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),e}select(){this.inputView.select()}focus(){this.inputView.focus()}}n(110);class Zf extends Dl{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById");const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to("input")}})}render(){super.render();const t=t=>{this.element.value=t||0===t?t:""};t(this.value),this.on("change:value",(e,n,o)=>{t(o)})}select(){this.element.select()}focus(){this.element.focus()}}function Qf({view:t}){t.listenTo(t.element,"submit",(e,n)=>{n.preventDefault(),t.fire("submit")},{useCapture:!0})}var Yf=n(9),Xf=n.n(Yf),tp=n(10),ep=n.n(tp);n(112);class np extends Dl{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new sl,this.keystrokes=new Yc,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("ay"),Xf.a,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("az"),ep.a,"ck-button-cancel","cancel"),this._focusables=new pl,this._focusCycler=new Bl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),Qf({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}_createButton(t,e,n,o){const i=new Wl(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),o&&i.delegate("execute").to(this,o),i}_createLabeledInputView(){const t=this.locale.t,e=new Jf(this.locale,Zf);return e.label=t("bd"),e.inputView.placeholder=t("bd"),e}}var op=n(48),ip=n.n(op);function rp(t){const e=t.editing.view,n=Pd.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class sp extends Gl{static get requires(){return[Nd]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",n=>{const o=t.commands.get("imageTextAlternative"),i=new Wl(n);return i.set({label:e("at"),icon:ip.a,tooltip:!0}),i.bind("isEnabled").to(o,"isEnabled"),this.listenTo(i,"execute",()=>this._showForm()),i})}_createForm(){const t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new np(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.inputView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(t,e)=>{this._hideForm(!0),e()}),this.listenTo(t.ui,"update",()=>{ku(e.selection)?this._isVisible&&function(t){const e=t.plugins.get("ContextualBalloon");if(ku(t.editing.view.document.selection)){const n=rp(t);e.updatePosition(n)}}(t):this._hideForm(!0)}),Ff({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._isInBalloon||this._balloon.add({view:this._form,position:rp(t)}),n.value=n.inputView.element.value=e.value||"",this._form.labeledInput.select()}_hideForm(t){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class ap extends Gl{static get requires(){return[Gf,sp]}static get pluginName(){return"ImageTextAlternative"}}n(114);function cp(t){for(const e of t.getChildren())if(e&&e.is("caption"))return e;return null}function lp(t){const e=t.parent;return"figcaption"==t.name&&e&&"figure"==e.name&&e.hasClass("image")?{name:!0}:null}class dp extends Gl{init(){const t=this.editor,e=t.editing.view,n=t.model.schema,o=t.data,i=t.editing,r=t.t;n.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),t.model.document.registerPostFixer(t=>this._insertMissingModelCaptionElement(t)),t.conversion.for("upcast").elementToElement({view:lp,model:"caption"});o.downcastDispatcher.on("insert:caption",up(t=>t.createContainerElement("figcaption"),!1));const s=function(t,e){return n=>{const o=n.createEditableElement("figcaption");return n.setCustomProperty("imageCaption",!0,o),ll({view:t,element:o,text:e}),rd(o,n)}}(e,r("ao"));i.downcastDispatcher.on("insert:caption",up(s)),i.downcastDispatcher.on("insert",this._fixCaptionVisibility(t=>t.item),{priority:"high"}),i.downcastDispatcher.on("remove",this._fixCaptionVisibility(t=>t.position.parent),{priority:"high"}),e.document.registerPostFixer(t=>this._updateCaptionVisibility(t))}_updateCaptionVisibility(t){const e=this.editor.editing.mapper,n=this._lastSelectedCaption;let o;const i=this.editor.model.document.selection,r=i.getSelectedElement();if(r&&r.is("image")){const t=cp(r);o=e.toViewElement(t)}const s=hp(i.getFirstPosition().parent);if(s&&(o=e.toViewElement(s)),o)return n?n===o?pp(o,t):(fp(n,t),this._lastSelectedCaption=o,pp(o,t)):(this._lastSelectedCaption=o,pp(o,t));if(n){const e=fp(n,t);return this._lastSelectedCaption=null,e}return!1}_fixCaptionVisibility(t){return(e,n,o)=>{const i=hp(t(n)),r=this.editor.editing.mapper,s=o.writer;if(i){const t=r.toViewElement(i);t&&(i.childCount?s.removeClass("ck-hidden",t):s.addClass("ck-hidden",t))}}}_insertMissingModelCaptionElement(t){const e=this.editor.model,n=e.document.differ.getChanges(),o=[];for(const t of n)if("insert"==t.type&&"$text"!=t.name){const n=t.position.nodeAfter;if(n.is("image")&&!cp(n)&&o.push(n),!n.is("image")&&n.childCount)for(const t of e.createRangeIn(n).getItems())t.is("image")&&!cp(t)&&o.push(t)}for(const e of o)t.appendElement("caption",e);return!!o.length}}function up(t,e=!0){return(n,o,i)=>{const r=o.item;if((r.childCount||e)&&_u(r.parent)){if(!i.consumable.consume(o.item,"insert"))return;const e=i.mapper.toViewElement(o.range.start.parent),n=t(i.writer),s=i.writer;r.childCount||s.addClass("ck-hidden",n),function(t,e,n,o){const i=o.writer.createPositionAt(n,"end");o.writer.insert(i,t),o.mapper.bindElements(e,t)}(n,o.item,e,i)}}}function hp(t){const e=t.getAncestors({includeSelf:!0}).find(t=>"caption"==t.name);return e&&e.parent&&"image"==e.parent.name?e:null}function fp(t,e){return!t.childCount&&!t.hasClass("ck-hidden")&&(e.addClass("ck-hidden",t),!0)}function pp(t,e){return!!t.hasClass("ck-hidden")&&(e.removeClass("ck-hidden",t),!0)}n(116);class mp extends bu{constructor(t,e){super(t),this.defaultStyle=!1,this.styles=e.reduce((t,e)=>(t[e.name]=e,e.isDefault&&(this.defaultStyle=e.name),t),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=_u(t),t)if(t.hasAttribute("imageStyle")){const e=t.getAttribute("imageStyle");this.value=!!this.styles[e]&&e}else this.value=this.defaultStyle;else this.value=!1}execute(t){const e=t.value,n=this.editor.model,o=n.document.selection.getSelectedElement();n.change(t=>{this.styles[e].isDefault?t.removeAttribute("imageStyle",o):t.setAttribute("imageStyle",e,o)})}}function gp(t,e){for(const n of e)if(n.name===t)return n}var bp=n(19),wp=n.n(bp),kp=n(20),_p=n.n(kp),vp=n(21),yp=n.n(vp),xp=n(11),Cp=n.n(xp);const Ap={full:{name:"full",title:"Full size image",icon:wp.a,isDefault:!0},side:{name:"side",title:"Side image",icon:Cp.a,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:_p.a,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:yp.a,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:Cp.a,className:"image-style-align-right"}},Pp={full:wp.a,left:_p.a,right:Cp.a,center:yp.a};function Tp(t=[]){return t.map(Ep)}function Ep(t){if("string"==typeof t){const e=t;Ap[e]?t=Object.assign({},Ap[e]):(console.warn(Object(Jn.a)("image-style-not-found: There is no such image style of given name."),{name:e}),t={name:e})}else if(Ap[t.name]){const e=Ap[t.name],n=Object.assign({},t);for(const o in e)t.hasOwnProperty(o)||(n[o]=e[o]);t=n}return"string"==typeof t.icon&&Pp[t.icon]&&(t.icon=Pp[t.icon]),t}class Sp extends Gl{static get pluginName(){return"ImageStyleEditing"}init(){const t=this.editor,e=t.model.schema,n=t.data,o=t.editing;t.config.define("image.styles",["full","side"]);const i=Tp(t.config.get("image.styles"));e.extend("image",{allowAttributes:"imageStyle"});const r=function(t){return(e,n,o)=>{if(!o.consumable.consume(n.item,e.name))return;const i=gp(n.attributeNewValue,t),r=gp(n.attributeOldValue,t),s=o.mapper.toViewElement(n.item),a=o.writer;r&&a.removeClass(r.className,s),i&&a.addClass(i.className,s)}}(i);o.downcastDispatcher.on("attribute:imageStyle:image",r),n.downcastDispatcher.on("attribute:imageStyle:image",r),n.upcastDispatcher.on("element:figure",function(t){const e=t.filter(t=>!t.isDefault);return(t,n,o)=>{if(!n.modelRange)return;const i=n.viewItem,r=lf(n.modelRange.getItems());if(o.schema.checkAttribute(r,"imageStyle"))for(const t of e)o.consumable.consume(i,{classes:t.className})&&o.writer.setAttribute("imageStyle",t.name,r)}}(i),{priority:"low"}),t.commands.add("imageStyle",new mp(t,i))}}n(118);class Rp extends Gl{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size image":t("ag"),"Side image":t("ah"),"Left aligned image":t("ai"),"Centered image":t("aj"),"Right aligned image":t("ak")}}init(){const t=function(t,e){for(const n of t)e[n.title]&&(n.title=e[n.title]);return t}(Tp(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,n=`imageStyle:${t.name}`;e.ui.componentFactory.add(n,n=>{const o=e.commands.get("imageStyle"),i=new Wl(n);return i.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),i.bind("isEnabled").to(o,"isEnabled"),i.bind("isOn").to(o,"value",e=>e===t.name),this.listenTo(i,"execute",()=>e.execute("imageStyle",{value:t.name})),i})}}class Op extends Gl{static get requires(){return[Nd]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",e=>{(function(t){const e=t.getSelectedElement();return!(!e||!nd(e))})(t.editing.view.document.selection)&&e.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:n,getRelatedElement:o,balloonClassName:i="ck-toolbar-container"}){const r=this.editor,s=r.t,a=new ql(r.locale);if(a.ariaLabel=e||s("af"),this._toolbarDefinitions.has(t))throw new Jn.b("widget-toolbar-duplicated: Toolbar with the given id was already added.",this,{toolbarId:t});a.fillFromConfig(n,r.ui.componentFactory),this._toolbarDefinitions.set(t,{view:a,getRelatedElement:o,balloonClassName:i})}_updateToolbarsVisibility(){let t=0,e=null,n=null;for(const o of this._toolbarDefinitions.values()){const i=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.editor.ui.focusTracker.isFocused)if(i){const r=i.getAncestors().length;r>t&&(t=r,e=i,n=o)}else this._isToolbarInBalloon(o)&&this._hideToolbar(o);else this._isToolbarVisible(o)&&this._hideToolbar(o)}n&&this._showToolbar(n,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?Ip(this.editor,e):this._isToolbarInBalloon(t)||(this._balloon.add({view:t.view,position:Mp(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);Ip(this.editor,e)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function Ip(t,e){const n=t.plugins.get("ContextualBalloon"),o=Mp(t,e);n.updatePosition(o)}function Mp(t,e){const n=t.editing.view,o=Pd.defaultPositions;return{target:n.domConverter.mapViewToDom(e),positions:[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast]}}function Dp(t,e,n){return n.createRange(Np(t,e,!0,n),Np(t,e,!1,n))}function Np(t,e,n,o){let i=t.textNode||(n?t.nodeBefore:t.nodeAfter),r=null;for(;i&&i.getAttribute("linkHref")==e;)r=i,i=n?i.previousSibling:i.nextSibling;return r?o.createPositionAt(r,n?"before":"after"):t}class Vp extends bu{constructor(t){super(t),this.manualDecorators=new si}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute("linkHref");for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id);this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(t,e={}){const n=this.editor.model,o=n.document.selection,i=[],r=[];for(const t in e)e[t]?i.push(t):r.push(t);n.change(e=>{if(o.isCollapsed){const s=o.getFirstPosition();if(o.hasAttribute("linkHref")){const a=Dp(s,o.getAttribute("linkHref"),n);e.setAttribute("linkHref",t,a),i.forEach(t=>{e.setAttribute(t,!0,a)}),r.forEach(t=>{e.removeAttribute(t,a)}),e.setSelection(a)}else if(""!==t){const r=Ls(o.getAttributes());r.set("linkHref",t),i.forEach(t=>{r.set(t,!0)});const a=e.createText(t,r);n.insertContent(a,s),e.setSelection(e.createRangeOn(a))}}else{const s=n.schema.getValidRanges(o.getRanges(),"linkHref");for(const n of s)e.setAttribute("linkHref",t,n),i.forEach(t=>{e.setAttribute(t,!0,n)}),r.forEach(t=>{e.removeAttribute(t,n)})}})}_getDecoratorStateFromModel(t){return this.editor.model.document.selection.getAttribute(t)||!1}}class Fp extends bu{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute("linkHref")}execute(){const t=this.editor,e=this.editor.model,n=e.document.selection,o=t.commands.get("link");e.change(t=>{const i=n.isCollapsed?[Dp(n.getFirstPosition(),n.getAttribute("linkHref"),e)]:n.getRanges();for(const e of i)if(t.removeAttribute("linkHref",e),o)for(const n of o.manualDecorators)t.removeAttribute(n.id,e)})}}var Bp=function(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var r=Array(i);++o<i;)r[o]=t[o+e];return r};var Lp=function(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:Bp(t,e,n)},zp=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var qp=function(t){return zp.test(t)};var jp=function(t){return t.split("")},Hp="[\\ud800-\\udfff]",Up="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",$p="\\ud83c[\\udffb-\\udfff]",Wp="[^\\ud800-\\udfff]",Gp="(?:\\ud83c[\\udde6-\\uddff]){2}",Kp="[\\ud800-\\udbff][\\udc00-\\udfff]",Jp="(?:"+Up+"|"+$p+")"+"?",Zp="[\\ufe0e\\ufe0f]?"+Jp+("(?:\\u200d(?:"+[Wp,Gp,Kp].join("|")+")[\\ufe0e\\ufe0f]?"+Jp+")*"),Qp="(?:"+[Wp+Up+"?",Up,Gp,Kp,Hp].join("|")+")",Yp=RegExp($p+"(?="+$p+")|"+Qp+Zp,"g");var Xp=function(t){return t.match(Yp)||[]};var tm=function(t){return qp(t)?Xp(t):jp(t)};var em=function(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i},nm=1/0,om=i?i.prototype:void 0,im=om?om.toString:void 0;var rm=function t(e){if("string"==typeof e)return e;if(Wt(e))return em(e,t)+"";if(rs(e))return im?im.call(e):"";var n=e+"";return"0"==n&&1/e==-nm?"-0":n};var sm=function(t){return null==t?"":rm(t)};var am=function(t){return function(e){e=sm(e);var n=qp(e)?tm(e):void 0,o=n?n[0]:e.charAt(0),i=n?Lp(n,1).join(""):e.slice(1);return o[t]()+i}}("toUpperCase");const cm=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,lm=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function dm(t,e){const n=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,n),n}function um(t){return function(t){return t.replace(cm,"").match(lm)}(t=String(t))?t:"#"}class hm{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(t=>this._definitions.add(t)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(t,e,n)=>{if(!n.consumable.test(e.item,"attribute:linkHref"))return;const o=n.writer,i=o.document.selection;for(const t of this._definitions){const r=o.createAttributeElement("a",t.attributes,{priority:5});o.setCustomProperty("link",!0,r),t.callback(e.attributeNewValue)?e.item.is("selection")?o.wrap(i.getFirstRange(),r):o.wrap(n.mapper.toViewRange(e.range),r):o.unwrap(n.mapper.toViewRange(e.range),r)}},{priority:"high"})}}}class fm{constructor({id:t,label:e,attributes:n}){this.id=t,this.set("value"),this.label=e,this.attributes=n}}lo(fm,Ho);class pm{constructor(t,e,n){this.model=t,this.attribute=n,this._modelSelection=t.document.selection,this._overrideUid=null,this._isNextGravityRestorationSkipped=!1,e.listenTo(this._modelSelection,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&mm(this._modelSelection.getFirstPosition(),n)||this._restoreGravity())})}handleForwardMovement(t,e){const n=this.attribute;if(!(this._isGravityOverridden||t.isAtStart&&this._hasSelectionAttribute))return wm(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._removeSelectionAttribute(),!0):gm(t,n)?(this._preventCaretMovement(e),this._overrideGravity(),!0):bm(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._overrideGravity(),!0):void 0}handleBackwardMovement(t,e){const n=this.attribute;return this._isGravityOverridden?wm(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(e),this._restoreGravity(),t.isAtStart&&this._removeSelectionAttribute(),!0):wm(t,n)&&!this._hasSelectionAttribute?(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtEnd&&bm(t,n)?this._hasSelectionAttribute?void(km(t,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity())):(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtStart?this._hasSelectionAttribute?(this._removeSelectionAttribute(),this._preventCaretMovement(e),!0):void 0:void(km(t,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity()))}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}_preventCaretMovement(t){t.preventDefault()}_removeSelectionAttribute(){this.model.change(t=>{t.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(t){const e=this.attribute;this.model.change(n=>{n.setSelectionAttribute(this.attribute,t.nodeBefore.getAttribute(e))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=!0}}function mm(t,e){return gm(t,e)||bm(t,e)}function gm(t,e){const{nodeBefore:n,nodeAfter:o}=t,i=!!n&&n.hasAttribute(e);return!!o&&o.hasAttribute(e)&&(!i||n.getAttribute(e)!==o.getAttribute(e))}function bm(t,e){const{nodeBefore:n,nodeAfter:o}=t,i=!!n&&n.hasAttribute(e),r=!!o&&o.hasAttribute(e);return i&&(!r||n.getAttribute(e)!==o.getAttribute(e))}function wm(t,e){const{nodeBefore:n,nodeAfter:o}=t,i=!!n&&n.hasAttribute(e);if(!!o&&o.hasAttribute(e)&&i)return o.getAttribute(e)!==n.getAttribute(e)}function km(t,e){return mm(t.getShiftedBy(-1),e)}n(120);const _m="ck-link_selected",vm="automatic",ym="manual",xm=/^(https?:)?\/\//;class Cm extends Gl{constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor,e=t.locale;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:dm}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>dm(um(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new Vp(t)),t.commands.add("unlink",new Fp(t));const n=function(t,e){const n={"Open in a new tab":t("bb"),Downloadable:t("bc")};return e.forEach(t=>(t.label&&n[t.label]&&(t.label=n[t.label]),t)),e}(t.t,function(t){const e=[];if(t)for(const[n,o]of Object.entries(t)){const t=Object.assign({},o,{id:`link${am(n)}`});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(n.filter(t=>t.mode===vm)),this._enableManualDecorators(n.filter(t=>t.mode===ym)),function({view:t,model:e,emitter:n,attribute:o,locale:i}){const r=new pm(e,n,o),s=e.document.selection;n.listenTo(t.document,"keydown",(t,e)=>{if(!s.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const n=e.keyCode==wi.arrowright,o=e.keyCode==wi.arrowleft;if(!n&&!o)return;const a=s.getFirstPosition(),c=i.contentLanguageDirection;let l;(l="ltr"===c&&n||"rtl"===c&&o?r.handleForwardMovement(a,e):r.handleBackwardMovement(a,e))&&t.stop()},{priority:Xn.get("high")+1})}({view:t.editing.view,model:t.model,emitter:this,attribute:"linkHref",locale:e}),this._setupLinkHighlight()}_enableAutomaticDecorators(t){const e=this.editor,n=new hm;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:vm,callback:t=>xm.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(t),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;t.forEach(t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),n.add(new fm(t)),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,o)=>{if(e){const e=n.get(t.id).attributes,i=o.createAttributeElement("a",e,{priority:5});return o.setCustomProperty("link",!0,i),i}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:n.get(t.id).attributes},model:{key:t.id}})})}_setupLinkHighlight(){const t=this.editor,e=t.editing.view,n=new Set;e.document.registerPostFixer(e=>{const o=t.model.document.selection;let i=!1;if(o.hasAttribute("linkHref")){const r=Dp(o.getFirstPosition(),o.getAttribute("linkHref"),t.model),s=t.editing.mapper.toViewRange(r);for(const t of s.getItems())t.is("a")&&!t.hasClass(_m)&&(e.addClass(_m,t),n.add(t),i=!0)}return i}),t.conversion.for("editingDowncast").add(t=>{function o(){e.change(t=>{for(const e of n.values())t.removeClass(_m,e),n.delete(e)})}t.on("insert",o,{priority:"highest"}),t.on("remove",o,{priority:"highest"}),t.on("attribute",o,{priority:"highest"}),t.on("selection",o,{priority:"highest"})})}}class Am extends es{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}n(122);class Pm extends Dl{constructor(t,e=[]){super(t);const n=t.t;this.focusTracker=new sl,this.keystrokes=new Yc,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("ay"),Xf.a,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("az"),ep.a,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e),this._focusables=new pl,this._focusCycler=new Bl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form"];e.length&&o.push("ck-link-form_layout-vertical"),this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),Qf({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new Jf(this.locale,Zf);return e.label=t("ba"),e.inputView.placeholder="https://example.com",e}_createButton(t,e,n,o){const i=new Wl(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),o&&i.delegate("execute").to(this,o),i}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t){const t=new Vf(this.locale);t.set({name:n.id,label:n.label,withText:!0}),t.bind("isOn").to(n,"value"),t.on("execute",()=>{n.set("value",!t.isOn)}),e.add(t)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new Dl;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}var Tm=n(49),Em=n.n(Tm),Sm=n(50),Rm=n.n(Sm);n(124);class Om extends Dl{constructor(t){super(t);const e=t.t;this.focusTracker=new sl,this.keystrokes=new Yc,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("au"),Em.a,"unlink"),this.editButtonView=this._createButton(e("av"),Rm.a,"edit"),this.set("href"),this._focusables=new pl,this._focusCycler=new Bl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const o=new Wl(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.delegate("execute").to(this,n),o}_createPreviewButton(){const t=new Wl(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("aw")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&um(t)),target:"_blank"}}),t.bind("label").to(this,"href",t=>t||n("ax")),t.bind("isEnabled").to(this,"href",t=>!!t),t.template.tag="a",t.template.eventListeners={},t}}var Im=n(51),Mm=n.n(Im);const Dm="Ctrl+K";class Nm extends Gl{static get requires(){return[Nd]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(Am),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(Nd),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const t=this.editor,e=new Om(t.locale),n=t.commands.get("link"),o=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(t,e)=>{this._hideUI(),e()}),e.keystrokes.set(Dm,(t,e)=>{this._addFormView(),e()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),n=new Pm(t.locale,e.manualDecorators);return n.urlInputView.bind("value").to(e,"value"),n.urlInputView.bind("isReadOnly").to(e,"isEnabled",t=>!t),n.saveButtonView.bind("isEnabled").to(e),this.listenTo(n,"submit",()=>{t.execute("link",n.urlInputView.inputView.element.value,n.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(n,"cancel",()=>{this._closeFormView()}),n.keystrokes.set("Esc",(t,e)=>{this._closeFormView(),e()}),n}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.keystrokes.set(Dm,(t,n)=>{n(),e.isEnabled&&this._showUI(!0)}),t.ui.componentFactory.add("link",t=>{const o=new Wl(t);return o.isEnabled=!0,o.label=n("al"),o.icon=Mm.a,o.keystroke=Dm,o.tooltip=!0,o.isToggleable=!0,o.bind("isEnabled").to(e,"isEnabled"),o.bind("isOn").to(e,"value",t=>!!t),this.listenTo(o,"execute",()=>this._showUI(!0)),o})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),Ff({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const t=this.editor.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.select(),this.formView.urlInputView.inputView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus())}_showUI(t=!1){this.editor.commands.get("link").isEnabled&&(this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI())}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView)}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let n=this._getSelectedLinkElement(),o=r();const i=()=>{const t=this._getSelectedLinkElement(),e=r();n&&!t||!n&&e!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=t,o=e};function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",i),this.listenTo(this._balloon,"change:visibleView",i)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=t.document,n=this._getSelectedLinkElement();return{target:n?t.domConverter.mapViewToDom(n):t.domConverter.viewRangeToDom(e.selection.getFirstRange())}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection;if(e.isCollapsed)return Vm(e.getFirstPosition());{const n=e.getFirstRange().getTrimmed(),o=Vm(n.start),i=Vm(n.end);return o&&o==i&&t.createRangeIn(o).getTrimmed().isEqual(n)?o:null}}}function Vm(t){return t.getAncestors().find(t=>(function(t){return t.is("attributeElement")&&!!t.getCustomProperty("link")})(t))}class Fm extends bu{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document,n=Array.from(e.selection.getSelectedBlocks()).filter(e=>Lm(e,t.schema)),o=!0===this.value;t.change(t=>{if(o){let e=n[n.length-1].nextSibling,o=Number.POSITIVE_INFINITY,i=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t<o&&(o=t);const n=t-o;i.push({element:e,listIndent:n}),e=e.nextSibling}i=i.reverse();for(const e of i)t.setAttribute("listIndent",e.listIndent,e.element)}if(!o){let t=Number.POSITIVE_INFINITY;for(const e of n)e.is("listItem")&&e.getAttribute("listIndent")<t&&(t=e.getAttribute("listIndent"));Bm(n,!0,t=0===t?1:t),Bm(n,!1,t)}for(const e of n.reverse())o&&"listItem"==e.name?t.rename(e,"paragraph"):o||"listItem"==e.name?o||"listItem"!=e.name||e.getAttribute("listType")==this.type||t.setAttribute("listType",this.type,e):(t.setAttributes({listType:this.type,listIndent:0},e),t.rename(e,"listItem"))})}_getValue(){const t=lf(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=lf(t.getSelectedBlocks());return!!n&&Lm(n,e)}}function Bm(t,e,n){const o=e?t[0]:t[t.length-1];if(o.is("listItem")){let i=o[e?"previousSibling":"nextSibling"],r=o.getAttribute("listIndent");for(;i&&i.is("listItem")&&i.getAttribute("listIndent")>=n;)r>i.getAttribute("listIndent")&&(r=i.getAttribute("listIndent")),i.getAttribute("listIndent")==r&&t[e?"unshift":"push"](i),i=i[e?"previousSibling":"nextSibling"]}}function Lm(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class zm extends bu{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let n=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=n[n.length-1];let o=e.nextSibling;for(;o&&"listItem"==o.name&&o.getAttribute("listIndent")>e.getAttribute("listIndent");)n.push(o),o=o.nextSibling;this._indentBy<0&&(n=n.reverse());for(const e of n){const n=e.getAttribute("listIndent")+this._indentBy;n<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",n,e)}})}_checkEnabled(){const t=lf(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),n=t.getAttribute("listType");let o=t.previousSibling;for(;o&&o.is("listItem")&&o.getAttribute("listIndent")>=e;){if(o.getAttribute("listIndent")==e)return o.getAttribute("listType")==n;o=o.previousSibling}return!1}return!0}}function qm(t,e){const n=e.mapper,o=e.writer,i="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=Km,e}(o),s=o.createContainerElement(i,null);return o.insert(o.createPositionAt(s,0),r),n.bindElements(t,r),r}function jm(t,e,n,o){const i=e.parent,r=n.mapper,s=n.writer;let a=r.toViewPosition(o.createPositionBefore(t));const c=$m(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),l=t.previousSibling;if(c&&c.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(t))}else a=l&&"listItem"==l.name?r.toViewPosition(o.createPositionAt(l,"end")):r.toViewPosition(o.createPositionBefore(t));if(a=Um(a),s.insert(a,i),l&&"listItem"==l.name){const t=r.toViewElement(l),n=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of n)if(t.item.is("li")){const o=s.breakContainer(s.createPositionBefore(t.item)),i=t.item.parent,r=s.createPositionAt(e,"end");Hm(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(i),r),n.position=o}}else{const n=i.nextSibling;if(n&&(n.is("ul")||n.is("ol"))){let o=null;for(const e of n.getChildren()){const n=r.toModelElement(e);if(!(n&&n.getAttribute("listIndent")>t.getAttribute("listIndent")))break;o=e}o&&(s.breakContainer(s.createPositionAfter(o)),s.move(s.createRangeOn(o.parent),s.createPositionAt(e,"end")))}}Hm(s,i,i.nextSibling),Hm(s,i.previousSibling,i)}function Hm(t,e,n){return!e||!n||"ul"!=e.name&&"ol"!=e.name?null:e.name!=n.name||e.getAttribute("class")!==n.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function Um(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function $m(t,e){const n=!!e.sameIndent,o=!!e.smallerIndent,i=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(n&&i==t||o&&i>t)return r;r=r.previousSibling}return null}function Wm(t,e){for(const n of t.getItems()){const t=e(n);if(t)return t}}function Gm(t,e,n,o){t.ui.componentFactory.add(e,i=>{const r=t.commands.get(e),s=new Wl(i);return s.set({label:n,icon:o,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>t.execute(e)),s})}function Km(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:Ao.call(this)}function Jm(t){return(e,n,o)=>{const i=o.consumable;if(!i.test(n.item,"insert")||!i.test(n.item,"attribute:listType")||!i.test(n.item,"attribute:listIndent"))return;i.consume(n.item,"insert"),i.consume(n.item,"attribute:listType"),i.consume(n.item,"attribute:listIndent");const r=n.item;jm(r,qm(r,o),o,t)}}function Zm(t,e,n){if(!n.consumable.consume(e.item,"attribute:listType"))return;const o=n.mapper.toViewElement(e.item),i=n.writer;i.breakContainer(i.createPositionBefore(o)),i.breakContainer(i.createPositionAfter(o));const r=o.parent,s="numbered"==e.attributeNewValue?"ol":"ul";i.rename(s,r)}function Qm(t,e,n){const o=n.mapper.toViewElement(e.item).parent,i=n.writer;Hm(i,o,o.nextSibling),Hm(i,o.previousSibling,o);for(const t of e.item.getChildren())n.consumable.consume(t,"insert")}function Ym(t,e,n){if("listItem"!=e.item.name){let t=n.mapper.toViewPosition(e.range.start);const o=n.writer,i=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&"li"==(t=o.breakContainer(t)).parent.name;){const e=t,n=o.createPositionAt(t.parent,"end");if(!e.isEqual(n)){const t=o.remove(o.createRange(e,n));i.push(t)}t=o.createPositionAfter(t.parent)}if(i.length>0){for(let e=0;e<i.length;e++){const n=t.nodeBefore;if(t=o.insert(t,i[e]).end,e>0){const e=Hm(o,n,n.nextSibling);e&&e.parent==n&&t.offset--}}Hm(o,t.nodeBefore,t.nodeAfter)}}}function Xm(t,e,n){const o=n.mapper.toViewPosition(e.position),i=o.nodeBefore,r=o.nodeAfter;Hm(n.writer,i,r)}function tg(t,e,n){if(n.consumable.consume(e.viewItem,{name:!0})){const t=n.writer,o=this.conversionApi.store,i=t.createElement("listItem");o.indent=o.indent||0,t.setAttribute("listIndent",o.indent,i);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";t.setAttribute("listType",r,i),o.indent++;const s=n.splitToAllowedParent(i,e.modelCursor);if(!s)return;t.insert(i,s.position);const a=function(t,e,n){const{writer:o,schema:i}=n;let r=o.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)r=n.convertItem(s,r).modelCursor;else{const e=n.convertItem(s,o.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter,c=a&&a.is("element")&&!i.checkChild(t,a.name);c&&(t=e.modelCursor.parent.is("listItem")?e.modelCursor.parent:rg(e.modelCursor),r=o.createPositionAfter(t))}return r}(i,e.viewItem.getChildren(),n);o.indent--,e.modelRange=t.createRange(e.modelCursor,a),s.cursorParent?e.modelCursor=t.createPositionAt(s.cursorParent,0):e.modelCursor=e.modelRange.end}}function eg(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t)e.is("li")||e._remove()}}function ng(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let n=!1,o=!0;for(const e of t)!n||e.is("ul")||e.is("ol")||e._remove(),e.is("text")?(o&&(e._data=e.data.replace(/^\s+/,"")),(!e.nextSibling||e.nextSibling.is("ul")||e.nextSibling.is("ol"))&&(e._data=e.data.replace(/\s+$/,""))):(e.is("ul")||e.is("ol"))&&(n=!0),o=!1}}function og(t){return(e,n)=>{if(n.isPhantom)return;const o=n.modelPosition.nodeBefore;if(o&&o.is("listItem")){const e=n.mapper.toViewElement(o),i=e.getAncestors().find(t=>t.is("ul")||t.is("ol")),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("li")){n.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==i){n.viewPosition=t.nextPosition;break}}}}}function ig(t,[e,n]){let o,i=e.is("documentFragment")?e.getChild(0):e;if(o=n?this.createSelection(n):this.document.selection,i&&i.is("listItem")){const t=o.getFirstPosition();let e=null;if(t.parent.is("listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;i&&i.is("listItem");)i._setAttribute("listIndent",i.getAttribute("listIndent")+t),i=i.nextSibling}}}function rg(t){const e=new $s({startPosition:t});let n;do{n=e.next()}while(!n.value.item.is("listItem"));return n.value.item}function sg(t,e,n,o,i,r){const s=$m(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),a=i.mapper,c=i.writer,l=s?s.getAttribute("listIndent"):null;let d;if(s)if(l==t){const t=a.toViewElement(s).parent;d=c.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}else d=n;d=Um(d);for(const t of[...o.getChildren()])(t.is("ul")||t.is("ol"))&&(d=c.move(c.createRangeOn(t),d).end,Hm(c,t,t.nextSibling),Hm(c,t.previousSibling,t))}class ag extends Gl{static get requires(){return[_f]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,n=t.editing;t.model.document.registerPostFixer(e=>(function(t,e){const n=t.document.differ.getChanges(),o=new Map;let i=!1;for(const t of n)if("insert"==t.type&&"listItem"==t.name)r(t.position);else if("insert"==t.type&&"listItem"!=t.name){if("$text"!=t.name){const n=t.position.nodeAfter;n.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",n),i=!0),n.hasAttribute("listType")&&(e.removeAttribute("listType",n),i=!0)}r(t.position.getShiftedBy(t.length))}else"remove"==t.type&&"listItem"==t.name?r(t.position):"attribute"==t.type&&"listIndent"==t.attributeKey?r(t.range.start):"attribute"==t.type&&"listType"==t.attributeKey&&r(t.range.start);for(const t of o.values())s(t),a(t);return i;function r(t){const e=t.nodeBefore;if(e&&e.is("listItem")){let n=e;if(o.has(n))return;for(;n.previousSibling&&n.previousSibling.is("listItem");)if(n=n.previousSibling,o.has(n))return;o.set(t.nodeBefore,n)}else{const e=t.nodeAfter;e&&e.is("listItem")&&o.set(e,e)}}function s(t){let n=0,o=null;for(;t&&t.is("listItem");){const r=t.getAttribute("listIndent");if(r>n){let s;null===o?(o=r-n,s=n):(o>r&&(o=r),s=r-o),e.setAttribute("listIndent",s,t),i=!0}else o=null,n=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let n=[],o=null;for(;t&&t.is("listItem");){const r=t.getAttribute("listIndent");if(o&&o.getAttribute("listIndent")>r&&(n=n.slice(0,r+1)),0!=r)if(n[r]){const o=n[r];t.getAttribute("listType")!=o&&(e.setAttribute("listType",o,t),i=!0)}else n[r]=t.getAttribute("listType");o=t,t=t.nextSibling}}})(t.model,e)),n.mapper.registerViewToModelLength("li",cg),e.mapper.registerViewToModelLength("li",cg),n.mapper.on("modelToViewPosition",og(n.view)),n.mapper.on("viewToModelPosition",function(t){return(e,n)=>{const o=n.viewPosition,i=o.parent,r=n.mapper;if("ul"==i.name||"ol"==i.name){if(o.isAtEnd){const e=r.toModelElement(o.nodeBefore),i=r.getModelLength(o.nodeBefore);n.modelPosition=t.createPositionBefore(e).getShiftedBy(i)}else{const e=r.toModelElement(o.nodeAfter);n.modelPosition=t.createPositionBefore(e)}e.stop()}else if("li"==i.name&&o.nodeBefore&&("ul"==o.nodeBefore.name||"ol"==o.nodeBefore.name)){const s=r.toModelElement(i);let a=1,c=o.nodeBefore;for(;c&&(c.is("ul")||c.is("ol"));)a+=r.getModelLength(c),c=c.previousSibling;n.modelPosition=t.createPositionBefore(s).getShiftedBy(a),e.stop()}}}(t.model)),e.mapper.on("modelToViewPosition",og(n.view)),n.downcastDispatcher.on("insert",Ym,{priority:"high"}),n.downcastDispatcher.on("insert:listItem",Jm(t.model)),e.downcastDispatcher.on("insert",Ym,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",Jm(t.model)),n.downcastDispatcher.on("attribute:listType:listItem",Zm,{priority:"high"}),n.downcastDispatcher.on("attribute:listType:listItem",Qm,{priority:"low"}),n.downcastDispatcher.on("attribute:listIndent:listItem",function(t){return(e,n,o)=>{if(!o.consumable.consume(n.item,"attribute:listIndent"))return;const i=o.mapper.toViewElement(n.item),r=o.writer;r.breakContainer(r.createPositionBefore(i)),r.breakContainer(r.createPositionAfter(i));const s=i.parent,a=s.previousSibling,c=r.createRangeOn(s);r.remove(c),a&&a.nextSibling&&Hm(r,a,a.nextSibling),sg(n.attributeOldValue+1,n.range.start,c.start,i,o,t),jm(n.item,i,o,t);for(const t of n.item.getChildren())o.consumable.consume(t,"insert")}}(t.model)),n.downcastDispatcher.on("remove:listItem",function(t){return(e,n,o)=>{const i=o.mapper.toViewPosition(n.position).getLastMatchingPosition(t=>!t.item.is("li")).nodeAfter,r=o.writer;r.breakContainer(r.createPositionBefore(i)),r.breakContainer(r.createPositionAfter(i));const s=i.parent,a=s.previousSibling,c=r.createRangeOn(s),l=r.remove(c);a&&a.nextSibling&&Hm(r,a,a.nextSibling),sg(o.mapper.toModelElement(i).getAttribute("listIndent")+1,n.position,c.start,i,o,t);for(const t of r.createRangeIn(l).getItems())o.mapper.unbindViewElement(t);e.stop()}}(t.model)),n.downcastDispatcher.on("remove",Xm,{priority:"low"}),e.upcastDispatcher.on("element:ul",eg,{priority:"high"}),e.upcastDispatcher.on("element:ol",eg,{priority:"high"}),e.upcastDispatcher.on("element:li",ng,{priority:"high"}),e.upcastDispatcher.on("element:li",tg),t.model.on("insertContent",ig,{priority:"high"}),t.commands.add("numberedList",new Fm(t,"numbered")),t.commands.add("bulletedList",new Fm(t,"bulleted")),t.commands.add("indentList",new zm(t,"forward")),t.commands.add("outdentList",new zm(t,"backward"));const o=n.view.document;this.listenTo(o,"enter",(t,e)=>{const n=this.editor.model.document,o=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==o.name&&o.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),this.listenTo(o,"delete",(t,e)=>{if("backward"!==e.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const o=n.getFirstPosition();if(!o.isAtStart)return;const i=o.parent;"listItem"===i.name&&(i.previousSibling&&"listItem"===i.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop()))},{priority:"high"});const i=t=>(e,n)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),n())};t.keystrokes.set("Tab",i("indentList")),t.keystrokes.set("Shift+Tab",i("outdentList"))}afterInit(){const t=this.editor.commands,e=t.get("indent"),n=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),n&&n.registerChildCommand(t.get("outdentList"))}}function cg(t){let e=1;for(const n of t.getChildren())if("ul"==n.name||"ol"==n.name)for(const t of n.getChildren())e+=cg(t);return e}var lg=n(52),dg=n.n(lg),ug=n(53),hg=n.n(ug);class fg extends Gl{init(){const t=this.editor.t;Gm(this.editor,"numberedList",t("ad"),dg.a),Gm(this.editor,"bulletedList",t("ae"),hg.a)}}var pg=n(54),mg=n.n(pg);var gg=n(55),bg=n.n(gg);const wg=Symbol("isOPCodeBlock");function kg(t){return!!t.getCustomProperty(wg)&&nd(t)}function _g(t){const e=t.getSelectedElement();return!(!e||!kg(e))}function vg(t,e,n){const o=e.createContainerElement("div",{class:"op-ckeditor--code-block",title:window.I18n.t("js.editor.macro.toolbar_help")});return yg(e,t,o),function(t,e,n){return e.setCustomProperty(wg,!0,t),od(t,e,{label:n})}(o,e,n)}function yg(t,e,n){const o=(e.getAttribute("opCodeblockLanguage")||"language-text").replace(/^language-/,""),i=t.createContainerElement("div",{class:"op-ckeditor--code-block-language"});xg(t,o,i,"text"),t.insert(t.createPositionAt(n,0),i),xg(t,e.getAttribute("opCodeblockContent"),n,"(empty)")}function xg(t,e,n,o){const i=t.createText(e||o);t.insert(t.createPositionAt(n,0),i)}class Cg extends es{constructor(t){super(t),this.domEventType="dblclick"}onDomEvent(t){this.fire(t.type,t)}}class Ag extends Gl{static get pluginName(){return"CodeBlockEditing"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,o=t.editing.view,i=o.document,r=hd(t);e.register("codeblock",{isObject:!0,isBlock:!0,allowContentOf:"$block",allowWhere:["$root","$block"],allowIn:["$root"],allowAttributes:["opCodeblockLanguage","opCodeblockContent"]}),n.for("upcast").add(function(){return e=>{e.on("element:pre",t,{priority:"high"})};function t(t,e,n){if(!n.consumable.test(e.viewItem,{name:!0}))return;const o=Array.from(e.viewItem.getChildren()).find(t=>t.is("code"));if(!o||!n.consumable.consume(o,{name:!0}))return;const i=n.writer.createElement("codeblock");n.writer.setAttribute("opCodeblockLanguage",o.getAttribute("class"),i);const r=n.splitToAllowedParent(i,e.modelCursor);if(r){n.writer.insert(i,r.position);const t=o.getChild(0);n.consumable.consume(t,{name:!0});const s=t.data.replace(/\n$/,"");n.writer.setAttribute("opCodeblockContent",s,i),e.modelRange=new Js(n.writer.createPositionBefore(i),n.writer.createPositionAfter(i)),e.modelCursor=e.modelRange.end}}}()),n.for("editingDowncast").elementToElement({model:"codeblock",view:(t,e)=>vg(t,e,"Code block")}).add(function(){return e=>{e.on("attribute:opCodeblockContent",t),e.on("attribute:opCodeblockLanguage",t)};function t(t,e,n){const o=e.item;n.consumable.consume(e.item,t.name);const i=n.mapper.toViewElement(o);n.writer.remove(n.writer.createRangeOn(i.getChild(1))),n.writer.remove(n.writer.createRangeOn(i.getChild(0))),yg(n.writer,o,i)}}()),n.for("dataDowncast").add(function(){return e=>{e.on("insert:codeblock",t,{priority:"high"})};function t(t,e,n){const o=e.item,i=o.getAttribute("opCodeblockLanguage")||"language-text",r=o.getAttribute("opCodeblockContent");n.consumable.consume(o,"insert");const s=n.writer,a=s.createContainerElement("pre"),c=s.createContainerElement("div",{class:"op-ckeditor--code-block-language"}),l=s.createContainerElement("code",{class:i}),d=s.createText(i),u=s.createText(r);s.insert(s.createPositionAt(l,0),u),s.insert(s.createPositionAt(c,0),d),s.insert(s.createPositionAt(a,0),c),s.insert(s.createPositionAt(a,0),l),n.mapper.bindElements(o,l),n.mapper.bindElements(o,a);const h=n.mapper.toViewPosition(e.range.start);s.insert(h,a),t.stop()}}()),o.addObserver(Cg),this.listenTo(i,"dblclick",(e,n)=>{let o=n.target,i=n.domEvent;if(i.shiftKey||i.altKey||i.metaKey)return;if(!kg(o)&&!(o=o.findAncestor(kg)))return;n.preventDefault(),n.stopPropagation();const s=t.editing.mapper.toModelElement(o),a=r.services.macros,c=s.getAttribute("opCodeblockLanguage"),l=s.getAttribute("opCodeblockContent");a.editCodeBlock(l,c).then(e=>t.model.change(t=>{t.setAttribute("opCodeblockLanguage",e.languageClass,s),t.setAttribute("opCodeblockContent",e.content,s)}))}),t.ui.componentFactory.add("insertCodeBlock",e=>{const n=new Wl(e);return n.set({label:window.I18n.t("js.editor.macro.code_block.button"),icon:bg.a,tooltip:!0}),n.on("execute",()=>{r.services.macros.editCodeBlock().then(e=>t.model.change(n=>{const o=n.createElement("codeblock");n.setAttribute("opCodeblockLanguage",e.languageClass,o),n.setAttribute("opCodeblockContent",e.content,o),t.model.insertContent(o,t.model.document.selection)}))}),n})}}class Pg extends Gl{static get requires(){return[Nd]}static get pluginName(){return"CodeBlockToolbar"}init(){const t=this.editor,e=this.editor.model,n=hd(t);zd(t,"opEditCodeBlock",t=>{const o=n.services.macros,i=t.getAttribute("opCodeblockLanguage"),r=t.getAttribute("opCodeblockContent");o.editCodeBlock(r,i).then(n=>e.change(e=>{e.setAttribute("opCodeblockLanguage",n.languageClass,t),e.setAttribute("opCodeblockContent",n.content,t)}))})}afterInit(){jd(this,this.editor,"OPCodeBlock",_g)}}var Tg=n(56),Eg=n.n(Tg);function Sg(t){return t.__currentlyDisabled=t.__currentlyDisabled||[],t.ui.view.toolbar?t.ui.view.toolbar.items._items:[]}function Rg(t,e){jQuery.each(Sg(t),function(n,o){let i=o;o instanceof tu?i=o.buttonView:o!==e&&o.hasOwnProperty("isEnabled")||(i=null),i&&(i.isEnabled?i.isEnabled=!1:t.__currentlyDisabled.push(i))})}function Og(t){jQuery.each(Sg(t),function(e,n){let o=n;n instanceof tu&&(o=n.buttonView),t.__currentlyDisabled.indexOf(o)<0&&(o.isEnabled=!0)}),t.__currentlyDisabled=[]}function Ig(t,e){let n=e.parent;for(;n;){if(n.name===t)return n;n=n.parent}}function Mg(t,e,n,o,i=1){e>i?o.setAttribute(t,e,n):o.removeAttribute(t,n)}function Dg(t,e,n={}){const o=t.createElement("tableCell",n);t.insertElement("paragraph",o),t.insert(o,e)}function Ng(){return t=>{t.on("element:table",(t,e,n)=>{const o=e.viewItem;if(!n.consumable.test(o,{name:!0}))return;const{rows:i,headingRows:r,headingColumns:s}=function(t){const e={headingRows:0,headingColumns:0},n=[],o=[];let i;for(const r of Array.from(t.getChildren()))if("tbody"===r.name||"thead"===r.name||"tfoot"===r.name){"thead"!==r.name||i||(i=r);const t=Array.from(r.getChildren()).filter(t=>t.is("element","tr"));for(const r of t)if("thead"===r.parent.name&&r.parent===i)e.headingRows++,n.push(r);else{o.push(r);const t=Fg(r);t>e.headingColumns&&(e.headingColumns=t)}}return e.rows=[...n,...o],e}(o),a={};s&&(a.headingColumns=s),r&&(a.headingRows=r);const c=n.writer.createElement("table",a),l=n.splitToAllowedParent(c,e.modelCursor);if(l){if(n.writer.insert(c,l.position),n.consumable.consume(o,{name:!0}),i.length)i.forEach(t=>n.convertItem(t,n.writer.createPositionAt(c,"end")));else{const t=n.writer.createElement("tableRow");n.writer.insert(t,n.writer.createPositionAt(c,"end")),Dg(n.writer,n.writer.createPositionAt(t,"end"))}e.modelRange=n.writer.createRange(n.writer.createPositionBefore(c),n.writer.createPositionAfter(c)),l.cursorParent?e.modelCursor=n.writer.createPositionAt(l.cursorParent,0):e.modelCursor=e.modelRange.end}})}}function Vg(t){return e=>{e.on(`element:${t}`,(t,e,n)=>{const o=e.viewItem;if(!n.consumable.test(o,{name:!0}))return;const i=n.writer.createElement("tableCell"),r=n.splitToAllowedParent(i,e.modelCursor);if(!r)return;n.writer.insert(i,r.position),n.consumable.consume(o,{name:!0});const s=n.writer.createPositionAt(i,0);n.convertChildren(o,s),i.childCount||n.writer.insertElement("paragraph",s),e.modelRange=n.writer.createRange(n.writer.createPositionBefore(i),n.writer.createPositionAfter(i)),e.modelCursor=e.modelRange.end})}}function Fg(t){let e=0,n=0;const o=Array.from(t.getChildren()).filter(t=>"th"===t.name||"td"===t.name);for(;n<o.length&&"th"===o[n].name;){const t=o[n];e+=parseInt(t.getAttribute("colspan")||1),n++}return e}class Bg{constructor(t,e={}){this.table=t,this.startRow=e.startRow||0,this.endRow="number"==typeof e.endRow?e.endRow:void 0,this.includeSpanned=!!e.includeSpanned,this.column="number"==typeof e.column?e.column:void 0,this._skipRows=new Set,this._row=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const t=this.table.getChild(this._row);if(!t||this._isOverEndRow())return{done:!0};let e,n,o;if(this._isSpanned(this._row,this._column))e=this._getSpanned(this._row,this._column),n=!this.includeSpanned||this._shouldSkipRow()||this._shouldSkipColumn(),o=this._formatOutValue(e,this._column,!0);else{if(!(e=t.getChild(this._cellIndex)))return this._row++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next();const i=parseInt(e.getAttribute("colspan")||1),r=parseInt(e.getAttribute("rowspan")||1);(i>1||r>1)&&this._recordSpans(this._row,this._column,r,i,e),this._nextCellAtColumn=this._column+i,n=this._shouldSkipRow()||this._shouldSkipColumn(),o=this._formatOutValue(e,this._column,!1,r,i)}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,n?this.next():o}skipRow(t){this._skipRows.add(t)}_isOverEndRow(){return void 0!==this.endRow&&this._row>this.endRow}_formatOutValue(t,e,n,o=1,i=1){return{done:!1,value:{cell:t,row:this._row,column:e,isSpanned:n,rowspan:o,colspan:i,cellIndex:this._cellIndex}}}_shouldSkipRow(){const t=this._row<this.startRow,e=this._skipRows.has(this._row);return t||e}_shouldSkipColumn(){return void 0!==this.column&&this.column!=this._column}_isSpanned(t,e){if(!this._spannedCells.has(t))return!1;return this._spannedCells.get(t).has(e)}_getSpanned(t,e){return this._spannedCells.get(t).get(e)}_recordSpans(t,e,n,o,i){for(let n=e+1;n<=e+o-1;n++)this._markSpannedCell(t,n,i);for(let r=t+1;r<t+n;r++)for(let t=e;t<=e+o-1;t++)this._markSpannedCell(r,t,i)}_markSpannedCell(t,e,n){this._spannedCells.has(t)||this._spannedCells.set(t,new Map),this._spannedCells.get(t).set(e,n)}}function Lg(t){return!!t.getCustomProperty("table")&&nd(t)}function zg(t){const e=t.getSelectedElement();return e&&Lg(e)?e:null}function qg(t){const e=Ig("table",t.getFirstPosition());return e&&Lg(e.parent)?e.parent:null}function jg(t={}){return e=>e.on("insert:table",(e,n,o)=>{const i=n.item;if(!o.consumable.consume(i,"insert"))return;o.consumable.consume(i,"attribute:headingRows:table"),o.consumable.consume(i,"attribute:headingColumns:table");const r=t&&t.asWidget,s=o.writer.createContainerElement("figure",{class:"table"}),a=o.writer.createContainerElement("table");let c;o.writer.insert(o.writer.createPositionAt(s,0),a),r&&(c=function(t,e){return e.setCustomProperty("table",!0,t),od(t,e,{hasSelectionHandler:!0})}(s,o.writer));const l=new Bg(i),d={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0},u=new Map;for(const e of l){const{row:n,cell:r}=e,s=Xg(Yg(n,d),a,o),c=i.getChild(n),l=u.get(n)||Zg(c,n,s,o);u.set(n,l),o.consumable.consume(r,"insert"),Jg(e,d,o.writer.createPositionAt(l,"end"),o,t)}const h=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(i,r?c:s),o.writer.insert(h,r?c:s)})}function Hg(t={}){return e=>e.on("insert:tableRow",(e,n,o)=>{const i=n.item;if(!o.consumable.consume(i,"insert"))return;const r=i.parent,s=ob(o.mapper.toViewElement(r)),a=r.getChildIndex(i),c=new Bg(r,{startRow:a,endRow:a}),l={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0},d=new Map;for(const e of c){const n=Xg(Yg(a,l),s,o),r=d.get(a)||Zg(i,a,n,o);d.set(a,r),o.consumable.consume(e.cell,"insert"),Jg(e,l,o.writer.createPositionAt(r,"end"),o,t)}})}function Ug(t={}){return e=>e.on("insert:tableCell",(e,n,o)=>{const i=n.item;if(!o.consumable.consume(i,"insert"))return;const r=i.parent,s=r.parent,a=s.getChildIndex(r),c=new Bg(s,{startRow:a,endRow:a}),l={headingRows:s.getAttribute("headingRows")||0,headingColumns:s.getAttribute("headingColumns")||0};for(const e of c)if(e.cell===i){const n=o.mapper.toViewElement(r);return void Jg(e,l,o.writer.createPositionAt(n,r.getChildIndex(i)),o,t)}})}function $g(t={}){const e=!!t.asWidget;return t=>t.on("attribute:headingRows:table",(t,n,o)=>{const i=n.item;if(!o.consumable.consume(n.item,t.name))return;const r=ob(o.mapper.toViewElement(i)),s=n.attributeOldValue,a=n.attributeNewValue;if(a>s){const t=Array.from(i.getChildren()).filter(({index:t})=>c(t,s-1,a));nb(t,Xg("thead",r,o),o,"end");for(const n of t)for(const t of n.getChildren())Gg(t,"th",o,e);eb("tbody",r,o)}else{nb(Array.from(i.getChildren()).filter(({index:t})=>c(t,a-1,s)).reverse(),Xg("tbody",r,o),o,0);const t=new Bg(i,{startRow:a?a-1:a,endRow:s-1}),n={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0};for(const i of t)Kg(i,n,o,e);eb("thead",r,o)}function c(t,e,n){return t>e&&t<n}})}function Wg(t={}){const e=!!t.asWidget;return t=>t.on("attribute:headingColumns:table",(t,n,o)=>{const i=n.item;if(!o.consumable.consume(n.item,t.name))return;const r={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0},s=n.attributeOldValue,a=n.attributeNewValue,c=(s>a?s:a)-1;for(const t of new Bg(i))t.column>c||Kg(t,r,o,e)})}function Gg(t,e,n,o){const i=n.writer,r=n.mapper.toViewElement(t);if(!r)return;let s;if(o){s=rd(i.createEditableElement(e,r.getAttributes()),i),i.insert(i.createPositionAfter(r),s),i.move(i.createRangeIn(r),i.createPositionAt(s,0)),i.remove(i.createRangeOn(r))}else s=i.rename(e,r);n.mapper.unbindViewElement(r),n.mapper.bindElements(t,s)}function Kg(t,e,n,o){const{cell:i}=t,r=Qg(t,e),s=n.mapper.toViewElement(i);s&&s.name!==r&&Gg(i,r,n,o)}function Jg(t,e,n,o,i){const r=i&&i.asWidget,s=Qg(t,e),a=r?rd(o.writer.createEditableElement(s),o.writer):o.writer.createContainerElement(s),c=t.cell,l=c.getChild(0),d=1===c.childCount&&"paragraph"===l.name;if(o.writer.insert(n,a),d&&!function(t){return!![...t.getAttributeKeys()].length}(l)){const t=c.getChild(0),e=o.writer.createPositionAt(a,"end");if(o.consumable.consume(t,"insert"),i.asWidget){const n=o.writer.createContainerElement("span");o.mapper.bindElements(t,n),o.writer.insert(e,n),o.mapper.bindElements(c,a)}else o.mapper.bindElements(c,a),o.mapper.bindElements(t,a)}else o.mapper.bindElements(c,a)}function Zg(t,e,n,o){o.consumable.consume(t,"insert");const i=o.writer.createContainerElement("tr");o.mapper.bindElements(t,i);const r=t.parent.getAttribute("headingRows")||0,s=r>0&&e>=r?e-r:e,a=o.writer.createPositionAt(n,s);return o.writer.insert(a,i),i}function Qg(t,e){const{row:n,column:o}=t,{headingColumns:i,headingRows:r}=e;return r&&r>n?"th":i&&i>o?"th":"td"}function Yg(t,e){return t<e.headingRows?"thead":"tbody"}function Xg(t,e,n){const o=tb(t,e);return o||function(t,e,n){const o=n.writer.createContainerElement(t),i=n.writer.createPositionAt(e,"tbody"==t?"end":0);return n.writer.insert(i,o),o}(t,e,n)}function tb(t,e){for(const n of e.getChildren())if(n.name==t)return n}function eb(t,e,n){const o=tb(t,e);o&&0===o.childCount&&n.writer.remove(n.writer.createRangeOn(o))}function nb(t,e,n,o){for(const i of t){const t=n.mapper.toViewElement(i);t&&n.writer.move(n.writer.createRangeOn(t),n.writer.createPositionAt(e,o))}}function ob(t){for(const e of t.getChildren())if("table"===e.name)return e}class ib extends bu{refresh(){const t=this.editor.model,e=t.document.selection,n=t.schema,o=function(t){const e=t.parent;return e===e.root?e:e.parent}(e.getFirstPosition());this.isEnabled=n.checkChild(o,"table")}execute(t={}){const e=this.editor.model,n=e.document.selection,o=this.editor.plugins.get("TableUtils"),i=parseInt(t.rows)||2,r=parseInt(t.columns)||2,s=sd(n,e);e.change(t=>{const n=o.createTable(t,i,r);e.insertContent(n,s),t.setSelection(t.createPositionAt(n.getNodeByPath([0,0,0]),0))})}}class rb extends bu{constructor(t,e={}){super(t),this.order=e.order||"below"}refresh(){const t=Ig("table",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t}execute(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("TableUtils"),o=Ig("tableCell",e.getFirstPosition()).parent,i=o.parent,r=i.getChildIndex(o),s="below"===this.order?r+1:r;n.insertRows(i,{rows:1,at:s})}}class sb extends bu{constructor(t,e={}){super(t),this.order=e.order||"right"}refresh(){const t=Ig("table",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t}execute(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("TableUtils"),o=Ig("tableCell",e.getFirstPosition()),i=o.parent.parent,{column:r}=n.getCellLocation(o),s="right"===this.order?r+1:r;n.insertColumns(i,{columns:1,at:s})}}class ab extends bu{constructor(t,e={}){super(t),this.direction=e.direction||"horizontally"}refresh(){const t=Ig("tableCell",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t}execute(){const t=Ig("tableCell",this.editor.model.document.selection.getFirstPosition()),e="horizontally"===this.direction,n=this.editor.plugins.get("TableUtils");e?n.splitCellHorizontally(t,2):n.splitCellVertically(t,2)}}class cb extends bu{constructor(t,e){super(t),this.direction=e.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const t=this._getMergeableCell();this.isEnabled=!!t,this.value=t}execute(){const t=this.editor.model,e=Ig("tableCell",t.document.selection.getFirstPosition()),n=this.value,o=this.direction;t.change(t=>{const i="right"==o||"down"==o,r=i?e:n,s=i?n:e,a=s.parent;!function(t,e,n){lb(t)||(lb(e)&&n.remove(n.createRangeIn(e)),n.move(n.createRangeIn(t),n.createPositionAt(e,"end")));n.remove(t)}(s,r,t);const c=this.isHorizontal?"colspan":"rowspan",l=parseInt(e.getAttribute(c)||1),d=parseInt(n.getAttribute(c)||1);t.setAttribute(c,l+d,r),t.setSelection(t.createRangeIn(r)),a.childCount||function(t,e){const n=t.parent,o=n.getChildIndex(t);for(const{cell:t,row:i,rowspan:r}of new Bg(n,{endRow:o})){const n=i+r-1>=o;n&&Mg("rowspan",r-1,t,e)}e.remove(t)}(a,t)})}_getMergeableCell(){const t=Ig("tableCell",this.editor.model.document.selection.getFirstPosition());if(!t)return;const e=this.editor.plugins.get("TableUtils"),n=this.isHorizontal?function(t,e,n){const o="right"==e?t.nextSibling:t.previousSibling;if(!o)return;const i="right"==e?t:o,r="right"==e?o:t,{column:s}=n.getCellLocation(i),{column:a}=n.getCellLocation(r),c=parseInt(i.getAttribute("colspan")||1);return s+c===a?o:void 0}(t,this.direction,e):function(t,e){const n=t.parent,o=n.parent,i=o.getChildIndex(n);if("down"==e&&i===o.childCount-1||"up"==e&&0===i)return;const r=parseInt(t.getAttribute("rowspan")||1),s=o.getAttribute("headingRows")||0;if(s&&("down"==e&&i+r===s||"up"==e&&i===s))return;const a=parseInt(t.getAttribute("rowspan")||1),c="down"==e?i+a:i,l=[...new Bg(o,{endRow:c})],d=l.find(e=>e.cell===t).column,u=l.find(({row:t,rowspan:n,column:o})=>o===d&&("down"==e?t===c:c===t+n));return u&&u.cell}(t,this.direction);if(!n)return;const o=this.isHorizontal?"rowspan":"colspan",i=parseInt(t.getAttribute(o)||1);return parseInt(n.getAttribute(o)||1)===i?n:void 0}}function lb(t){return 1==t.childCount&&t.getChild(0).is("paragraph")&&t.getChild(0).isEmpty}class db extends bu{refresh(){const t=Ig("tableCell",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t&&t.parent.parent.childCount>1}execute(){const t=this.editor.model,e=Ig("tableCell",t.document.selection.getFirstPosition()).parent,n=e.parent,o=n.getChildIndex(e),i=n.getAttribute("headingRows")||0;t.change(t=>{i&&o<=i&&Mg("headingRows",i-1,n,t,0);const r=[...new Bg(n,{endRow:o})],s=new Map;r.filter(({row:t,rowspan:e})=>t===o&&e>1).forEach(({column:t,cell:e,rowspan:n})=>s.set(t,{cell:e,rowspanToSet:n-1})),r.filter(({row:t,rowspan:e})=>t<=o-1&&t+e>o).forEach(({cell:e,rowspan:n})=>Mg("rowspan",n-1,e,t));const a=o+1,c=new Bg(n,{includeSpanned:!0,startRow:a,endRow:a});let l;for(const{row:e,column:o,cell:i}of[...c])if(s.has(o)){const{cell:i,rowspanToSet:r}=s.get(o),a=l?t.createPositionAfter(l):t.createPositionAt(n.getChild(e),0);t.move(t.createRangeOn(i),a),Mg("rowspan",r,i,t),l=i}else l=i;t.remove(e)})}}class ub extends bu{refresh(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("TableUtils"),o=Ig("tableCell",e.getFirstPosition());this.isEnabled=!!o&&n.getColumns(o.parent.parent)>1}execute(){const t=this.editor.model,e=Ig("tableCell",t.document.selection.getFirstPosition()),n=e.parent,o=n.parent,i=o.getAttribute("headingColumns")||0,r=o.getChildIndex(n),s=[...new Bg(o)],a=s.find(t=>t.cell===e).column;t.change(t=>{i&&r<=i&&t.setAttribute("headingColumns",i-1,o);for(const{cell:e,column:n,colspan:o}of s)n<=a&&o>1&&n+o>a?Mg("colspan",o-1,e,t):n===a&&t.remove(e)})}}class hb extends bu{refresh(){const t=Ig("tableCell",this.editor.model.document.selection.getFirstPosition()),e=!!t;this.isEnabled=e,this.value=e&&this._isInHeading(t,t.parent.parent)}execute(t={}){const e=this.editor.model,n=Ig("tableCell",e.document.selection.getFirstPosition()).parent,o=n.parent,i=o.getAttribute("headingRows")||0,r=n.index;if(t.forceValue===this.value)return;const s=this.value?r:r+1;e.change(t=>{if(s){const e=function(t,e,n){const o=[],i=new Bg(t,{startRow:e>n?n:0,endRow:e-1});for(const{row:t,rowspan:n,cell:r}of i)n>1&&t+n>e&&o.push(r);return o}(o,s,i);for(const n of e)fb(n,s,t)}Mg("headingRows",s,o,t,0)})}_isInHeading(t,e){const n=parseInt(e.getAttribute("headingRows")||0);return!!n&&t.parent.index<n}}function fb(t,e,n){const o=t.parent,i=o.parent,r=e-o.index,s={},a=parseInt(t.getAttribute("rowspan"))-r;a>1&&(s.rowspan=a);const c=parseInt(t.getAttribute("colspan")||1);c>1&&(s.colspan=c);const l=i.getChildIndex(o),d=l+r,u=[...new Bg(i,{startRow:l,endRow:d,includeSpanned:!0})];let h;for(const{row:e,column:o,cell:r,cellIndex:a}of u)if(r===t&&void 0===h&&(h=o),void 0!==h&&h===o&&e===d){const t=i.getChild(e);Dg(n,n.createPositionAt(t,a),s)}Mg("rowspan",r,t,n)}class pb extends bu{refresh(){const t=Ig("tableCell",this.editor.model.document.selection.getFirstPosition()),e=!!t;this.isEnabled=e,this.value=e&&this._isInHeading(t,t.parent.parent)}execute(t={}){const e=this.editor.model,n=e.document.selection,o=this.editor.plugins.get("TableUtils"),i=Ig("tableCell",n.getFirstPosition()),r=i.parent.parent,{column:s}=o.getCellLocation(i);if(t.forceValue===this.value)return;const a=this.value?s:s+1;e.change(t=>{Mg("headingColumns",a,r,t,0)})}_isInHeading(t,e){const n=parseInt(e.getAttribute("headingColumns")||0),o=this.editor.plugins.get("TableUtils"),{column:i}=o.getCellLocation(t);return!!n&&i<n}}class mb extends Gl{static get pluginName(){return"TableUtils"}getCellLocation(t){const e=t.parent,n=e.parent,o=n.getChildIndex(e),i=new Bg(n,{startRow:o,endRow:o});for(const{cell:e,row:n,column:o}of i)if(e===t)return{row:n,column:o}}createTable(t,e,n){const o=t.createElement("table");return gb(t,o,0,e,n),o}insertRows(t,e={}){const n=this.editor.model,o=e.at||0,i=e.rows||1;n.change(e=>{const n=t.getAttribute("headingRows")||0;if(n>o&&e.setAttribute("headingRows",n+i,t),0===o||o===t.childCount)return void gb(e,t,o,i,this.getColumns(t));const r=new Bg(t,{endRow:o});let s=0;for(const{row:t,rowspan:n,colspan:a,cell:c}of r){t<o&&t+n>o&&e.setAttribute("rowspan",n+i,c),t===o&&(s+=a)}gb(e,t,o,i,s)})}insertColumns(t,e={}){const n=this.editor.model,o=e.at||0,i=e.columns||1;n.change(e=>{const n=t.getAttribute("headingColumns");o<n&&e.setAttribute("headingColumns",n+i,t);const r=this.getColumns(t);if(0===o||r===o){for(const n of t.getChildren())bb(i,e,e.createPositionAt(n,o?"end":0));return}const s=new Bg(t,{column:o,includeSpanned:!0});for(const{row:n,cell:r,cellIndex:a}of s){const c=parseInt(r.getAttribute("rowspan")||1),l=parseInt(r.getAttribute("colspan")||1);if(r.index!==o&&l>1){if(e.setAttribute("colspan",l+i,r),s.skipRow(n),c>1)for(let t=n+1;t<n+c;t++)s.skipRow(t)}else{const o=e.createPositionAt(t.getChild(n),a);bb(i,e,o)}}})}splitCellVertically(t,e=2){const n=this.editor.model,o=t.parent.parent,i=parseInt(t.getAttribute("rowspan")||1),r=parseInt(t.getAttribute("colspan")||1);n.change(n=>{if(r>1){const{newCellsSpan:o,updatedSpan:s}=wb(r,e);Mg("colspan",s,t,n);const a={};o>1&&(a.colspan=o),i>1&&(a.rowspan=i),bb(r>e?e-1:r-1,n,n.createPositionAfter(t),a)}if(r<e){const s=e-r,a=[...new Bg(o)],{column:c}=a.find(({cell:e})=>e===t),l=a.filter(({cell:e,colspan:n,column:o})=>{return e!==t&&o===c||o<c&&o+n>c});for(const{cell:t,colspan:e}of l)n.setAttribute("colspan",e+s,t);const d={};i>1&&(d.rowspan=i),bb(s,n,n.createPositionAfter(t),d);const u=o.getAttribute("headingColumns")||0;u>c&&Mg("headingColumns",u+s,o,n)}})}splitCellHorizontally(t,e=2){const n=this.editor.model,o=t.parent,i=o.parent,r=i.getChildIndex(o),s=parseInt(t.getAttribute("rowspan")||1),a=parseInt(t.getAttribute("colspan")||1);n.change(n=>{if(s>1){const o=[...new Bg(i,{startRow:r,endRow:r+s-1,includeSpanned:!0})],{newCellsSpan:c,updatedSpan:l}=wb(s,e);Mg("rowspan",l,t,n);const{column:d}=o.find(({cell:e})=>e===t),u={};c>1&&(u.rowspan=c),a>1&&(u.colspan=a);for(const{column:t,row:e,cellIndex:s}of o){if(e>=r+l&&t===d&&(e+r+l)%c==0){bb(1,n,n.createPositionAt(i.getChild(e),s),u)}}}if(s<e){const o=e-s,c=[...new Bg(i,{startRow:0,endRow:r})];for(const{cell:e,rowspan:i,row:s}of c)if(e!==t&&s+i>r){const t=i+o;n.setAttribute("rowspan",t,e)}const l={};a>1&&(l.colspan=a),gb(n,i,r+1,o,1,l);const d=i.getAttribute("headingRows")||0;d>r&&Mg("headingRows",d+o,i,n)}})}getColumns(t){return[...t.getChild(0).getChildren()].reduce((t,e)=>{return t+parseInt(e.getAttribute("colspan")||1)},0)}}function gb(t,e,n,o,i,r={}){for(let s=0;s<o;s++){const o=t.createElement("tableRow");t.insert(o,e,n),bb(i,t,t.createPositionAt(o,"end"),r)}}function bb(t,e,n,o={}){for(let i=0;i<t;i++)Dg(e,n,o)}function wb(t,e){if(t<e)return{newCellsSpan:1,updatedSpan:1};const n=Math.floor(t/e);return{newCellsSpan:n,updatedSpan:t-n*e+n}}function kb(t){t.document.registerPostFixer(e=>(function(t,e){const n=e.document.differ.getChanges();let o=!1;const i=new Set;for(const e of n){let n;"table"==e.name&&"insert"==e.type&&(n=e.position.nodeAfter),"tableRow"!=e.name&&"tableCell"!=e.name||(n=Ig("table",e.position)),yb(e)&&(n=Ig("table",e.range.start)),n&&!i.has(n)&&(o=_b(n,t)||o,o=vb(n,t)||o,i.add(n))}return o})(e,t))}function _b(t,e){let n=!1;const o=function(t){const e=parseInt(t.getAttribute("headingRows")||0),n=t.childCount,o=[];for(const{row:i,rowspan:r,cell:s}of new Bg(t)){if(r<2)continue;const t=i<e,a=t?e:n;if(i+r>a){const t=a-i;o.push({cell:s,rowspan:t})}}return o}(t);if(o.length){n=!0;for(const t of o)Mg("rowspan",t.rowspan,t.cell,e,1)}return n}function vb(t,e){let n=!1;const o=function(t){const e={};for(const{row:n}of new Bg(t,{includeSpanned:!0}))e[n]||(e[n]=0),e[n]+=1;return e}(t),i=o[0];if(!Object.values(o).every(t=>t===i)){const i=Object.values(o).reduce((t,e)=>e>t?e:t,0);for(const[r,s]of Object.entries(o)){const o=i-s;if(o){for(let n=0;n<o;n++)Dg(e,e.createPositionAt(t.getChild(r),"end"));n=!0}}}return n}function yb(t){const e="attribute"===t.type,n=t.attributeKey;return e&&("headingRows"===n||"colspan"===n||"rowspan"===n)}function xb(t){t.document.registerPostFixer(e=>(function(t,e){const n=e.document.differ.getChanges();let o=!1;for(const e of n)"insert"==e.type&&"table"==e.name&&(o=Cb(e.position.nodeAfter,t)||o),"insert"==e.type&&"tableRow"==e.name&&(o=Ab(e.position.nodeAfter,t)||o),"insert"==e.type&&"tableCell"==e.name&&(o=Pb(e.position.nodeAfter,t)||o),Tb(e)&&(o=Pb(e.position.parent,t)||o);return o})(e,t))}function Cb(t,e){let n=!1;for(const o of t.getChildren())n=Ab(o,e)||n;return n}function Ab(t,e){let n=!1;for(const o of t.getChildren())n=Pb(o,e)||n;return n}function Pb(t,e){if(0==t.childCount)return e.insertElement("paragraph",t),!0;const n=Array.from(t.getChildren()).filter(t=>t.is("text"));for(const t of n)e.wrap(e.createRangeOn(t),"paragraph");return!!n.length}function Tb(t){return!(!t.position||!t.position.parent.is("tableCell"))&&("insert"==t.type&&"$text"==t.name||"remove"==t.type)}function Eb(t){t.document.registerPostFixer(()=>(function(t){const e=t.document.differ,n=new Set;for(const t of e.getChanges()){const e="insert"==t.type||"remove"==t.type?t.position.parent:t.range.start.parent;e.is("tableCell")&&Sb(e,t.type)&&n.add(e)}if(n.size){for(const t of n.values())e.refreshItem(t);return!0}return!1})(t))}function Sb(t,e){if(!Array.from(t.getChildren()).some(t=>t.is("paragraph")))return!1;if("attribute"==e){const e=Array.from(t.getChild(0).getAttributeKeys()).length;return 1===t.childCount&&e<2}return t.childCount<=("insert"==e?2:1)}n(126);class Rb extends Gl{init(){const t=this.editor,e=t.model,n=e.schema,o=t.conversion;n.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isLimit:!0,isObject:!0,isBlock:!0}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0}),n.extend("$block",{allowIn:"tableCell"}),n.addChildCheck((t,e)=>{if("table"==e.name&&Array.from(t.getNames()).includes("table"))return!1}),o.for("upcast").add(Ng()),o.for("editingDowncast").add(jg({asWidget:!0})),o.for("dataDowncast").add(jg()),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("editingDowncast").add(Hg({asWidget:!0})),o.for("dataDowncast").add(Hg()),o.for("downcast").add(t=>t.on("remove:tableRow",(t,e,n)=>{t.stop();const o=n.writer,i=n.mapper,r=i.toViewPosition(e.position).getLastMatchingPosition(t=>!t.item.is("tr")).nodeAfter,s=r.parent,a=o.createRangeOn(r),c=o.remove(a);for(const t of o.createRangeIn(c).getItems())i.unbindViewElement(t);s.childCount||o.remove(o.createRangeOn(s))},{priority:"higher"})),o.for("upcast").add(Vg("td")),o.for("upcast").add(Vg("th")),o.for("editingDowncast").add(Ug({asWidget:!0})),o.for("dataDowncast").add(Ug()),o.attributeToAttribute({model:"colspan",view:"colspan"}),o.attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("editingDowncast").add(Wg({asWidget:!0})),o.for("dataDowncast").add(Wg()),o.for("editingDowncast").add($g({asWidget:!0})),o.for("dataDowncast").add($g()),t.commands.add("insertTable",new ib(t)),t.commands.add("insertTableRowAbove",new rb(t,{order:"above"})),t.commands.add("insertTableRowBelow",new rb(t,{order:"below"})),t.commands.add("insertTableColumnLeft",new sb(t,{order:"left"})),t.commands.add("insertTableColumnRight",new sb(t,{order:"right"})),t.commands.add("removeTableRow",new db(t)),t.commands.add("removeTableColumn",new ub(t)),t.commands.add("splitTableCellVertically",new ab(t,{direction:"vertically"})),t.commands.add("splitTableCellHorizontally",new ab(t,{direction:"horizontally"})),t.commands.add("mergeTableCellRight",new cb(t,{direction:"right"})),t.commands.add("mergeTableCellLeft",new cb(t,{direction:"left"})),t.commands.add("mergeTableCellDown",new cb(t,{direction:"down"})),t.commands.add("mergeTableCellUp",new cb(t,{direction:"up"})),t.commands.add("setTableColumnHeader",new pb(t)),t.commands.add("setTableRowHeader",new hb(t)),kb(e),Eb(e),xb(e),this.editor.keystrokes.set("Tab",(...t)=>this._handleTabOnSelectedTable(...t),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"})}static get requires(){return[mb]}_handleTabOnSelectedTable(t,e){const n=this.editor,o=n.model.document.selection;if(!o.isCollapsed&&1===o.rangeCount&&o.getFirstRange().isFlat){const t=o.getSelectedElement();if(!t||!t.is("table"))return;e(),n.model.change(e=>{e.setSelection(e.createRangeIn(t.getChild(0).getChild(0)))})}}_getTabHandler(t){const e=this.editor;return(n,o)=>{const i=Ig("tableCell",e.model.document.selection.getFirstPosition());if(!i)return;o();const r=i.parent,s=r.parent,a=s.getChildIndex(r),c=r.getChildIndex(i),l=0===c;if(!t&&l&&0===a)return;const d=c===r.childCount-1,u=a===s.childCount-1;if(t&&u&&d&&(e.execute("insertTableRowBelow"),a===s.childCount-1))return;let h;if(t&&d){const t=s.getChild(a+1);h=t.getChild(0)}else if(!t&&l){const t=s.getChild(a-1);h=t.getChild(t.childCount-1)}else h=r.getChild(c+(t?1:-1));e.model.change(t=>{t.setSelection(t.createRangeIn(h))})}}}n(128);class Ob extends Dl{constructor(t){super(t);const e=this.bindTemplate;this.items=this.createCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(t,e)=>`${e} × ${t}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:e.to("label")}]}],on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(()=>{this.fire("execute")})}});for(let t=0;t<100;t++){const e=new Ib;e.on("over",()=>{const e=Math.floor(t/10),n=t%10;this.set("rows",e+1),this.set("columns",n+1)}),this.items.add(e)}this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const t=this.rows,e=this.columns;this.items.map((n,o)=>{const i=Math.floor(o/10)<t&&o%10<e;n.set("isOn",i)})}}class Ib extends Dl{constructor(t){super(t);const e=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",e.if("isOn","ck-on")]},on:{mouseover:e.to("over")}})}}var Mb=n(57),Db=n.n(Mb),Nb=n(58),Vb=n.n(Nb),Fb=n(59),Bb=n.n(Fb),Lb=n(60),zb=n.n(Lb);class qb extends Gl{init(){const t=this.editor,e=this.editor.t;t.ui.componentFactory.add("insertTable",n=>{const o=t.commands.get("insertTable"),i=Bf(n);i.bind("isEnabled").to(o),i.buttonView.set({icon:Db.a,label:e("j"),tooltip:!0});const r=new Ob(n);return i.panelView.children.add(r),r.delegate("execute").to(i),i.buttonView.on("open",()=>{r.rows=0,r.columns=0}),i.on("execute",()=>{t.execute("insertTable",{rows:r.rows,columns:r.columns}),t.editing.view.focus()}),i}),t.ui.componentFactory.add("tableColumn",t=>{const n=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:e("k"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableColumnLeft",label:e("l")}},{type:"button",model:{commandName:"insertTableColumnRight",label:e("m")}},{type:"button",model:{commandName:"removeTableColumn",label:e("n")}}];return this._prepareDropdown(e("o"),Vb.a,n,t)}),t.ui.componentFactory.add("tableRow",t=>{const n=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:e("p"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowBelow",label:e("q")}},{type:"button",model:{commandName:"insertTableRowAbove",label:e("r")}},{type:"button",model:{commandName:"removeTableRow",label:e("s")}}];return this._prepareDropdown(e("t"),Bb.a,n,t)}),t.ui.componentFactory.add("mergeTableCells",t=>{const n=[{type:"button",model:{commandName:"mergeTableCellUp",label:e("u")}},{type:"button",model:{commandName:"mergeTableCellRight",label:e("v")}},{type:"button",model:{commandName:"mergeTableCellDown",label:e("w")}},{type:"button",model:{commandName:"mergeTableCellLeft",label:e("x")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:e("y")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:e("z")}}];return this._prepareDropdown(e("aa"),zb.a,n,t)})}_prepareDropdown(t,e,n,o){const i=this.editor,r=Bf(o),s=[],a=new si;for(const t of n)jb(t,i,s,a);return Lf(r,a),r.buttonView.set({label:t,icon:e,tooltip:!0}),r.bind("isEnabled").toMany(s,"isEnabled",(...t)=>t.some(t=>t)),this.listenTo(r,"execute",t=>{i.execute(t.source.commandName),i.editing.view.focus()}),r}}function jb(t,e,n,o){const i=t.model=new Tf(t.model),{commandName:r,bindIsOn:s}=t.model;if("separator"!==t.type){const t=e.commands.get(r);n.push(t),i.set({commandName:r}),i.bind("isEnabled").to(t),s&&i.bind("isOn").to(t,"value")}i.set({withText:!0}),o.add(t)}n(130);function Hb(t,e){if(!t.childCount)return;const n=new gu,o=function(t,e){const n=e.createRangeIn(t),o=new ko({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),i=[];for(const t of n)if("elementStart"===t.type&&o.match(t.item)){const e=Ub(t.item);i.push({element:t.item,id:e.id,order:e.order,indent:e.indent})}return i}(t,n);if(!o.length)return;let i=null;o.forEach((t,r)=>{if(!i||function(t,e){if(t.id!==e.id)return!0;const n=e.element.previousSibling;if(!n)return!0;return!$b(n)}(o[r-1],t)){const o=function(t,e){const n=/mso-level-number-format:([^;]*);/gi,o=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi").exec(e);let i="decimal";if(o&&o[1]){const t=n.exec(o[1]);t&&t[1]&&(i=t[1].trim())}return{type:"bullet"!==i&&"image"!==i?"ol":"ul",style:i}}(t,e);i=function(t,e,n){const o=new vo(t.type),i=e.parent.getChildIndex(e);return n.insertChild(i,o,e.parent),o}(o,t.element,n)}const s=function(t,e){return function(t,e){const n=new ko({name:"span",styles:{"mso-list":"Ignore"}}),o=e.createRangeIn(t);for(const t of o)"elementStart"===t.type&&n.match(t.item)&&e.remove(t.item)}(t,e),e.rename("li",t)}(t.element,n);n.appendChild(s,i)})}function Ub(t){const e={},n=t.getStyle("mso-list");return n&&(e.id=parseInt(n.match(/(^|\s+)l(\d+)/i)[2]),e.order=parseInt(n.match(/\s*lfo(\d+)/i)[1]),e.indent=parseInt(n.match(/\s*level(\d+)/i)[1])),e}function $b(t){return t.is("ol")||t.is("ul")}const Wb=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class Gb{isActive(t){return Wb.test(t)}execute(t){const e=new gu;!function(t,e){for(const n of t.getChildren())if(n.is("b")&&"normal"===n.getStyle("font-weight")){const o=t.getChildIndex(n);e.remove(n),e.insertChild(o,n.getChildren(),t)}}(t.content,e),function(t,e){for(const n of e.createRangeIn(t)){const t=n.item;if(t.is("li")){const n=t.nextSibling;n&&$b(n)&&(e.remove(n),e.insertChild(t.childCount,n,t))}if($b(t)){let n=t.getChild(0);for(;$b(n);)e.unwrapElement(n),n=t.getChild(0)}}}(t.content,e),function(t,e){for(const n of e.createRangeIn(t)){const t=n.item;if(t.is("li")){const n=t.getChild(0);n.is("p")&&e.unwrapElement(n)}}}(t.content,e)}}function Kb(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(t,e)=>1===e.length?" ":Array(e.length+1).join("  ").substr(0,e.length))}function Jb(t){const e=new DOMParser,n=function(t){return Kb(Kb(t)).replace(/(<span style=['"]mso-spacerun:yes['"]>[\s]*?)[\r\n]+(\s*<\/span>)/g,"$1$2").replace(/<span style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/>(\s*[\r\n]\s*)</g,"><")}(function(t){const e=t.match(/<\/body>(.*?)(<\/html>|$)/);e&&e[1]&&(t=t.slice(0,e.index)+t.slice(e.index).replace(e[1],""));return t}(t=t.replace(/<!--\[if gte vml 1]>/g,""))),o=e.parseFromString(n,"text/html");!function(t){t.querySelectorAll("span[style*=spacerun]").forEach(t=>{const e=t.childNodes[0].data.length;t.innerHTML=Array(e+1).join("  ").substr(0,e)})}(o);const i=o.body.innerHTML,r=function(t){const e=new sr({blockFiller:Bi}),n=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)n.appendChild(o[0]);return e.domToView(n)}(o),s=function(t){const e=[],n=[],o=Array.from(t.getElementsByTagName("style"));for(const t of o)t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length&&(e.push(t.sheet),n.push(t.innerHTML));return{styles:e,stylesString:n.join(" ")}}(o);return{body:r,bodyString:i,styles:s.styles,stylesString:s.stylesString}}function Zb(t,e){if(!t.childCount)return;const n=new gu;!function(t,e,n){const o=n.createRangeIn(e),i=new ko({name:"img"}),r=[];for(const e of o)if(i.match(e.item)){const n=e.item,o=n.getAttribute("v:shapes")?n.getAttribute("v:shapes").split(" "):[];o.length&&o.every(e=>t.indexOf(e)>-1)?r.push(n):n.getAttribute("src")||r.push(n)}for(const t of r)n.remove(t)}(function(t,e){const n=e.createRangeIn(t),o=new ko({name:/v:(.+)/}),i=[];for(const t of n){const e=t.item,n=e.previousSibling&&e.previousSibling.name||null;o.match(e)&&e.getAttribute("o:gfxdata")&&"v:shapetype"!==n&&i.push(t.item.getAttribute("id"))}return i}(t,n),t,n),function(t,e){const n=e.createRangeIn(t),o=new ko({name:/v:(.+)/}),i=[];for(const t of n)o.match(t.item)&&i.push(t.item);for(const t of i)e.remove(t)}(t,n);const o=function(t,e){const n=e.createRangeIn(t),o=new ko({name:"img"}),i=[];for(const t of n)o.match(t.item)&&t.item.getAttribute("src").startsWith("file://")&&i.push(t.item);return i}(t,n);o.length&&function(t,e,n){if(t.length===e.length)for(let o=0;o<t.length;o++){const i=`data:${e[o].type};base64,${Qb(e[o].hex)}`;n.setAttribute("src",i,t[o])}}(o,function(t){if(!t)return[];const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),o=t.match(n),i=[];if(o)for(const t of o){let n=!1;t.includes("\\pngblip")?n="image/png":t.includes("\\jpegblip")&&(n="image/jpeg"),n&&i.push({hex:t.replace(e,"").replace(/[^\da-fA-F]/g,""),type:n})}return i}(e),n)}function Qb(t){return btoa(t.match(/\w{2}/g).map(t=>String.fromCharCode(parseInt(t,16))).join(""))}const Yb=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,Xb=/xmlns:o="urn:schemas-microsoft-com/i;class tw{isActive(t){return Yb.test(t)||Xb.test(t)}execute(t){const{body:e,stylesString:n}=Jb(t.dataTransfer.getData("text/html"));Hb(e,n),Zb(e,t.dataTransfer.getData("text/rtf")),t.content=e}}const ew="todoListChecked";class nw extends bu{constructor(t){super(t),this._selectedElements=[],this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every(t=>!!t.getAttribute("todoListChecked")),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,n=t.document.selection.getFirstRange(),o=n.start.parent,i=[];e.checkAttribute(o,ew)&&i.push(o);for(const t of n.getItems())e.checkAttribute(t,ew)&&!i.includes(t)&&i.push(t);return i}execute(t={}){this.editor.model.change(e=>{for(const n of this._selectedElements){(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute(ew,!0,n):e.removeAttribute(ew,n)}})}}var ow="[object String]";var iw=function(t){return"string"==typeof t||!Wt(t)&&w(t)&&m(t)==ow};function rw(t,e,n){const o=e.range.start.parent;if("listItem"!=o.name||"todo"!=o.getAttribute("listType"))return;if(!n.consumable.consume(e.item,"insert"))return;const i=n.writer,r=n.mapper.toViewPosition(e.range.start),s=i.createText(e.item.data);i.insert(r.offset?r:r.getShiftedBy(1),s)}function sw(t,e,n){const o=e.range.start.parent;if("listItem"!=o.name||"todo"!=o.getAttribute("listType"))return;if(!n.consumable.consume(e.item,"insert"))return;const i=n.writer,r=n.mapper.toViewPosition(e.range.start),s=i.createText(e.item.data),a=i.createAttributeElement("span",{class:"todo-list__label__description"}),c=r.parent.getChild(0);i.insert(i.createPositionAt(r.parent,"end"),s),i.wrap(i.createRangeOn(s),a),i.wrap(i.createRangeOn(s.parent),c)}function aw(t,e,n){const o=e.modelCursor,i=o.parent,r=e.viewItem;if("checkbox"!=r.getAttribute("type")||"listItem"!=i.name||!o.isAtStart)return;if(!n.consumable.consume(r,{name:!0}))return;const s=n.writer;s.setAttribute("listType","todo",i),e.viewItem.hasAttribute("checked")&&s.setAttribute("todoListChecked",!0,i),e.modelRange=s.createRange(o)}function cw(t,e,n,o){const i=e.createUIElement("label",{class:"todo-list__checkmark",contenteditable:!1},function(e){const i=function(t,e,n={},o=[]){const i=t.createElement(e);for(const t in n)i.setAttribute(t,n[t]);!iw(o)&&wo(o)||(o=[o]);for(let e of o)iw(e)&&(e=t.createTextNode(e)),i.appendChild(e);return i}(document,"input",{type:"checkbox"});i.checked=n,i.addEventListener("change",()=>o(t));const r=this.toDomElement(e);return r.appendChild(i),r});return n&&e.addClass("todo-list__checkmark_checked",i),i}class lw extends Gl{static get requires(){return[ag]}init(){const t=this.editor,{editing:e,data:n,model:o}=t,i=e.view.document;o.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),o.schema.addAttributeCheck((t,e)=>{const n=t.last;if("todoListChecked"==e&&"listItem"==n.name&&"todo"!=n.getAttribute("listType"))return!1}),t.commands.add("todoList",new Fm(t,"todo")),t.commands.add("todoListCheck",new nw(t)),e.downcastDispatcher.on("insert:listItem",function(t,e){return(n,o,i)=>{const r=i.consumable;if(!r.test(o.item,"insert")||!r.test(o.item,"attribute:listType")||!r.test(o.item,"attribute:listIndent"))return;if("todo"!=o.item.getAttribute("listType"))return;const s=o.item;r.consume(s,"insert"),r.consume(s,"attribute:listType"),r.consume(s,"attribute:listIndent"),r.consume(s,"attribute:todoListChecked");const a=i.writer,c=qm(s,i),l=cw(s,a,!!s.getAttribute("todoListChecked"),e);a.addClass("todo-list",c.parent),a.insert(a.createPositionAt(c,0),l),jm(s,c,i,t)}}(o,t=>this._handleCheckmarkChange(t)),{priority:"high"}),e.downcastDispatcher.on("insert:$text",rw,{priority:"high"}),n.downcastDispatcher.on("insert:listItem",function(t){return(e,n,o)=>{const i=o.consumable;if(!i.test(n.item,"insert")||!i.test(n.item,"attribute:listType")||!i.test(n.item,"attribute:listIndent"))return;if("todo"!=n.item.getAttribute("listType"))return;i.consume(n.item,"insert"),i.consume(n.item,"attribute:listType"),i.consume(n.item,"attribute:listIndent");const r=o.writer,s=n.item,a=qm(s,o);r.addClass("todo-list",a.parent);const c=r.createAttributeElement("label",{class:"todo-list__label"}),l=r.createEmptyElement("input",{type:"checkbox",disabled:"disabled",class:"todo-list__label__checkmark"});n.item.getAttribute("todoListChecked")&&(r.setAttribute("checked","checked",l),r.addClass("todo-list__label_checked",c)),r.insert(r.createPositionAt(a,0),l),r.wrap(r.createRangeOn(l),c),jm(s,a,o,t)}}(o),{priority:"high"}),n.downcastDispatcher.on("insert:$text",sw,{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",function(t){return(e,n,o)=>{const i=o.mapper.toViewElement(n.item),r=o.writer;if("todo"==n.attributeNewValue){const e=!!n.item.getAttribute("todoListChecked"),o=cw(n.item,r,e,t);r.addClass("todo-list",i.parent),r.insert(r.createPositionAt(i,0),o)}else"todo"==n.attributeOldValue&&(r.removeClass("todo-list",i.parent),r.remove(i.getChild(0)))}}(t=>this._handleCheckmarkChange(t))),e.downcastDispatcher.on("attribute:todoListChecked:listItem",function(t){return(e,n,o)=>{if("todo"!=n.item.getAttribute("listType"))return;if(!o.consumable.consume(n.item,"attribute:todoListChecked"))return;const{mapper:i,writer:r}=o,s=!!n.item.getAttribute("todoListChecked"),a=i.toViewElement(n.item),c=Wm(r.createRangeIn(a),t=>!!t.is("uiElement")&&t),l=cw(n.item,r,s,t);r.insert(r.createPositionAfter(c),l),r.remove(c)}}(t=>this._handleCheckmarkChange(t))),n.upcastDispatcher.on("element:input",aw,{priority:"high"});const r=new Set;function s(t){t.on("change:children",(t,e)=>r.add(e))}Array.from(i.roots).forEach(s),this.listenTo(i.roots,"add",(t,e)=>s(e)),i.registerPostFixer(t=>{const e=function(t,e){const n=[];for(const o of e)for(const e of t.createRangeIn(o).getItems())e.is("uiElement")&&e.hasClass("todo-list__checkmark")&&!n.includes(e)&&o.document&&n.push(e);return n}(t,r);return r.clear(),function(t,e){let n=!1;for(const o of e){const e=dw(o),i=t.createPositionAt(e,0),r=t.createPositionBefore(o);if(i.isEqual(r))continue;const s=t.createRange(i,r);for(const e of Array.from(s.getItems()))e.is("uiElement")&&(t.move(t.createRangeOn(e),t.createPositionAfter(o)),n=!0)}return n}(t,e)}),i.registerPostFixer(t=>(function(t,e){if(!e.isCollapsed)return!1;const n=e.getFirstPosition();if("li"!=n.parent.name||!n.parent.parent.hasClass("todo-list"))return!1;const o=t.createPositionAt(n.parent,"end"),i=Wm(t.createRange(n,o),t=>!(!t.is("uiElement")||!t.hasClass("todo-list__checkmark"))&&t);if(i&&!n.isAfter(t.createPositionBefore(i))){const n=t.createRange(t.createPositionAfter(i),o),r=Wm(n,t=>!!t.is("textProxy")&&t.textNode),s=r?t.createPositionAt(r,0):o;return t.setSelection(t.createRange(s),{isBackward:e.isBackward}),!0}return!1})(t,i.selection)),t.keystrokes.set("arrowleft",(t,e)=>(function(t,e){const n=e.schema,o=e.document.selection;if(!o.isCollapsed)return;const i=o.getFirstPosition(),r=i.parent;if("listItem"===r.name&&"todo"==r.getAttribute("listType")&&i.isAtStart){const o=n.getNearestSelectionRange(e.createPositionBefore(r),"backward");o&&(t(),e.change(t=>t.setSelection(o)))}})(e,o)),t.keystrokes.set("Ctrl+space",()=>t.execute("todoListCheck"));const a=new Set;this.listenTo(o,"applyOperation",(t,e)=>{const n=e[0];if("rename"==n.type&&"listItem"==n.oldName){const t=n.position.nodeAfter;t.hasAttribute("todoListChecked")&&a.add(t)}else if("changeAttribute"==n.type&&"listType"==n.key&&"todo"===n.oldValue)for(const t of n.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&a.add(t)}),o.document.registerPostFixer(t=>{let e=!1;for(const n of a)t.removeAttribute("todoListChecked",n),e=!0;return a.clear(),e})}_handleCheckmarkChange(t){const e=this.editor,n=e.model,o=Array.from(n.document.selection.getRanges());n.change(n=>{n.setSelection(t,"end"),e.execute("todoListCheck"),n.setSelection(o)})}}function dw(t){for(const e of t.getAncestors({parentFirst:!0}))if("li"==e.name)return e}var uw=n(61),hw=n.n(uw);n(132);class fw extends Gl{init(){const t=this.editor.t;Gm(this.editor,"todoList",t("ab"),hw.a)}}var pw=/highlight-(?:text|source)-([a-z0-9]+)/;function mw(t){t.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return"DIV"===t.nodeName&&pw.test(t.className)&&e&&"PRE"===e.nodeName},replacement:function(t,e,n){var o=((e.className||"").match(pw)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}})}var gw=Array.prototype.indexOf,bw=Array.prototype.every,ww={};function kw(t){var e=t.parentNode;return"THEAD"===e.nodeName||e.firstChild===t&&("TABLE"===e.nodeName||function(t){var e=t.previousSibling;return"TBODY"===t.nodeName&&(!e||"THEAD"===e.nodeName&&/^\s*$/i.test(e.textContent))}(e))&&bw.call(t.childNodes,function(t){return"TH"===t.nodeName})}function _w(t,e){var n=" ";return 0===gw.call(e.parentNode.childNodes,e)&&(n="| "),n+t+" |"}function vw(t,e){return Array(e+1).join(t)}ww.tableCell={filter:["th","td"],replacement:function(t,e){return _w(t,e)}},ww.tableRow={filter:"tr",replacement:function(t,e){var n="",o={left:":--",right:"--:",center:":-:"};if(kw(e))for(var i=0;i<e.childNodes.length;i++){var r="---",s=(e.childNodes[i].getAttribute("align")||"").toLowerCase();s&&(r=o[s]||r),n+=_w(r,e.childNodes[i])}return"\n"+t+(n?"\n"+n:"")}},ww.table={filter:function(t){return"TABLE"===t.nodeName&&kw(t.rows[0])},replacement:function(t){return"\n\n"+(t=t.replace("\n\n","\n"))+"\n\n"}},ww.tableSection={filter:["thead","tbody","tfoot"],replacement:function(t){return t}};var yw=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function xw(t){return-1!==yw.indexOf(t.nodeName.toLowerCase())}var Cw=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Aw(t){return-1!==Cw.indexOf(t.nodeName.toLowerCase())}var Pw=Cw.join();var Tw={};function Ew(t){for(var e in this.options=t,this._keep=[],this._remove=[],this.blankRule={replacement:t.blankReplacement},this.keepReplacement=t.keepReplacement,this.defaultRule={replacement:t.defaultReplacement},this.array=[],t.rules)this.array.push(t.rules[e])}function Sw(t,e,n){for(var o=0;o<t.length;o++){var i=t[o];if(Rw(i,e,n))return i}}function Rw(t,e,n){var o=t.filter;if("string"==typeof o){if(o===e.nodeName.toLowerCase())return!0}else if(Array.isArray(o)){if(o.indexOf(e.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof o)throw new TypeError("`filter` needs to be a string, array, or function");if(o.call(t,e,n))return!0}}function Ow(t){var e=t.nextSibling||t.parentNode;return t.parentNode.removeChild(t),e}function Iw(t,e,n){return t&&t.parentNode===e||n(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}Tw.paragraph={filter:"p",replacement:function(t){return"\n\n"+t+"\n\n"}},Tw.lineBreak={filter:"br",replacement:function(t,e,n){return n.br+"\n"}},Tw.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(t,e,n){var o=Number(e.nodeName.charAt(1));return"setext"===n.headingStyle&&o<3?"\n\n"+t+"\n"+vw(1===o?"=":"-",t.length)+"\n\n":"\n\n"+vw("#",o)+" "+t+"\n\n"}},Tw.blockquote={filter:"blockquote",replacement:function(t){return"\n\n"+(t=(t=t.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},Tw.list={filter:["ul","ol"],replacement:function(t,e){var n=e.parentNode;return"LI"===n.nodeName&&n.lastElementChild===e?"\n"+t:"\n\n"+t+"\n\n"}},Tw.listItem={filter:"li",replacement:function(t,e,n){t=t.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var o=n.bulletListMarker+" ",i=e.parentNode;if("OL"===i.nodeName){var r=i.getAttribute("start"),s=Array.prototype.indexOf.call(i.children,e);o=(r?Number(r)+s:s+1)+". "}return o+t+(e.nextSibling&&!/\n$/.test(t)?"\n":"")}},Tw.indentedCodeBlock={filter:function(t,e){return"indented"===e.codeBlockStyle&&"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName},replacement:function(t,e,n){return"\n\n "+e.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},Tw.fencedCodeBlock={filter:function(t,e){return"fenced"===e.codeBlockStyle&&"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName},replacement:function(t,e,n){var o=((e.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}},Tw.horizontalRule={filter:"hr",replacement:function(t,e,n){return"\n\n"+n.hr+"\n\n"}},Tw.inlineLink={filter:function(t,e){return"inlined"===e.linkStyle&&"A"===t.nodeName&&t.getAttribute("href")},replacement:function(t,e){return"["+t+"]("+e.getAttribute("href")+(e.title?' "'+e.title+'"':"")+")"}},Tw.referenceLink={filter:function(t,e){return"referenced"===e.linkStyle&&"A"===t.nodeName&&t.getAttribute("href")},replacement:function(t,e,n){var o,i,r=e.getAttribute("href"),s=e.title?' "'+e.title+'"':"";switch(n.linkReferenceStyle){case"collapsed":o="["+t+"][]",i="["+t+"]: "+r+s;break;case"shortcut":o="["+t+"]",i="["+t+"]: "+r+s;break;default:var a=this.references.length+1;o="["+t+"]["+a+"]",i="["+a+"]: "+r+s}return this.references.push(i),o},references:[],append:function(t){var e="";return this.references.length&&(e="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),e}},Tw.emphasis={filter:["em","i"],replacement:function(t,e,n){return t.trim()?n.emDelimiter+t+n.emDelimiter:""}},Tw.strong={filter:["strong","b"],replacement:function(t,e,n){return t.trim()?n.strongDelimiter+t+n.strongDelimiter:""}},Tw.code={filter:function(t){var e=t.previousSibling||t.nextSibling,n="PRE"===t.parentNode.nodeName&&!e;return"CODE"===t.nodeName&&!n},replacement:function(t){if(!t.trim())return"";var e="`",n="",o="",i=t.match(/`+/gm);if(i)for(/^`/.test(t)&&(n=" "),/`$/.test(t)&&(o=" ");-1!==i.indexOf(e);)e+="`";return e+n+t+o+e}},Tw.image={filter:"img",replacement:function(t,e){var n=e.alt||"",o=e.getAttribute("src")||"",i=e.title||"";return o?"!["+n+"]("+o+(i?' "'+i+'"':"")+")":""}},Ew.prototype={add:function(t,e){this.array.unshift(e)},keep:function(t){this._keep.unshift({filter:t,replacement:this.keepReplacement})},remove:function(t){this._remove.unshift({filter:t,replacement:function(){return""}})},forNode:function(t){return t.isBlank?this.blankRule:(e=Sw(this.array,t,this.options))?e:(e=Sw(this._keep,t,this.options))?e:(e=Sw(this._remove,t,this.options))?e:this.defaultRule;var e},forEach:function(t){for(var e=0;e<this.array.length;e++)t(this.array[e],e)}};var Mw="undefined"!=typeof window?window:{};var Dw,Nw=function(){var t=Mw.DOMParser,e=!1;try{(new t).parseFromString("","text/html")&&(e=!0)}catch(t){}return e}()?Mw.DOMParser:function(){var t=function(){},e=n(134).JSDOM;return t.prototype.parseFromString=function(t){return new e(t).window.document},t}();function Vw(t){var e;"string"==typeof t?e=(Dw=Dw||new Nw).parseFromString('<x-turndown id="turndown-root">'+t+"</x-turndown>","text/html").getElementById("turndown-root"):e=t.cloneNode(!0);return function(t){var e=t.element,n=t.isBlock,o=t.isVoid,i=t.isPre||function(t){return"PRE"===t.nodeName};if(e.firstChild&&!i(e)){for(var r=null,s=!1,a=null,c=Iw(a,e,i);c!==e;){if(3===c.nodeType||4===c.nodeType){var l=c.data.replace(/[ \r\n\t]+/g," ");if(r&&!/ $/.test(r.data)||s||" "!==l[0]||(l=l.substr(1)),!l){c=Ow(c);continue}c.data=l,r=c}else{if(1!==c.nodeType){c=Ow(c);continue}n(c)||"BR"===c.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,s=!1):o(c)&&(r=null,s=!0)}var d=Iw(a,c,i);a=c,c=d}r&&(r.data=r.data.replace(/ $/,""),r.data||Ow(r))}}({element:e,isBlock:xw,isVoid:Aw}),e}function Fw(t){return t.isBlock=xw(t),t.isCode="code"===t.nodeName.toLowerCase()||t.parentNode.isCode,t.isBlank=function(t){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(t.nodeName)&&/^\s*$/i.test(t.textContent)&&!Aw(t)&&!function(t){return t.querySelector&&t.querySelector(Pw)}(t)}(t),t.flankingWhitespace=function(t){var e="",n="";if(!t.isBlock){var o=/^[ \r\n\t]/.test(t.textContent),i=/[ \r\n\t]$/.test(t.textContent);o&&!Bw("left",t)&&(e=" "),i&&!Bw("right",t)&&(n=" ")}return{leading:e,trailing:n}}(t),t}function Bw(t,e){var n,o,i;return"left"===t?(n=e.previousSibling,o=/ $/):(n=e.nextSibling,o=/^ /),n&&(3===n.nodeType?i=o.test(n.nodeValue):1!==n.nodeType||xw(n)||(i=o.test(n.textContent))),i}var Lw=Array.prototype.reduce,zw=/^\n*/,qw=/\n*$/,jw=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Hw(t){if(!(this instanceof Hw))return new Hw(t);var e={rules:Tw,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(t,e){return e.isBlock?"\n\n":""},keepReplacement:function(t,e){return e.isBlock?"\n\n"+e.outerHTML+"\n\n":e.outerHTML},defaultReplacement:function(t,e){return e.isBlock?"\n\n"+t+"\n\n":t}};this.options=function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}({},e,t),this.rules=new Ew(this.options)}function Uw(t){var e=this;return Lw.call(t.childNodes,function(t,n){var o="";return 3===(n=new Fw(n)).nodeType?o=n.isCode?n.nodeValue:e.escape(n.nodeValue):1===n.nodeType&&(o=function(t){var e=this.rules.forNode(t),n=Uw.call(this,t),o=t.flankingWhitespace;(o.leading||o.trailing)&&(n=n.trim());return o.leading+e.replacement(n,t,this.options)+o.trailing}.call(e,n)),$w(t,o)},"")}function $w(t,e){var n=function(t,e){var n=[t.match(qw)[0],e.match(zw)[0]].sort(),o=n[n.length-1];return o.length<2?o:"\n\n"}(t,e);return(t=t.replace(qw,""))+n+(e=e.replace(zw,""))}Hw.prototype={turndown:function(t){if(!function(t){return null!=t&&("string"==typeof t||t.nodeType&&(1===t.nodeType||9===t.nodeType||11===t.nodeType))}(t))throw new TypeError(t+" is not a string, or an element/document/fragment node.");if(""===t)return"";var e=Uw.call(this,new Vw(t));return function(t){var e=this;return this.rules.forEach(function(n){"function"==typeof n.append&&(t=$w(t,n.append(e.options)))}),t.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}.call(this,e)},use:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.use(t[e]);else{if("function"!=typeof t)throw new TypeError("plugin must be a Function or an Array of Functions");t(this)}return this},addRule:function(t,e){return this.rules.add(t,e),this},keep:function(t){return this.rules.keep(t),this},remove:function(t){return this.rules.remove(t),this},escape:function(t){return jw.reduce(function(t,e){return t.replace(e[0],e[1])},t)}};var Ww=Hw;function Gw(t,e){let n=t.parentElement;for(;n;){if(e.indexOf(n.tagName)>=0)return!0;n=n.parentElement}return!1}const Kw="data-original-src";class Jw{constructor(){this._htmlDP=new ol,this._domConverter=new sr}toView(t){const e=n(135)({html:!0,langPrefix:"language-"});let o=n(191);const i=e.use(o,{label:!0}).render(t),r=this._htmlDP._toDom(i);return function(t){let e,n=document.createNodeIterator(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function(t){if("P"===t.tagName&&t.parentElement&&"LI"===t.parentElement.tagName)return NodeFilter.FILTER_ACCEPT}},!1);for(;e=n.nextNode();)e.outerHTML=e.innerHTML}(r),this._domConverter.domToView(r)}toData(t){const e=this._domConverter.viewToDom(t,document);!function(t,e,n){e=e.map(t=>t.toUpperCase()),n=n.map(t=>t.toUpperCase());let o,i=document.createNodeIterator(t,NodeFilter.SHOW_TEXT);for(;o=i.nextNode();)o.parentElement&&e.indexOf(o.parentElement.nodeName)>=0&&(o.nodeValue=o.nodeValue.replace(/^[\u00a0]+/g," ").replace(/[\u00a0]+$/g," ")),Gw(o,n)||(o.nodeValue=_.escape(o.nodeValue))}(e,["strong","em"],["pre","code","table"]),function(t,e,n){let o,i=document.createNodeIterator(t,NodeFilter.SHOW_ELEMENT,function(t){return"a"===t.nodeName.toLowerCase()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});for(;o=i.nextNode();)o.setAttribute("href",o.href)}(e);const n=new Ww({headingStyle:"atx",codeBlockStyle:"fenced"});return n.use([mw]),n.addRule("todolist",{filter:function(t){let e=t.parentNode,n=e&&e.parentNode;return"checkbox"===t.type&&n&&"LI"===n.nodeName},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}}),n.addRule("img",{filter:"img",replacement:function(t,e){var n=e.alt||"",o=e.getAttribute(Kw)||e.getAttribute("src")||"",i=e.title||"";return o?"!["+n+"]("+o+(i?' "'+i+'"':"")+")":""}}),n.addRule("htmlTables",{filter:["table"],replacement:function(t,e){return e.querySelectorAll("td br[data-cke-filler]").forEach(t=>t.remove()),e.outerHTML}}),n.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~~"+t+"~~"}}),n.addRule("openProjectMacros",{filter:["macro"],replacement:(t,e)=>{return e.innerHTML="",e.outerHTML.replace("</macro>","\n</macro>")}}),n.turndown(e)}}var Zw=n(22),Qw=n.n(Zw),Yw=n(62),Xw=n.n(Yw);class tk extends bu{refresh(){const t=this.editor.model,e=t.document;this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"mention")}execute(t){const e=this.editor.model,n=e.document.selection,o="string"==typeof t.mention?{id:t.mention}:t.mention,i=o.id,r=t.range||n.getFirstRange(),s=t.text||i,a=nk({_text:s,id:i},o);if(1!=t.marker.length)throw new Jn.b("mentioncommand-incorrect-marker: The marker must be a single character.",this);if(i.charAt(0)!=t.marker)throw new Jn.b("mentioncommand-incorrect-id: The item id must start with the marker character.",this);e.change(t=>{const o=Ls(n.getAttributes()),i=new Map(o.entries());i.set("mention",a),e.insertContent(t.createText(s,i),r),e.insertContent(t.createText(" ",o),r.start.getShiftedBy(s.length))})}}class ek extends Gl{static get pluginName(){return"MentionEditing"}init(){const t=this.editor,e=t.model,n=e.document;e.schema.extend("$text",{allowAttributes:"mention"}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",key:"data-mention",classes:"mention"},model:{key:"mention",value:ok}}),t.conversion.for("downcast").attributeToElement({model:"mention",view:rk}),t.conversion.for("downcast").add(ik),n.registerPostFixer(t=>(function(t,e,n){const o=e.differ.getChanges();let i=!1;for(const e of o){const o=e.position;if("$text"==e.name){const e=o.textNode&&o.textNode.nextSibling;i=ak(o.textNode,t)||i,i=ak(e,t)||i,i=ak(o.nodeBefore,t)||i,i=ak(o.nodeAfter,t)||i}if("$text"!=e.name&&"insert"==e.type){const e=o.nodeAfter;for(const n of t.createRangeIn(e).getItems())i=ak(n,t)||i}if("insert"==e.type&&n.isInline(e.name)){const e=o.nodeAfter&&o.nodeAfter.nextSibling;i=ak(o.nodeBefore,t)||i,i=ak(e,t)||i}}return i})(t,n,e.schema)),n.registerPostFixer(t=>(function(t,e){const n=e.differ.getChanges();let o=!1;for(const e of n)if("attribute"===e.type&&"mention"!=e.attributeKey){const n=e.range.start.nodeBefore,i=e.range.end.nodeAfter;for(const r of[n,i])sk(r)&&r.getAttribute(e.attributeKey)!=e.attributeNewValue&&(t.setAttribute(e.attributeKey,e.attributeNewValue,r),o=!0)}return o})(t,n)),n.registerPostFixer(t=>(function(t,e){const n=e.selection,o=n.focus;if(n.isCollapsed&&n.hasAttribute("mention")&&function(t){const e=t.isAtStart;return t.nodeBefore&&t.nodeBefore.is("text")||e}(o))return t.removeSelectionAttribute("mention"),!0})(t,n)),t.commands.add("mention",new tk(t))}}function nk(t,e){return Object.assign({_uid:Yn()},t,e||{})}function ok(t,e){const n=t.getAttribute("data-mention"),o=t.getChild(0);if(o)return nk({id:n,_text:o.data},e)}function ik(t){t.on("attribute:mention",(t,e,n)=>{const o=e.attributeNewValue;if(!e.item.is("textProxy")||!o)return;const i=e.range.start;(i.textNode||i.nodeAfter).data!=o._text&&n.consumable.consume(e.item,t.name)},{priority:"highest"})}function rk(t,e){if(!t)return;const n={class:"mention","data-mention":t.id},o={id:t._uid,priority:20};return e.createAttributeElement("span",n,o)}function sk(t){if(!t||!t.is("text")&&!t.is("textProxy")||!t.hasAttribute("mention"))return!1;return t.data!=t.getAttribute("mention")._text}function ak(t,e){return!!sk(t)&&(e.removeAttribute("mention",t),!0)}class ck{constructor(t,e){this.model=t,this.testCallback=e,this.hasMatch=!1,this._startListening()}_startListening(){const t=this.model.document;t.selection.on("change:range",(e,{directChange:n})=>{n&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),t.on("change:data",(t,e)=>{"transparent"!=e.type&&this._evaluateTextBeforeSelection("data",{batch:e})})}_evaluateTextBeforeSelection(t,e={}){const n=this._getText(),o=this.testCallback(n);if(!o&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=o,o){const o=Object.assign(e,{text:n});this.fire(`matched:${t}`,o)}}_getText(){const t=this.model,e=t.document.selection;return function(t){return Array.from(t.getItems()).reduce((t,e)=>e.is("softBreak")?"":t+e.data,"")}(t.createRange(t.createPositionAt(e.focus.parent,0),e.focus))}}lo(ck,no);n(192);class lk extends Mf{constructor(t){super(t),this.extendTemplate({attributes:{class:["ck-mentions"],tabindex:"-1"}})}selectFirst(){this.select(0)}selectNext(){const t=this.selected,e=this.items.getIndex(t);this.select(e+1)}selectPrevious(){const t=this.selected,e=this.items.getIndex(t);this.select(e-1)}select(t){let e=0;t>0&&t<this.items.length?e=t:t<0&&(e=this.items.length-1);const n=this.items.get(e);this.selected!==n&&(this.selected&&this.selected.removeHighlight(),n.highlight(),this.selected=n,this._isItemVisibleInScrolledArea(n)||(this.element.scrollTop=n.element.offsetTop))}executeSelected(){this.selected.fire("execute")}_isItemVisibleInScrolledArea(t){return new As(this.element).contains(new As(t.element))}}class dk extends Dl{constructor(t,e){super(t),this.template=!1,this.domElement=e,this.domElement.classList.add("ck-button"),this.set("isOn",!1),this.on("change:isOn",(t,e,n)=>{n?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))}),this.listenTo(this.domElement,"click",()=>{this.fire("execute")})}render(){super.render(),this.element=this.domElement}}class uk extends Df{highlight(){this.children.first.isOn=!0}removeHighlight(){this.children.first.isOn=!1}}const hk=3;class fk extends Gl{static get pluginName(){return"MentionUI"}constructor(t){super(t),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,t.config.define("mention",{feeds:[]})}init(){const t=this.editor;this._balloon=t.plugins.get(Nd),t.editing.view.document.on("keydown",(t,e)=>{(function(t){return[wi.arrowup,wi.arrowdown,wi.enter,wi.tab,wi.space,wi.esc].includes(t)})(e.keyCode)&&this._isUIVisible&&(e.preventDefault(),t.stop(),e.keyCode==wi.arrowdown&&this._mentionsView.selectNext(),e.keyCode==wi.arrowup&&this._mentionsView.selectPrevious(),e.keyCode!=wi.enter&&e.keyCode!=wi.tab&&e.keyCode!=wi.space||this._mentionsView.executeSelected(),e.keyCode==wi.esc&&this._hideUIAndRemoveMarker())},{priority:"highest"}),Ff({emitter:this._mentionsView,activator:()=>this._isUIVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideUIAndRemoveMarker()});const e=t.config.get("mention.feeds");for(const t of e){const e=t.feed,n=t.marker;if(!n||1!=n.length)throw new Jn.b("mentionconfig-incorrect-marker: The marker must be provided and it must be a single character.",null);const o=t.minimumCharacters||0,i="function"==typeof e?e.bind(this.editor):mk(e),r={watcher:this._setupTextWatcherForFeed(n,o),marker:n,feedCallback:i,itemRenderer:t.itemRenderer};this._mentionsConfigurations.set(n,r)}}destroy(){super.destroy(),this._mentionsView.destroy()}static get requires(){return[Nd]}get _isUIVisible(){return this._balloon.visibleView===this._mentionsView}_createMentionView(){const t=this.editor.locale,e=new lk(t);return this._items=new si,e.items.bindTo(this._items).using(n=>{const{item:o,marker:i}=n,r=new uk(t),s=this._renderItem(o,i);return s.delegate("execute").to(r),r.children.add(s),r.item=o,r.marker=i,r.on("execute",()=>{e.fire("execute",{item:o,marker:i})}),r}),e.on("execute",(t,e)=>{const n=this.editor,o=n.model,i=e.item,r=e.marker,s=n.model.markers.get("mention"),a=o.createPositionAt(o.document.selection.focus),c=o.createPositionAt(s.getStart()),l=o.createRange(c,a);this._hideUIAndRemoveMarker(),n.execute("mention",{mention:i,text:i.text,marker:r,range:l}),n.editing.view.focus()}),e}_getItemRenderer(t){const{itemRenderer:e}=this._mentionsConfigurations.get(t);return e}_getFeed(t,e){const{feedCallback:n}=this._mentionsConfigurations.get(t);return Promise.resolve().then(()=>n(e))}_setupTextWatcherForFeed(t,e){const n=this.editor,o=new ck(n.model,function(t,e){const n=pk(t,e);return t=>n.test(t)}(t,e));return o.on("matched",(e,o)=>{const i=n.model.document.selection.focus,r=i.textNode&&i.textNode.hasAttribute("mention"),s=i.nodeBefore;if(r||s&&s.is("text")&&s.hasAttribute("mention"))return void this._hideUIAndRemoveMarker();const a=function(t,e){const n=pk(t,0);return e.match(n)[2]}(t,o.text),c=t.length+a.length,l=i.getShiftedBy(-c),d=i.getShiftedBy(-a.length),u=n.model.createRange(l,d);let h;h=n.model.markers.has("mention")?n.model.markers.get("mention"):n.model.change(t=>t.addMarker("mention",{range:u,usingOperation:!1,affectsData:!1})),this._getFeed(t,a).then(e=>{this._items.clear();for(const n of e){const e="object"!=typeof n?{id:n,text:n}:n;this._items.add({item:e,marker:t})}this._items.length?this._showUI(h):this._hideUIAndRemoveMarker()})}),o.on("unmatched",()=>{this._hideUIAndRemoveMarker()}),o}_showUI(t){this._isUIVisible?this._balloon.updatePosition(this._getBalloonPanelPositionData(t,this._mentionsView.position)):this._balloon.add({view:this._mentionsView,position:this._getBalloonPanelPositionData(t,this._mentionsView.position),withArrow:!1,singleViewMode:!0}),this._mentionsView.position=this._balloon.view.position,this._mentionsView.selectFirst()}_hideUIAndRemoveMarker(){this._balloon.hasView(this._mentionsView)&&this._balloon.remove(this._mentionsView),this.editor.model.markers.has("mention")&&this.editor.model.change(t=>t.removeMarker("mention")),this._mentionsView.position=void 0}_renderItem(t,e){const n=this.editor;let o,i=t.id;const r=this._getItemRenderer(e);if(r){const e=r(t);"string"!=typeof e?o=new dk(n.locale,e):i=e}if(!o){const t=new Wl(n.locale);t.label=i,t.withText=!0,o=t}return o}_getBalloonPanelPositionData(t,e){const n=this.editor,o=this.editor.editing,i=o.view.domConverter,r=o.mapper;return{target:()=>{let e=t.getRange();"$graveyard"==e.start.root.rootName&&(e=n.model.document.selection.getFirstRange());const o=r.toViewRange(e);return As.getDomRangeRects(i.viewRangeToDom(o)).pop()},limiter:()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},positions:function(t){const e={caret_se:t=>({top:t.bottom+hk,left:t.right,name:"caret_se"}),caret_ne:(t,e)=>({top:t.top-e.height-hk,left:t.right,name:"caret_ne"}),caret_sw:(t,e)=>({top:t.bottom+hk,left:t.right-e.width,name:"caret_sw"}),caret_nw:(t,e)=>({top:t.top-e.height-hk,left:t.right-e.width,name:"caret_nw"})};if(e.hasOwnProperty(t))return[e[t]];return[e.caret_se,e.caret_sw,e.caret_ne,e.caret_nw]}(e)}}}function pk(t,e){const n=0==e?"*":`{${e},}`,o=`(?:^|[ ${mi.features.isRegExpUnicodePropertySupported?"\\p{Ps}\\p{Pi}\"'":"\\(\\[{\"'"}])([${t}])([_${mi.features.isRegExpUnicodePropertySupported?"\\p{L}\\p{N}":"a-zA-ZÀ-ž0-9"}]${n})$`;return new RegExp(o,"u")}function mk(t){return e=>{const n=t.filter(t=>{return("string"==typeof t?t:String(t.id)).toLowerCase().includes(e.toLowerCase())}).slice(0,10);return Promise.resolve(n)}}n(194);const gk=[cd,class extends Gl{static get requires(){return[md,wd,Ud]}static get pluginName(){return"OPMacroEmbeddedTable"}static get buttonName(){return md.buttonName}},class extends Gl{static get requires(){return[Gd,wd,Kd]}static get pluginName(){return"OPMacroWpButton"}static get buttonName(){return Gd.buttonName}},class extends Gl{static get requires(){return[Ru,wd,Ou]}static get pluginName(){return"OPChildPages"}static get buttonName(){return Ru.buttonName}}],bk=[class extends Gl{static get requires(){return[Qd,Tu]}static get pluginName(){return"OpUploadPlugin"}init(){this.editor.plugins.get("FileRepository").createUploadAdapter=(t=>{const e=fd(this.editor);return new Xd(t,e,this.editor)})}},class extends Gl{static get pluginName(){return"OPAttachmentListener"}init(){this.editor.model.on("op:attachment-removed",(t,e)=>{this.removeDeletedImage(e)})}removeDeletedImage(t){let e=this.editor.model.document.getRoot();for(const n of Array.from(e.getChildren()))if("image"===n.name&&t.indexOf(n.getAttribute("src"))>-1){const t=new ea(n,"on");this.editor.model.deleteContent(t)}}}],wk=[class extends Gl{static get requires(){return[Nu,zu,Uu,ih,Th]}static get pluginName(){return"Essentials"}},class extends Gl{static get requires(){return[Qd]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const t=this.editor.config.get("ckfinder.uploadUrl");t&&(this.editor.plugins.get(Qd).createUploadAdapter=(e=>new Ih(e,t,this.editor.t)))}},class extends Gl{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats()}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&new Mh(this.editor,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&new Mh(this.editor,/^1[.|)]\s$/,"numberedList")}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const t=Vh(this.editor,"bold");new Dh(this.editor,/(\*\*)([^*]+)(\*\*)$/g,t),new Dh(this.editor,/(__)([^_]+)(__)$/g,t)}if(t.get("italic")){const t=Vh(this.editor,"italic");new Dh(this.editor,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,t),new Dh(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,t)}if(t.get("code")){const t=Vh(this.editor,"code");new Dh(this.editor,/(`)([^`]+)(`)$/g,t)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter(t=>t.match(/^heading[1-6]$/)).forEach(e=>{const n=e[7],o=new RegExp(`^(#{${n}})\\s$`);new Mh(this.editor,o,()=>{if(!t.isEnabled)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&new Mh(this.editor,/^>\s$/,"blockQuote")}},class extends Gl{static get requires(){return[Lh,Hh]}static get pluginName(){return"Bold"}},class extends Gl{static get requires(){return[$h,Jh]}static get pluginName(){return"Code"}},class extends Gl{static get requires(){return[of,cf]}static get pluginName(){return"Italic"}},class extends Gl{static get requires(){return[Qh,ef]}static get pluginName(){return"Strikethrough"}},class extends Gl{static get requires(){return[pf,bf]}static get pluginName(){return"BlockQuote"}},class extends Gl{static get requires(){return[Pf,zf]}static get pluginName(){return"Heading"}},class extends Gl{static get requires(){return[Uf,wd,ap]}static get pluginName(){return"Image"}},class extends Gl{static get requires(){return[dp]}static get pluginName(){return"ImageCaption"}},class extends Gl{static get requires(){return[Sp,Rp]}static get pluginName(){return"ImageStyle"}},class extends Gl{static get requires(){return[Op]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor,e=t.t;t.plugins.get(Op).register("image",{ariaLabel:e("b"),items:t.config.get("image.toolbar")||[],getRelatedElement:ku})}},class extends Gl{static get pluginName(){return"OpImageAttachmentLookup"}init(){const t=this.editor,e=t.conversion,n=fd(t);e.for("editingDowncast").add(function(t){return t=>{t.on("attribute:src:image",e,{priority:"highest"})};function e(e,n,o){let i=n.attributeNewValue;if(!i||!t.lookupDownloadLocationByName)return;const r=t.lookupDownloadLocationByName(i);n.attributeNewValue=r||i}}(n)),e.for("dataDowncast").add(function(t){return t=>{t.on("attribute:src:image",e,{priority:"highest"})};function e(e,n,o){let i=n.attributeNewValue;if(!i||!t.lookupDownloadLocationByName)return;const r=t.lookupDownloadLocationByName(i);n.attributeNewValue=r||i;const s=o.writer,a=o.mapper.toViewElement(n.item).getChild(0);r&&s.setAttribute(Kw,i,a)}}(n))}},class extends Gl{static get requires(){return[Cm,Nm]}static get pluginName(){return"Link"}},class extends Gl{static get requires(){return[ag,fg]}static get pluginName(){return"List"}},class extends Gl{static get requires(){return[lw,fw]}static get pluginName(){return"TodoList"}},_f,ih,class extends Gl{toMentionAttribute(t,e){return ok(t,e)}static get pluginName(){return"Mention"}static get requires(){return[ek,fk]}},function(t){t.conversion.for("upcast").elementToAttribute({view:{name:"a",key:"data-mention",classes:"mention",attributes:{href:!0,"data-user-id":!0}},model:{key:"mention",value:e=>t.plugins.get("Mention").toMentionAttribute(e,{link:e.getAttribute("href"),userId:e.getAttribute("data-user-id")})},converterPriority:"high"}),t.conversion.for("downcast").attributeToElement({model:"mention",converterPriority:"high",view:(t,e)=>{if(t)return e.createAttributeElement("span",{class:"mention","data-type":t.type||""})}})},class extends Gl{static get pluginName(){return"PasteFromOffice"}static get requires(){return[Nu]}init(){const t=this.editor,e=[];e.push(new tw),e.push(new Gb),t.plugins.get("Clipboard").on("inputTransformation",(t,n)=>{if(n.isTransformedWithPasteFromOffice)return;const o=n.dataTransfer.getData("text/html"),i=e.find(t=>t.isActive(o));i&&(i.execute(n),n.isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends Gl{static get pluginName(){return"OPHelpLinkPlugin"}init(){const t=this.editor,e=(t.model,t.config.get("openProject.helpURL"));t.ui.componentFactory.add("openProjectShowFormattingHelp",t=>{const n=new Wl(t);return n.set({label:window.I18n.t("js.inplace.link_formatting_help"),icon:mg.a,tooltip:!0}),n.on("execute",()=>{window.open(e,"_blank")}),n})}},class extends Gl{static get pluginName(){return"CodeBlock"}static get requires(){return[Ag,Pg]}},class extends Gl{static get pluginName(){return"OPPreview"}init(){const t=this.editor;let e=!1,n=null;t.ui.componentFactory.add("preview",o=>{const i=new Wl(o);i.set({label:this.label,icon:Eg.a,tooltip:!0});let r=function(e){let o,r=jQuery(t.ui.getEditableElement()).parent();o=r.length?r:$editable;let s=jQuery('<div class="ck-editor__preview"></div>');o.siblings(".ck-editor__preview").remove();const a=ud(t,"ckEditorPreview");n=a.render(s[0],e),o.hide(),o.after(s),Rg(t,i)},s=function(){let e=function(t){return _.get(t.config,"_config.openProject.context.previewContext")}(t),n=pd(t).api.v3.previewMarkup(e);jQuery.ajax({data:t.getData(),url:n,response_type:"text",contentType:"text/plain; charset=UTF-8",method:"POST"}).done(r)};return i.on("execute",()=>{e?(e=!1,function(){let e=jQuery(t.ui.getEditableElement()).parent();n(),e.siblings(".ck-editor__preview").remove(),e.show(),Og(t)}()):(e=!0,s())}),i})}get label(){return window.I18n.t("js.editor.preview")}},class extends Gl{static get pluginName(){return"OPSourceCode"}init(){const t=this.editor;let e=!1,n={source:window.I18n.t("js.editor.mode.manual"),wysiwyg:window.I18n.t("js.editor.mode.wysiwyg")};t.ui.componentFactory.add("opShowSource",o=>{const i=new Wl(o);return i.set({label:n.source,class:"",icon:Qw.a,tooltip:!0}),i.on("execute",()=>{e?(e=!1,function(){let e=jQuery(t.ui.getEditableElement()).parent();t.fire("op:source-code-disabled"),e.siblings(".ck-editor__source").remove(),e.show(),Og(t),i.set({label:n.source,class:"",icon:Qw.a,tooltip:!0})}()):(e=!0,function(e){let o,r=jQuery(t.ui.getEditableElement()).parent();o=r.length?r:$editable;let s=jQuery('<div class="ck-editor__source"></div>');o.siblings(".ck-editor__source").remove(),o.hide(),o.after(s),Rg(t,i),t.fire("op:source-code-enabled"),i.set({label:n.wysiwyg,class:"-source-enabled",icon:Xw.a,tooltip:!0})}())}),i})}},function(t){t.data.processor=new Jw},class extends Gl{static get requires(){return[Rb,qb,wd]}static get pluginName(){return"Table"}},class extends Gl{static get requires(){return[Op]}static get pluginName(){return"TableToolbar"}afterInit(){const t=this.editor,e=t.t,n=t.plugins.get(Op),o=t.config.get("table.contentToolbar"),i=t.config.get("table.tableToolbar");o&&n.register("tableContent",{ariaLabel:e("c"),items:o,getRelatedElement:qg}),i&&n.register("table",{ariaLabel:e("c"),items:i,getRelatedElement:zg})}},class extends Gl{init(){const t=this.editor,e=(t.config.get("removePlugins")||[]).map(t=>t.pluginName),n=window.I18n.t("js.editor.macro.dropdown.chose_macro");!0!==t.config.get("openProject.disableAllMacros")&&t.ui.componentFactory.add("macroList",o=>{const i=[];for(const n of gk){if(-1!==e.indexOf(n.pluginName))continue;const o=t.ui.componentFactory.create(n.buttonName);i.push(o)}const r=Bf(o);return function(t,e){const n=t.locale,o=n.t,i=t.toolbarView=new ql(n);i.set("ariaLabel",o("h")),t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>i.items.add(t)),t.panelView.children.add(i),i.items.delegate("execute").to(t)}(r,i),r.buttonView.set({isOn:!1,withText:!0,tooltip:n,label:window.I18n.t("js.editor.macro.dropdown.macros")}),r.toolbarView.isVertical=!0,r.toolbarView.className="op-macro-list-button",r})}}].concat(gk,bk);function kk(t){const e=document.createElement("span");return e.classList.add("mention-list-item"),e.textContent=t.name,e}const _k={heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"}]},toolbar:{},OPMacroEmbeddedTable:{toolbar:["opEditEmbeddedTableQuery"]},OPMacroWpButton:{toolbar:["opEditWpMacroButton"]},OPWikiIncludePage:{toolbar:["opEditWikiIncludeMacroButton"]},OPCodeBlock:{toolbar:["opEditCodeBlock"]},OPChildPages:{toolbar:["opEditChildPagesMacroButton"]},image:{toolbar:["imageStyle:full","|","imageTextAlternative"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},mention:{feeds:[{marker:"@",feed:function(t){let e=fd(this);if(!e||"WorkPackage"!==e._type)return[];const n=e.project.idFromLink,o=pd(this).api.v3.principals(n,t);let i=window.OpenProject.urlRoot+"/users/";return new Promise((t,e)=>{jQuery.getJSON(o,e=>{t(e._embedded.elements.map(t=>{const e=`${t._type.toLowerCase()}#${t.id}`;return{type:"user",id:`@${t.id}`,text:e,name:t.name,link:i+t.id}}))})})},itemRenderer:kk,minimumCharacters:0},{marker:"#",feed:function(t){const e=window.OpenProject.urlRoot+"/work_packages/auto_complete.json";let n=window.OpenProject.urlRoot+"/work_packages/";return new Promise((o,i)=>{jQuery.getJSON(e,{q:t,scope:"all"},t=>{o(t.map(t=>{const e=`#${t.id}`;return{type:"work_package",id:e,text:e,name:t.to_s,link:n+t.id}}))})})},itemRenderer:kk,minimumCharacters:1}]},language:"en"};function vk(t){return(e,n)=>{const o=n.openProject.context;n.removePlugins=n.removePlugins||[];const i=o.resource;if(i&&i.canAddAttachments||n.removePlugins.push(...bk.map(t=>t.pluginName)),!1===o.macros&&(n.openProject.disableAllMacros=!0,n.removePlugins.push(...gk.map(t=>t.pluginName))),Array.isArray(o.macros)){const t=gk.filter(t=>-1===o.macros.indexOf(t.pluginName));n.removePlugins.push(...t)}return t.create(e,n)}}n.d(e,"ConstrainedEditor",function(){return yk}),n.d(e,"FullEditor",function(){return xk});class yk extends Hl{}class xk extends Hl{}window.OPConstrainedEditor=yk,window.OPClassicEditor=xk,xk.createCustomized=vk(xk),xk.builtinPlugins=wk,xk.defaultConfig=Object.assign({},_k),xk.defaultConfig.toolbar={items:["heading","|","bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","insertTable","macroList","|","undo","redo","openProjectShowFormattingHelp","|","preview","opShowSource"]},yk.createCustomized=vk(yk),yk.builtinPlugins=wk,yk.defaultConfig=Object.assign({},_k),yk.defaultConfig.toolbar={items:["bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","openProjectShowFormattingHelp","preview","opShowSource"]}}]).default});
//# sourceMappingURL=ckeditor.js.map