{"version":3,"file":"ckeditor.js","sources":["webpack://ClassicEditor/ckeditor.js"],"sourcesContent":["/*!\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n(function(e){const t=e[\"en\"]=e[\"en\"]||{};t.dictionary=Object.assign(t.dictionary||{},{\"%0 of %1\":\"%0 of %1\",\"Align cell text to the bottom\":\"Align cell text to the bottom\",\"Align cell text to the center\":\"Align cell text to the center\",\"Align cell text to the left\":\"Align cell text to the left\",\"Align cell text to the middle\":\"Align cell text to the middle\",\"Align cell text to the right\":\"Align cell text to the right\",\"Align cell text to the top\":\"Align cell text to the top\",\"Align center\":\"Align center\",\"Align left\":\"Align left\",\"Align right\":\"Align right\",\"Align table to the left\":\"Align table to the left\",\"Align table to the right\":\"Align table to the right\",Alignment:\"Alignment\",\"Almost equal to\":\"Almost equal to\",Angle:\"Angle\",\"Approximately equal to\":\"Approximately equal to\",Aquamarine:\"Aquamarine\",\"Asterisk operator\":\"Asterisk operator\",Background:\"Background\",Big:\"Big\",Black:\"Black\",\"Block quote\":\"Block quote\",Blue:\"Blue\",\"Blue marker\":\"Blue marker\",Bold:\"Bold\",Border:\"Border\",\"Bulleted List\":\"Bulleted List\",Cancel:\"Cancel\",\"Cannot upload file:\":\"Cannot upload file:\",\"Cell properties\":\"Cell properties\",\"Center table\":\"Center table\",\"Centered image\":\"Centered image\",\"Change image text alternative\":\"Change image text alternative\",\"Character categories\":\"Character categories\",\"Choose heading\":\"Choose heading\",Code:\"Code\",Color:\"Color\",\"Color picker\":\"Color picker\",Column:\"Column\",\"Contains as member\":\"Contains as member\",\"Copyright sign\":\"Copyright sign\",\"Could not insert image at the current position.\":\"Could not insert image at the current position.\",\"Could not obtain resized image URL.\":\"Could not obtain resized image URL.\",Dashed:\"Dashed\",\"Decrease indent\":\"Decrease indent\",Default:\"Default\",\"Degree sign\":\"Degree sign\",\"Delete column\":\"Delete column\",\"Delete row\":\"Delete row\",\"Dim grey\":\"Dim grey\",Dimensions:\"Dimensions\",\"Division sign\":\"Division sign\",\"Document colors\":\"Document colors\",Dotted:\"Dotted\",Double:\"Double\",\"Double dagger\":\"Double dagger\",\"Double exclamation mark\":\"Double exclamation mark\",\"Double low-9 quotation mark\":\"Double low-9 quotation mark\",\"Double question mark\":\"Double question mark\",Downloadable:\"Downloadable\",\"Dropdown toolbar\":\"Dropdown toolbar\",\"Edit link\":\"Edit link\",\"Editor toolbar\":\"Editor toolbar\",\"Element of\":\"Element of\",\"Em dash\":\"Em dash\",\"Empty set\":\"Empty set\",\"En dash\":\"En dash\",\"Enter image caption\":\"Enter image caption\",\"Exclamation question mark\":\"Exclamation question mark\",\"Font Background Color\":\"Font Background Color\",\"Font Color\":\"Font Color\",\"Font Family\":\"Font Family\",\"Font Size\":\"Font Size\",\"For all\":\"For all\",\"Fraction slash\":\"Fraction slash\",\"Full size image\":\"Full size image\",\"Greater-than or equal to\":\"Greater-than or equal to\",\"Greater-than sign\":\"Greater-than sign\",Green:\"Green\",\"Green marker\":\"Green marker\",\"Green pen\":\"Green pen\",Grey:\"Grey\",Groove:\"Groove\",\"Header column\":\"Header column\",\"Header row\":\"Header row\",Heading:\"Heading\",\"Heading 1\":\"Heading 1\",\"Heading 2\":\"Heading 2\",\"Heading 3\":\"Heading 3\",\"Heading 4\":\"Heading 4\",\"Heading 5\":\"Heading 5\",\"Heading 6\":\"Heading 6\",Height:\"Height\",Highlight:\"Highlight\",\"Horizontal ellipsis\":\"Horizontal ellipsis\",\"Horizontal text alignment toolbar\":\"Horizontal text alignment toolbar\",Huge:\"Huge\",\"Identical to\":\"Identical to\",\"Image resize list\":\"Image resize list\",\"Image toolbar\":\"Image toolbar\",\"image widget\":\"image widget\",\"Increase indent\":\"Increase indent\",Infinity:\"Infinity\",\"Insert code block\":\"Insert code block\",\"Insert column left\":\"Insert column left\",\"Insert column right\":\"Insert column right\",\"Insert image\":\"Insert image\",\"Insert image or file\":\"Insert image or file\",\"Insert paragraph after block\":\"Insert paragraph after block\",\"Insert paragraph before block\":\"Insert paragraph before block\",\"Insert row above\":\"Insert row above\",\"Insert row below\":\"Insert row below\",\"Insert table\":\"Insert table\",\"Inserting image failed\":\"Inserting image failed\",Inset:\"Inset\",Integral:\"Integral\",Intersection:\"Intersection\",\"Inverted exclamation mark\":\"Inverted exclamation mark\",\"Inverted question mark\":\"Inverted question mark\",Italic:\"Italic\",Justify:\"Justify\",\"Justify cell text\":\"Justify cell text\",\"Latin small letter f with hook\":\"Latin small letter f with hook\",\"Left aligned image\":\"Left aligned image\",\"Left double quotation mark\":\"Left double quotation mark\",\"Left single quotation mark\":\"Left single quotation mark\",\"Left-pointing double angle quotation mark\":\"Left-pointing double angle quotation mark\",\"Less-than or equal to\":\"Less-than or equal to\",\"Less-than sign\":\"Less-than sign\",\"Light blue\":\"Light blue\",\"Light green\":\"Light green\",\"Light grey\":\"Light grey\",Link:\"Link\",\"Link URL\":\"Link URL\",\"Logical and\":\"Logical and\",\"Logical or\":\"Logical or\",Macron:\"Macron\",\"Merge cell down\":\"Merge cell down\",\"Merge cell left\":\"Merge cell left\",\"Merge cell right\":\"Merge cell right\",\"Merge cell up\":\"Merge cell up\",\"Merge cells\":\"Merge cells\",\"Minus sign\":\"Minus sign\",\"Multiplication sign\":\"Multiplication sign\",\"N-ary product\":\"N-ary product\",\"N-ary summation\":\"N-ary summation\",Nabla:\"Nabla\",Next:\"Next\",None:\"None\",\"Not an element of\":\"Not an element of\",\"Not equal to\":\"Not equal to\",\"Not sign\":\"Not sign\",\"Numbered List\":\"Numbered List\",\"Open in a new tab\":\"Open in a new tab\",\"Open link in new tab\":\"Open link in new tab\",Orange:\"Orange\",Original:\"Original\",Outset:\"Outset\",Overline:\"Overline\",Padding:\"Padding\",\"Page break\":\"Page break\",Paragraph:\"Paragraph\",\"Paragraph sign\":\"Paragraph sign\",\"Partial differential\":\"Partial differential\",\"Per mille sign\":\"Per mille sign\",\"Per ten thousand sign\":\"Per ten thousand sign\",\"Pink marker\":\"Pink marker\",\"Plain text\":\"Plain text\",\"Plus-minus sign\":\"Plus-minus sign\",Previous:\"Previous\",\"Proportional to\":\"Proportional to\",Purple:\"Purple\",\"Question exclamation mark\":\"Question exclamation mark\",Red:\"Red\",\"Red pen\":\"Red pen\",Redo:\"Redo\",\"Registered sign\":\"Registered sign\",\"Remove color\":\"Remove color\",\"Remove highlight\":\"Remove highlight\",\"Resize image\":\"Resize image\",\"Resize image to %0\":\"Resize image to %0\",\"Resize image to the original size\":\"Resize image to the original size\",\"Reversed paragraph sign\":\"Reversed paragraph sign\",\"Rich Text Editor\":\"Rich Text Editor\",\"Rich Text Editor, %0\":\"Rich Text Editor, %0\",Ridge:\"Ridge\",\"Right aligned image\":\"Right aligned image\",\"Right double quotation mark\":\"Right double quotation mark\",\"Right single quotation mark\":\"Right single quotation mark\",\"Right-pointing double angle quotation mark\":\"Right-pointing double angle quotation mark\",Row:\"Row\",Save:\"Save\",\"Section sign\":\"Section sign\",\"Select all\":\"Select all\",\"Select column\":\"Select column\",\"Select row\":\"Select row\",\"Selecting resized image failed\":\"Selecting resized image failed\",\"Show more items\":\"Show more items\",\"Side image\":\"Side image\",\"Single left-pointing angle quotation mark\":\"Single left-pointing angle quotation mark\",\"Single low-9 quotation mark\":\"Single low-9 quotation mark\",\"Single right-pointing angle quotation mark\":\"Single right-pointing angle quotation mark\",Small:\"Small\",Solid:\"Solid\",\"Special characters\":\"Special characters\",\"Split cell horizontally\":\"Split cell horizontally\",\"Split cell vertically\":\"Split cell vertically\",\"Square root\":\"Square root\",Strikethrough:\"Strikethrough\",Style:\"Style\",Subscript:\"Subscript\",Superscript:\"Superscript\",\"Table alignment toolbar\":\"Table alignment toolbar\",\"Table cell text alignment\":\"Table cell text alignment\",\"Table properties\":\"Table properties\",\"Table toolbar\":\"Table toolbar\",\"Text alignment\":\"Text alignment\",\"Text alignment toolbar\":\"Text alignment toolbar\",\"Text alternative\":\"Text alternative\",\"Text highlight toolbar\":\"Text highlight toolbar\",'The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".':'The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".','The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".':'The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".',\"There exists\":\"There exists\",\"This link has no URL\":\"This link has no URL\",\"Tilde operator\":\"Tilde operator\",Tiny:\"Tiny\",\"Trade mark sign\":\"Trade mark sign\",Turquoise:\"Turquoise\",\"Two dot leader\":\"Two dot leader\",Underline:\"Underline\",Undo:\"Undo\",Union:\"Union\",Unlink:\"Unlink\",\"Upload failed\":\"Upload failed\",\"Upload in progress\":\"Upload in progress\",\"Vertical text alignment toolbar\":\"Vertical text alignment toolbar\",\"Vulgar fraction one half\":\"Vulgar fraction one half\",\"Vulgar fraction one quarter\":\"Vulgar fraction one quarter\",\"Vulgar fraction three quarters\":\"Vulgar fraction three quarters\",White:\"White\",\"Widget toolbar\":\"Widget toolbar\",Width:\"Width\",Yellow:\"Yellow\",\"Yellow marker\":\"Yellow marker\"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function e(t,n){if(typeof exports===\"object\"&&typeof module===\"object\")module.exports=n();else if(typeof define===\"function\"&&define.amd)define([],n);else if(typeof exports===\"object\")exports[\"ClassicEditor\"]=n();else t[\"ClassicEditor\"]=n()})(window,(function(){return function(e){var t={};function n(o){if(t[o]){return t[o].exports}var i=t[o]={i:o,l:false,exports:{}};e[o].call(i.exports,i,i.exports,n);i.l=true;return i.exports}n.m=e;n.c=t;n.d=function(e,t,o){if(!n.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:o})}};n.r=function(e){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(e,\"__esModule\",{value:true})};n.t=function(e,t){if(t&1)e=n(e);if(t&8)return e;if(t&4&&typeof e===\"object\"&&e&&e.__esModule)return e;var o=Object.create(null);n.r(o);Object.defineProperty(o,\"default\",{enumerable:true,value:e});if(t&2&&typeof e!=\"string\")for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o};n.n=function(e){var t=e&&e.__esModule?function t(){return e[\"default\"]}:function t(){return e};n.d(t,\"a\",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p=\"\";return n(n.s=128)}([function(e,t,n){\"use strict\";n.d(t,\"b\",(function(){return i}));n.d(t,\"a\",(function(){return r}));const o=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class i extends Error{constructor(e,t,n){e=r(e);if(n){e+=\" \"+JSON.stringify(n)}super(e);this.name=\"CKEditorError\";this.context=t;this.data=n}is(e){return e===\"CKEditorError\"}static rethrowUnexpectedError(e,t){if(e.is&&e.is(\"CKEditorError\")){throw e}const n=new i(e.message,t);n.stack=e.stack;throw n}}function r(e){const t=e.match(/^([^:]+):/);if(!t){return e}return e+` Read more: ${o}#error-${t[1]}\\n`}},function(e,t,n){\"use strict\";var o=function e(){var t;return function e(){if(typeof t===\"undefined\"){t=Boolean(window&&document&&document.all&&!window.atob)}return t}}();var i=function e(){var t={};return function e(n){if(typeof t[n]===\"undefined\"){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement){try{o=o.contentDocument.head}catch(e){o=null}}t[n]=o}return t[n]}}();var r=[];function s(e){var t=-1;for(var n=0;n:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.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(e,t,n){var o=n(1);var i=n(23);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}\"},function(e,t,n){var o=n(1);var i=n(25);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}\"},function(e,t,n){var o=n(1);var i=n(27);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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}.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{top:100%;bottom:auto}.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-standard)}[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-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.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-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}\"},function(e,t,n){var o=n(1);var i=n(29);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(31);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:\"\";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.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{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.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)}'},function(e,t,n){var o=n(1);var i=n(33);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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__label,a.ck.ck-button .ck-button__label{display:none}.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:focus:not(:hover) .ck-tooltip,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,border .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}.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 .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.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-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.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-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.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-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(e,t,n){var o=n(1);var i=n(35);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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;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:active{box-shadow:none}.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:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.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(e,t,n){var o=n(1);var i=n(37);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2*var(--ck-switch-button-toggle-spacing))}[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-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 .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-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-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.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(e,t,n){var o=n(1);var i=n(39);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-toolbar-dropdown .ck.ck-toolbar .ck.ck-toolbar__items{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(e,t,n){var o=n(1);var i=n(41);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(43);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.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 .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items>*{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>*,.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}\"},function(e,t,n){var o=n(1);var i=n(45);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}\"},function(e,t,n){var o=n(1);var i=n(47);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(49);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-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_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-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_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}'},function(e,t,n){var o=n(1);var i=n(51);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}\"},function(e,t){e.exports=\".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}\"},function(e,t,n){var o=n(1);var i=n(54);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-radius:0}.ck-rounded-corners [dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow,[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-left-color:var(--ck-color-split-button-hover-border)}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-right-color:var(--ck-color-split-button-hover-border)}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}\"},function(e,t,n){var o=n(1);var i=n(56);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck-content pre{padding:1em;color:#353535;background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;text-align:left;direction:ltr;tab-size:4;white-space:pre-wrap;font-style:normal;min-width:200px}.ck-content pre code{background:unset;padding:0;border-radius:0}.ck.ck-editor__editable pre{position:relative}.ck.ck-editor__editable pre[data-language]:after{content:attr(data-language);position:absolute}:root{--ck-color-code-block-label-background:#757575}.ck.ck-editor__editable pre[data-language]:after{top:-1px;right:10px;background:var(--ck-color-code-block-label-background);font-size:10px;font-family:var(--ck-font-face);line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);color:#fff;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}\"},function(e,t,n){var o=n(1);var i=n(58);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}\"},function(e,t,n){var o=n(1);var i=n(60);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}\"},function(e,t,n){var o=n(1);var i=n(62);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}\"},function(e,t){e.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(e,t,n){var o=n(1);var i=n(65);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{color:var(--ck-highlight-pen-red);background-color:transparent}.ck-content .pen-green{color:var(--ck-highlight-pen-green);background-color:transparent}\"},function(e,t,n){var o=n(1);var i=n(67);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(-0.5*var(--ck-widget-outline-thickness));left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(-0.5*var(--ck-widget-outline-thickness));right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:\"\";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(-1*var(--ck-widget-outline-thickness));right:calc(-1*var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(-1*var(--ck-widget-outline-thickness) - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(-1*var(--ck-widget-outline-thickness) - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},function(e,t,n){var o=n(1);var i=n(69);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{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 .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{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-handle .ck-widget__selection-handle .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-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}\"},function(e,t,n){var o=n(1);var i=n(71);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view>.ck.ck-label{width:100%;text-overflow:ellipsis;overflow:hidden}\"},function(e,t,n){var o=n(1);var i=n(73);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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:box-shadow .2s ease-in-out,border .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(e,t,n){var o=n(1);var i=n(75);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{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-field-view{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-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-field-view .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(e,t,n){var o=n(1);var i=n(77);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(79);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(81);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(83);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(85);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".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}\"},function(e,t,n){var o=n(1);var i=n(87);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}\"},function(e,t,n){var o=n(1);var i=n(89);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.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(e,t,n){var o=n(1);var i=n(91);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(93);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(95);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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(e,t,n){var o=n(1);var i=n(97);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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-field-view{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-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-field-view .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-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .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(e,t,n){var o=n(1);var i=n(99);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.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-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 .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: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(e,t,n){var o=n(1);var i=n(101);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports='.ck-content .page-break{position:relative;clear:both;padding:5px 0;display:flex;align-items:center;justify-content:center}.ck-content .page-break:after{content:\"\";position:absolute;border-bottom:2px dashed #c4c4c4;width:100%}.ck-content .page-break__label{position:relative;z-index:1;padding:.3em .6em;display:block;text-transform:uppercase;border:1px solid #c4c4c4;border-radius:2px;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;color:#333;background:#fff;box-shadow:2px 2px 1px rgba(0,0,0,.15);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}}'},function(e,t,n){var o=n(1);var i=n(103);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}\"},function(e,t,n){var o=n(1);var i=n(105);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-character-grid .ck-character-grid__tiles{display:grid;grid-template-columns:repeat(10,1fr)}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{overflow-y:auto;overflow-x:hidden;width:350px;max-height:200px}.ck.ck-character-grid .ck-character-grid__tiles{margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}.ck.ck-character-grid .ck-character-grid__tile{width:var(--ck-character-grid-tile-size);height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);font-size:1.2em;padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);width:100%;text-align:center}\"},function(e,t,n){var o=n(1);var i=n(107);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-character-info{display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-large);border-top:1px solid var(--ck-color-base-border)}.ck.ck-character-info>*{text-transform:uppercase;font-size:var(--ck-font-size-small)}.ck.ck-character-info .ck-character-info__name{max-width:280px;text-overflow:ellipsis;overflow:hidden}.ck.ck-character-info .ck-character-info__code{opacity:.6}\"},function(e,t,n){var o=n(1);var i=n(109);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-special-characters-navigation>.ck-label{max-width:160px;text-overflow:ellipsis;overflow:hidden}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}\"},function(e,t,n){var o=n(1);var i=n(111);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}\"},function(e,t,n){var o=n(1);var i=n(113);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}: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 .ck-insert-table-dropdown__grid{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-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}\"},function(e,t,n){var o=n(1);var i=n(115);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:\"\";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},function(e,t,n){var o=n(1);var i=n(117);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}\"},function(e,t,n){var o=n(1);var i=n(119);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-input-color{width:100%;display:flex}.ck.ck-input-color>input.ck.ck-input-text{min-width:auto;flex-grow:1}.ck.ck-input-color>input.ck.ck-input-text:active,.ck.ck-input-color>input.ck.ck-input-text:focus{z-index:var(--ck-z-default)}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{position:relative;overflow:hidden}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{position:absolute;display:block}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-1px}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview{border-radius:0}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview{width:20px;height:20px;border:1px solid var(--ck-color-input-border)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{top:-30%;left:50%;height:150%;width:8%;background:red;border-radius:2px;transform:rotate(45deg);transform-origin:50%}.ck.ck-input-color .ck.ck-input-color__remove-color{width:100%;border-bottom:1px solid var(--ck-color-input-border);padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:0;margin-left:var(--ck-spacing-standard)}\"},function(e,t,n){var o=n(1);var i=n(121);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{width:100%;min-width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}\"},function(e,t){e.exports=\".ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}\"},function(e,t){e.exports='.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view{display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{flex-grow:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{flex-wrap:wrap;align-items:center}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{display:flex;flex-direction:column-reverse;align-items:center}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{position:absolute;left:50%;bottom:calc(-1*var(--ck-table-properties-error-arrow-size));transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:\"\";position:absolute;top:calc(-1*var(--ck-table-properties-error-arrow-size));left:50%;transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style{width:80px;min-width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{width:50px;min-width:50px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view>.ck-label{font-size:10px;text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:start;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{border-radius:0}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{background:var(--ck-color-base-error);color:var(--ck-color-base-background);padding:var(--ck-spacing-small) var(--ck-spacing-medium);min-width:var(--ck-table-properties-min-error-width);text-align:center}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-left:var(--ck-table-properties-error-arrow-size) solid transparent;border-bottom:var(--ck-table-properties-error-arrow-size) solid var(--ck-color-base-error);border-right:var(--ck-table-properties-error-arrow-size) solid transparent;border-top:0 solid transparent}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}'},function(e,t,n){var o=n(1);var i=n(125);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{flex-grow:0}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{padding:0;width:35%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none}\"},function(e,t,n){var o=n(1);var i=n(127);i=i.__esModule?i.default:i;if(typeof i===\"string\"){i=[[e.i,i,\"\"]]}var r={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};r.insert=\"head\";r.singleton=true;var s=o(i,r);e.exports=i.locals||{}},function(e,t){e.exports=\".ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{flex-wrap:wrap;flex-basis:0;align-content:baseline}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}\"},function(e,t,n){\"use strict\";n.r(t);var o=n(3);var i=o[\"a\"].Symbol;var r=i;var s=Object.prototype;var a=s.hasOwnProperty;var c=s.toString;var l=r?r.toStringTag:undefined;function d(e){var t=a.call(e,l),n=e[l];try{e[l]=undefined;var o=true}catch(e){}var i=c.call(e);if(o){if(t){e[l]=n}else{delete e[l]}}return i}var u=d;var h=Object.prototype;var f=h.toString;function g(e){return f.call(e)}var m=g;var p=\"[object Null]\",b=\"[object Undefined]\";var w=r?r.toStringTag:undefined;function k(e){if(e==null){return e===undefined?b:p}return w&&w in Object(e)?u(e):m(e)}var _=k;function v(e,t){return function(n){return e(t(n))}}var y=v;var x=y(Object.getPrototypeOf,Object);var C=x;function A(e){return e!=null&&typeof e==\"object\"}var T=A;var P=\"[object Object]\";var S=Function.prototype,E=Object.prototype;var R=S.toString;var I=E.hasOwnProperty;var O=R.call(Object);function V(e){if(!T(e)||_(e)!=P){return false}var t=C(e);if(t===null){return true}var n=I.call(t,\"constructor\")&&t.constructor;return typeof n==\"function\"&&n instanceof n&&R.call(n)==O}var M=V;function N(){this.__data__=[];this.size=0}var z=N;function B(e,t){return e===t||e!==e&&t!==t}var D=B;function F(e,t){var n=e.length;while(n--){if(D(e[n][0],t)){return n}}return-1}var L=F;var H=Array.prototype;var j=H.splice;function q(e){var t=this.__data__,n=L(t,e);if(n<0){return false}var o=t.length-1;if(n==o){t.pop()}else{j.call(t,n,1)}--this.size;return true}var W=q;function $(e){var t=this.__data__,n=L(t,e);return n<0?undefined:t[n][1]}var U=$;function G(e){return L(this.__data__,e)>-1}var K=G;function J(e,t){var n=this.__data__,o=L(n,e);if(o<0){++this.size;n.push([e,t])}else{n[o][1]=t}return this}var Y=J;function Q(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t-1&&e%1==0&&e-1&&e%1==0&&e<=tn}var on=nn;var rn=\"[object Arguments]\",sn=\"[object Array]\",an=\"[object Boolean]\",cn=\"[object Date]\",ln=\"[object Error]\",dn=\"[object Function]\",un=\"[object Map]\",hn=\"[object Number]\",fn=\"[object Object]\",gn=\"[object RegExp]\",mn=\"[object Set]\",pn=\"[object String]\",bn=\"[object WeakMap]\";var wn=\"[object ArrayBuffer]\",kn=\"[object DataView]\",_n=\"[object Float32Array]\",vn=\"[object Float64Array]\",yn=\"[object Int8Array]\",xn=\"[object Int16Array]\",Cn=\"[object Int32Array]\",An=\"[object Uint8Array]\",Tn=\"[object Uint8ClampedArray]\",Pn=\"[object Uint16Array]\",Sn=\"[object Uint32Array]\";var En={};En[_n]=En[vn]=En[yn]=En[xn]=En[Cn]=En[An]=En[Tn]=En[Pn]=En[Sn]=true;En[rn]=En[sn]=En[wn]=En[an]=En[kn]=En[cn]=En[ln]=En[dn]=En[un]=En[hn]=En[fn]=En[gn]=En[mn]=En[pn]=En[bn]=false;function Rn(e){return T(e)&&on(e.length)&&!!En[_(e)]}var In=Rn;function On(e){return function(t){return e(t)}}var Vn=On;var Mn=n(5);var Nn=Mn[\"a\"]&&Mn[\"a\"].isTypedArray;var zn=Nn?Vn(Nn):In;var Bn=zn;var Dn=Object.prototype;var Fn=Dn.hasOwnProperty;function Ln(e,t){var n=Jt(e),o=!n&&Gt(e),i=!n&&!o&&Object(Yt[\"a\"])(e),r=!n&&!o&&!i&&Bn(e),s=n||o||i||r,a=s?Ft(e.length,String):[],c=a.length;for(var l in e){if((t||Fn.call(e,l))&&!(s&&(l==\"length\"||i&&(l==\"offset\"||l==\"parent\")||r&&(l==\"buffer\"||l==\"byteLength\"||l==\"byteOffset\")||en(l,c)))){a.push(l)}}return a}var Hn=Ln;var jn=Object.prototype;function qn(e){var t=e&&e.constructor,n=typeof t==\"function\"&&t.prototype||jn;return e===n}var Wn=qn;var $n=y(Object.keys,Object);var Un=$n;var Gn=Object.prototype;var Kn=Gn.hasOwnProperty;function Jn(e){if(!Wn(e)){return Un(e)}var t=[];for(var n in Object(e)){if(Kn.call(e,n)&&n!=\"constructor\"){t.push(n)}}return t}var Yn=Jn;function Qn(e){return e!=null&&on(e.length)&&!ge(e)}var Xn=Qn;function Zn(e){return Xn(e)?Hn(e):Yn(e)}var eo=Zn;function to(e,t){return e&&Bt(t,eo(t),e)}var no=to;function oo(e){var t=[];if(e!=null){for(var n in Object(e)){t.push(n)}}return t}var io=oo;var ro=Object.prototype;var so=ro.hasOwnProperty;function ao(e){if(!ce(e)){return io(e)}var t=Wn(e),n=[];for(var o in e){if(!(o==\"constructor\"&&(t||!so.call(e,o)))){n.push(o)}}return n}var co=ao;function lo(e){return Xn(e)?Hn(e,true):co(e)}var uo=lo;function ho(e,t){return e&&Bt(t,uo(t),e)}var fo=ho;var go=n(8);function mo(e,t){var n=-1,o=e.length;t||(t=Array(o));while(++n{this._setToTarget(e,o,t[o],n)})}}function Yr(e){return Ur(e,Qr)}function Qr(e){return Kr(e)?e:undefined}function Xr(){return function e(){e.called=true}}var Zr=Xr;class es{constructor(e,t){this.source=e;this.name=t;this.path=[];this.stop=Zr();this.off=Zr()}}const ts=new Array(256).fill().map((e,t)=>(\"0\"+t.toString(16)).slice(-2));function ns(){const e=Math.random()*4294967296>>>0;const t=Math.random()*4294967296>>>0;const n=Math.random()*4294967296>>>0;const o=Math.random()*4294967296>>>0;return\"e\"+ts[e>>0&255]+ts[e>>8&255]+ts[e>>16&255]+ts[e>>24&255]+ts[t>>0&255]+ts[t>>8&255]+ts[t>>16&255]+ts[t>>24&255]+ts[n>>0&255]+ts[n>>8&255]+ts[n>>16&255]+ts[n>>24&255]+ts[o>>0&255]+ts[o>>8&255]+ts[o>>16&255]+ts[o>>24&255]}const os={get(e){if(typeof e!=\"number\"){return this[e]||this.normal}else{return e}},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var is=os;var rs=n(6);var ss=n(0);const as=Symbol(\"listeningTo\");const cs=Symbol(\"emitterId\");const ls={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){let o=false;const i=function(e,...n){if(!o){o=true;e.off();t.call(this,e,...n)}};this.listenTo(this,e,i,n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,o={}){let i,r;if(!this[as]){this[as]={}}const s=this[as];if(!fs(e)){hs(e)}const a=fs(e);if(!(i=s[a])){i=s[a]={emitter:e,callbacks:{}}}if(!(r=i.callbacks[t])){r=i.callbacks[t]=[]}r.push(n);ps(e,t);const c=bs(e,t);const l=is.get(o.priority);const d={callback:n,priority:l};for(const e of c){let t=false;for(let n=0;n{if(!this._delegations){this._delegations=new Map}e.forEach(e=>{const o=this._delegations.get(e);if(!o){this._delegations.set(e,new Map([[t,n]]))}else{o.set(t,n)}})}}},stopDelegating(e,t){if(!this._delegations){return}if(!e){this._delegations.clear()}else if(!t){this._delegations.delete(e)}else{const n=this._delegations.get(e);if(n){n.delete(t)}}}};var ds=ls;function us(e,t){if(e[as]&&e[as][t]){return e[as][t].emitter}return null}function hs(e,t){if(!e[cs]){e[cs]=t||ns()}}function fs(e){return e[cs]}function gs(e){if(!e._events){Object.defineProperty(e,\"_events\",{value:{}})}return e._events}function ms(){return{callbacks:[],childEvents:[]}}function ps(e,t){const n=gs(e);if(n[t]){return}let o=t;let i=null;const r=[];while(o!==\"\"){if(n[o]){break}n[o]=ms();r.push(n[o]);if(i){n[o].childEvents.push(i)}i=o;o=o.substr(0,o.lastIndexOf(\":\"))}if(o!==\"\"){for(const e of r){e.callbacks=n[o].callbacks.slice()}n[o].childEvents.push(i)}}function bs(e,t){const n=gs(e)[t];if(!n){return[]}let o=[n.callbacks];for(let t=0;t-1){return ws(e,t.substr(0,t.lastIndexOf(\":\")))}else{return null}}return n.callbacks}function ks(e,t,n){for(let[o,i]of e){if(!i){i=t.name}else if(typeof i==\"function\"){i=i(t.name)}const e=new es(t.source,i);e.path=[...t.path];o.fire(e,...n)}}function _s(e,t,n){const o=bs(e,t);for(const e of o){for(let t=0;t{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in e.prototype){return}const o=Object.getOwnPropertyDescriptor(t,n);o.enumerable=false;Object.defineProperty(e.prototype,n,o)})})}class xs{constructor(e={},t={}){const n=vs(e);if(!n){t=e}this._items=[];this._itemMap=new Map;this._idProperty=t.idProperty||\"id\";this._bindToExternalToInternalMap=new WeakMap;this._bindToInternalToExternalMap=new WeakMap;this._skippedIndexesFromExternal=[];if(n){for(const t of e){this._items.push(t);this._itemMap.set(this._getItemIdBeforeAdding(t),t)}}}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(t===undefined){t=this._items.length}else if(t>this._items.length||t<0){throw new ss[\"b\"](\"collection-add-item-invalid-index\",this)}for(let n=0;n{this._setUpBindToBinding(t=>new e(t))},using:e=>{if(typeof e==\"function\"){this._setUpBindToBinding(t=>e(t))}else{this._setUpBindToBinding(t=>t[e])}}}}_setUpBindToBinding(e){const t=this._bindToCollection;const n=(n,o,i)=>{const r=t._bindToCollection==this;const s=t._bindToInternalToExternalMap.get(o);if(r&&s){this._bindToExternalToInternalMap.set(o,s);this._bindToInternalToExternalMap.set(s,o)}else{const n=e(o);if(!n){this._skippedIndexesFromExternal.push(i);return}let r=i;for(const e of this._skippedIndexesFromExternal){if(i>e){r--}}for(const e of t._skippedIndexesFromExternal){if(r>=e){r++}}this._bindToExternalToInternalMap.set(o,n);this._bindToInternalToExternalMap.set(n,o);this.add(n,r);for(let e=0;e{const o=this._bindToExternalToInternalMap.get(t);if(o){this.remove(o)}this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>{if(nt){e.push(t)}return e},[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){n=e[t];if(typeof n!=\"string\"){throw new ss[\"b\"](\"collection-add-invalid-id\",this)}if(this.get(n)){throw new ss[\"b\"](\"collection-add-item-already-exists\",this)}}else{e[t]=n=ns()}return n}_remove(e){let t,n,o;let i=false;const r=this._idProperty;if(typeof e==\"string\"){n=e;o=this._itemMap.get(n);i=!o;if(o){t=this._items.indexOf(o)}}else if(typeof e==\"number\"){t=e;o=this._items[t];i=!o;if(o){n=o[r]}}else{o=e;n=o[r];t=this._items.indexOf(o);i=t==-1||!this._itemMap.get(n)}if(i){throw new ss[\"b\"](\"collection-remove-404: Item not found.\",this)}this._items.splice(t,1);this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(o);this._bindToInternalToExternalMap.delete(o);this._bindToExternalToInternalMap.delete(s);this.fire(\"remove\",o,t);return[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ys(xs,ds);class Cs{constructor(e,t=[],n=[]){this._context=e;this._plugins=new Map;this._availablePlugins=new Map;for(const e of t){if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}this._contextPlugins=new Map;for(const[e,t]of n){this._contextPlugins.set(e,t);this._contextPlugins.set(t,e);if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}}*[Symbol.iterator](){for(const e of this._plugins){if(typeof e[0]==\"function\"){yield e}}}get(e){const t=this._plugins.get(e);if(!t){const t=\"plugincollection-plugin-not-loaded: The requested plugin is not loaded.\";let n=e;if(typeof e==\"function\"){n=e.pluginName||e.name}throw new ss[\"b\"](t,this._context,{plugin:n})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const n=this;const o=this._context;const i=new Set;const r=[];const s=g(e);const a=g(t);const c=f(e);if(c){const e=\"plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.\";console.error(Object(ss[\"a\"])(e),{plugins:c});return Promise.reject(new ss[\"b\"](e,o,{plugins:c}))}return Promise.all(s.map(l)).then(()=>d(r,\"init\")).then(()=>d(r,\"afterInit\")).then(()=>r);function l(e){if(a.includes(e)){return}if(n._plugins.has(e)||i.has(e)){return}return u(e).catch(t=>{console.error(Object(ss[\"a\"])(\"plugincollection-load: It was not possible to load the plugin.\"),{plugin:e});throw t})}function d(e,t){return e.reduce((e,o)=>{if(!o[t]){return e}if(n._contextPlugins.has(o)){return e}return e.then(o[t].bind(o))},Promise.resolve())}function u(e){return new Promise(s=>{i.add(e);if(e.requires){e.requires.forEach(n=>{const i=h(n);if(e.isContextPlugin&&!i.isContextPlugin){throw new ss[\"b\"](\"plugincollection-context-required: Context plugin can not require plugin which is not a context plugin\",null,{plugin:i.name,requiredBy:e.name})}if(t.includes(i)){throw new ss[\"b\"](\"plugincollection-required: Cannot load a plugin because one of its dependencies is listed in\"+\"the `removePlugins` option.\",o,{plugin:i.name,requiredBy:e.name})}l(i)})}const a=n._contextPlugins.get(e)||new e(o);n._add(e,a);r.push(a);s()})}function h(e){if(typeof e==\"function\"){return e}return n._availablePlugins.get(e)}function f(e){const t=[];for(const n of e){if(!h(n)){t.push(n)}}return t.length?t:null}function g(e){return e.map(e=>h(e)).filter(e=>!!e)}}destroy(){const e=[];for(const[,t]of this){if(typeof t.destroy==\"function\"&&!this._contextPlugins.has(t)){e.push(t.destroy())}}return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(!n){return}if(this._plugins.has(n)){throw new ss[\"b\"](\"plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.\",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e})}this._plugins.set(n,t)}}ys(Cs,ds);if(!window.CKEDITOR_TRANSLATIONS){window.CKEDITOR_TRANSLATIONS={}}function As(e,t,n){if(!window.CKEDITOR_TRANSLATIONS[e]){window.CKEDITOR_TRANSLATIONS[e]={}}const o=window.CKEDITOR_TRANSLATIONS[e];o.dictionary=o.dictionary||{};o.getPluralForm=n||o.getPluralForm;Object.assign(o.dictionary,t)}function Ts(e,t,n=1){if(typeof n!==\"number\"){throw new ss[\"b\"](\"translation-service-quantity-not-a-number: Expecting `quantity` to be a number.\",null,{quantity:n})}const o=Es();if(o===1){e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]}const i=t.id||t.string;if(o===0||!Ss(e,i)){if(n!==1){return t.plural}return t.string}const r=window.CKEDITOR_TRANSLATIONS[e].dictionary;const s=window.CKEDITOR_TRANSLATIONS[e].getPluralForm||(e=>e===1?0:1);if(typeof r[i]===\"string\"){return r[i]}const a=Number(s(n));return r[i][a]}function Ps(){window.CKEDITOR_TRANSLATIONS={}}function Ss(e,t){return!!window.CKEDITOR_TRANSLATIONS[e]&&!!window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}function Es(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}const Rs=[\"ar\",\"fa\",\"he\",\"ku\",\"ug\"];class Is{constructor(e={}){this.uiLanguage=e.uiLanguage||\"en\";this.contentLanguage=e.contentLanguage||this.uiLanguage;this.uiLanguageDirection=Vs(this.uiLanguage);this.contentLanguageDirection=Vs(this.contentLanguage);this.t=(e,t)=>this._t(e,t)}get language(){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.\");return this.uiLanguage}_t(e,t=[]){if(!Array.isArray(t)){t=[t]}if(typeof e===\"string\"){e={string:e}}const n=!!e.plural;const o=n?t[0]:1;const i=Ts(this.uiLanguage,e,o);return Os(i,t)}}function Os(e,t){return e.replace(/%(\\d+)/g,(e,n)=>ne.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner){throw new ss[\"b\"](\"context-addEditor-private-context: Cannot add multiple editors to the context which is created by the editor.\")}this.editors.add(e);if(t){this._contextOwner=e}}_removeEditor(e){if(this.editors.has(e)){this.editors.remove(e)}if(this._contextOwner===e){return this.destroy()}return Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names()){if(![\"plugins\",\"removePlugins\",\"extraPlugins\"].includes(t)){e[t]=this.config.get(t)}}return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}function Ns(e,t){const n=Math.min(e.length,t.length);for(let o=0;oe.data.length){throw new ss[\"b\"](\"view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\",this)}if(n<0||t+n>e.data.length){throw new ss[\"b\"](\"view-textproxy-wrong-length: Given length value is incorrect.\",this)}this.data=e.data.substring(t,t+n);this.offsetInText=t}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(e){return e===\"$textProxy\"||e===\"view:$textProxy\"||e===\"textProxy\"||e===\"view:textProxy\"}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let n=e.includeSelf?this.textNode:this.parent;while(n!==null){t[e.parentFirst?\"push\":\"unshift\"](n);n=n.parent}return t}}function js(e){const t=new Map;for(const n in e){t.set(n,e[n])}return t}function qs(e){if(vs(e)){return new Map(e)}else{return js(e)}}class Ws{constructor(...e){this._patterns=[];this.add(...e)}add(...e){for(let t of e){if(typeof t==\"string\"||t instanceof RegExp){t={name:t}}if(t.classes&&(typeof t.classes==\"string\"||t.classes instanceof RegExp)){t.classes=[t.classes]}this._patterns.push(t)}}match(...e){for(const t of e){for(const e of this._patterns){const n=$s(t,e);if(n){return{element:t,pattern:e,match:n}}}}return null}matchAll(...e){const t=[];for(const n of e){for(const e of this._patterns){const o=$s(n,e);if(o){t.push({element:n,pattern:e,match:o})}}}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1){return null}const e=this._patterns[0];const t=e.name;return typeof e!=\"function\"&&t&&!(t instanceof RegExp)?t:null}}function $s(e,t){if(typeof t==\"function\"){return t(e)}const n={};if(t.name){n.name=Us(t.name,e.name);if(!n.name){return null}}if(t.attributes){n.attributes=Gs(t.attributes,e);if(!n.attributes){return null}}if(t.classes){n.classes=Ks(t.classes,e);if(!n.classes){return false}}if(t.styles){n.styles=Js(t.styles,e);if(!n.styles){return false}}return n}function Us(e,t){if(e instanceof RegExp){return e.test(t)}return e===t}function Gs(e,t){const n=[];for(const o in e){const i=e[o];if(t.hasAttribute(o)){const e=t.getAttribute(o);if(i===true){n.push(o)}else if(i instanceof RegExp){if(i.test(e)){n.push(o)}else{return null}}else if(e===i){n.push(o)}else{return null}}else{return null}}return n}function Ks(e,t){const n=[];for(const o of e){if(o instanceof RegExp){const e=t.getClassNames();for(const t of e){if(o.test(t)){n.push(t)}}if(n.length===0){return null}}else if(t.hasClass(o)){n.push(o)}else{return null}}return n}function Js(e,t){const n=[];for(const o in e){const i=e[o];if(t.hasStyle(o)){const e=t.getStyle(o);if(i instanceof RegExp){if(i.test(e)){n.push(o)}else{return null}}else if(e===i){n.push(o)}else{return null}}else{return null}}return n}var Ys=\"[object Symbol]\";function Qs(e){return typeof e==\"symbol\"||T(e)&&_(e)==Ys}var Xs=Qs;var Zs=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,ea=/^\\w*$/;function ta(e,t){if(Jt(e)){return false}var n=typeof e;if(n==\"number\"||n==\"symbol\"||n==\"boolean\"||e==null||Xs(e)){return true}return ea.test(e)||!Zs.test(e)||t!=null&&e in Object(t)}var na=ta;var oa=\"Expected a function\";function ia(e,t){if(typeof e!=\"function\"||t!=null&&typeof t!=\"function\"){throw new TypeError(oa)}var n=function(){var o=arguments,i=t?t.apply(this,o):o[0],r=n.cache;if(r.has(i)){return r.get(i)}var s=e.apply(this,o);n.cache=r.set(i,s)||r;return s};n.cache=new(ia.Cache||_t);return n}ia.Cache=_t;var ra=ia;var sa=500;function aa(e){var t=ra(e,(function(e){if(n.size===sa){n.clear()}return e}));var n=t.cache;return t}var ca=aa;var la=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;var da=/\\\\(\\\\)?/g;var ua=ca((function(e){var t=[];if(e.charCodeAt(0)===46){t.push(\"\")}e.replace(la,(function(e,n,o,i){t.push(o?i.replace(da,\"$1\"):n||e)}));return t}));var ha=ua;function fa(e,t){var n=-1,o=e==null?0:e.length,i=Array(o);while(++ni?0:i+t}n=n>i?i:n;if(n<0){n+=i}i=t>n?0:n-t>>>0;t>>>=0;var r=Array(i);while(++o0){if(++t>=gc){return arguments[0]}}else{t=0}return e.apply(undefined,arguments)}}var wc=bc;var kc=wc(fc);var _c=kc;function vc(e,t){return _c(lc(e,t,ic),e+\"\")}var yc=vc;function xc(e,t,n){if(!ce(n)){return false}var o=typeof t;if(o==\"number\"?Xn(n)&&en(t,n.length):o==\"string\"&&t in n){return D(n[t],e)}return false}var Cc=xc;function Ac(e){return yc((function(t,n){var o=-1,i=n.length,r=i>1?n[i-1]:undefined,s=i>2?n[2]:undefined;r=e.length>3&&typeof r==\"function\"?(i--,r):undefined;if(s&&Cc(n[0],n[1],s)){r=i<3?undefined:r;i=1}t=Object(t);while(++ot===e);return Array.isArray(n)}set(e,t){if(ce(e)){for(const[t,n]of Object.entries(e)){this._styleProcessor.toNormalizedForm(t,n,this._styles)}}else{this._styleProcessor.toNormalizedForm(e,t,this._styles)}}remove(e){const t=zc(e);Da(this._styles,t);delete this._styles[e];this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){if(this.isEmpty){return\"\"}return this._getStylesEntries().map(e=>e.join(\":\")).sort().join(\";\")+\";\"}getAsString(e){if(this.isEmpty){return}if(this._styles[e]&&!ce(this._styles[e])){return this._styles[e]}const t=this._styleProcessor.getReducedForm(e,this._styles);const n=t.find(([t])=>t===e);if(Array.isArray(n)){return n[1]}}getStyleNames(){if(this.isEmpty){return[]}const e=this._getStylesEntries();return e.map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[];const t=Object.keys(this._styles);for(const n of t){e.push(...this._styleProcessor.getReducedForm(n,this._styles))}return e}_cleanEmptyObjectsOnPath(e){const t=e.split(\".\");const n=t.length>1;if(!n){return}const o=t.splice(0,t.length-1).join(\".\");const i=La(this._styles,o);if(!i){return}const r=!Array.from(Object.keys(i)).length;if(r){this.remove(o)}}}class Mc{constructor(){this._normalizers=new Map;this._extractors=new Map;this._reducers=new Map;this._consumables=new Map}toNormalizedForm(e,t,n){if(ce(t)){Bc(n,zc(e),t);return}if(this._normalizers.has(e)){const o=this._normalizers.get(e);const{path:i,value:r}=o(t);Bc(n,i,r)}else{Bc(n,e,t)}}getNormalized(e,t){if(!e){return Sc({},t)}if(t[e]!==undefined){return t[e]}if(this._extractors.has(e)){const n=this._extractors.get(e);if(typeof n===\"string\"){return La(t,n)}const o=n(e,t);if(o){return o}}return La(t,zc(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);if(n===undefined){return[]}if(this._reducers.has(e)){const t=this._reducers.get(e);return t(n)}return[[e,n]]}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t){this._mapStyleNames(n,[e])}}_mapStyleNames(e,t){if(!this._consumables.has(e)){this._consumables.set(e,[])}this._consumables.get(e).push(...t)}}function Nc(e){let t=null;let n=0;let o=0;let i=null;const r=new Map;if(e===\"\"){return r}if(e.charAt(e.length-1)!=\";\"){e=e+\";\"}for(let s=0;s0){yield\"class\"}if(!this._styles.isEmpty){yield\"style\"}yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries();if(this._classes.size>0){yield[\"class\",this.getAttribute(\"class\")]}if(!this._styles.isEmpty){yield[\"style\",this.getAttribute(\"style\")]}}getAttribute(e){if(e==\"class\"){if(this._classes.size>0){return[...this._classes].join(\" \")}return undefined}if(e==\"style\"){const e=this._styles.toString();return e==\"\"?undefined:e}return this._attrs.get(e)}hasAttribute(e){if(e==\"class\"){return this._classes.size>0}if(e==\"style\"){return!this._styles.isEmpty}return this._attrs.has(e)}isSimilar(e){if(!(e instanceof Dc)){return false}if(this===e){return true}if(this.name!=e.name){return false}if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size){return false}for(const[t,n]of this._attrs){if(!e._attrs.has(t)||e._attrs.get(t)!==n){return false}}for(const t of this._classes){if(!e._classes.has(t)){return false}}for(const t of this._styles.getStyleNames()){if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t)){return false}}return true}hasClass(...e){for(const t of e){if(!this._classes.has(t)){return false}}return true}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...e){for(const t of e){if(!this._styles.has(t)){return false}}return true}findAncestor(...e){const t=new Ws(...e);let n=this.parent;while(n){if(t.match(n)){return n}n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(\",\");const t=this._styles.toString();const n=Array.from(this._attrs).map(e=>`${e[0]}=\"${e[1]}\"`).sort().join(\" \");return this.name+(e==\"\"?\"\":` class=\"${e}\"`)+(!t?\"\":` style=\"${t}\"`)+(n==\"\"?\"\":` ${n}`)}_clone(e=false){const t=[];if(e){for(const n of this.getChildren()){t.push(n._clone(e))}}const n=new this.constructor(this.document,this.name,this._attrs,t);n._classes=new Set(this._classes);n._styles.set(this._styles.getNormalized());n._customProperties=new Map(this._customProperties);n.getFillerOffset=this.getFillerOffset;return n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange(\"children\",this);let n=0;const o=Hc(this.document,t);for(const t of o){if(t.parent!==null){t._remove()}t.parent=this;t.document=this.document;this._children.splice(e,0,t);e++;n++}return n}_removeChildren(e,t=1){this._fireChange(\"children\",this);for(let n=e;n0){this._classes.clear();return true}return false}if(e==\"style\"){if(!this._styles.isEmpty){this._styles.clear();return true}return false}return this._attrs.delete(e)}_addClass(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._classes.add(e))}_removeClass(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._classes.delete(e))}_setStyle(e,t){this._fireChange(\"attributes\",this);this._styles.set(e,t)}_removeStyle(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._styles.remove(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Fc(e){e=qs(e);for(const[t,n]of e){if(n===null){e.delete(t)}else if(typeof n!=\"string\"){e.set(t,String(n))}}return e}function Lc(e,t){const n=t.split(/\\s+/);e.clear();n.forEach(t=>e.add(t))}function Hc(e,t){if(typeof t==\"string\"){return[new Ls(e,t)]}if(!vs(t)){t=[t]}return Array.from(t).map(t=>{if(typeof t==\"string\"){return new Ls(e,t)}if(t instanceof Hs){return new Ls(e,t.data)}return t})}class jc extends Dc{constructor(e,t,n,o){super(e,t,n,o);this.getFillerOffset=qc}is(e,t=null){if(!t){return e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\")}}}function qc(){const e=[...this.getChildren()];const t=e[this.childCount-1];if(t&&t.is(\"element\",\"br\")){return this.childCount}for(const t of e){if(!t.is(\"uiElement\")){return null}}return this.childCount}var Wc=Tc((function(e,t){Bt(t,uo(t),e)}));var $c=Wc;const Uc=Symbol(\"observableProperties\");const Gc=Symbol(\"boundObservables\");const Kc=Symbol(\"boundProperties\");const Jc={set(e,t){if(ce(e)){Object.keys(e).forEach(t=>{this.set(t,e[t])},this);return}Qc(this);const n=this[Uc];if(e in this&&!n.has(e)){throw new ss[\"b\"](\"observable-set-cannot-override: Cannot override an existing property.\",this)}Object.defineProperty(this,e,{enumerable:true,configurable:true,get(){return n.get(e)},set(t){const o=n.get(e);let i=this.fire(\"set:\"+e,e,t,o);if(i===undefined){i=t}if(o!==i||!n.has(e)){n.set(e,i);this.fire(\"change:\"+e,e,i,o)}}});this[e]=t},bind(...e){if(!e.length||!tl(e)){throw new ss[\"b\"](\"observable-bind-wrong-properties: All properties must be strings.\",this)}if(new Set(e).size!==e.length){throw new ss[\"b\"](\"observable-bind-duplicate-properties: Properties must be unique.\",this)}Qc(this);const t=this[Kc];e.forEach(e=>{if(t.has(e)){throw new ss[\"b\"](\"observable-bind-rebind: Cannot bind the same property more than once.\",this)}});const n=new Map;e.forEach(e=>{const o={property:e,to:[]};t.set(e,o);n.set(e,o)});return{to:Xc,toMany:Zc,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!this[Uc]){return}const t=this[Kc];const n=this[Gc];if(e.length){if(!tl(e)){throw new ss[\"b\"](\"observable-unbind-wrong-properties: Properties must be strings.\",this)}e.forEach(e=>{const o=t.get(e);if(!o){return}let i,r,s,a;o.to.forEach(e=>{i=e[0];r=e[1];s=n.get(i);a=s[r];a.delete(o);if(!a.size){delete s[r]}if(!Object.keys(s).length){n.delete(i);this.stopListening(i,\"change\")}});t.delete(e)})}else{n.forEach((e,t)=>{this.stopListening(t,\"change\")});n.clear();t.clear()}},decorate(e){const t=this[e];if(!t){throw new ss[\"b\"](\"observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.\",this,{object:this,methodName:e})}this.on(e,(e,n)=>{e.return=t.apply(this,n)});this[e]=function(...t){return this.fire(e,t)}}};$c(Jc,ds);var Yc=Jc;function Qc(e){if(e[Uc]){return}Object.defineProperty(e,Uc,{value:new Map});Object.defineProperty(e,Gc,{value:new Map});Object.defineProperty(e,Kc,{value:new Map})}function Xc(...e){const t=nl(...e);const n=Array.from(this._bindings.keys());const o=n.length;if(!t.callback&&t.to.length>1){throw new ss[\"b\"](\"observable-bind-to-no-callback: Binding multiple observables only possible with callback.\",this)}if(o>1&&t.callback){throw new ss[\"b\"](\"observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.\",this)}t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==o){throw new ss[\"b\"](\"observable-bind-to-properties-length: The number of properties must match.\",this)}if(!e.properties.length){e.properties=this._bindProperties}});this._to=t.to;if(t.callback){this._bindings.get(n[0]).callback=t.callback}sl(this._observable,this._to);il(this);this._bindProperties.forEach(e=>{rl(this._observable,e)})}function Zc(e,t,n){if(this._bindings.size>1){throw new ss[\"b\"](\"observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().\",this)}this.to(...el(e,t),n)}function el(e,t){const n=e.map(e=>[e,t]);return Array.prototype.concat.apply([],n)}function tl(e){return e.every(e=>typeof e==\"string\")}function nl(...e){if(!e.length){throw new ss[\"b\"](\"observable-bind-to-parse-error: Invalid argument syntax in `to()`.\",null)}const t={to:[]};let n;if(typeof e[e.length-1]==\"function\"){t.callback=e.pop()}e.forEach(e=>{if(typeof e==\"string\"){n.properties.push(e)}else if(typeof e==\"object\"){n={observable:e,properties:[]};t.to.push(n)}else{throw new ss[\"b\"](\"observable-bind-to-parse-error: Invalid argument syntax in `to()`.\",null)}});return t}function ol(e,t,n,o){const i=e[Gc];const r=i.get(n);const s=r||{};if(!s[o]){s[o]=new Set}s[o].add(t);if(!r){i.set(n,s)}}function il(e){let t;e._bindings.forEach((n,o)=>{e._to.forEach(i=>{t=i.properties[n.callback?0:e._bindProperties.indexOf(o)];n.to.push([i.observable,t]);ol(e._observable,n,i.observable,t)})})}function rl(e,t){const n=e[Kc];const o=n.get(t);let i;if(o.callback){i=o.callback.apply(e,o.to.map(e=>e[0][e[1]]))}else{i=o.to[0];i=i[0][i[1]]}if(Object.prototype.hasOwnProperty.call(e,t)){e[t]=i}else{e.set(t,i)}}function sl(e,t){t.forEach(t=>{const n=e[Gc];let o;if(!n.get(t.observable)){e.listenTo(t.observable,\"change\",(i,r)=>{o=n.get(t.observable)[r];if(o){o.forEach(t=>{rl(e,t.property)})}})}})}class al extends jc{constructor(e,t,n,o){super(e,t,n,o);this.set(\"isReadOnly\",false);this.set(\"isFocused\",false);this.bind(\"isReadOnly\").to(e);this.bind(\"isFocused\").to(e,\"isFocused\",t=>t&&e.selection.editableElement==this);this.listenTo(e.selection,\"change\",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){if(!t){return e===\"editableElement\"||e===\"view:editableElement\"||e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"editableElement\"||e===\"view:editableElement\"||e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\")}}destroy(){this.stopListening()}}ys(al,Yc);const cl=Symbol(\"rootName\");class ll extends al{constructor(e,t){super(e,t);this.rootName=\"main\"}is(e,t=null){if(!t){return e===\"rootElement\"||e===\"view:rootElement\"||e===\"editableElement\"||e===\"view:editableElement\"||e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"rootElement\"||e===\"view:rootElement\"||e===\"editableElement\"||e===\"view:editableElement\"||e===\"containerElement\"||e===\"view:containerElement\"||e===\"element\"||e===\"view:element\")}}get rootName(){return this.getCustomProperty(cl)}set rootName(e){this._setCustomProperty(cl,e)}set _name(e){this.name=e}}class dl{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss[\"b\"](\"view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.\",null)}if(e.direction&&e.direction!=\"forward\"&&e.direction!=\"backward\"){throw new ss[\"b\"](\"view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.\",e.startPosition,{direction:e.direction})}this.boundaries=e.boundaries||null;if(e.startPosition){this.position=ul._createAt(e.startPosition)}else{this.position=ul._createAt(e.boundaries[e.direction==\"backward\"?\"end\":\"start\"])}this.direction=e.direction||\"forward\";this.singleCharacters=!!e.singleCharacters;this.shallow=!!e.shallow;this.ignoreElementEnd=!!e.ignoreElementEnd;this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null;this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,o;do{o=this.position;({done:t,value:n}=this.next())}while(!t&&e(n));if(!t){this.position=o}}next(){if(this.direction==\"forward\"){return this._next()}else{return this._previous()}}_next(){let e=this.position.clone();const t=this.position;const n=e.parent;if(n.parent===null&&e.offset===n.childCount){return{done:true}}if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset){return{done:true}}let o;if(n instanceof Ls){if(e.isAtEnd){this.position=ul._createAfter(n);return this._next()}o=n.data[e.offset]}else{o=n.getChild(e.offset)}if(o instanceof Dc){if(!this.shallow){e=new ul(o,0)}else{e.offset++}this.position=e;return this._formatReturnValue(\"elementStart\",o,t,e,1)}else if(o instanceof Ls){if(this.singleCharacters){e=new ul(o,0);this.position=e;return this._next()}else{let n=o.data.length;let i;if(o==this._boundaryEndParent){n=this.boundaries.end.offset;i=new Hs(o,0,n);e=ul._createAfter(i)}else{i=new Hs(o,0,o.data.length);e.offset++}this.position=e;return this._formatReturnValue(\"text\",i,t,e,n)}}else if(typeof o==\"string\"){let o;if(this.singleCharacters){o=1}else{const t=n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length;o=t-e.offset}const i=new Hs(n,e.offset,o);e.offset+=o;this.position=e;return this._formatReturnValue(\"text\",i,t,e,o)}else{e=ul._createAfter(n);this.position=e;if(this.ignoreElementEnd){return this._next()}else{return this._formatReturnValue(\"elementEnd\",n,t,e)}}}_previous(){let e=this.position.clone();const t=this.position;const n=e.parent;if(n.parent===null&&e.offset===0){return{done:true}}if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset){return{done:true}}let o;if(n instanceof Ls){if(e.isAtStart){this.position=ul._createBefore(n);return this._previous()}o=n.data[e.offset-1]}else{o=n.getChild(e.offset-1)}if(o instanceof Dc){if(!this.shallow){e=new ul(o,o.childCount);this.position=e;if(this.ignoreElementEnd){return this._previous()}else{return this._formatReturnValue(\"elementEnd\",o,t,e)}}else{e.offset--;this.position=e;return this._formatReturnValue(\"elementStart\",o,t,e,1)}}else if(o instanceof Ls){if(this.singleCharacters){e=new ul(o,o.data.length);this.position=e;return this._previous()}else{let n=o.data.length;let i;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new Hs(o,t,o.data.length-t);n=i.data.length;e=ul._createBefore(i)}else{i=new Hs(o,0,o.data.length);e.offset--}this.position=e;return this._formatReturnValue(\"text\",i,t,e,n)}}else if(typeof o==\"string\"){let o;if(!this.singleCharacters){const t=n===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-t}else{o=1}e.offset-=o;const i=new Hs(n,e.offset,o);this.position=e;return this._formatReturnValue(\"text\",i,t,e,o)}else{e=ul._createBefore(n);this.position=e;return this._formatReturnValue(\"elementStart\",n,t,e,1)}}_formatReturnValue(e,t,n,o,i){if(t instanceof Hs){if(t.offsetInText+t.data.length==t.textNode.data.length){if(this.direction==\"forward\"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))){o=ul._createAfter(t.textNode);this.position=o}else{n=ul._createAfter(t.textNode)}}if(t.offsetInText===0){if(this.direction==\"backward\"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))){o=ul._createBefore(t.textNode);this.position=o}else{n=ul._createBefore(t.textNode)}}}return{done:false,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}}class ul{constructor(e,t){this.parent=e;this.offset=t}get nodeAfter(){if(this.parent.is(\"$text\")){return null}return this.parent.getChild(this.offset)||null}get nodeBefore(){if(this.parent.is(\"$text\")){return null}return this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const e=this.parent.is(\"$text\")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;while(!(e instanceof al)){if(e.parent){e=e.parent}else{return null}}return e}getShiftedBy(e){const t=ul._createAt(this);const n=t.offset+e;t.offset=n<0?0:n;return t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new dl(t);n.skip(e);return n.position}getAncestors(){if(this.parent.is(\"documentFragment\")){return[this.parent]}else{return this.parent.getAncestors({includeSelf:true})}}getCommonAncestor(e){const t=this.getAncestors();const n=e.getAncestors();let o=0;while(t[o]==n[o]&&t[o]){o++}return o===0?null:t[o-1]}is(e){return e===\"position\"||e===\"view:position\"}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)==\"before\"}isAfter(e){return this.compareWith(e)==\"after\"}compareWith(e){if(this.root!==e.root){return\"different\"}if(this.isEqual(e)){return\"same\"}const t=this.parent.is(\"node\")?this.parent.getPath():[];const n=e.parent.is(\"node\")?e.parent.getPath():[];t.push(this.offset);n.push(e.offset);const o=Ns(t,n);switch(o){case\"prefix\":return\"before\";case\"extension\":return\"after\";default:return t[o]0?new this(n,o):new this(o,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is(\"$textProxy\")?e.offsetSize:1;return this._createFromPositionAndShift(ul._createBefore(e),t)}}function fl(e){if(e.item.is(\"attributeElement\")||e.item.is(\"uiElement\")){return true}return false}function gl(e){let t=0;for(const n of e){t++}return t}class ml{constructor(e=null,t,n){this._ranges=[];this._lastRangeBackward=false;this._isFake=false;this._fakeSelectionLabel=\"\";this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length){return null}const e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.end:e.start;return t.clone()}get focus(){if(!this._ranges.length){return null}const e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.start:e.end;return t.clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){if(this.anchor){return this.anchor.editableElement}return null}*getRanges(){for(const e of this._ranges){yield e.clone()}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges){if(!e||t.end.isAfter(e.end)){e=t}}return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake){return false}if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel){return false}if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let n=false;for(const o of e._ranges){if(t.isEqual(o)){n=true;break}}if(!n){return false}}return true}isSimilar(e){if(this.isBackward!=e.isBackward){return false}const t=gl(this.getRanges());const n=gl(e.getRanges());if(t!=n){return false}if(t==0){return true}for(let t of this.getRanges()){t=t.getTrimmed();let n=false;for(let o of e.getRanges()){o=o.getTrimmed();if(t.start.isEqual(o.start)&&t.end.isEqual(o.end)){n=true;break}}if(!n){return false}}return true}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}setTo(e,t,n){if(e===null){this._setRanges([]);this._setFakeOptions(t)}else if(e instanceof ml||e instanceof pl){this._setRanges(e.getRanges(),e.isBackward);this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel})}else if(e instanceof hl){this._setRanges([e],t&&t.backward);this._setFakeOptions(t)}else if(e instanceof ul){this._setRanges([new hl(e)]);this._setFakeOptions(t)}else if(e instanceof Fs){const o=!!n&&!!n.backward;let i;if(t===undefined){throw new ss[\"b\"](\"view-selection-setTo-required-second-parameter: \"+\"selection.setTo requires the second parameter when the first parameter is a node.\",this)}else if(t==\"in\"){i=hl._createIn(e)}else if(t==\"on\"){i=hl._createOn(e)}else{i=new hl(ul._createAt(e,t))}this._setRanges([i],o);this._setFakeOptions(n)}else if(vs(e)){this._setRanges(e,t&&t.backward);this._setFakeOptions(t)}else{throw new ss[\"b\"](\"view-selection-setTo-not-selectable: Cannot set selection to given place.\",this)}this.fire(\"change\")}setFocus(e,t){if(this.anchor===null){throw new ss[\"b\"](\"view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\",this)}const n=ul._createAt(e,t);if(n.compareWith(this.focus)==\"same\"){return}const o=this.anchor;this._ranges.pop();if(n.compareWith(o)==\"before\"){this._addRange(new hl(n,o),true)}else{this._addRange(new hl(o,n))}this.fire(\"change\")}is(e){return e===\"selection\"||e===\"view:selection\"}_setRanges(e,t=false){e=Array.from(e);this._ranges=[];for(const t of e){this._addRange(t)}this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake;this._fakeSelectionLabel=e.fake?e.label||\"\":\"\"}_addRange(e,t=false){if(!(e instanceof hl)){throw new ss[\"b\"](\"view-selection-add-range-not-range: \"+\"Selection range set to an object that is not an instance of view.Range\",this)}this._pushRange(e);this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges){if(e.isIntersecting(t)){throw new ss[\"b\"](\"view-selection-range-intersects: Trying to add a range that intersects with another range from selection.\",this,{addedRange:e,intersectingRange:t})}}this._ranges.push(new hl(e.start,e.end))}}ys(ml,ds);class pl{constructor(e=null,t,n){this._selection=new ml;this._selection.delegate(\"change\").to(this);this._selection.setTo(e,t,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(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return e===\"selection\"||e==\"documentSelection\"||e==\"view:selection\"||e==\"view:documentSelection\"}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}ys(pl,ds);class bl{constructor(e){this.selection=new pl;this.roots=new xs({idProperty:\"rootName\"});this.stylesProcessor=e;this.set(\"isReadOnly\",false);this.set(\"isFocused\",false);this.set(\"isComposing\",false);this._postFixers=new Set}getRoot(e=\"main\"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy());this.stopListening()}_callPostFixers(e){let t=false;do{for(const n of this._postFixers){t=n(e);if(t){break}}}while(t)}}ys(bl,Yc);const wl=10;class kl extends Dc{constructor(e,t,n,o){super(e,t,n,o);this.getFillerOffset=_l;this._priority=wl;this._id=null;this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null){throw new ss[\"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(e,t=null){if(!t){return e===\"attributeElement\"||e===\"view:attributeElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"attributeElement\"||e===\"view:attributeElement\"||e===\"element\"||e===\"view:element\")}}isSimilar(e){if(this.id!==null||e.id!==null){return this.id===e.id}return super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);t._priority=this._priority;t._id=this._id;return t}}kl.DEFAULT_PRIORITY=wl;function _l(){if(vl(this)){return null}let e=this.parent;while(e&&e.is(\"attributeElement\")){if(vl(e)>1){return null}e=e.parent}if(!e||vl(e)>1){return null}return this.childCount}function vl(e){return Array.from(e.getChildren()).filter(e=>!e.is(\"uiElement\")).length}class yl extends Dc{constructor(e,t,n,o){super(e,t,n,o);this.getFillerOffset=xl}is(e,t=null){if(!t){return e===\"emptyElement\"||e===\"view:emptyElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"emptyElement\"||e===\"view:emptyElement\"||e===\"element\"||e===\"view:element\")}}_insertChild(e,t){if(t&&(t instanceof Fs||Array.from(t).length>0)){throw new ss[\"b\"](\"view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.\",[this,t])}}}function xl(){return null}const Cl=navigator.userAgent.toLowerCase();const Al={isMac:Pl(Cl),isGecko:Sl(Cl),isSafari:El(Cl),isAndroid:Rl(Cl),features:{isRegExpUnicodePropertySupported:Il()}};var Tl=Al;function Pl(e){return e.indexOf(\"macintosh\")>-1}function Sl(e){return!!e.match(/gecko\\/\\d+/)}function El(e){return e.indexOf(\" applewebkit/\")>-1&&e.indexOf(\"chrome\")===-1}function Rl(e){return e.indexOf(\"android\")>-1}function Il(){let e=false;try{e=\"ć\".search(new RegExp(\"[\\\\p{L}]\",\"u\"))===0}catch(e){}return e}const Ol={\"⌘\":\"ctrl\",\"⇧\":\"shift\",\"⌥\":\"alt\"};const Vl={ctrl:\"⌘\",shift:\"⇧\",alt:\"⌥\"};const Ml=Hl();function Nl(e){let t;if(typeof e==\"string\"){t=Ml[e.toLowerCase()];if(!t){throw new ss[\"b\"](\"keyboard-unknown-key: Unknown key name.\",null,{key:e})}}else{t=e.keyCode+(e.altKey?Ml.alt:0)+(e.ctrlKey?Ml.ctrl:0)+(e.shiftKey?Ml.shift:0)}return t}function zl(e){if(typeof e==\"string\"){e=jl(e)}return e.map(e=>typeof e==\"string\"?Nl(e):e).reduce((e,t)=>t+e,0)}function Bl(e){if(!Tl.isMac){return e}return jl(e).map(e=>Vl[e.toLowerCase()]||e).reduce((e,t)=>{if(e.slice(-1)in Ol){return e+t}else{return e+\"+\"+t}})}function Dl(e){return e==Ml.arrowright||e==Ml.arrowleft||e==Ml.arrowup||e==Ml.arrowdown}function Fl(e,t){const n=t===\"ltr\";switch(e){case Ml.arrowleft:return n?\"left\":\"right\";case Ml.arrowright:return n?\"right\":\"left\";case Ml.arrowup:return\"up\";case Ml.arrowdown:return\"down\"}}function Ll(e,t){const n=Fl(e,t);return n===\"down\"||n===\"right\"}function Hl(){const e={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 t=65;t<=90;t++){const n=String.fromCharCode(t);e[n.toLowerCase()]=t}for(let t=48;t<=57;t++){e[t-48]=t}for(let t=112;t<=123;t++){e[\"f\"+(t-111)]=t}return e}function jl(e){return e.split(/\\s*\\+\\s*/)}class ql extends Dc{constructor(e,t,n,o){super(e,t,n,o);this.getFillerOffset=$l}is(e,t=null){if(!t){return e===\"uiElement\"||e===\"view:uiElement\"||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"uiElement\"||e===\"view:uiElement\"||e===\"element\"||e===\"view:element\")}}_insertChild(e,t){if(t&&(t instanceof Fs||Array.from(t).length>0)){throw new ss[\"b\"](\"view-uielement-cannot-add: Cannot add child nodes to UIElement instance.\",this)}}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys()){t.setAttribute(e,this.getAttribute(e))}return t}}function Wl(e){e.document.on(\"keydown\",(t,n)=>Ul(t,n,e.domConverter))}function $l(){return null}function Ul(e,t,n){if(t.keyCode==Ml.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection();const o=e.rangeCount==1&&e.getRangeAt(0).collapsed;if(o||t.shiftKey){const t=e.focusNode;const i=e.focusOffset;const r=n.domPositionToView(t,i);if(r===null){return}let s=false;const a=r.getLastMatchingPosition(e=>{if(e.item.is(\"uiElement\")){s=true}if(e.item.is(\"uiElement\")||e.item.is(\"attributeElement\")){return true}return false});if(s){const t=n.viewPositionToDom(a);if(o){e.collapse(t.parent,t.offset)}else{e.extend(t.parent,t.offset)}}}}}class Gl extends Dc{constructor(e,t,n,o){super(e,t,n,o);this.getFillerOffset=Kl}is(e,t=null){if(!t){return e===\"rawElement\"||e===\"view:rawElement\"||e===this.name||e===\"view:\"+this.name||e===\"element\"||e===\"view:element\"||e===\"node\"||e===\"view:node\"}else{return t===this.name&&(e===\"rawElement\"||e===\"view:rawElement\"||e===\"element\"||e===\"view:element\")}}_insertChild(e,t){if(t&&(t instanceof Fs||Array.from(t).length>0)){throw new ss[\"b\"](\"view-rawelement-cannot-add: Cannot add child nodes to a RawElement instance.\",[this,t])}}}function Kl(){return null}class Jl{constructor(e,t){this.document=e;this._children=[];if(t){this._insertChild(0,t)}}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e===\"documentFragment\"||e===\"view:documentFragment\"}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange(\"children\",this);let n=0;const o=Yl(this.document,t);for(const t of o){if(t.parent!==null){t._remove()}t.parent=this;this._children.splice(e,0,t);e++;n++}return n}_removeChildren(e,t=1){this._fireChange(\"children\",this);for(let n=e;n{if(typeof t==\"string\"){return new Ls(e,t)}if(t instanceof Hs){return new Ls(e,t.data)}return t})}class Ql{constructor(e){this.document=e;this._cloneGroups=new Map}setSelection(e,t,n){this.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createText(e){return new Ls(this.document,e)}createAttributeElement(e,t,n={}){const o=new kl(this.document,e,t);if(n.priority){o._priority=n.priority}if(n.id){o._id=n.id}return o}createContainerElement(e,t){return new jc(this.document,e,t)}createEditableElement(e,t){const n=new al(this.document,e,t);n._document=this.document;return n}createEmptyElement(e,t){return new yl(this.document,e,t)}createUIElement(e,t,n){const o=new ql(this.document,e,t);if(n){o.render=n}return o}createRawElement(e,t,n){const o=new Gl(this.document,e,t);o.render=n||(()=>{});return o}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){if(M(e)&&n===undefined){n=t}n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){if(e instanceof ul){return this._breakAttributes(e)}else{return this._breakAttributesRange(e)}}breakContainer(e){const t=e.parent;if(!t.is(\"containerElement\")){throw new ss[\"b\"](\"view-writer-break-non-container-element: Trying to break an element which is not a container element.\",this.document)}if(!t.parent){throw new ss[\"b\"](\"view-writer-break-root: Trying to break root element.\",this.document)}if(e.isAtStart){return ul._createBefore(t)}else if(!e.isAtEnd){const n=t._clone(false);this.insert(ul._createAfter(t),n);const o=new hl(e,ul._createAt(t,\"end\"));const i=new ul(n,0);this.move(o,i)}return ul._createAfter(t)}mergeAttributes(e){const t=e.offset;const n=e.parent;if(n.is(\"$text\")){return e}if(n.is(\"attributeElement\")&&n.childCount===0){const e=n.parent;const t=n.index;n._remove();this._removeFromClonedElementsGroup(n);return this.mergeAttributes(new ul(e,t))}const o=n.getChild(t-1);const i=n.getChild(t);if(!o||!i){return e}if(o.is(\"$text\")&&i.is(\"$text\")){return od(o,i)}else if(o.is(\"attributeElement\")&&i.is(\"attributeElement\")&&o.isSimilar(i)){const e=o.childCount;o._appendChild(i.getChildren());i._remove();this._removeFromClonedElementsGroup(i);return this.mergeAttributes(new ul(o,e))}return e}mergeContainers(e){const t=e.nodeBefore;const n=e.nodeAfter;if(!t||!n||!t.is(\"containerElement\")||!n.is(\"containerElement\")){throw new ss[\"b\"](\"view-writer-merge-containers-invalid-position: \"+\"Element before and after given position cannot be merged.\",this.document)}const o=t.getChild(t.childCount-1);const i=o instanceof Ls?ul._createAt(o,\"end\"):ul._createAt(t,\"end\");this.move(hl._createIn(n),ul._createAt(t,\"end\"));this.remove(hl._createOn(n));return i}insert(e,t){t=vs(t)?[...t]:[t];id(t,this.document);const n=Zl(e);if(!n){throw new ss[\"b\"](\"view-writer-invalid-position-container\",this.document)}const o=this._breakAttributes(e,true);const i=n._insertChild(o.offset,t);for(const e of t){this._addToClonedElementsGroup(e)}const r=o.getShiftedBy(i);const s=this.mergeAttributes(o);if(i===0){return new hl(s,s)}else{if(!s.isEqual(o)){r.offset--}const e=this.mergeAttributes(r);return new hl(s,e)}}remove(e){const t=e instanceof hl?e:hl._createOn(e);ad(t,this.document);if(t.isCollapsed){return new Jl(this.document)}const{start:n,end:o}=this._breakAttributesRange(t,true);const i=n.parent;const r=o.offset-n.offset;const s=i._removeChildren(n.offset,r);for(const e of s){this._removeFromClonedElementsGroup(e)}const a=this.mergeAttributes(n);t.start=a;t.end=a.clone();return new Jl(this.document,s)}clear(e,t){ad(e,this.document);const n=e.getWalker({direction:\"backward\",ignoreElementEnd:true});for(const o of n){const n=o.item;let i;if(n.is(\"element\")&&t.isSimilar(n)){i=hl._createOn(n)}else if(!o.nextPosition.isAfter(e.start)&&n.is(\"$textProxy\")){const e=n.getAncestors().find(e=>e.is(\"element\")&&t.isSimilar(e));if(e){i=hl._createIn(e)}}if(i){if(i.end.isAfter(e.end)){i.end=e.end}if(i.start.isBefore(e.start)){i.start=e.start}this.remove(i)}}}move(e,t){let n;if(t.isAfter(e.end)){t=this._breakAttributes(t,true);const o=t.parent;const i=o.childCount;e=this._breakAttributesRange(e,true);n=this.remove(e);t.offset+=o.childCount-i}else{n=this.remove(e)}return this.insert(t,n)}wrap(e,t){if(!(t instanceof kl)){throw new ss[\"b\"](\"view-writer-wrap-invalid-attribute\",this.document)}ad(e,this.document);if(!e.isCollapsed){return this._wrapRange(e,t)}else{let n=e.start;if(n.parent.is(\"element\")&&!Xl(n.parent)){n=n.getLastMatchingPosition(e=>e.item.is(\"uiElement\"))}n=this._wrapPosition(n,t);const o=this.document.selection;if(o.isCollapsed&&o.getFirstPosition().isEqual(e.start)){this.setSelection(n)}return new hl(n)}}unwrap(e,t){if(!(t instanceof kl)){throw new ss[\"b\"](\"view-writer-unwrap-invalid-attribute\",this.document)}ad(e,this.document);if(e.isCollapsed){return e}const{start:n,end:o}=this._breakAttributesRange(e,true);const i=n.parent;const r=this._unwrapChildren(i,n.offset,o.offset,t);const s=this.mergeAttributes(r.start);if(!s.isEqual(r.start)){r.end.offset--}const a=this.mergeAttributes(r.end);return new hl(s,a)}rename(e,t){const n=new jc(this.document,e,t.getAttributes());this.insert(ul._createAfter(t),n);this.move(hl._createIn(t),ul._createAt(n,0));this.remove(hl._createOn(t));return n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,n){return new ml(e,t,n)}_wrapChildren(e,t,n,o){let i=t;const r=[];while(ifalse;e.parent._insertChild(e.offset,n);const o=new hl(e,e.getShiftedBy(1));this.wrap(o,t);const i=new ul(n.parent,n.index);n._remove();const r=i.nodeBefore;const s=i.nodeAfter;if(r instanceof Ls&&s instanceof Ls){return od(r,s)}return td(i)}_wrapAttributeElement(e,t){if(!cd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const n of e.getAttributeKeys()){if(n===\"class\"||n===\"style\"){continue}if(t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n)){return false}}for(const n of e.getStyleNames()){if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n)){return false}}for(const n of e.getAttributeKeys()){if(n===\"class\"||n===\"style\"){continue}if(!t.hasAttribute(n)){this.setAttribute(n,e.getAttribute(n),t)}}for(const n of e.getStyleNames()){if(!t.hasStyle(n)){this.setStyle(n,e.getStyle(n),t)}}for(const n of e.getClassNames()){if(!t.hasClass(n)){this.addClass(n,t)}}return true}_unwrapAttributeElement(e,t){if(!cd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const n of e.getAttributeKeys()){if(n===\"class\"||n===\"style\"){continue}if(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)){return false}}if(!t.hasClass(...e.getClassNames())){return false}for(const n of e.getStyleNames()){if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n)){return false}}for(const n of e.getAttributeKeys()){if(n===\"class\"||n===\"style\"){continue}this.removeAttribute(n,t)}this.removeClass(Array.from(e.getClassNames()),t);this.removeStyle(Array.from(e.getStyleNames()),t);return true}_breakAttributesRange(e,t=false){const n=e.start;const o=e.end;ad(e,this.document);if(e.isCollapsed){const n=this._breakAttributes(e.start,t);return new hl(n,n)}const i=this._breakAttributes(o,t);const r=i.parent.childCount;const s=this._breakAttributes(n,t);i.offset+=i.parent.childCount-r;return new hl(s,i)}_breakAttributes(e,t=false){const n=e.offset;const o=e.parent;if(e.parent.is(\"emptyElement\")){throw new ss[\"b\"](\"view-writer-cannot-break-empty-element\",this.document)}if(e.parent.is(\"uiElement\")){throw new ss[\"b\"](\"view-writer-cannot-break-ui-element\",this.document)}if(e.parent.is(\"rawElement\")){throw new ss[\"b\"](\"view-writer-cannot-break-raw-element: Cannot break inside a RawElement instance.\",this.document)}if(!t&&o.is(\"$text\")&&sd(o.parent)){return e.clone()}if(sd(o)){return e.clone()}if(o.is(\"$text\")){return this._breakAttributes(nd(e),t)}const i=o.childCount;if(n==i){const e=new ul(o.parent,o.index+1);return this._breakAttributes(e,t)}else{if(n===0){const e=new ul(o.parent,o.index);return this._breakAttributes(e,t)}else{const e=o.index+1;const i=o._clone();o.parent._insertChild(e,i);this._addToClonedElementsGroup(i);const r=o.childCount-n;const s=o._removeChildren(n,r);i._appendChild(s);const a=new ul(o.parent,e);return this._breakAttributes(a,t)}}}_addToClonedElementsGroup(e){if(!e.root.is(\"rootElement\")){return}if(e.is(\"element\")){for(const t of e.getChildren()){this._addToClonedElementsGroup(t)}}const t=e.id;if(!t){return}let n=this._cloneGroups.get(t);if(!n){n=new Set;this._cloneGroups.set(t,n)}n.add(e);e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is(\"element\")){for(const t of e.getChildren()){this._removeFromClonedElementsGroup(t)}}const t=e.id;if(!t){return}const n=this._cloneGroups.get(t);if(!n){return}n.delete(e)}}function Xl(e){return Array.from(e.getChildren()).some(e=>!e.is(\"uiElement\"))}function Zl(e){let t=e.parent;while(!sd(t)){if(!t){return undefined}t=t.parent}return t}function ed(e,t){if(e.priorityt.priority){return false}return e.getIdentity()n instanceof e)){throw new ss[\"b\"](\"view-writer-insert-invalid-node\",t)}if(!n.is(\"$text\")){id(n.getChildren(),t)}}}const rd=[Ls,kl,jc,yl,Gl,ql];function sd(e){return e&&(e.is(\"containerElement\")||e.is(\"documentFragment\"))}function ad(e,t){const n=Zl(e.start);const o=Zl(e.end);if(!n||!o||n!==o){throw new ss[\"b\"](\"view-writer-invalid-range-container\",t)}}function cd(e,t){return e.id===null&&t.id===null}function ld(e){return Object.prototype.toString.call(e)==\"[object Text]\"}const dd=e=>e.createTextNode(\" \");const ud=e=>{const t=e.createElement(\"br\");t.dataset.ckeFiller=true;return t};const hd=7;const fd=(()=>{let e=\"\";for(let t=0;t0){n.push({index:o,type:\"insert\",values:e.slice(o,r)})}if(i-o>0){n.push({index:o+(r-o),type:\"delete\",howMany:i-o})}return n}function Cd(e,t){const{firstIndex:n,lastIndexOld:o,lastIndexNew:i}=e;if(n===-1){return Array(t).fill(\"equal\")}let r=[];if(n>0){r=r.concat(Array(n).fill(\"equal\"))}if(i-n>0){r=r.concat(Array(i-n).fill(\"insert\"))}if(o-n>0){r=r.concat(Array(o-n).fill(\"delete\"))}if(i200||i>200||o+i>300){return Ad.fastDiff(e,t,n,true)}let r,s;if(il?-1:1;if(d[o+h]){d[o]=d[o+h].slice(0)}if(!d[o]){d[o]=[]}d[o].push(i>l?r:s);let f=Math.max(i,l);let g=f-o;while(gl;g--){u[g]=h(g)}u[l]=h(l);f++}while(u[l]!==c);return d[l].slice(1)}Ad.fastDiff=kd;function Td(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Pd(e){const t=e.parentNode;if(t){t.removeChild(e)}}function Sd(e){if(e){if(e.defaultView){return e instanceof e.defaultView.Document}else if(e.ownerDocument&&e.ownerDocument.defaultView){return e instanceof e.ownerDocument.defaultView.Node}}return false}class Ed{constructor(e,t){this.domDocuments=new Set;this.domConverter=e;this.markedAttributes=new Set;this.markedChildren=new Set;this.markedTexts=new Set;this.selection=t;this.isFocused=false;this._inlineFiller=null;this._fakeSelectionContainer=null}markToSync(e,t){if(e===\"text\"){if(this.domConverter.mapViewToDom(t.parent)){this.markedTexts.add(t)}}else{if(!this.domConverter.mapViewToDom(t)){return}if(e===\"attributes\"){this.markedAttributes.add(t)}else if(e===\"children\"){this.markedChildren.add(t)}else{throw new ss[\"b\"](\"view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.\",this)}}}render(){let e;for(const e of this.markedChildren){this._updateChildrenMappings(e)}if(this._inlineFiller&&!this._isSelectionInInlineFiller()){this._removeInlineFiller()}if(this._inlineFiller){e=this._getInlineFillerPosition()}else if(this._needsInlineFillerAtSelection()){e=this.selection.getFirstPosition();this.markedChildren.add(e.parent)}for(const e of this.markedAttributes){this._updateAttrs(e)}for(const t of this.markedChildren){this._updateChildren(t,{inlineFillerPosition:e})}for(const t of this.markedTexts){if(!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)){this._updateText(t,{inlineFillerPosition:e})}}if(e){const t=this.domConverter.viewPositionToDom(e);const n=t.parent.ownerDocument;if(!gd(t.parent)){this._inlineFiller=Id(n,t.parent,t.offset)}else{this._inlineFiller=t.parent}}else{this._inlineFiller=null}this._updateSelection();this._updateFocus();this.markedTexts.clear();this.markedAttributes.clear();this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const n=this.domConverter.mapViewToDom(e).childNodes;const o=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:false}));const i=this._diffNodeLists(n,o);const r=this._findReplaceActions(i,n,o);if(r.indexOf(\"replace\")!==-1){const t={equal:0,insert:0,delete:0};for(const i of r){if(i===\"replace\"){const i=t.equal+t.insert;const r=t.equal+t.delete;const s=e.getChild(i);if(s&&!(s.is(\"uiElement\")||s.is(\"rawElement\"))){this._updateElementMappings(s,n[r])}Pd(o[i]);t.equal++}else{t[i]++}}}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t);this.domConverter.bindElements(t,e);this.markedChildren.add(e);this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();if(e.parent.is(\"$text\")){return ul._createBefore(this.selection.getFirstPosition().parent)}else{return e}}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=this.domConverter.viewPositionToDom(e);if(t&&ld(t.parent)&&gd(t.parent)){return true}return false}_removeInlineFiller(){const e=this._inlineFiller;if(!gd(e)){throw new ss[\"b\"](\"view-renderer-filler-was-lost: The inline filler node was lost.\",this)}if(md(e)){e.parentNode.removeChild(e)}else{e.data=e.data.substr(hd)}this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=e.parent;const n=e.offset;if(!this.domConverter.mapViewToDom(t.root)){return false}if(!t.is(\"element\")){return false}if(!Rd(t)){return false}if(n===t.getFillerOffset()){return false}const o=e.nodeBefore;const i=e.nodeAfter;if(o instanceof Ls||i instanceof Ls){return false}return true}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e);const o=this.domConverter.viewToDom(e,n.ownerDocument);const i=n.data;let r=o.data;const s=t.inlineFillerPosition;if(s&&s.parent==e.parent&&s.offset==e.index){r=fd+r}if(i!=r){const e=kd(i,r);for(const t of e){if(t.type===\"insert\"){n.insertData(t.index,t.values.join(\"\"))}else{n.deleteData(t.index,t.howMany)}}}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const n=Array.from(t.attributes).map(e=>e.name);const o=e.getAttributeKeys();for(const n of o){t.setAttribute(n,e.getAttribute(n))}for(const o of n){if(!e.hasAttribute(o)){t.removeAttribute(o)}}}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n){return}const o=t.inlineFillerPosition;const i=this.domConverter.mapViewToDom(e).childNodes;const r=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:true,inlineFillerPosition:o}));if(o&&o.parent===e){Id(n.ownerDocument,r,o.offset)}const s=this._diffNodeLists(i,r);let a=0;const c=new Set;for(const e of s){if(e===\"delete\"){c.add(i[a]);Pd(i[a])}else if(e===\"equal\"){a++}}a=0;for(const e of s){if(e===\"insert\"){Td(n,a,r[a]);a++}else if(e===\"equal\"){this._markDescendantTextToSync(this.domConverter.domToView(r[a]));a++}}for(const e of c){if(!e.parentNode){this.domConverter.unbindDomElement(e)}}}_diffNodeLists(e,t){e=Nd(e,this._fakeSelectionContainer);return Ad(e,t,Vd.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(e.indexOf(\"insert\")===-1||e.indexOf(\"delete\")===-1){return e}let o=[];let i=[];let r=[];const s={equal:0,insert:0,delete:0};for(const a of e){if(a===\"insert\"){r.push(n[s.equal+s.insert])}else if(a===\"delete\"){i.push(t[s.equal+s.delete])}else{o=o.concat(Ad(i,r,Od).map(e=>e===\"equal\"?\"replace\":e));o.push(\"equal\");i=[];r=[]}s[a]++}return o.concat(Ad(i,r,Od).map(e=>e===\"equal\"?\"replace\":e))}_markDescendantTextToSync(e){if(!e){return}if(e.is(\"$text\")){this.markedTexts.add(e)}else if(e.is(\"element\")){for(const t of e.getChildren()){this._markDescendantTextToSync(t)}}}_updateSelection(){if(this.selection.rangeCount===0){this._removeDomSelection();this._removeFakeSelection();return}const e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){return}if(this.selection.isFake){this._updateFakeSelection(e)}else{this._removeFakeSelection();this._updateDomSelection(e)}}_updateFakeSelection(e){const t=e.ownerDocument;if(!this._fakeSelectionContainer){this._fakeSelectionContainer=zd(t)}const n=this._fakeSelectionContainer;this.domConverter.bindFakeSelection(n,this.selection);if(!this._fakeSelectionNeedsUpdate(e)){return}if(!n.parentElement||n.parentElement!=e){e.appendChild(n)}n.textContent=this.selection.fakeSelectionLabel||\" \";const o=t.getSelection();const i=t.createRange();o.removeAllRanges();i.selectNodeContents(n);o.addRange(i)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t)){return}const n=this.domConverter.viewPositionToDom(this.selection.anchor);const o=this.domConverter.viewPositionToDom(this.selection.focus);e.focus();t.collapse(n.parent,n.offset);t.extend(o.parent,o.offset);if(Tl.isGecko){Md(o,t)}}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e)){return true}const t=e&&this.domConverter.domSelectionToView(e);if(t&&this.selection.isEqual(t)){return false}if(!this.selection.isCollapsed&&this.selection.isSimilar(t)){return false}return true}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer;const n=e.ownerDocument.getSelection();if(!t||t.parentElement!==e){return true}if(n.anchorNode!==t&&!t.contains(n.anchorNode)){return true}return t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const t=e.activeElement;const n=this.domConverter.mapDomToView(t);if(t&&n){e.getSelection().removeAllRanges()}}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;if(e){e.remove()}}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;if(e){this.domConverter.focus(e)}}}}ys(Ed,Yc);function Rd(e){if(e.getAttribute(\"contenteditable\")==\"false\"){return false}const t=e.findAncestor(e=>e.hasAttribute(\"contenteditable\"));return!t||t.getAttribute(\"contenteditable\")==\"true\"}function Id(e,t,n){const o=t instanceof Array?t:t.childNodes;const i=o[n];if(ld(i)){i.data=fd+i.data;return i}else{const i=e.createTextNode(fd);if(Array.isArray(t)){o.splice(n,0,i)}else{Td(t,n,i)}return i}}function Od(e,t){return Sd(e)&&Sd(t)&&!ld(e)&&!ld(t)&&e.nodeType!==Node.COMMENT_NODE&&t.nodeType!==Node.COMMENT_NODE&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Vd(e,t,n){if(t===n){return true}else if(ld(t)&&ld(n)){return t.data===n.data}else if(e.isBlockFiller(t)&&e.isBlockFiller(n)){return true}return false}function Md(e,t){const n=e.parent;if(n.nodeType!=Node.ELEMENT_NODE||e.offset!=n.childNodes.length-1){return}const o=n.childNodes[e.offset];if(o&&o.tagName==\"BR\"){t.addRange(t.getRangeAt(0))}}function Nd(e,t){const n=Array.from(e);if(n.length==0||!t){return n}const o=n[n.length-1];if(o==t){n.pop()}return n}function zd(e){const t=e.createElement(\"div\");Object.assign(t.style,{position:\"fixed\",top:0,left:\"-9999px\",width:\"42px\"});t.textContent=\" \";return t}var Bd={window:window,document:document};function Dd(e){let t=0;while(e.previousSibling){e=e.previousSibling;t++}return t}function Fd(e){const t=[];while(e&&e.nodeType!=Node.DOCUMENT_NODE){t.unshift(e);e=e.parentNode}return t}function Ld(e,t){const n=Fd(e);const o=Fd(t);let i=0;while(n[i]==o[i]&&n[i]){i++}return i===0?null:n[i-1]}const Hd=ud(document);class jd{constructor(e,t={}){this.document=e;this.blockFillerMode=t.blockFillerMode||\"br\";this.preElements=[\"pre\"];this.blockElements=[\"p\",\"div\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"dd\",\"dt\",\"figcaption\",\"td\",\"th\"];this._blockFiller=this.blockFillerMode==\"br\"?ud:dd;this._domToViewMapping=new WeakMap;this._viewToDomMapping=new WeakMap;this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new ml(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t);this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e);this._viewToDomMapping.delete(t);for(const t of e.childNodes){this.unbindDomElement(t)}}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t);this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is(\"$text\")){const n=this._processDataFromViewText(e);return t.createTextNode(n)}else{if(this.mapViewToDom(e)){return this.mapViewToDom(e)}let o;if(e.is(\"documentFragment\")){o=t.createDocumentFragment();if(n.bind){this.bindDocumentFragments(o,e)}}else if(e.is(\"uiElement\")){o=e.render(t);if(n.bind){this.bindElements(o,e)}return o}else{if(e.hasAttribute(\"xmlns\")){o=t.createElementNS(e.getAttribute(\"xmlns\"),e.name)}else{o=t.createElement(e.name)}if(e.is(\"rawElement\")){e.render(o)}if(n.bind){this.bindElements(o,e)}for(const t of e.getAttributeKeys()){o.setAttribute(t,e.getAttribute(t))}}if(n.withChildren||n.withChildren===undefined){for(const i of this.viewChildrenToDom(e,t,n)){o.appendChild(i)}}return o}}*viewChildrenToDom(e,t,n={}){const o=e.getFillerOffset&&e.getFillerOffset();let i=0;for(const r of e.getChildren()){if(o===i){yield this._blockFiller(t)}yield this.viewToDom(r,t,n);i++}if(o===i){yield this._blockFiller(t)}}viewRangeToDom(e){const t=this.viewPositionToDom(e.start);const n=this.viewPositionToDom(e.end);const o=document.createRange();o.setStart(t.parent,t.offset);o.setEnd(n.parent,n.offset);return o}viewPositionToDom(e){const t=e.parent;if(t.is(\"$text\")){const n=this.findCorrespondingDomText(t);if(!n){return null}let o=e.offset;if(gd(n)){o+=hd}return{parent:n,offset:o}}else{let n,o,i;if(e.offset===0){n=this.mapViewToDom(t);if(!n){return null}i=n.childNodes[0]}else{const t=e.nodeBefore;o=t.is(\"$text\")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore);if(!o){return null}n=o.parentNode;i=o.nextSibling}if(ld(i)&&gd(i)){return{parent:i,offset:hd}}const r=o?Dd(o)+1:0;return{parent:n,offset:r}}}domToView(e,t={}){if(this.isBlockFiller(e,this.blockFillerMode)){return null}const n=this.getHostViewElement(e,this._domToViewMapping);if(n){return n}if(ld(e)){if(md(e)){return null}else{const t=this._processDataFromDomText(e);return t===\"\"?null:new Ls(this.document,t)}}else if(this.isComment(e)){return null}else{if(this.mapDomToView(e)){return this.mapDomToView(e)}let n;if(this.isDocumentFragment(e)){n=new Jl(this.document);if(t.bind){this.bindDocumentFragments(e,n)}}else{const o=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new Dc(this.document,o);if(t.bind){this.bindElements(e,n)}const i=e.attributes;for(let e=i.length-1;e>=0;e--){n._setAttribute(i[e].name,i[e].value)}}if(t.withChildren||t.withChildren===undefined){for(const o of this.domChildrenToView(e,t)){n._appendChild(o)}}return n}}*domChildrenToView(e,t={}){for(let n=0;n{const{scrollLeft:t,scrollTop:n}=e;o.push([t,n])});t.focus();Wd(t,e=>{const[t,n]=o.shift();e.scrollLeft=t;e.scrollTop=n});Bd.window.scrollTo(e,n)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isBlockFiller(e){if(this.blockFillerMode==\"br\"){return e.isEqualNode(Hd)}if(e.tagName===\"BR\"&&Ud(e,this.blockElements)&&e.parentNode.childNodes.length===1){return true}return $d(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed){return false}const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset);t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;t.detach();return n}getHostViewElement(e){const t=Fd(e);t.pop();while(t.length){const e=t.pop();const n=this._domToViewMapping.get(e);if(n&&(n.is(\"uiElement\")||n.is(\"rawElement\"))){return n}}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(ld(e)&&gd(e)&&tthis.preElements.includes(e.name))){return t}if(t.charAt(0)==\" \"){const n=this._getTouchingViewTextNode(e,false);const o=n&&this._nodeEndsWithSpace(n);if(o||!n){t=\" \"+t.substr(1)}}if(t.charAt(t.length-1)==\" \"){const n=this._getTouchingViewTextNode(e,true);if(t.charAt(t.length-2)==\" \"||!n||n.data.charAt(0)==\" \"){t=t.substr(0,t.length-1)+\" \"}}return t.replace(/ {2}/g,\"  \")}_nodeEndsWithSpace(e){if(e.getAncestors().some(e=>this.preElements.includes(e.name))){return false}const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==\" \"}_processDataFromDomText(e){let t=e.data;if(qd(e,this.preElements)){return pd(e)}t=t.replace(/[ \\n\\t\\r]{1,}/g,\" \");const n=this._getTouchingInlineDomNode(e,false);const o=this._getTouchingInlineDomNode(e,true);const i=this._checkShouldLeftTrimDomText(n);const r=this._checkShouldRightTrimDomText(e,o);if(i){t=t.replace(/^ /,\"\")}if(r){t=t.replace(/ $/,\"\")}t=pd(new Text(t));t=t.replace(/ \\u00A0/g,\" \");if(/( |\\u00A0)\\u00A0$/.test(t)||!o||o.data&&o.data.charAt(0)==\" \"){t=t.replace(/\\u00A0$/,\" \")}if(i){t=t.replace(/^\\u00A0/,\" \")}return t}_checkShouldLeftTrimDomText(e){if(!e){return true}if(Kr(e)){return true}return/[^\\S\\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(e,t){if(t){return false}return!gd(e)}_getTouchingViewTextNode(e,t){const n=new dl({startPosition:t?ul._createAfter(e):ul._createBefore(e),direction:t?\"forward\":\"backward\"});for(const e of n){if(e.item.is(\"containerElement\")){return null}else if(e.item.is(\"element\",\"br\")){return null}else if(e.item.is(\"$textProxy\")){return e.item}}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode){return null}const n=t?\"nextNode\":\"previousNode\";const o=e.ownerDocument;const i=Fd(e)[0];const r=o.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode(e){if(ld(e)){return NodeFilter.FILTER_ACCEPT}if(e.tagName==\"BR\"){return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP}});r.currentNode=e;const s=r[n]();if(s!==null){const t=Ld(e,s);if(t&&!qd(e,this.blockElements,t)&&!qd(s,this.blockElements,t)){return s}}return null}}function qd(e,t,n){let o=Fd(e);if(n){o=o.slice(o.indexOf(n)+1)}return o.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function Wd(e,t){while(e&&e!=Bd.document){t(e);e=e.parentNode}}function $d(e,t){const n=ld(e)&&e.data==\" \";return n&&Ud(e,t)&&e.parentNode.childNodes.length===1}function Ud(e,t){const n=e.parentNode;return n&&n.tagName&&t.includes(n.tagName.toLowerCase())}function Gd(e){const t=Object.prototype.toString.apply(e);if(t==\"[object Window]\"){return true}if(t==\"[object global]\"){return true}return false}const Kd=$c({},ds,{listenTo(e,...t){if(Sd(e)||Gd(e)){const n=this._getProxyEmitter(e)||new Yd(e);n.attach(...t);e=n}ds.listenTo.call(this,e,...t)},stopListening(e,t,n){if(Sd(e)||Gd(e)){const t=this._getProxyEmitter(e);if(!t){return}e=t}ds.stopListening.call(this,e,t,n);if(e instanceof Yd){e.detach(t)}},_getProxyEmitter(e){return us(this,Qd(e))}});var Jd=Kd;class Yd{constructor(e){hs(this,Qd(e));this._domNode=e}}$c(Yd.prototype,ds,{attach(e,t,n={}){if(this._domListeners&&this._domListeners[e]){return}const o=this._createDomListener(e,!!n.useCapture);this._domNode.addEventListener(e,o,!!n.useCapture);if(!this._domListeners){this._domListeners={}}this._domListeners[e]=o},detach(e){let t;if(this._domListeners[e]&&(!(t=this._events[e])||!t.callbacks.length)){this._domListeners[e].removeListener()}},_createDomListener(e,t){const n=t=>{this.fire(e,t)};n.removeListener=()=>{this._domNode.removeEventListener(e,n,t);delete this._domListeners[e]};return n}});function Qd(e){return e[\"data-ck-expando\"]||(e[\"data-ck-expando\"]=ns())}class Xd{constructor(e){this.view=e;this.document=e.document;this.isEnabled=false}enable(){this.isEnabled=true}disable(){this.isEnabled=false}destroy(){this.disable();this.stopListening()}}ys(Xd,Jd);var Zd=\"__lodash_hash_undefined__\";function eu(e){this.__data__.set(e,Zd);return this}var tu=eu;function nu(e){return this.__data__.has(e)}var ou=nu;function iu(e){var t=-1,n=e==null?0:e.length;this.__data__=new _t;while(++ta)){return false}var l=r.get(e);if(l&&r.get(t)){return l==t}var d=-1,u=true,h=n&uu?new ru:undefined;r.set(e,t);r.set(t,e);while(++d{this.listenTo(e,t,(e,t)=>{if(this.isEnabled){this.onDomEvent(t)}},{useCapture:this.useCapture})})}fire(e,t,n){if(this.isEnabled){this.document.fire(e,new Zu(this.view,t,n))}}}class th extends eh{constructor(e){super(e);this.domEventType=[\"keydown\",\"keyup\"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,get keystroke(){return Nl(this)}})}}var nh=function(){return o[\"a\"].Date.now()};var oh=nh;var ih=0/0;var rh=/^\\s+|\\s+$/g;var sh=/^[-+]0x[0-9a-f]+$/i;var ah=/^0b[01]+$/i;var ch=/^0o[0-7]+$/i;var lh=parseInt;function dh(e){if(typeof e==\"number\"){return e}if(Xs(e)){return ih}if(ce(e)){var t=typeof e.valueOf==\"function\"?e.valueOf():e;e=ce(t)?t+\"\":t}if(typeof e!=\"string\"){return e===0?e:+e}e=e.replace(rh,\"\");var n=ah.test(e);return n||ch.test(e)?lh(e.slice(2),n?2:8):sh.test(e)?ih:+e}var uh=dh;var hh=\"Expected a function\";var fh=Math.max,gh=Math.min;function mh(e,t,n){var o,i,r,s,a,c,l=0,d=false,u=false,h=true;if(typeof e!=\"function\"){throw new TypeError(hh)}t=uh(t)||0;if(ce(n)){d=!!n.leading;u=\"maxWait\"in n;r=u?fh(uh(n.maxWait)||0,t):r;h=\"trailing\"in n?!!n.trailing:h}function f(t){var n=o,r=i;o=i=undefined;l=t;s=e.apply(r,n);return s}function g(e){l=e;a=setTimeout(b,t);return d?f(e):s}function m(e){var n=e-c,o=e-l,i=t-n;return u?gh(i,r-o):i}function p(e){var n=e-c,o=e-l;return c===undefined||n>=t||n<0||u&&o>=r}function b(){var e=oh();if(p(e)){return w(e)}a=setTimeout(b,m(e))}function w(e){a=undefined;if(h&&o){return f(e)}o=i=undefined;return s}function k(){if(a!==undefined){clearTimeout(a)}l=0;o=c=i=a=undefined}function _(){return a===undefined?s:w(oh())}function v(){var e=oh(),n=p(e);o=arguments;i=this;c=e;if(n){if(a===undefined){return g(c)}if(u){clearTimeout(a);a=setTimeout(b,t);return f(c)}}if(a===undefined){a=setTimeout(b,t)}return s}v.cancel=k;v.flush=_;return v}var ph=mh;class bh extends Xd{constructor(e){super(e);this._fireSelectionChangeDoneDebounced=ph(e=>this.document.fire(\"selectionChangeDone\",e),200)}observe(){const e=this.document;e.on(\"keydown\",(t,n)=>{const o=e.selection;if(o.isFake&&wh(n.keyCode)&&this.isEnabled){n.preventDefault();this._handleSelectionMove(n.keyCode)}},{priority:\"lowest\"})}destroy(){super.destroy();this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection;const n=new ml(t.getRanges(),{backward:t.isBackward,fake:false});if(e==Ml.arrowleft||e==Ml.arrowup){n.setTo(n.getFirstPosition())}if(e==Ml.arrowright||e==Ml.arrowdown){n.setTo(n.getLastPosition())}const o={oldSelection:t,newSelection:n,domSelection:null};this.document.fire(\"selectionChange\",o);this._fireSelectionChangeDoneDebounced(o)}}function wh(e){return e==Ml.arrowright||e==Ml.arrowleft||e==Ml.arrowup||e==Ml.arrowdown}class kh extends Xd{constructor(e){super(e);this.mutationObserver=e.getObserver(Xu);this.selection=this.document.selection;this.domConverter=e.domConverter;this._documents=new WeakSet;this._fireSelectionChangeDoneDebounced=ph(e=>this.document.fire(\"selectionChangeDone\",e),200);this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3);this._loopbackCounter=0}observe(e){const t=e.ownerDocument;if(this._documents.has(t)){return}this.listenTo(t,\"selectionchange\",()=>{this._handleSelectionChange(t)});this._documents.add(t)}destroy(){super.destroy();clearInterval(this._clearInfiniteLoopInterval);this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e){if(!this.isEnabled){return}this.mutationObserver.flush();const t=e.defaultView.getSelection();const n=this.domConverter.domSelectionToView(t);if(n.rangeCount==0){this.view.hasDomSelection=false;return}this.view.hasDomSelection=true;if(this.selection.isEqual(n)&&this.domConverter.isDomSelectionCorrect(t)){return}if(++this._loopbackCounter>60){return}if(this.selection.isSimilar(n)){this.view.forceRender()}else{const e={oldSelection:this.selection,newSelection:n,domSelection:t};this.document.fire(\"selectionChange\",e);this._fireSelectionChangeDoneDebounced(e)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class _h extends eh{constructor(e){super(e);this.domEventType=[\"focus\",\"blur\"];this.useCapture=true;const t=this.document;t.on(\"focus\",()=>{t.isFocused=true;this._renderTimeoutId=setTimeout(()=>e.forceRender(),50)});t.on(\"blur\",(n,o)=>{const i=t.selection.editableElement;if(i===null||i===o.target){t.isFocused=false;e.forceRender()}})}onDomEvent(e){this.fire(e.type,e)}destroy(){if(this._renderTimeoutId){clearTimeout(this._renderTimeoutId)}super.destroy()}}class vh extends eh{constructor(e){super(e);this.domEventType=[\"compositionstart\",\"compositionupdate\",\"compositionend\"];const t=this.document;t.on(\"compositionstart\",()=>{t.isComposing=true});t.on(\"compositionend\",()=>{t.isComposing=false})}onDomEvent(e){this.fire(e.type,e)}}class yh extends eh{constructor(e){super(e);this.domEventType=[\"beforeinput\"]}onDomEvent(e){this.fire(e.type,e)}}function xh(e){return Object.prototype.toString.apply(e)==\"[object Range]\"}function Ch(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const Ah=[\"top\",\"right\",\"bottom\",\"left\",\"width\",\"height\"];class Th{constructor(e){const t=xh(e);Object.defineProperty(this,\"_source\",{value:e._source||e,writable:true,enumerable:false});if(Kr(e)||t){if(t){Ph(this,Th.getDomRangeRects(e)[0])}else{Ph(this,e.getBoundingClientRect())}}else if(Gd(e)){const{innerWidth:t,innerHeight:n}=e;Ph(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else{Ph(this,e)}}clone(){return new Th(this)}moveTo(e,t){this.top=t;this.right=e+this.width;this.bottom=t+this.height;this.left=e;return this}moveBy(e,t){this.top+=t;this.right+=e;this.left+=e;this.bottom+=t;return this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};t.width=t.right-t.left;t.height=t.bottom-t.top;if(t.width<0||t.height<0){return null}else{return new Th(t)}}getIntersectionArea(e){const t=this.getIntersection(e);if(t){return t.getArea()}else{return 0}}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!Sh(e)){let n=e.parentNode||e.commonAncestorContainer;while(n&&!Sh(n)){const e=new Th(n);const o=t.getIntersection(e);if(o){if(o.getArea()Lh(e,o));const s=Lh(e,o);Oh(o,s,t);if(o.parent!=o){i=o.frameElement;o=o.parent;if(!i){return}}else{o=null}}}function Ih(e){const t=Fh(e);Vh(t,()=>new Th(e))}Object.assign(Eh,{scrollViewportToShowTarget:Rh,scrollAncestorsToShowTarget:Ih});function Oh(e,t,n){const o=t.clone().moveBy(0,n);const i=t.clone().moveBy(0,-n);const r=new Th(e).excludeScrollbarsAndBorders();const s=[i,o];if(!s.every(e=>r.contains(e))){let{scrollX:s,scrollY:a}=e;if(Nh(i,r)){a-=r.top-t.top+n}else if(Mh(o,r)){a+=t.bottom-r.bottom+n}if(zh(t,r)){s-=r.left-t.left+n}else if(Bh(t,r)){s+=t.right-r.right+n}e.scrollTo(s,a)}}function Vh(e,t){const n=Dh(e);let o,i;while(e!=n.document.body){i=t();o=new Th(e).excludeScrollbarsAndBorders();if(!o.contains(i)){if(Nh(i,o)){e.scrollTop-=o.top-i.top}else if(Mh(i,o)){e.scrollTop+=i.bottom-o.bottom}if(zh(i,o)){e.scrollLeft-=o.left-i.left}else if(Bh(i,o)){e.scrollLeft+=i.right-o.right}}e=e.parentNode}}function Mh(e,t){return e.bottom>t.bottom}function Nh(e,t){return e.topt.right}function Dh(e){if(xh(e)){return e.startContainer.ownerDocument.defaultView}else{return e.ownerDocument.defaultView}}function Fh(e){if(xh(e)){let t=e.commonAncestorContainer;if(ld(t)){t=t.parentNode}return t}else{return e.parentNode}}function Lh(e,t){const n=Dh(e);const o=new Th(e);if(n===t){return o}else{let e=n;while(e!=t){const t=e.frameElement;const n=new Th(t).excludeScrollbarsAndBorders();o.moveBy(n.left,n.top);e=e.parent}}return o}class Hh{constructor(e){this.document=new bl(e);this.domConverter=new jd(this.document);this.domRoots=new Map;this.set(\"isRenderingInProgress\",false);this.set(\"hasDomSelection\",false);this._renderer=new Ed(this.domConverter,this.document.selection);this._renderer.bind(\"isFocused\").to(this.document);this._initialDomRootAttributes=new WeakMap;this._observers=new Map;this._ongoingChange=false;this._postFixersInProgress=false;this._renderingDisabled=false;this._hasChangedSinceTheLastRendering=false;this._writer=new Ql(this.document);this.addObserver(Xu);this.addObserver(kh);this.addObserver(_h);this.addObserver(th);this.addObserver(bh);this.addObserver(vh);if(Tl.isAndroid){this.addObserver(yh)}bd(this);Wl(this);this.on(\"render\",()=>{this._render();this.document.fire(\"layoutChanged\");this._hasChangedSinceTheLastRendering=false});this.listenTo(this.document.selection,\"change\",()=>{this._hasChangedSinceTheLastRendering=true})}attachDomRoot(e,t=\"main\"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const o={};for(const{name:t,value:i}of Array.from(e.attributes)){o[t]=i;if(t===\"class\"){this._writer.addClass(i.split(\" \"),n)}else{this._writer.setAttribute(t,i,n)}}this._initialDomRootAttributes.set(e,o);const i=()=>{this._writer.setAttribute(\"contenteditable\",!n.isReadOnly,n);if(n.isReadOnly){this._writer.addClass(\"ck-read-only\",n)}else{this._writer.removeClass(\"ck-read-only\",n)}};i();this.domRoots.set(t,e);this.domConverter.bindElements(e,n);this._renderer.markToSync(\"children\",n);this._renderer.markToSync(\"attributes\",n);this._renderer.domDocuments.add(e.ownerDocument);n.on(\"change:children\",(e,t)=>this._renderer.markToSync(\"children\",t));n.on(\"change:attributes\",(e,t)=>this._renderer.markToSync(\"attributes\",t));n.on(\"change:text\",(e,t)=>this._renderer.markToSync(\"text\",t));n.on(\"change:isReadOnly\",()=>this.change(i));n.on(\"change\",()=>{this._hasChangedSinceTheLastRendering=true});for(const n of this._observers.values()){n.observe(e,t)}}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const n=this._initialDomRootAttributes.get(t);for(const e in n){t.setAttribute(e,n[e])}this.domRoots.delete(e);this.domConverter.unbindDomElement(t)}getDomRoot(e=\"main\"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t){return t}t=new e(this);this._observers.set(e,t);for(const[e,n]of this.domRoots){t.observe(n,e)}t.enable();return t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values()){e.disable()}}enableObservers(){for(const e of this._observers.values()){e.enable()}}scrollToTheSelection(){const e=this.document.selection.getFirstRange();if(e){Rh({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;if(e){this.domConverter.focus(e);this.forceRender()}else{}}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress){throw new ss[\"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)}try{if(this._ongoingChange){return e(this._writer)}this._ongoingChange=true;const t=e(this._writer);this._ongoingChange=false;if(!this._renderingDisabled&&this._hasChangedSinceTheLastRendering){this._postFixersInProgress=true;this.document._callPostFixers(this._writer);this._postFixersInProgress=false;this.fire(\"render\")}return t}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=true;this.change(()=>{})}destroy(){for(const e of this._observers.values()){e.destroy()}this.document.destroy();this.stopListening()}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,n){return new ml(e,t,n)}_disableRendering(e){this._renderingDisabled=e;if(e==false){this.change(()=>{})}}_render(){this.isRenderingInProgress=true;this.disableObservers();this._renderer.render();this.enableObservers();this.isRenderingInProgress=false}}ys(Hh,Yc);class jh{constructor(e){this.parent=null;this._attrs=qs(e)}get index(){let e;if(!this.parent){return null}if((e=this.parent.getChildIndex(this))===null){throw new ss[\"b\"](\"model-node-not-found-in-parent: The node's parent does not contain this node.\",this)}return e}get startOffset(){let e;if(!this.parent){return null}if((e=this.parent.getChildStartOffset(this))===null){throw new ss[\"b\"](\"model-node-not-found-in-parent: The node's parent does not contain this node.\",this)}return e}get offsetSize(){return 1}get endOffset(){if(!this.parent){return null}return this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;while(e.parent){e=e.parent}return e}isAttached(){return this.root.is(\"rootElement\")}getPath(){const e=[];let t=this;while(t.parent){e.unshift(t.startOffset);t=t.parent}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let n=e.includeSelf?this:this.parent;while(n){t[e.parentFirst?\"push\":\"unshift\"](n);n=n.parent}return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t);const o=e.getAncestors(t);let i=0;while(n[i]==o[i]&&n[i]){i++}return i===0?null:n[i-1]}isBefore(e){if(this==e){return false}if(this.root!==e.root){return false}const t=this.getPath();const n=e.getPath();const o=Ns(t,n);switch(o){case\"prefix\":return true;case\"extension\":return false;default:return t[o]{e[t[0]]=t[1];return e},{})}return e}is(e){return e===\"node\"||e===\"model:node\"}_clone(){return new jh(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=qs(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class qh extends jh{constructor(e,t){super(t);this._data=e||\"\"}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return e===\"$text\"||e===\"model:$text\"||e===\"text\"||e===\"model:text\"||e===\"node\"||e===\"model:node\"}toJSON(){const e=super.toJSON();e.data=this.data;return e}_clone(){return new qh(this.data,this.getAttributes())}static fromJSON(e){return new qh(e.data,e.attributes)}}class Wh{constructor(e,t,n){this.textNode=e;if(t<0||t>e.offsetSize){throw new ss[\"b\"](\"model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\",this)}if(n<0||t+n>e.offsetSize){throw new ss[\"b\"](\"model-textproxy-wrong-length: Given length value is incorrect.\",this)}this.data=e.data.substring(t,t+n);this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?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}is(e){return e===\"$textProxy\"||e===\"model:$textProxy\"||e===\"textProxy\"||e===\"model:textProxy\"}getPath(){const e=this.textNode.getPath();if(e.length>0){e[e.length-1]+=this.offsetInText}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let n=e.includeSelf?this:this.parent;while(n){t[e.parentFirst?\"push\":\"unshift\"](n);n=n.parent}return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class $h{constructor(e){this._nodes=[];if(e){this._insertNodes(0,e)}}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length){return this.maxOffset}const t=this._nodes[e];if(!t){throw new ss[\"b\"](\"model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.\",this)}return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&ee.toJSON())}}class Uh extends jh{constructor(e,t,n){super(t);this.name=e;this._children=new $h;if(n){this._insertChild(0,n)}}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(e,t=null){if(!t){return e===\"element\"||e===\"model:element\"||e===\"node\"||e===\"model:node\"}return t===this.name&&(e===\"element\"||e===\"model:element\")}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e){t=t.getChild(t.offsetToIndex(n))}return t}findAncestor(e,t={includeSelf:false}){let n=t.includeSelf?this:this.parent;while(n){if(n.name===e){return n}n=n.parent}return null}toJSON(){const e=super.toJSON();e.name=this.name;if(this._children.length>0){e.children=[];for(const t of this._children){e.children.push(t.toJSON())}}return e}_clone(e=false){const t=e?Array.from(this._children).map(e=>e._clone(true)):null;return new Uh(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=Gh(t);for(const e of n){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n){e.parent=null}return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children){if(n.name){t.push(Uh.fromJSON(n))}else{t.push(qh.fromJSON(n))}}}return new Uh(e.name,e.attributes,t)}}function Gh(e){if(typeof e==\"string\"){return[new qh(e)]}if(!vs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new qh(e)}if(e instanceof Wh){return new qh(e.data,e.getAttributes())}return e})}class Kh{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss[\"b\"](\"model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.\",null)}const t=e.direction||\"forward\";if(t!=\"forward\"&&t!=\"backward\"){throw new ss[\"b\"](\"model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.\",e,{direction:t})}this.direction=t;this.boundaries=e.boundaries||null;if(e.startPosition){this.position=e.startPosition.clone()}else{this.position=Yh._createAt(this.boundaries[this.direction==\"backward\"?\"end\":\"start\"])}this.position.stickiness=\"toNone\";this.singleCharacters=!!e.singleCharacters;this.shallow=!!e.shallow;this.ignoreElementEnd=!!e.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(e){let t,n,o,i;do{o=this.position;i=this._visitedParent;({done:t,value:n}=this.next())}while(!t&&e(n));if(!t){this.position=o;this._visitedParent=i}}next(){if(this.direction==\"forward\"){return this._next()}else{return this._previous()}}_next(){const e=this.position;const t=this.position.clone();const n=this._visitedParent;if(n.parent===null&&t.offset===n.maxOffset){return{done:true}}if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset){return{done:true}}const o=t.parent;const i=Qh(t,o);const r=i?i:Xh(t,o,i);if(r instanceof Uh){if(!this.shallow){t.path.push(0);this._visitedParent=r}else{t.offset++}this.position=t;return Jh(\"elementStart\",r,e,t,1)}else if(r instanceof qh){let o;if(this.singleCharacters){o=1}else{let e=r.endOffset;if(this._boundaryEndParent==n&&this.boundaries.end.offsete){e=this.boundaries.start.offset}o=t.offset-e}const i=t.offset-r.startOffset;const s=new Wh(r,i-o,o);t.offset-=o;this.position=t;return Jh(\"text\",s,e,t,o)}else{t.path.pop();this.position=t;this._visitedParent=n.parent;return Jh(\"elementStart\",n,e,t,1)}}}function Jh(e,t,n,o,i){return{done:false,value:{type:e,item:t,previousPosition:n,nextPosition:o,length:i}}}class Yh{constructor(e,t,n=\"toNone\"){if(!e.is(\"element\")&&!e.is(\"documentFragment\")){throw new ss[\"b\"](\"model-position-root-invalid: Position root invalid.\",e)}if(!(t instanceof Array)||t.length===0){throw new ss[\"b\"](\"model-position-path-incorrect-format: Position path must be an array with at least one item.\",e,{path:t})}if(e.is(\"rootElement\")){t=t.slice()}else{t=[...e.getPath(),...t];e=e.root}this.root=e;this.path=t;this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;tn.path.length){if(t.offset!==i.maxOffset){return false}t.path=t.path.slice(0,-1);i=i.parent;t.offset++}else{if(n.offset!==0){return false}n.path=n.path.slice(0,-1)}}}is(e){return e===\"position\"||e===\"model:position\"}hasSameParentAs(e){if(this.root!==e.root){return false}const t=this.getParentPath();const n=e.getParentPath();return Ns(t,n)==\"same\"}getTransformedByOperation(e){let t;switch(e.type){case\"insert\":t=this._getTransformedByInsertOperation(e);break;case\"move\":case\"remove\":case\"reinsert\":t=this._getTransformedByMoveOperation(e);break;case\"split\":t=this._getTransformedBySplitOperation(e);break;case\"merge\":t=this._getTransformedByMergeOperation(e);break;default:t=Yh._createAt(this);break}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;const n=t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness==\"toNext\";if(n){return this._getCombined(e.splitPosition,e.moveTargetPosition)}else{if(e.graveyardPosition){return this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1)}else{return this._getTransformedByInsertion(e.insertionPosition,1)}}}_getTransformedByMergeOperation(e){const t=e.movedRange;const n=t.containsPosition(this)||t.start.isEqual(this);let o;if(n){o=this._getCombined(e.sourcePosition,e.targetPosition);if(e.sourcePosition.isBefore(e.targetPosition)){o=o._getTransformedByDeletion(e.deletionPosition,1)}}else if(this.isEqual(e.deletionPosition)){o=Yh._createAt(e.deletionPosition)}else{o=this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1)}return o}_getTransformedByDeletion(e,t){const n=Yh._createAt(this);if(this.root!=e.root){return n}if(Ns(e.getParentPath(),this.getParentPath())==\"same\"){if(e.offsetthis.offset){return null}else{n.offset-=t}}}else if(Ns(e.getParentPath(),this.getParentPath())==\"prefix\"){const o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o]){return null}else{n.path[o]-=t}}}return n}_getTransformedByInsertion(e,t){const n=Yh._createAt(this);if(this.root!=e.root){return n}if(Ns(e.getParentPath(),this.getParentPath())==\"same\"){if(e.offsett+1){const t=o.maxOffset-n.offset;if(t!==0){e.push(new ef(n,n.getShiftedBy(t)))}n.path=n.path.slice(0,-1);n.offset++;o=o.parent}while(n.path.length<=this.end.path.length){const t=this.end.path[n.path.length-1];const o=t-n.offset;if(o!==0){e.push(new ef(n,n.getShiftedBy(o)))}n.offset=t;n.path.push(0)}return e}getWalker(e={}){e.boundaries=this;return new Kh(e)}*getItems(e={}){e.boundaries=this;e.ignoreElementEnd=true;const t=new Kh(e);for(const e of t){yield e.item}}*getPositions(e={}){e.boundaries=this;const t=new Kh(e);yield t.position;for(const e of t){yield e.nextPosition}}getTransformedByOperation(e){switch(e.type){case\"insert\":return this._getTransformedByInsertOperation(e);case\"move\":case\"remove\":case\"reinsert\":return this._getTransformedByMoveOperation(e);case\"split\":return[this._getTransformedBySplitOperation(e)];case\"merge\":return[this._getTransformedByMergeOperation(e)]}return[new ef(this.start,this.end)]}getTransformedByOperations(e){const t=[new ef(this.start,this.end)];for(const n of e){for(let e=0;e0?new this(n,o):new this(o,n)}static _createIn(e){return new this(Yh._createAt(e,0),Yh._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Yh._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0){throw new ss[\"b\"](\"range-create-from-ranges-empty-array: At least one range has to be passed.\",null)}else if(e.length==1){return e[0].clone()}const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const n=e.indexOf(t);const o=new this(t.start,t.end);if(n>0){for(let t=n-1;true;t++){if(e[t].end.isEqual(o.start)){o.start=Yh._createAt(e[t].start)}else{break}}}for(let t=n+1;t{if(t.viewPosition){return}const n=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:\"low\"});this.on(\"viewToModelPosition\",(e,t)=>{if(t.modelPosition){return}const n=this.findMappedViewAncestor(t.viewPosition);const o=this._viewToModelMapping.get(n);const i=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=Yh._createAt(o,i)},{priority:\"low\"})}bindElements(e,t){this._modelToViewMapping.set(e,t);this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);this._viewToModelMapping.delete(e);if(this._elementToMarkerNames.has(e)){for(const t of this._elementToMarkerNames.get(e)){this._unboundMarkerNames.add(t)}}if(this._modelToViewMapping.get(t)==e){this._modelToViewMapping.delete(t)}}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e);if(this._viewToModelMapping.get(t)==e){this._viewToModelMapping.delete(t)}}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const o=this._elementToMarkerNames.get(e)||new Set;o.add(t);this._markerNameToElements.set(t,n);this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);if(n){n.delete(e);if(n.size==0){this._markerNameToElements.delete(t)}}const o=this._elementToMarkerNames.get(e);if(o){o.delete(t);if(o.size==0){this._elementToMarkerNames.delete(e)}}}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);this._unboundMarkerNames.clear();return e}clearBindings(){this._modelToViewMapping=new WeakMap;this._viewToModelMapping=new WeakMap;this._markerNameToElements=new Map;this._elementToMarkerNames=new Map;this._unboundMarkerNames=new Set}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new ef(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new hl(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};this.fire(\"viewToModelPosition\",t);return t.modelPosition}toViewPosition(e,t={isPhantom:false}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};this.fire(\"modelToViewPosition\",n);return n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t){return null}const n=new Set;for(const e of t){if(e.is(\"attributeElement\")){for(const t of e.getElementsWithSameId()){n.add(t)}}else{n.add(e)}}return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;while(!this._viewToModelMapping.has(t)){t=t.parent}return t}_toModelOffset(e,t,n){if(n!=e){const o=this._toModelOffset(e.parent,e.index,n);const i=this._toModelOffset(e,t,e);return o+i}if(e.is(\"$text\")){return t}let o=0;for(let n=0;n1?t[0]+\":\"+t[1]:t[0]}class rf{constructor(e){this.conversionApi=$c({dispatcher:this},e)}convertChanges(e,t,n){for(const t of e.getMarkersToRemove()){this.convertMarkerRemove(t.name,t.range,n)}for(const t of e.getChanges()){if(t.type==\"insert\"){this.convertInsert(ef._createFromPositionAndShift(t.position,t.length),n)}else if(t.type==\"remove\"){this.convertRemove(t.position,t.length,t.name,n)}else{this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,n)}}for(const e of this.conversionApi.mapper.flushUnboundMarkerNames()){const o=t.get(e).getRange();this.convertMarkerRemove(e,o,n);this.convertMarkerAdd(e,o,n)}for(const t of e.getMarkersToAdd()){this.convertMarkerAdd(t.name,t.range,n)}}convertInsert(e,t){this.conversionApi.writer=t;this.conversionApi.consumable=this._createInsertConsumable(e);for(const t of e){const e=t.item;const n=ef._createFromPositionAndShift(t.previousPosition,t.length);const o={item:e,range:n};this._testAndFire(\"insert\",o);for(const t of e.getAttributeKeys()){o.attributeKey=t;o.attributeOldValue=null;o.attributeNewValue=e.getAttribute(t);this._testAndFire(`attribute:${t}`,o)}}this._clearConversionApi()}convertRemove(e,t,n,o){this.conversionApi.writer=o;this.fire(\"remove:\"+n,{position:e,length:t},this.conversionApi);this._clearConversionApi()}convertAttribute(e,t,n,o,i){this.conversionApi.writer=i;this.conversionApi.consumable=this._createConsumableForRange(e,`attribute:${t}`);for(const i of e){const e=i.item;const r=ef._createFromPositionAndShift(i.previousPosition,i.length);const s={item:e,range:r,attributeKey:t,attributeOldValue:n,attributeNewValue:o};this._testAndFire(`attribute:${t}`,s)}this._clearConversionApi()}convertSelection(e,t,n){const o=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));this.conversionApi.writer=n;this.conversionApi.consumable=this._createSelectionConsumable(e,o);this.fire(\"selection\",{selection:e},this.conversionApi);if(!e.isCollapsed){return}for(const t of o){const n=t.getRange();if(!sf(e.getFirstPosition(),t,this.conversionApi.mapper)){continue}const o={item:e,markerName:t.name,markerRange:n};if(this.conversionApi.consumable.test(e,\"addMarker:\"+t.name)){this.fire(\"addMarker:\"+t.name,o,this.conversionApi)}}for(const t of e.getAttributeKeys()){const n={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};if(this.conversionApi.consumable.test(e,\"attribute:\"+n.attributeKey)){this.fire(\"attribute:\"+n.attributeKey+\":$text\",n,this.conversionApi)}}this._clearConversionApi()}convertMarkerAdd(e,t,n){if(!t.root.document||t.root.rootName==\"$graveyard\"){return}this.conversionApi.writer=n;const o=\"addMarker:\"+e;const i=new nf;i.add(t,o);this.conversionApi.consumable=i;this.fire(o,{markerName:e,markerRange:t},this.conversionApi);if(!i.test(t,o)){return}this.conversionApi.consumable=this._createConsumableForRange(t,o);for(const n of t.getItems()){if(!this.conversionApi.consumable.test(n,o)){continue}const i={item:n,range:ef._createOn(n),markerName:e,markerRange:t};this.fire(o,i,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(e,t,n){if(!t.root.document||t.root.rootName==\"$graveyard\"){return}this.conversionApi.writer=n;this.fire(\"removeMarker:\"+e,{markerName:e,markerRange:t},this.conversionApi);this._clearConversionApi()}_createInsertConsumable(e){const t=new nf;for(const n of e){const e=n.item;t.add(e,\"insert\");for(const n of e.getAttributeKeys()){t.add(e,\"attribute:\"+n)}}return t}_createConsumableForRange(e,t){const n=new nf;for(const o of e.getItems()){n.add(o,t)}return n}_createSelectionConsumable(e,t){const n=new nf;n.add(e,\"selection\");for(const o of t){n.add(e,\"addMarker:\"+o.name)}for(const t of e.getAttributeKeys()){n.add(e,\"attribute:\"+t)}return n}_testAndFire(e,t){if(!this.conversionApi.consumable.test(t.item,e)){return}const n=t.item.name||\"$text\";this.fire(e+\":\"+n,t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer;delete this.conversionApi.consumable}}ys(rf,ds);function sf(e,t,n){const o=t.getRange();const i=Array.from(e.getAncestors());i.shift();i.reverse();const r=i.some(e=>{if(o.containsItem(e)){const t=n.toViewElement(e);return!!t.getCustomProperty(\"addHighlight\")}});return!r}class af{constructor(e,t,n){this._lastRangeBackward=false;this._ranges=[];this._attrs=new Map;if(e){this.setTo(e,t,n)}}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){const e=this._ranges.length;if(e===1){return this._ranges[0].isCollapsed}else{return false}}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let n=false;for(const o of e._ranges){if(t.isEqual(o)){n=true;break}}if(!n){return false}}return true}*getRanges(){for(const e of this._ranges){yield new ef(e.start,e.end)}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?new ef(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges){if(!e||t.end.isAfter(e.end)){e=t}}return e?new ef(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,n){if(e===null){this._setRanges([])}else if(e instanceof af){this._setRanges(e.getRanges(),e.isBackward)}else if(e&&typeof e.getRanges==\"function\"){this._setRanges(e.getRanges(),e.isBackward)}else if(e instanceof ef){this._setRanges([e],!!t&&!!t.backward)}else if(e instanceof Yh){this._setRanges([new ef(e)])}else if(e instanceof jh){const o=!!n&&!!n.backward;let i;if(t==\"in\"){i=ef._createIn(e)}else if(t==\"on\"){i=ef._createOn(e)}else if(t!==undefined){i=new ef(Yh._createAt(e,t))}else{throw new ss[\"b\"](\"model-selection-setTo-required-second-parameter: \"+\"selection.setTo requires the second parameter when the first parameter is a node.\",[this,e])}this._setRanges([i],o)}else if(vs(e)){this._setRanges(e,t&&!!t.backward)}else{throw new ss[\"b\"](\"model-selection-setTo-not-selectable: Cannot set the selection to the given place.\",[this,e])}}_setRanges(e,t=false){e=Array.from(e);const n=e.some(t=>{if(!(t instanceof ef)){throw new ss[\"b\"](\"model-selection-set-ranges-not-range: \"+\"Selection range set to an object that is not an instance of model.Range.\",[this,e])}return this._ranges.every(e=>!e.isEqual(t))});if(e.length===this._ranges.length&&!n){return}this._removeAllRanges();for(const t of e){this._pushRange(t)}this._lastRangeBackward=!!t;this.fire(\"change:range\",{directChange:true})}setFocus(e,t){if(this.anchor===null){throw new ss[\"b\"](\"model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\",[this,e])}const n=Yh._createAt(e,t);if(n.compareWith(this.focus)==\"same\"){return}const o=this.anchor;if(this._ranges.length){this._popRange()}if(n.compareWith(o)==\"before\"){this._pushRange(new ef(n,o));this._lastRangeBackward=true}else{this._pushRange(new ef(o,n));this._lastRangeBackward=false}this.fire(\"change:range\",{directChange:true})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){if(this.hasAttribute(e)){this._attrs.delete(e);this.fire(\"change:attribute\",{attributeKeys:[e],directChange:true})}}setAttribute(e,t){if(this.getAttribute(e)!==t){this._attrs.set(e,t);this.fire(\"change:attribute\",{attributeKeys:[e],directChange:true})}}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}is(e){return e===\"selection\"||e===\"model:selection\"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=df(t.start,e);if(n&&uf(n,t)){yield n}for(const n of t.getWalker()){const o=n.item;if(n.type==\"elementEnd\"&&lf(o,e,t)){yield o}}const o=df(t.end,e);if(o&&!t.end.isTouching(Yh._createAt(o,0))&&uf(o,t)){yield o}}}containsEntireContent(e=this.anchor.root){const t=Yh._createAt(e,0);const n=Yh._createAt(e,\"end\");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e);this._ranges.push(new ef(e.start,e.end))}_checkRange(e){for(let t=0;t0){this._popRange()}}_popRange(){this._ranges.pop()}}ys(af,ds);function cf(e,t){if(t.has(e)){return false}t.add(e);return e.root.document.model.schema.isBlock(e)&&e.parent}function lf(e,t,n){return cf(e,t)&&uf(e,n)}function df(e,t){const n=e.parent;const o=n.root.document.model.schema;const i=e.parent.getAncestors({parentFirst:true,includeSelf:true});let r=false;const s=i.find(e=>{if(r){return false}r=o.isLimit(e);return!r&&cf(e,t)});i.forEach(e=>t.add(e));return s}function uf(e,t){const n=hf(e);if(!n){return true}const o=t.containsRange(ef._createOn(n),true);return!o}function hf(e){const t=e.root.document.model.schema;let n=e.parent;while(n){if(t.isBlock(n)){return n}n=n.parent}}class ff extends ef{constructor(e,t){super(e,t);gf.call(this)}detach(){this.stopListening()}is(e){return e===\"liveRange\"||e===\"model:liveRange\"||e==\"range\"||e===\"model:range\"}toRange(){return new ef(this.start,this.end)}static fromRange(e){return new ff(e.start,e.end)}}function gf(){this.listenTo(this.root.document.model,\"applyOperation\",(e,t)=>{const n=t[0];if(!n.isDocumentOperation){return}mf.call(this,n)},{priority:\"low\"})}function mf(e){const t=this.getTransformedByOperation(e);const n=ef._createFromRanges(t);const o=!n.isEqual(this);const i=pf(this,e);let r=null;if(o){if(n.root.rootName==\"$graveyard\"){if(e.type==\"remove\"){r=e.sourcePosition}else{r=e.deletionPosition}}const t=this.toRange();this.start=n.start;this.end=n.end;this.fire(\"change:range\",t,{deletionPosition:r})}else if(i){this.fire(\"change:content\",this.toRange(),{deletionPosition:r})}}function pf(e,t){switch(t.type){case\"insert\":return e.containsPosition(t.position);case\"move\":case\"remove\":case\"reinsert\":case\"merge\":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case\"split\":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return false}ys(ff,ds);const bf=\"selection:\";class wf{constructor(e){this._selection=new kf(e);this._selection.delegate(\"change:range\").to(this);this._selection.delegate(\"change:attribute\").to(this);this._selection.delegate(\"change:marker\").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()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers();this._selection._updateAttributes(false)}is(e){return e===\"selection\"||e==\"model:selection\"||e==\"documentSelection\"||e==\"model:documentSelection\"}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return bf+e}static _isStoreAttributeKey(e){return e.startsWith(bf)}}ys(wf,ds);class kf extends af{constructor(e){super();this.markers=new xs({idProperty:\"name\"});this._model=e.model;this._document=e;this._attributePriority=new Map;this._selectionRestorePosition=null;this._hasChangedRange=false;this._overriddenGravityRegister=new Set;this.listenTo(this._model,\"applyOperation\",(e,t)=>{const n=t[0];if(!n.isDocumentOperation||n.type==\"marker\"||n.type==\"rename\"||n.type==\"noop\"){return}if(this._ranges.length==0&&this._selectionRestorePosition){this._fixGraveyardSelection(this._selectionRestorePosition)}this._selectionRestorePosition=null;if(this._hasChangedRange){this._hasChangedRange=false;this.fire(\"change:range\",{directChange:false})}},{priority:\"lowest\"});this.on(\"change:range\",()=>{for(const e of this.getRanges()){if(!this._document._validateSelectionRange(e)){throw new ss[\"b\"](\"document-selection-wrong-position: Range from document selection starts or ends at incorrect position.\",this,{range:e})}}});this.listenTo(this._model.markers,\"update\",()=>this._updateMarkers());this.listenTo(this._document,\"change\",(e,t)=>{vf(this._model,t)})}get isCollapsed(){const e=this._ranges.length;return e===0?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 e=0;e{this._hasChangedRange=true;if(t.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1);t.detach()}});return t}_updateMarkers(){const e=[];let t=false;for(const t of this._model.markers){const n=t.getRange();for(const o of this.getRanges()){if(n.containsRange(o,!o.isCollapsed)){e.push(t)}}}const n=Array.from(this.markers);for(const n of e){if(!this.markers.has(n)){this.markers.add(n);t=true}}for(const n of Array.from(this.markers)){if(!e.includes(n)){this.markers.remove(n);t=true}}if(t){this.fire(\"change:marker\",{oldMarkers:n,directChange:false})}}_updateAttributes(e){const t=qs(this._getSurroundingAttributes());const n=qs(this.getAttributes());if(e){this._attributePriority=new Map;this._attrs=new Map}else{for(const[e,t]of this._attributePriority){if(t==\"low\"){this._attrs.delete(e);this._attributePriority.delete(e)}}}this._setAttributesTo(t);const o=[];for(const[e,t]of this.getAttributes()){if(!n.has(e)||n.get(e)!==t){o.push(e)}}for(const[e]of n){if(!this.hasAttribute(e)){o.push(e)}}if(o.length>0){this.fire(\"change:attribute\",{attributeKeys:o,directChange:false})}}_setAttribute(e,t,n=true){const o=n?\"normal\":\"low\";if(o==\"low\"&&this._attributePriority.get(e)==\"normal\"){return false}const i=super.getAttribute(e);if(i===t){return false}this._attrs.set(e,t);this._attributePriority.set(e,o);return true}_removeAttribute(e,t=true){const n=t?\"normal\":\"low\";if(n==\"low\"&&this._attributePriority.get(e)==\"normal\"){return false}this._attributePriority.set(e,n);if(!super.hasAttribute(e)){return false}this._attrs.delete(e);return true}_setAttributesTo(e){const t=new Set;for(const[t,n]of this.getAttributes()){if(e.get(t)===n){continue}this._removeAttribute(t,false)}for(const[n,o]of e){const e=this._setAttribute(n,o,false);if(e){t.add(n)}}return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty){for(const t of e.getAttributeKeys()){if(t.startsWith(bf)){const n=t.substr(bf.length);yield[n,e.getAttribute(t)]}}}}_getSurroundingAttributes(){const e=this.getFirstPosition();const t=this._model.schema;let n=null;if(!this.isCollapsed){const e=this.getFirstRange();for(const o of e){if(o.item.is(\"element\")&&t.isObject(o.item)){break}if(o.type==\"text\"){n=o.item.getAttributes();break}}}else{const t=e.textNode?e.textNode:e.nodeBefore;const o=e.textNode?e.textNode:e.nodeAfter;if(!this.isGravityOverridden){n=_f(t)}if(!n){n=_f(o)}if(!this.isGravityOverridden&&!n){let e=t;while(e&&!n){e=e.previousSibling;n=_f(e)}}if(!n){let e=o;while(e&&!n){e=e.nextSibling;n=_f(e)}}if(!n){n=this._getStoredAttributes()}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);if(t){this._pushRange(t)}}}function _f(e){if(e instanceof Wh||e instanceof qh){return e.getAttributes()}return null}function vf(e,t){const n=e.document.differ;for(const o of n.getChanges()){if(o.type!=\"insert\"){continue}const n=o.position.parent;const i=o.length===n.maxOffset;if(i){e.enqueueChange(t,e=>{const t=Array.from(n.getAttributeKeys()).filter(e=>e.startsWith(bf));for(const o of t){e.removeAttribute(o,n)}})}}}class yf{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers){e(t)}return this}}var xf=1,Cf=4;function Af(e){return jr(e,xf|Cf)}var Tf=Af;class Pf extends yf{elementToElement(e){return this.add(Gf(e))}attributeToElement(e){return this.add(Kf(e))}attributeToAttribute(e){return this.add(Jf(e))}markerToElement(e){return this.add(Yf(e))}markerToHighlight(e){return this.add(Xf(e))}markerToData(e){return this.add(Qf(e))}}function Sf(){return(e,t,n)=>{if(!n.consumable.consume(t.item,\"insert\")){return}const o=n.writer;const i=n.mapper.toViewPosition(t.range.start);const r=o.createText(t.item.data);o.insert(i,r)}}function Ef(){return(e,t,n)=>{const o=n.mapper.toViewPosition(t.position);const i=t.position.getShiftedBy(t.length);const r=n.mapper.toViewPosition(i,{isPhantom:true});const s=n.writer.createRange(o,r);const a=n.writer.remove(s.getTrimmed());for(const e of n.writer.createRangeIn(a).getItems()){n.mapper.unbindViewElement(e)}}}function Rf(e,t){const n=e.createAttributeElement(\"span\",t.attributes);if(t.classes){n._addClass(t.classes)}if(t.priority){n._priority=t.priority}n._id=t.id;return n}function If(){return(e,t,n)=>{const o=t.selection;if(o.isCollapsed){return}if(!n.consumable.consume(o,\"selection\")){return}const i=[];for(const e of o.getRanges()){const t=n.mapper.toViewRange(e);i.push(t)}n.writer.setSelection(i,{backward:o.isBackward})}}function Of(){return(e,t,n)=>{const o=t.selection;if(!o.isCollapsed){return}if(!n.consumable.consume(o,\"selection\")){return}const i=n.writer;const r=o.getFirstPosition();const s=n.mapper.toViewPosition(r);const a=i.breakAttributes(s);i.setSelection(a)}}function Vf(){return(e,t,n)=>{const o=n.writer;const i=o.document.selection;for(const e of i.getRanges()){if(e.isCollapsed){if(e.end.parent.isAttached()){n.writer.mergeAttributes(e.start)}}}o.setSelection(null)}}function Mf(e){return(t,n,o)=>{const i=e(n.attributeOldValue,o.writer);const r=e(n.attributeNewValue,o.writer);if(!i&&!r){return}if(!o.consumable.consume(n.item,t.name)){return}const s=o.writer;const a=s.document.selection;if(n.item instanceof af||n.item instanceof wf){s.wrap(a.getFirstRange(),r)}else{let e=o.mapper.toViewRange(n.range);if(n.attributeOldValue!==null&&i){e=s.unwrap(e,i)}if(n.attributeNewValue!==null&&r){s.wrap(e,r)}}}}function Nf(e){return(t,n,o)=>{const i=e(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)}}function zf(e){return(t,n,o)=>{n.isOpening=true;const i=e(n,o.writer);n.isOpening=false;const r=e(n,o.writer);if(!i||!r){return}const s=n.markerRange;if(s.isCollapsed&&!o.consumable.consume(s,t.name)){return}for(const e of s){if(!o.consumable.consume(e.item,t.name)){return}}const a=o.mapper;const c=o.writer;c.insert(a.toViewPosition(s.start),i);o.mapper.bindElementToMarker(i,n.markerName);if(!s.isCollapsed){c.insert(a.toViewPosition(s.end),r);o.mapper.bindElementToMarker(r,n.markerName)}t.stop()}}function Bf(){return(e,t,n)=>{const o=n.mapper.markerNameToElements(t.markerName);if(!o){return}for(const e of o){n.mapper.unbindElementFromMarkerName(e,t.markerName);n.writer.clear(n.writer.createRangeOn(e),e)}n.writer.clearClonedElementsGroup(t.markerName);e.stop()}}function Df(e){return(t,n,o)=>{const i=e(n.markerName);if(!i){return}const r=n.markerRange;if(!o.consumable.consume(r,t.name)){return}Ff(r,false,o,n,i);Ff(r,true,o,n,i);t.stop()}}function Ff(e,t,n,o,i){const r=t?e.start:e.end;const s=n.schema.checkChild(r,\"$text\");if(s){const e=n.mapper.toViewPosition(r);Hf(e,t,n,o,i)}else{let e;let s;if(t&&r.nodeAfter||!t&&!r.nodeBefore){e=r.nodeAfter;s=true}else{e=r.nodeBefore;s=false}const a=n.mapper.toViewElement(e);Lf(a,t,s,n,o,i)}}function Lf(e,t,n,o,i,r){const s=`data-${r.group}-${t?\"start\":\"end\"}-${n?\"before\":\"after\"}`;const a=e.hasAttribute(s)?e.getAttribute(s).split(\",\"):[];a.unshift(r.name);o.writer.setAttribute(s,a.join(\",\"),e);o.mapper.bindElementToMarker(e,i.markerName)}function Hf(e,t,n,o,i){const r=`${i.group}-${t?\"start\":\"end\"}`;const s=i.name?{name:i.name}:null;const a=n.writer.createUIElement(r,s);n.writer.insert(e,a);n.mapper.bindElementToMarker(a,o.markerName)}function jf(e){return(t,n,o)=>{const i=e(n.markerName);if(!i){return}const r=o.mapper.markerNameToElements(n.markerName);if(!r){return}for(const e of r){o.mapper.unbindElementFromMarkerName(e,n.markerName);if(e.is(\"containerElement\")){s(`data-${i.group}-start-before`,e);s(`data-${i.group}-start-after`,e);s(`data-${i.group}-end-before`,e);s(`data-${i.group}-end-after`,e)}else{o.writer.clear(o.writer.createRangeOn(e),e)}}o.writer.clearClonedElementsGroup(n.markerName);t.stop();function s(e,t){if(t.hasAttribute(e)){const n=new Set(t.getAttribute(e).split(\",\"));n.delete(i.name);if(n.size==0){o.writer.removeAttribute(e,t)}else{o.writer.setAttribute(e,Array.from(n).join(\",\"),t)}}}}}function qf(e){return(t,n,o)=>{const i=e(n.attributeOldValue,n);const r=e(n.attributeNewValue,n);if(!i&&!r){return}if(!o.consumable.consume(n.item,t.name)){return}const s=o.mapper.toViewElement(n.item);const a=o.writer;if(!s){throw new ss[\"b\"](\"conversion-attribute-to-attribute-on-text: \"+\"Trying to convert text node's attribute with attribute-to-attribute converter.\",[n,o])}if(n.attributeOldValue!==null&&i){if(i.key==\"class\"){const e=Array.isArray(i.value)?i.value:[i.value];for(const t of e){a.removeClass(t,s)}}else if(i.key==\"style\"){const e=Object.keys(i.value);for(const t of e){a.removeStyle(t,s)}}else{a.removeAttribute(i.key,s)}}if(n.attributeNewValue!==null&&r){if(r.key==\"class\"){const e=Array.isArray(r.value)?r.value:[r.value];for(const t of e){a.addClass(t,s)}}else if(r.key==\"style\"){const e=Object.keys(r.value);for(const t of e){a.setStyle(t,r.value[t],s)}}else{a.setAttribute(r.key,r.value,s)}}}}function Wf(e){return(t,n,o)=>{if(!n.item){return}if(!(n.item instanceof af||n.item instanceof wf)&&!n.item.is(\"$textProxy\")){return}const i=og(e,n,o);if(!i){return}if(!o.consumable.consume(n.item,t.name)){return}const r=o.writer;const s=Rf(r,i);const a=r.document.selection;if(n.item instanceof af||n.item instanceof wf){r.wrap(a.getFirstRange(),s,a)}else{const e=o.mapper.toViewRange(n.range);const t=r.wrap(e,s);for(const e of t.getItems()){if(e.is(\"attributeElement\")&&e.isSimilar(s)){o.mapper.bindElementToMarker(e,n.markerName);break}}}}}function $f(e){return(t,n,o)=>{if(!n.item){return}if(!(n.item instanceof Uh)){return}const i=og(e,n,o);if(!i){return}if(!o.consumable.test(n.item,t.name)){return}const r=o.mapper.toViewElement(n.item);if(r&&r.getCustomProperty(\"addHighlight\")){o.consumable.consume(n.item,t.name);for(const e of ef._createIn(n.item)){o.consumable.consume(e.item,t.name)}r.getCustomProperty(\"addHighlight\")(r,i,o.writer);o.mapper.bindElementToMarker(r,n.markerName)}}}function Uf(e){return(t,n,o)=>{if(n.markerRange.isCollapsed){return}const i=og(e,n,o);if(!i){return}const r=Rf(o.writer,i);const s=o.mapper.markerNameToElements(n.markerName);if(!s){return}for(const e of s){o.mapper.unbindElementFromMarkerName(e,n.markerName);if(e.is(\"attributeElement\")){o.writer.unwrap(o.writer.createRangeOn(e),r)}else{e.getCustomProperty(\"removeHighlight\")(e,i.id,o.writer)}}o.writer.clearClonedElementsGroup(n.markerName);t.stop()}}function Gf(e){e=Tf(e);e.view=Zf(e.view,\"container\");return t=>{t.on(\"insert:\"+e.model,Nf(e.view),{priority:e.converterPriority||\"normal\"})}}function Kf(e){e=Tf(e);const t=e.model.key?e.model.key:e.model;let n=\"attribute:\"+t;if(e.model.name){n+=\":\"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=Zf(e.view[t],\"attribute\")}}else{e.view=Zf(e.view,\"attribute\")}const o=tg(e);return t=>{t.on(n,Mf(o),{priority:e.converterPriority||\"normal\"})}}function Jf(e){e=Tf(e);const t=e.model.key?e.model.key:e.model;let n=\"attribute:\"+t;if(e.model.name){n+=\":\"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=ng(e.view[t])}}else{e.view=ng(e.view)}const o=tg(e);return t=>{t.on(n,qf(o),{priority:e.converterPriority||\"normal\"})}}function Yf(e){e=Tf(e);e.view=Zf(e.view,\"ui\");return t=>{t.on(\"addMarker:\"+e.model,zf(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"removeMarker:\"+e.model,Bf(e.view),{priority:e.converterPriority||\"normal\"})}}function Qf(e){e=Tf(e);const t=e.model;if(!e.view){e.view=n=>({group:t,name:n.substr(e.model.length+1)})}return n=>{n.on(\"addMarker:\"+t,Df(e.view),{priority:e.converterPriority||\"normal\"});n.on(\"removeMarker:\"+t,jf(e.view),{priority:e.converterPriority||\"normal\"})}}function Xf(e){return t=>{t.on(\"addMarker:\"+e.model,Wf(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"addMarker:\"+e.model,$f(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"removeMarker:\"+e.model,Uf(e.view),{priority:e.converterPriority||\"normal\"})}}function Zf(e,t){if(typeof e==\"function\"){return e}return(n,o)=>eg(e,o,t)}function eg(e,t,n){if(typeof e==\"string\"){e={name:e}}let o;const i=Object.assign({},e.attributes);if(n==\"container\"){o=t.createContainerElement(e.name,i)}else if(n==\"attribute\"){const n={priority:e.priority||kl.DEFAULT_PRIORITY};o=t.createAttributeElement(e.name,i,n)}else{o=t.createUIElement(e.name,i)}if(e.styles){const n=Object.keys(e.styles);for(const i of n){t.setStyle(i,e.styles[i],o)}}if(e.classes){const n=e.classes;if(typeof n==\"string\"){t.addClass(n,o)}else{for(const e of n){t.addClass(e,o)}}}return o}function tg(e){if(e.model.values){return(t,n)=>{const o=e.view[t];if(o){return o(t,n)}return null}}else{return e.view}}function ng(e){if(typeof e==\"string\"){return t=>({key:e,value:t})}else if(typeof e==\"object\"){if(e.value){return()=>e}else{return t=>({key:e.key,value:t})}}else{return e}}function og(e,t,n){const o=typeof e==\"function\"?e(t,n):e;if(!o){return null}if(!o.priority){o.priority=10}if(!o.id){o.id=t.markerName}return o}class ig extends yf{elementToElement(e){return this.add(cg(e))}elementToAttribute(e){return this.add(lg(e))}attributeToAttribute(e){return this.add(dg(e))}elementToMarker(e){console.warn(Object(ss[\"a\"])(\"upcast-helpers-element-to-marker-deprecated: \"+\"The UpcastHelpers#elementToMarker() method has been deprecated and will be removed in the near future. \"+\"Please use UpcastHelpers#dataToMarker() instead.\"));return this.add(ug(e))}dataToMarker(e){return this.add(hg(e))}}function rg(){return(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:true})){const{modelRange:e,modelCursor:o}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e;t.modelCursor=o}}}function sg(){return(e,t,n)=>{if(n.schema.checkChild(t.modelCursor,\"$text\")){if(n.consumable.consume(t.viewItem)){const e=n.writer.createText(t.viewItem.data);n.writer.insert(e,t.modelCursor);t.modelRange=ef._createFromPositionAndShift(t.modelCursor,e.offsetSize);t.modelCursor=t.modelRange.end}}}}function ag(e,t){return(n,o)=>{const i=o.newSelection;const r=new af;const s=[];for(const e of i.getRanges()){s.push(t.toModelRange(e))}r.setTo(s,{backward:i.isBackward});if(!r.isEqual(e.document.selection)){e.change(e=>{e.setSelection(r)})}}}function cg(e){e=Tf(e);const t=mg(e);const n=gg(e.view);const o=n?\"element:\"+n:\"element\";return n=>{n.on(o,t,{priority:e.converterPriority||\"normal\"})}}function lg(e){e=Tf(e);wg(e);const t=kg(e,false);const n=gg(e.view);const o=n?\"element:\"+n:\"element\";return n=>{n.on(o,t,{priority:e.converterPriority||\"low\"})}}function dg(e){e=Tf(e);let t=null;if(typeof e.view==\"string\"||e.view.key){t=bg(e)}wg(e,t);const n=kg(e,true);return t=>{t.on(\"element\",n,{priority:e.converterPriority||\"low\"})}}function ug(e){e=Tf(e);yg(e);return cg(e)}function hg(e){e=Tf(e);if(!e.model){e.model=t=>t?e.view+\":\"+t:e.view}const t=mg(xg(e,\"start\"));const n=mg(xg(e,\"end\"));return o=>{o.on(\"element:\"+e.view+\"-start\",t,{priority:e.converterPriority||\"normal\"});o.on(\"element:\"+e.view+\"-end\",n,{priority:e.converterPriority||\"normal\"});const i=is.get(\"low\");const r=is.get(\"highest\");const s=is.get(e.converterPriority)/r;o.on(\"element\",fg(e),{priority:i+s})}}function fg(e){return(t,n,o)=>{const i=`data-${e.view}`;if(!n.modelRange){n=Object.assign(n,o.convertChildren(n.viewItem,n.modelCursor))}if(o.consumable.consume(n.viewItem,{attributes:i+\"-end-after\"})){r(n.modelRange.end,n.viewItem.getAttribute(i+\"-end-after\").split(\",\"))}if(o.consumable.consume(n.viewItem,{attributes:i+\"-start-after\"})){r(n.modelRange.end,n.viewItem.getAttribute(i+\"-start-after\").split(\",\"))}if(o.consumable.consume(n.viewItem,{attributes:i+\"-end-before\"})){r(n.modelRange.start,n.viewItem.getAttribute(i+\"-end-before\").split(\",\"))}if(o.consumable.consume(n.viewItem,{attributes:i+\"-start-before\"})){r(n.modelRange.start,n.viewItem.getAttribute(i+\"-start-before\").split(\",\"))}function r(t,i){for(const r of i){const i=e.model(r);const s=o.writer.createElement(\"$marker\",{\"data-name\":i});o.writer.insert(s,t);if(n.modelCursor.isEqual(t)){n.modelCursor=n.modelCursor.getShiftedBy(1)}else{n.modelCursor=n.modelCursor._getTransformedByInsertion(t,1)}n.modelRange=n.modelRange._getTransformedByInsertion(t,1)[0]}}}}function gg(e){if(typeof e==\"string\"){return e}if(typeof e==\"object\"&&typeof e.name==\"string\"){return e.name}return null}function mg(e){const t=e.view?new Ws(e.view):null;return(n,o,i)=>{let r={};if(t){const e=t.match(o.viewItem);if(!e){return}r=e.match}r.name=true;const s=pg(e.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 ef(i.writer.createPositionBefore(s),i.writer.createPositionAfter(c[c.length-1]));if(a.cursorParent){o.modelCursor=i.writer.createPositionAt(a.cursorParent,0)}else{o.modelCursor=o.modelRange.end}}}function pg(e,t,n){if(e instanceof Function){return e(t,n)}else{return n.createElement(e)}}function bg(e){if(typeof e.view==\"string\"){e.view={key:e.view}}const t=e.view.key;let n;if(t==\"class\"||t==\"style\"){const o=t==\"class\"?\"classes\":\"styles\";n={[o]:e.view.value}}else{const o=typeof e.view.value==\"undefined\"?/[\\s\\S]*/:e.view.value;n={attributes:{[t]:o}}}if(e.view.name){n.name=e.view.name}e.view=n;return t}function wg(e,t=null){const n=t===null?true:e=>e.getAttribute(t);const o=typeof e.model!=\"object\"?e.model:e.model.key;const i=typeof e.model!=\"object\"||typeof e.model.value==\"undefined\"?n:e.model.value;e.model={key:o,value:i}}function kg(e,t){const n=new Ws(e.view);return(o,i,r)=>{const s=n.match(i.viewItem);if(!s){return}const a=e.model.key;const c=typeof e.model.value==\"function\"?e.model.value(i.viewItem):e.model.value;if(c===null){return}if(_g(e.view,i.viewItem)){s.match.name=true}else{delete s.match.name}if(!r.consumable.test(i.viewItem,s.match)){return}if(!i.modelRange){i=Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor))}const l=vg(i.modelRange,{key:a,value:c},t,r);if(l){r.consumable.consume(i.viewItem,s.match)}}}function _g(e,t){const n=typeof e==\"function\"?e(t):e;if(typeof n==\"object\"&&!gg(n)){return false}return!n.classes&&!n.attributes&&!n.styles}function vg(e,t,n,o){let i=false;for(const r of Array.from(e.getItems({shallow:n}))){if(o.schema.checkAttribute(r,t.key)){o.writer.setAttribute(t.key,t.value,r);i=true}}return i}function yg(e){const t=e.model;e.model=(e,n)=>{const o=typeof t==\"string\"?t:t(e);return n.createElement(\"$marker\",{\"data-name\":o})}}function xg(e,t){const n={};n.view=e.view+\"-\"+t;n.model=(t,n)=>{const o=t.getAttribute(\"name\");const i=e.model(o);return n.createElement(\"$marker\",{\"data-name\":i})};return n}class Cg{constructor(e,t){this.model=e;this.view=new Hh(t);this.mapper=new tf;this.downcastDispatcher=new rf({mapper:this.mapper,schema:e.schema});const n=this.model.document;const o=n.selection;const i=this.model.markers;this.listenTo(this.model,\"_beforeChanges\",()=>{this.view._disableRendering(true)},{priority:\"highest\"});this.listenTo(this.model,\"_afterChanges\",()=>{this.view._disableRendering(false)},{priority:\"lowest\"});this.listenTo(n,\"change\",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(n.differ,i,e);this.downcastDispatcher.convertSelection(o,i,e)})},{priority:\"low\"});this.listenTo(this.view.document,\"selectionChange\",ag(this.model,this.mapper));this.downcastDispatcher.on(\"insert:$text\",Sf(),{priority:\"lowest\"});this.downcastDispatcher.on(\"remove\",Ef(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",Vf(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",If(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",Of(),{priority:\"low\"});this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if(e.rootName==\"$graveyard\"){return null}const t=new ll(this.view.document,e.name);t.rootName=e.rootName;this.mapper.bindElements(e,t);return t})}destroy(){this.view.destroy();this.stopListening()}}ys(Cg,Yc);class Ag{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n){throw new ss[\"b\"](\"commandcollection-command-not-found: Command does not exist.\",this,{commandName:e})}return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands()){e.destroy()}}}class Tg{constructor(){this._consumables=new Map}add(e,t){let n;if(e.is(\"$text\")||e.is(\"documentFragment\")){this._consumables.set(e,true);return}if(!this._consumables.has(e)){n=new Pg(e);this._consumables.set(e,n)}else{n=this._consumables.get(e)}n.add(t)}test(e,t){const n=this._consumables.get(e);if(n===undefined){return null}if(e.is(\"$text\")||e.is(\"documentFragment\")){return n}return n.test(t)}consume(e,t){if(this.test(e,t)){if(e.is(\"$text\")||e.is(\"documentFragment\")){this._consumables.set(e,false)}else{this._consumables.get(e).consume(t)}return true}return false}revert(e,t){const n=this._consumables.get(e);if(n!==undefined){if(e.is(\"$text\")||e.is(\"documentFragment\")){this._consumables.set(e,true)}else{n.revert(t)}}}static consumablesFromElement(e){const t={element:e,name:true,attributes:[],classes:[],styles:[]};const n=e.getAttributeKeys();for(const e of n){if(e==\"style\"||e==\"class\"){continue}t.attributes.push(e)}const o=e.getClassNames();for(const e of o){t.classes.push(e)}const i=e.getStyleNames();for(const e of i){t.styles.push(e)}return t}static createFrom(e,t){if(!t){t=new Tg(e)}if(e.is(\"$text\")){t.add(e);return t}if(e.is(\"element\")){t.add(e,Tg.consumablesFromElement(e))}if(e.is(\"documentFragment\")){t.add(e)}for(const n of e.getChildren()){t=Tg.createFrom(n,t)}return t}}class Pg{constructor(e){this.element=e;this._canConsumeName=null;this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(t in e){this._add(t,e[t])}}}test(e){if(e.name&&!this._canConsumeName){return this._canConsumeName}for(const t in this._consumables){if(t in e){const n=this._test(t,e[t]);if(n!==true){return n}}}return true}consume(e){if(e.name){this._canConsumeName=false}for(const t in this._consumables){if(t in e){this._consume(t,e[t])}}}revert(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(t in e){this._revert(t,e[t])}}}_add(e,t){const n=Jt(t)?t:[t];const o=this._consumables[e];for(const t of n){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){throw new ss[\"b\"](\"viewconsumable-invalid-attribute: Classes and styles should be handled separately.\",this)}o.set(t,true);if(e===\"styles\"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){o.set(e,true)}}}}_test(e,t){const n=Jt(t)?t:[t];const o=this._consumables[e];for(const t of n){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";const n=this._test(e,[...this._consumables[e].keys()]);if(n!==true){return n}}else{const e=o.get(t);if(e===undefined){return null}if(!e){return false}}}return true}_consume(e,t){const n=Jt(t)?t:[t];const o=this._consumables[e];for(const t of n){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";this._consume(e,[...this._consumables[e].keys()])}else{o.set(t,false);if(e==\"styles\"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){o.set(e,false)}}}}}_revert(e,t){const n=Jt(t)?t:[t];const o=this._consumables[e];for(const t of n){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";this._revert(e,[...this._consumables[e].keys()])}else{const e=o.get(t);if(e===false){o.set(t,true)}}}}}class Sg{constructor(){this._sourceDefinitions={};this._attributeProperties={};this.decorate(\"checkChild\");this.decorate(\"checkAttribute\");this.on(\"checkAttribute\",(e,t)=>{t[0]=new Eg(t[0])},{priority:\"highest\"});this.on(\"checkChild\",(e,t)=>{t[0]=new Eg(t[0]);t[1]=this.getDefinition(t[1])},{priority:\"highest\"})}register(e,t){if(this._sourceDefinitions[e]){throw new ss[\"b\"](\"schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.\",this,{itemName:e})}this._sourceDefinitions[e]=[Object.assign({},t)];this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e]){throw new ss[\"b\"](\"schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.\",this,{itemName:e})}this._sourceDefinitions[e].push(Object.assign({},t));this._clearCache()}getDefinitions(){if(!this._compiledDefinitions){this._compile()}return this._compiledDefinitions}getDefinition(e){let t;if(typeof e==\"string\"){t=e}else if(e.is&&(e.is(\"$text\")||e.is(\"$textProxy\"))){t=\"$text\"}else{t=e.name}return this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!!(t&&t.isBlock)}isLimit(e){const t=this.getDefinition(e);if(!t){return false}return!!(t.isLimit||t.isObject)}isObject(e){const t=this.getDefinition(e);return!!(t&&t.isObject)}isInline(e){const t=this.getDefinition(e);return!!(t&&t.isInline)}checkChild(e,t){if(!t){return false}return this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);if(!n){return false}return n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof Yh){const t=e.nodeBefore;const n=e.nodeAfter;if(!(t instanceof Uh)){throw new ss[\"b\"](\"schema-check-merge-no-element-before: The node before the merge position must be an element.\",this)}if(!(n instanceof Uh)){throw new ss[\"b\"](\"schema-check-merge-no-element-after: The node after the merge position must be an element.\",this)}return this.checkMerge(t,n)}for(const n of t.getChildren()){if(!this.checkChild(e,n)){return false}}return true}addChildCheck(e){this.on(\"checkChild\",(t,[n,o])=>{if(!o){return}const i=e(n,o);if(typeof i==\"boolean\"){t.stop();t.return=i}},{priority:\"high\"})}addAttributeCheck(e){this.on(\"checkAttribute\",(t,[n,o])=>{const i=e(n,o);if(typeof i==\"boolean\"){t.stop();t.return=i}},{priority:\"high\"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;if(e instanceof Yh){t=e.parent}else{const n=e instanceof ef?[e]:Array.from(e.getRanges());t=n.reduce((e,t)=>{const n=t.getCommonAncestor();if(!e){return n}return e.getCommonAncestor(n,{includeSelf:true})},null)}while(!this.isLimit(t)){if(t.parent){t=t.parent}else{break}}return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=e.getFirstPosition();const o=[...n.getAncestors(),new qh(\"\",e.getAttributes())];return this.checkAttribute(o,t)}else{const n=e.getRanges();for(const e of n){for(const n of e){if(this.checkAttribute(n.item,t)){return true}}}}return false}*getValidRanges(e,t){e=Wg(e);for(const n of e){yield*this._getValidRangesForRange(n,t)}}getNearestSelectionRange(e,t=\"both\"){if(this.checkChild(e,\"$text\")){return new ef(e)}let n,o;const i=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;if(t==\"both\"||t==\"backward\"){n=new Kh({boundaries:ef._createIn(i),startPosition:e,direction:\"backward\"})}if(t==\"both\"||t==\"forward\"){o=new Kh({boundaries:ef._createIn(i),startPosition:e})}for(const e of qg(n,o)){const t=e.walker==n?\"elementEnd\":\"elementStart\";const o=e.value;if(o.type==t&&this.isObject(o.item)){return ef._createOn(o.item)}if(this.checkChild(o.nextPosition,\"$text\")){return new ef(o.nextPosition)}}return null}findAllowedParent(e,t){let n=e.parent;while(n){if(this.checkChild(n,t)){return n}if(this.isLimit(n)){return null}n=n.parent}return null}removeDisallowedAttributes(e,t){for(const n of e){if(n.is(\"$text\")){$g(this,n,t)}else{const e=ef._createIn(n);const o=e.getPositions();for(const e of o){const n=e.nodeBefore||e.parent;$g(this,n,t)}}}}createContext(e){return new Eg(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={};const t=this._sourceDefinitions;const n=Object.keys(t);for(const o of n){e[o]=Rg(t[o],o)}for(const t of n){Ig(e,t)}for(const t of n){Og(e,t)}for(const t of n){Vg(e,t);Mg(e,t)}for(const t of n){Ng(e,t);zg(e,t)}this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const o=t.getItem(n);if(e.allowIn.includes(o.name)){if(n==0){return true}else{const e=this.getDefinition(o);return this._checkContextMatch(e,t,n-1)}}else{return false}}*_getValidRangesForRange(e,t){let n=e.start;let o=e.start;for(const i of e.getItems({shallow:true})){if(i.is(\"element\")){yield*this._getValidRangesForRange(ef._createIn(i),t)}if(!this.checkAttribute(i,t)){if(!n.isEqual(o)){yield new ef(n,o)}n=Yh._createAfter(i)}o=Yh._createAfter(i)}if(!n.isEqual(o)){yield new ef(n,o)}}}ys(Sg,Yc);class Eg{constructor(e){if(e instanceof Eg){return e}if(typeof e==\"string\"){e=[e]}else if(!Array.isArray(e)){e=e.getAncestors({includeSelf:true})}if(e[0]&&typeof e[0]!=\"string\"&&e[0].is(\"documentFragment\")){e.shift()}this._items=e.map(jg)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Eg([e]);t._items=[...this._items,...t._items];return t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(\" \").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(\" \").startsWith(e)}}function Rg(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};Bg(e,n);Dg(e,n,\"allowIn\");Dg(e,n,\"allowContentOf\");Dg(e,n,\"allowWhere\");Dg(e,n,\"allowAttributes\");Dg(e,n,\"allowAttributesOf\");Dg(e,n,\"inheritTypesFrom\");Fg(e,n);return n}function Ig(e,t){for(const n of e[t].allowContentOf){if(e[n]){const o=Lg(e,n);o.forEach(e=>{e.allowIn.push(t)})}}delete e[t].allowContentOf}function Og(e,t){for(const n of e[t].allowWhere){const o=e[n];if(o){const n=o.allowIn;e[t].allowIn.push(...n)}}delete e[t].allowWhere}function Vg(e,t){for(const n of e[t].allowAttributesOf){const o=e[n];if(o){const n=o.allowAttributes;e[t].allowAttributes.push(...n)}}delete e[t].allowAttributesOf}function Mg(e,t){const n=e[t];for(const t of n.inheritTypesFrom){const o=e[t];if(o){const e=Object.keys(o).filter(e=>e.startsWith(\"is\"));for(const t of e){if(!(t in n)){n[t]=o[t]}}}}delete n.inheritTypesFrom}function Ng(e,t){const n=e[t];const o=n.allowIn.filter(t=>e[t]);n.allowIn=Array.from(new Set(o))}function zg(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Bg(e,t){for(const n of e){const e=Object.keys(n).filter(e=>e.startsWith(\"is\"));for(const o of e){t[o]=n[o]}}}function Dg(e,t,n){for(const o of e){if(typeof o[n]==\"string\"){t[n].push(o[n])}else if(Array.isArray(o[n])){t[n].push(...o[n])}}}function Fg(e,t){for(const n of e){const e=n.inheritAllFrom;if(e){t.allowContentOf.push(e);t.allowWhere.push(e);t.allowAttributesOf.push(e);t.inheritTypesFrom.push(e)}}}function Lg(e,t){const n=e[t];return Hg(e).filter(e=>e.allowIn.includes(n.name))}function Hg(e){return Object.keys(e).map(t=>e[t])}function jg(e){if(typeof e==\"string\"){return{name:e,*getAttributeKeys(){},getAttribute(){}}}else{return{name:e.is(\"element\")?e.name:\"$text\",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute(t){return e.getAttribute(t)}}}}function*qg(e,t){let n=false;while(!n){n=true;if(e){const t=e.next();if(!t.done){n=false;yield{walker:e,value:t.value}}}if(t){const e=t.next();if(!e.done){n=false;yield{walker:t,value:e.value}}}}}function*Wg(e){for(const t of e){yield*t.getMinimalFlatRanges()}}function $g(e,t,n){for(const o of t.getAttributeKeys()){if(!e.checkAttribute(t,o)){n.removeAttribute(o,t)}}}class Ug{constructor(e={}){this._splitParts=new Map;this._modelCursor=null;this.conversionApi=Object.assign({},e);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(e,t,n=[\"$root\"]){this.fire(\"viewCleanup\",e);this._modelCursor=Kg(n,t);this.conversionApi.writer=t;this.conversionApi.consumable=Tg.createFrom(e);this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor);const i=t.createDocumentFragment();if(o){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren())){t.append(e,i)}i.markers=Gg(i,t)}this._modelCursor=null;this._splitParts.clear();this.conversionApi.writer=null;this.conversionApi.store=null;return i}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is(\"element\")){this.fire(\"element:\"+e.name,n,this.conversionApi)}else if(e.is(\"$text\")){this.fire(\"text\",n,this.conversionApi)}else{this.fire(\"documentFragment\",n,this.conversionApi)}if(n.modelRange&&!(n.modelRange instanceof ef)){throw new ss[\"b\"](\"view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.\",this)}return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){const n=new ef(t);let o=t;for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,o);if(e.modelRange instanceof ef){n.end=e.modelRange.end;o=e.modelCursor}}return{modelRange:n,modelCursor:o}}_splitToAllowedParent(e,t){const n=this.conversionApi.schema.findAllowedParent(t,e);if(!n){return null}if(n===t.parent){return{position:t}}if(this._modelCursor.parent.getAncestors().includes(n)){return null}const o=this.conversionApi.writer.split(t,n);const i=[];for(const e of o.range.getWalker()){if(e.type==\"elementEnd\"){i.push(e.item)}else{const t=i.pop();const n=e.item;this._registerSplitPair(t,n)}}return{position:o.position,cursorParent:o.range.end.parent}}_registerSplitPair(e,t){if(!this._splitParts.has(e)){this._splitParts.set(e,[e])}const n=this._splitParts.get(e);this._splitParts.set(t,n);n.push(t)}_getSplitParts(e){let t;if(!this._splitParts.has(e)){t=[e]}else{t=this._splitParts.get(e)}return t}_removeEmptyElements(){let e=false;for(const t of this._splitParts.keys()){if(t.isEmpty){this.conversionApi.writer.remove(t);this._splitParts.delete(t);e=true}}if(e){this._removeEmptyElements()}}}ys(Ug,ds);function Gg(e,t){const n=new Set;const o=new Map;const i=ef._createIn(e).getItems();for(const e of i){if(e.name==\"$marker\"){n.add(e)}}for(const e of n){const n=e.getAttribute(\"data-name\");const i=t.createPositionBefore(e);if(!o.has(n)){o.set(n,new ef(i.clone()))}else{o.get(n).end=i.clone()}t.remove(e)}return o}function Kg(e,t){let n;for(const o of new Eg(e)){const e={};for(const t of o.getAttributeKeys()){e[t]=o.getAttribute(t)}const i=t.createElement(o.name,e);if(n){t.append(i,n)}n=Yh._createAt(i,0)}return n}class Jg{constructor(e,t){this.model=e;this.stylesProcessor=t;this.processor;this.mapper=new tf;this.downcastDispatcher=new rf({mapper:this.mapper,schema:e.schema});this.downcastDispatcher.on(\"insert:$text\",Sf(),{priority:\"lowest\"});this.upcastDispatcher=new Ug({schema:e.schema});this.viewDocument=new bl(t);this._viewWriter=new Ql(this.viewDocument);this.upcastDispatcher.on(\"text\",sg(),{priority:\"lowest\"});this.upcastDispatcher.on(\"element\",rg(),{priority:\"lowest\"});this.upcastDispatcher.on(\"documentFragment\",rg(),{priority:\"lowest\"});this.decorate(\"init\");this.decorate(\"set\");this.on(\"init\",()=>{this.fire(\"ready\")},{priority:\"lowest\"})}get(e){const{rootName:t=\"main\",trim:n=\"empty\"}=e||{};if(!this._checkIfRootsExists([t])){throw new ss[\"b\"](\"datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.\",this)}const o=this.model.document.getRoot(t);if(n===\"empty\"&&!this.model.hasContent(o,{ignoreWhitespaces:true})){return\"\"}return this.stringify(o)}stringify(e){const t=this.toView(e);return this.processor.toData(t)}toView(e){const t=this.viewDocument;const n=this._viewWriter;this.mapper.clearBindings();const o=ef._createIn(e);const i=new Jl(t);this.mapper.bindElements(e,i);this.downcastDispatcher.convertInsert(o,n);if(!e.is(\"documentFragment\")){const t=Yg(e);for(const[e,o]of t){this.downcastDispatcher.convertMarkerAdd(e,o,n)}}return i}init(e){if(this.model.document.version){throw new ss[\"b\"](\"datacontroller-init-document-not-empty: Trying to set initial data to not empty document.\",this)}let t={};if(typeof e===\"string\"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss[\"b\"](\"datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.\",this)}this.model.enqueueChange(\"transparent\",e=>{for(const n of Object.keys(t)){const o=this.model.document.getRoot(n);e.insert(this.parse(t[n],o),o,0)}});return Promise.resolve()}set(e){let t={};if(typeof e===\"string\"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss[\"b\"](\"datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.\",this)}this.model.enqueueChange(\"transparent\",e=>{e.setSelection(null);e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const n of Object.keys(t)){const o=this.model.document.getRoot(n);e.remove(e.createRangeIn(o));e.insert(this.parse(t[n],o),o,0)}})}parse(e,t=\"$root\"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t=\"$root\"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e){if(!this.model.document.getRootNames().includes(t)){return false}}return true}}ys(Jg,Yc);function Yg(e){const t=[];const n=e.root.document;if(!n){return[]}const o=ef._createIn(e);for(const e of n.model.markers){const n=o.getIntersection(e.getRange());if(n){t.push([e.name,n])}}return t}class Qg{constructor(e,t){this._helpers=new Map;this._downcast=Array.isArray(e)?e:[e];this._createConversionHelpers({name:\"downcast\",dispatchers:this._downcast,isDowncast:true});this._upcast=Array.isArray(t)?t:[t];this._createConversionHelpers({name:\"upcast\",dispatchers:this._upcast,isDowncast:false})}addAlias(e,t){const n=this._downcast.includes(t);const o=this._upcast.includes(t);if(!o&&!n){throw new ss[\"b\"](\"conversion-add-alias-dispatcher-not-registered: \"+\"Trying to register and alias for a dispatcher that nas not been registered.\",this)}this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e)){throw new ss[\"b\"](\"conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.\",this)}return this._helpers.get(e)}elementToElement(e){this.for(\"downcast\").elementToElement(e);for(const{model:t,view:n}of Xg(e)){this.for(\"upcast\").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}}attributeToElement(e){this.for(\"downcast\").attributeToElement(e);for(const{model:t,view:n}of Xg(e)){this.for(\"upcast\").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}}attributeToAttribute(e){this.for(\"downcast\").attributeToAttribute(e);for(const{model:t,view:n}of Xg(e)){this.for(\"upcast\").attributeToAttribute({view:n,model:t})}}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e)){throw new ss[\"b\"](\"conversion-group-exists: Trying to register a group name that has already been registered.\",this)}const o=n?new Pf(t):new ig(t);this._helpers.set(e,o)}}function*Xg(e){if(e.model.values){for(const t of e.model.values){const n={key:e.model.key,value:t};const o=e.view[t];const i=e.upcastAlso?e.upcastAlso[t]:undefined;yield*Zg(n,o,i)}}else{yield*Zg(e.model,e.view,e.upcastAlso)}}function*Zg(e,t,n){yield{model:e,view:t};if(n){n=Array.isArray(n)?n:[n];for(const t of n){yield{model:e,view:t}}}}class em{constructor(e=\"default\"){this.operations=[];this.type=e}get baseVersion(){for(const e of this.operations){if(e.baseVersion!==null){return e.baseVersion}}return null}addOperation(e){e.batch=this;this.operations.push(e);return e}}class tm{constructor(e){this.baseVersion=e;this.isDocumentOperation=this.baseVersion!==null;this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);e.__className=this.constructor.className;delete e.batch;delete e.isDocumentOperation;return e}static get className(){return\"Operation\"}static fromJSON(e){return new this(e.baseVersion)}}class nm{constructor(e){this.markers=new Map;this._children=new $h;if(e){this._insertChild(0,e)}}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e===\"documentFragment\"||e===\"model:documentFragment\"}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e){t=t.getChild(t.offsetToIndex(n))}return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children){e.push(t.toJSON())}return e}static fromJSON(e){const t=[];for(const n of e){if(n.name){t.push(Uh.fromJSON(n))}else{t.push(qh.fromJSON(n))}}return new nm(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=om(t);for(const e of n){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n){e.parent=null}return n}}function om(e){if(typeof e==\"string\"){return[new qh(e)]}if(!vs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new qh(e)}if(e instanceof Wh){return new qh(e.data,e.getAttributes())}return e})}function im(e,t){t=cm(t);const n=t.reduce((e,t)=>e+t.offsetSize,0);const o=e.parent;dm(e);const i=e.index;o._insertChild(i,t);lm(o,i+t.length);lm(o,i);return new ef(e,e.getShiftedBy(n))}function rm(e){if(!e.isFlat){throw new ss[\"b\"](\"operation-utils-remove-range-not-flat: \"+\"Trying to remove a range which starts and ends in different element.\",this)}const t=e.start.parent;dm(e.start);dm(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);lm(t,e.start.index);return n}function sm(e,t){if(!e.isFlat){throw new ss[\"b\"](\"operation-utils-move-range-not-flat: \"+\"Trying to move a range which starts and ends in different element.\",this)}const n=rm(e);t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset);return im(t,n)}function am(e,t,n){dm(e.start);dm(e.end);for(const o of e.getItems({shallow:true})){const e=o.is(\"$textProxy\")?o.textNode:o;if(n!==null){e._setAttribute(t,n)}else{e._removeAttribute(t)}lm(e.parent,e.index)}lm(e.end.parent,e.end.index)}function cm(e){const t=[];if(!(e instanceof Array)){e=[e]}for(let n=0;ne.maxOffset){throw new ss[\"b\"](\"move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.\",this)}else if(e===t&&n=n&&this.targetPosition.path[e]e._clone(true)));const t=new bm(this.position,e,this.baseVersion);t.shouldReceiveAttributes=this.shouldReceiveAttributes;return t}getReversed(){const e=this.position.root.document.graveyard;const t=new Yh(e,[0]);return new pm(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(true)));im(this.position,e)}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();e.nodes=this.nodes.toJSON();return e}static get className(){return\"InsertOperation\"}static fromJSON(e,t){const n=[];for(const t of e.nodes){if(t.name){n.push(Uh.fromJSON(t))}else{n.push(qh.fromJSON(t))}}const o=new bm(Yh.fromJSON(e.position,t),n,e.baseVersion);o.shouldReceiveAttributes=e.shouldReceiveAttributes;return o}}class wm extends tm{constructor(e,t,n,o,i,r){super(r);this.name=e;this.oldRange=t?t.clone():null;this.newRange=n?n.clone():null;this.affectsData=i;this._markers=o}get type(){return\"marker\"}clone(){return new wm(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new wm(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?\"_set\":\"_remove\";this._markers[e](this.name,this.newRange,true,this.affectsData)}toJSON(){const e=super.toJSON();if(this.oldRange){e.oldRange=this.oldRange.toJSON()}if(this.newRange){e.newRange=this.newRange.toJSON()}delete e._markers;return e}static get className(){return\"MarkerOperation\"}static fromJSON(e,t){return new wm(e.name,e.oldRange?ef.fromJSON(e.oldRange,t):null,e.newRange?ef.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class km extends tm{constructor(e,t,n,o){super(o);this.position=e;this.position.stickiness=\"toNext\";this.oldName=t;this.newName=n}get type(){return\"rename\"}clone(){return new km(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new km(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Uh)){throw new ss[\"b\"](\"rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.\",this)}else if(e.name!==this.oldName){throw new ss[\"b\"](\"rename-operation-wrong-name: Element to change has different name than operation's old name.\",this)}}_execute(){const e=this.position.nodeAfter;e.name=this.newName}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();return e}static get className(){return\"RenameOperation\"}static fromJSON(e,t){return new km(Yh.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class _m extends tm{constructor(e,t,n,o,i){super(i);this.root=e;this.key=t;this.oldValue=n;this.newValue=o}get type(){if(this.oldValue===null){return\"addRootAttribute\"}else if(this.newValue===null){return\"removeRootAttribute\"}else{return\"changeRootAttribute\"}}clone(){return new _m(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new _m(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is(\"documentFragment\")){throw new ss[\"b\"](\"rootattribute-operation-not-a-root: The element to change is not a root element.\",this,{root:this.root,key:this.key})}if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue){throw new ss[\"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(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key)){throw new ss[\"b\"](\"rootattribute-operation-attribute-exists: The attribute with given key already exists.\",this,{root:this.root,key:this.key})}}_execute(){if(this.newValue!==null){this.root._setAttribute(this.key,this.newValue)}else{this.root._removeAttribute(this.key)}}toJSON(){const e=super.toJSON();e.root=this.root.toJSON();return e}static get className(){return\"RootAttributeOperation\"}static fromJSON(e,t){if(!t.getRoot(e.root)){throw new ss[\"b\"](\"rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.\",this,{rootName:e.root})}return new _m(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class vm extends tm{constructor(e,t,n,o,i){super(i);this.sourcePosition=e.clone();this.sourcePosition.stickiness=\"toPrevious\";this.howMany=t;this.targetPosition=n.clone();this.targetPosition.stickiness=\"toNext\";this.graveyardPosition=o.clone()}get type(){return\"merge\"}get deletionPosition(){return new Yh(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ef(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this);const t=this.sourcePosition.path.slice(0,-1);const n=new Yh(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);const o=new ym(e,this.howMany,this.graveyardPosition,this.baseVersion+1);o.insertionPosition=n;return o}_validate(){const e=this.sourcePosition.parent;const t=this.targetPosition.parent;if(!e.parent){throw new ss[\"b\"](\"merge-operation-source-position-invalid: Merge source position is invalid.\",this)}else if(!t.parent){throw new ss[\"b\"](\"merge-operation-target-position-invalid: Merge target position is invalid.\",this)}else if(this.howMany!=e.maxOffset){throw new ss[\"b\"](\"merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.\",this)}}_execute(){const e=this.sourcePosition.parent;const t=ef._createIn(e);sm(t,this.targetPosition);sm(ef._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();e.sourcePosition=e.sourcePosition.toJSON();e.targetPosition=e.targetPosition.toJSON();e.graveyardPosition=e.graveyardPosition.toJSON();return e}static get className(){return\"MergeOperation\"}static fromJSON(e,t){const n=Yh.fromJSON(e.sourcePosition,t);const o=Yh.fromJSON(e.targetPosition,t);const i=Yh.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,o,i,e.baseVersion)}}class ym extends tm{constructor(e,t,n,o){super(o);this.splitPosition=e.clone();this.splitPosition.stickiness=\"toNext\";this.howMany=t;this.insertionPosition=ym.getInsertionPosition(e);this.insertionPosition.stickiness=\"toNone\";this.graveyardPosition=n?n.clone():null;if(this.graveyardPosition){this.graveyardPosition.stickiness=\"toNext\"}}get type(){return\"split\"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();e.push(0);return new Yh(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ef(this.splitPosition,e)}clone(){const e=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);e.insertionPosition=this.insertionPosition;return e}getReversed(){const e=this.splitPosition.root.document.graveyard;const t=new Yh(e,[0]);return new vm(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent;const t=this.splitPosition.offset;if(!e||e.maxOffset{for(const t of e.getAttributeKeys()){this.removeAttribute(t,e)}};if(!(e instanceof ef)){t(e)}else{for(const n of e.getItems()){t(n)}}}move(e,t,n){this._assertWriterUsedCorrectly();if(!(e instanceof ef)){throw new ss[\"b\"](\"writer-move-invalid-range: Invalid range to move.\",this)}if(!e.isFlat){throw new ss[\"b\"](\"writer-move-range-not-flat: Range to move is not flat.\",this)}const o=Yh._createAt(t,n);if(o.isEqual(e.start)){return}this._addOperationForAffectedMarkers(\"move\",e);if(!Em(e.root,o.root)){throw new ss[\"b\"](\"writer-move-different-document: Range is going to be moved between different documents.\",this)}const i=e.root.document?e.root.document.version:null;const r=new pm(e.start,e.end.offset-e.start.offset,o,i);this.batch.addOperation(r);this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=e instanceof ef?e:ef._createOn(e);const n=t.getMinimalFlatRanges().reverse();for(const e of n){this._addOperationForAffectedMarkers(\"move\",e);Sm(e.start,e.end.offset-e.start.offset,this.batch,this.model)}}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore;const n=e.nodeAfter;this._addOperationForAffectedMarkers(\"merge\",e);if(!(t instanceof Uh)){throw new ss[\"b\"](\"writer-merge-no-element-before: Node before merge position must be an element.\",this)}if(!(n instanceof Uh)){throw new ss[\"b\"](\"writer-merge-no-element-after: Node after merge position must be an element.\",this)}if(!e.root.document){this._mergeDetached(e)}else{this._merge(e)}}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore;const n=e.nodeAfter;this.move(ef._createIn(n),Yh._createAt(t,\"end\"));this.remove(n)}_merge(e){const t=Yh._createAt(e.nodeBefore,\"end\");const n=Yh._createAt(e.nodeAfter,0);const o=e.root.document.graveyard;const i=new Yh(o,[0]);const r=e.root.document.version;const s=new vm(n,e.nodeAfter.maxOffset,t,i,r);this.batch.addOperation(s);this.model.applyOperation(s)}rename(e,t){this._assertWriterUsedCorrectly();if(!(e instanceof Uh)){throw new ss[\"b\"](\"writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.\",this)}const n=e.root.document?e.root.document.version:null;const o=new km(Yh._createBefore(e),e.name,t,n);this.batch.addOperation(o);this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let n=e.parent;if(!n.parent){throw new ss[\"b\"](\"writer-split-element-no-parent: Element with no parent can not be split.\",this)}if(!t){t=n.parent}if(!e.parent.getAncestors({includeSelf:true}).includes(t)){throw new ss[\"b\"](\"writer-split-invalid-limit-element: Limit element is not a position ancestor.\",this)}let o,i;do{const t=n.root.document?n.root.document.version:null;const r=n.maxOffset-e.offset;const s=new ym(e,r,null,t);this.batch.addOperation(s);this.model.applyOperation(s);if(!o&&!i){o=n;i=e.parent.nextSibling}e=this.createPositionAfter(e.parent);n=e.parent}while(n!==t);return{position:e,range:new ef(Yh._createAt(o,\"end\"),Yh._createAt(i,0))}}wrap(e,t){this._assertWriterUsedCorrectly();if(!e.isFlat){throw new ss[\"b\"](\"writer-wrap-range-not-flat: Range to wrap is not flat.\",this)}const n=t instanceof Uh?t:new Uh(t);if(n.childCount>0){throw new ss[\"b\"](\"writer-wrap-element-not-empty: Element to wrap with is not empty.\",this)}if(n.parent!==null){throw new ss[\"b\"](\"writer-wrap-element-attached: Element to wrap with is already attached to tree model.\",this)}this.insert(n,e.start);const o=new ef(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,Yh._createAt(n,0))}unwrap(e){this._assertWriterUsedCorrectly();if(e.parent===null){throw new ss[\"b\"](\"writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.\",this)}this.move(ef._createIn(e),this.createPositionAfter(e));this.remove(e)}addMarker(e,t){this._assertWriterUsedCorrectly();if(!t||typeof t.usingOperation!=\"boolean\"){throw new ss[\"b\"](\"writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.\",this)}const n=t.usingOperation;const o=t.range;const i=t.affectsData===undefined?false:t.affectsData;if(this.model.markers.has(e)){throw new ss[\"b\"](\"writer-addMarker-marker-exists: Marker with provided name already exists.\",this)}if(!o){throw new ss[\"b\"](\"writer-addMarker-no-range: Range parameter is required when adding a new marker.\",this)}if(!n){return this.model.markers._set(e,o,n,i)}Pm(this,e,null,o,i);return this.model.markers.get(e)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n=typeof e==\"string\"?e:e.name;const o=this.model.markers.get(n);if(!o){throw new ss[\"b\"](\"writer-updateMarker-marker-not-exists: Marker with provided name does not exists.\",this)}if(!t){this.model.markers._refresh(o);return}const i=typeof t.usingOperation==\"boolean\";const r=typeof t.affectsData==\"boolean\";const s=r?t.affectsData:o.affectsData;if(!i&&!t.range&&!r){throw new ss[\"b\"](\"writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.\",this)}const a=o.getRange();const c=t.range?t.range:a;if(i&&t.usingOperation!==o.managedUsingOperations){if(t.usingOperation){Pm(this,n,null,c,s)}else{Pm(this,n,a,null,s);this.model.markers._set(n,c,undefined,s)}return}if(o.managedUsingOperations){Pm(this,n,a,c,s)}else{this.model.markers._set(n,c,undefined,s)}}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e==\"string\"?e:e.name;if(!this.model.markers.has(t)){throw new ss[\"b\"](\"writer-removeMarker-no-marker: Trying to remove marker which does not exist.\",this)}const n=this.model.markers.get(t);if(!n.managedUsingOperations){this.model.markers._remove(t);return}const o=n.getRange();Pm(this,t,o,null,n.affectsData)}setSelection(e,t,n){this._assertWriterUsedCorrectly();this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly();this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){this._assertWriterUsedCorrectly();if(typeof e===\"string\"){this._setSelectionAttribute(e,t)}else{for(const[t,n]of qs(e)){this._setSelectionAttribute(t,n)}}}removeSelectionAttribute(e){this._assertWriterUsedCorrectly();if(typeof e===\"string\"){this._removeSelectionAttribute(e)}else{for(const t of e){this._removeSelectionAttribute(t)}}}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const o=wf._getStoreAttributeKey(e);this.setAttribute(o,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=wf._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this){throw new ss[\"b\"](\"writer-incorrect-use: Trying to use a writer outside the change() block.\",this)}}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations){continue}const o=n.getRange();let i=false;if(e===\"move\"){i=t.containsPosition(o.start)||t.start.isEqual(o.start)||t.containsPosition(o.end)||t.end.isEqual(o.end)}else{const e=t.nodeBefore;const n=t.nodeAfter;const r=o.start.parent==e&&o.start.isAtEnd;const s=o.end.parent==n&&o.end.offset==0;const a=o.end.nodeAfter==n;const c=o.start.nodeAfter==n;i=r||s||a||c}if(i){this.updateMarker(n.name,{range:o})}}}}function Am(e,t,n,o){const i=e.model;const r=i.document;let s=o.start;let a;let c;let l;for(const e of o.getWalker({shallow:true})){l=e.item.getAttribute(t);if(a&&c!=l){if(c!=n){d()}s=a}a=e.nextPosition;c=l}if(a instanceof Yh&&a!=s&&c!=n){d()}function d(){const o=new ef(s,a);const l=o.root.document?r.version:null;const d=new gm(o,t,c,n,l);e.batch.addOperation(d);i.applyOperation(d)}}function Tm(e,t,n,o){const i=e.model;const r=i.document;const s=o.getAttribute(t);let a,c;if(s!=n){const l=o.root===o;if(l){const e=o.document?r.version:null;c=new _m(o,t,s,n,e)}else{a=new ef(Yh._createBefore(o),e.createPositionAfter(o));const i=a.root.document?r.version:null;c=new gm(a,t,s,n,i)}e.batch.addOperation(c);i.applyOperation(c)}}function Pm(e,t,n,o,i){const r=e.model;const s=r.document;const a=new wm(t,n,o,r.markers,i,s.version);e.batch.addOperation(a);r.applyOperation(a)}function Sm(e,t,n,o){let i;if(e.root.document){const n=o.document;const r=new Yh(n.graveyard,[0]);i=new pm(e,t,r,n.version)}else{i=new mm(e,t)}n.addOperation(i);o.applyOperation(i)}function Em(e,t){if(e===t){return true}if(e instanceof xm&&t instanceof xm){return true}return false}class Rm{constructor(e){this._markerCollection=e;this._changesInElement=new Map;this._elementSnapshots=new Map;this._changedMarkers=new Map;this._changeCount=0;this._cachedChanges=null;this._cachedChangesWithGraveyard=null}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0}refreshItem(e){if(this._isInInsertedElement(e.parent)){return}this._markRemove(e.parent,e.startOffset,e.offsetSize);this._markInsert(e.parent,e.startOffset,e.offsetSize);const t=ef._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}this._cachedChanges=null}bufferOperation(e){switch(e.type){case\"insert\":{if(this._isInInsertedElement(e.position.parent)){return}this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break}case\"addAttribute\":case\"removeAttribute\":case\"changeAttribute\":{for(const t of e.range.getItems({shallow:true})){if(this._isInInsertedElement(t.parent)){continue}this._markAttribute(t)}break}case\"remove\":case\"move\":case\"reinsert\":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition)){return}const t=this._isInInsertedElement(e.sourcePosition.parent);const n=this._isInInsertedElement(e.targetPosition.parent);if(!t){this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany)}if(!n){this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany)}break}case\"rename\":{if(this._isInInsertedElement(e.position.parent)){return}this._markRemove(e.position.parent,e.position.offset,1);this._markInsert(e.position.parent,e.position.offset,1);const t=ef._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}break}case\"split\":{const t=e.splitPosition.parent;if(!this._isInInsertedElement(t)){this._markRemove(t,e.splitPosition.offset,e.howMany)}if(!this._isInInsertedElement(e.insertionPosition.parent)){this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1)}if(e.graveyardPosition){this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1)}break}case\"merge\":{const t=e.sourcePosition.parent;if(!this._isInInsertedElement(t.parent)){this._markRemove(t.parent,t.startOffset,1)}const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const o=e.targetPosition.parent;if(!this._isInInsertedElement(o)){this._markInsert(o,e.targetPosition.offset,t.maxOffset)}break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,o){const i=this._changedMarkers.get(e);if(!i){this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:o})}else{i.newRange=n;i.affectsData=o;if(i.oldRange==null&&i.newRange==null){this._changedMarkers.delete(e)}}}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers){if(n.oldRange!=null){e.push({name:t,range:n.oldRange})}}return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers){if(n.newRange!=null){e.push({name:t,range:n.newRange})}}return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(const[,e]of this._changedMarkers){if(e.affectsData){return true}}return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:false}){if(this._cachedChanges){if(e.includeChangesInGraveyard){return this._cachedChangesWithGraveyard.slice()}else{return this._cachedChanges.slice()}}const t=[];for(const e of this._changesInElement.keys()){const n=this._changesInElement.get(e).sort((e,t)=>{if(e.offset===t.offset){if(e.type!=t.type){return e.type==\"remove\"?-1:1}return 0}return e.offset{if(e.position.root!=t.position.root){return e.position.root.rootNamen.offset){if(o>i){const e={type:\"attribute\",offset:i,howMany:o-i,count:this._changeCount++};this._handleChange(e,t);t.push(e)}e.nodesToHandle=n.offset-e.offset;e.howMany=e.nodesToHandle}else if(e.offset>=n.offset&&e.offseti){e.nodesToHandle=o-i;e.offset=i}else{e.nodesToHandle=0}}}if(n.type==\"remove\"){if(e.offsetn.offset){const i={type:\"attribute\",offset:n.offset,howMany:o-n.offset,count:this._changeCount++};this._handleChange(i,t);t.push(i);e.nodesToHandle=n.offset-e.offset;e.howMany=e.nodesToHandle}}if(n.type==\"attribute\"){if(e.offset>=n.offset&&o<=i){e.nodesToHandle=0;e.howMany=0;e.offset=0}else if(e.offset<=n.offset&&o>=i){n.howMany=0}}}}e.howMany=e.nodesToHandle;delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:\"insert\",position:Yh._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:\"remove\",position:Yh._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const o=[];n=new Map(n);for(const[i,r]of t){const t=n.has(i)?n.get(i):null;if(t!==r){o.push({type:\"attribute\",position:e.start,range:e.clone(),length:1,attributeKey:i,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++})}n.delete(i)}for(const[t,i]of n){o.push({type:\"attribute\",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:i,changeCount:this._changeCount++})}return o}_isInInsertedElement(e){const t=e.parent;if(!t){return false}const n=this._changesInElement.get(t);const o=e.startOffset;if(n){for(const e of n){if(e.type==\"insert\"&&o>=e.offset&&oo){for(let t=0;t{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version){throw new ss[\"b\"](\"model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.\",this,{operation:n})}},{priority:\"highest\"});this.listenTo(e,\"applyOperation\",(e,t)=>{const n=t[0];if(n.isDocumentOperation){this.differ.bufferOperation(n)}},{priority:\"high\"});this.listenTo(e,\"applyOperation\",(e,t)=>{const n=t[0];if(n.isDocumentOperation){this.version++;this.history.addOperation(n)}},{priority:\"low\"});this.listenTo(this.selection,\"change\",()=>{this._hasSelectionChangedFromTheLastChangeBlock=true});this.listenTo(e.markers,\"update\",(e,t,n,o)=>{this.differ.bufferMarkerChange(t.name,n,o,t.affectsData);if(n===null){t.on(\"change\",(e,n)=>{this.differ.bufferMarkerChange(t.name,n,t.getRange(),t.affectsData)})}})}get graveyard(){return this.getRoot(Lm)}createRoot(e=\"$root\",t=\"main\"){if(this.roots.get(t)){throw new ss[\"b\"](\"model-document-createRoot-name-exists: Root with specified name already exists.\",this,{name:t})}const n=new xm(this,e,t);this.roots.add(n);return n}destroy(){this.selection.destroy();this.stopListening()}getRoot(e=\"main\"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!=Lm)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Ds(this);e.selection=\"[engine.model.DocumentSelection]\";e.model=\"[engine.model.Model]\";return e}_handleChangeBlock(e){if(this._hasDocumentChangedFromTheLastChangeBlock()){this._callPostFixers(e);this.selection.refresh();if(this.differ.hasDataChanges()){this.fire(\"change:data\",e.batch)}else{this.fire(\"change\",e.batch)}this.selection.refresh();this.differ.reset()}this._hasSelectionChangedFromTheLastChangeBlock=false}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots){if(e!==this.graveyard){return e}}return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot();const t=this.model;const n=t.schema;const o=t.createPositionFromPath(e,[0]);const i=n.getNearestSelectionRange(o);return i||t.createRange(o)}_validateSelectionRange(e){return jm(e.start)&&jm(e.end)}_callPostFixers(e){let t=false;do{for(const n of this._postFixers){this.selection.refresh();t=n(e);if(t){break}}}while(t)}}ys(Hm,ds);function jm(e){const t=e.textNode;if(t){const n=t.data;const o=e.offset-t.startOffset;return!Dm(n,o)&&!Fm(n,o)}return true}class qm{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,n=false,o=false){const i=e instanceof Wm?e.name:e;if(i.includes(\",\")){throw new ss[\"b\"]('markercollection-incorrect-marker-name: Marker name cannot contain \",\" character.',this)}const r=this._markers.get(i);if(r){const e=r.getRange();let s=false;if(!e.isEqual(t)){r._attachLiveRange(ff.fromRange(t));s=true}if(n!=r.managedUsingOperations){r._managedUsingOperations=n;s=true}if(typeof o===\"boolean\"&&o!=r.affectsData){r._affectsData=o;s=true}if(s){this.fire(\"update:\"+i,r,e,t)}return r}const s=ff.fromRange(t);const a=new Wm(i,s,n,o);this._markers.set(i,a);this.fire(\"update:\"+i,a,null,t);return a}_remove(e){const t=e instanceof Wm?e.name:e;const n=this._markers.get(t);if(n){this._markers.delete(t);this.fire(\"update:\"+t,n,n.getRange(),null);this._destroyMarker(n);return true}return false}_refresh(e){const t=e instanceof Wm?e.name:e;const n=this._markers.get(t);if(!n){throw new ss[\"b\"](\"markercollection-refresh-marker-not-exists: Marker with provided name does not exists.\",this)}const o=n.getRange();this.fire(\"update:\"+t,n,o,o,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(e){for(const t of this){if(t.getRange().containsPosition(e)){yield t}}}*getMarkersIntersectingRange(e){for(const t of this){if(t.getRange().getIntersection(e)!==null){yield t}}}destroy(){for(const e of this._markers.values()){this._destroyMarker(e)}this._markers=null;this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values()){if(t.name.startsWith(e+\":\")){yield t}}}_destroyMarker(e){e.stopListening();e._detachLiveRange()}}ys(qm,ds);class Wm{constructor(e,t,n,o){this.name=e;this._liveRange=this._attachLiveRange(t);this._managedUsingOperations=n;this._affectsData=o}get managedUsingOperations(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._managedUsingOperations}get affectsData(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._affectsData}getStart(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.start.clone()}getEnd(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.end.clone()}getRange(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.toRange()}is(e){return e===\"marker\"||e===\"model:marker\"}_attachLiveRange(e){if(this._liveRange){this._detachLiveRange()}e.delegate(\"change:range\").to(this);e.delegate(\"change:content\").to(this);this._liveRange=e;return e}_detachLiveRange(){this._liveRange.stopDelegating(\"change:range\",this);this._liveRange.stopDelegating(\"change:content\",this);this._liveRange.detach();this._liveRange=null}}ys(Wm,ds);class $m extends tm{get type(){return\"noop\"}clone(){return new $m(this.baseVersion)}getReversed(){return new $m(this.baseVersion+1)}_execute(){}static get className(){return\"NoOperation\"}}const Um={};Um[gm.className]=gm;Um[bm.className]=bm;Um[wm.className]=wm;Um[pm.className]=pm;Um[$m.className]=$m;Um[tm.className]=tm;Um[km.className]=km;Um[_m.className]=_m;Um[ym.className]=ym;Um[vm.className]=vm;class Gm{static fromJSON(e,t){return Um[e.__className].fromJSON(e,t)}}class Km extends Yh{constructor(e,t,n=\"toNone\"){super(e,t,n);if(!this.root.is(\"rootElement\")){throw new ss[\"b\"](\"model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.\",e)}Jm.call(this)}detach(){this.stopListening()}is(e){return e===\"livePosition\"||e===\"model:livePosition\"||e==\"position\"||e===\"model:position\"}toPosition(){return new Yh(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t?t:e.stickiness)}}function Jm(){this.listenTo(this.root.document.model,\"applyOperation\",(e,t)=>{const n=t[0];if(!n.isDocumentOperation){return}Ym.call(this,n)},{priority:\"low\"})}function Ym(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path;this.root=t.root;this.fire(\"change\",e)}}ys(Km,ds);function Qm(e,t,n,o){return e.change(i=>{let r;if(!n){r=e.document.selection}else if(n instanceof af||n instanceof wf){r=n}else{r=i.createSelection(n,o)}if(!r.isCollapsed){e.deleteContent(r,{doNotAutoparagraph:true})}const s=new Xm(e,i,r.anchor);let a;if(t.is(\"documentFragment\")){a=t.getChildren()}else{a=[t]}s.handleNodes(a,{isFirst:true,isLast:true});const c=s.getSelectionRange();if(c){if(r instanceof wf){i.setSelection(c)}else{r.setTo(c)}}else{}const l=s.getAffectedRange()||e.createRange(r.anchor);s.destroy();return l})}class Xm{constructor(e,t,n){this.model=e;this.writer=t;this.position=n;this.canMergeWith=new Set([this.position.parent]);this.schema=e.schema;this._filterAttributesOf=[];this._affectedStart=null;this._affectedEnd=null}handleNodes(e,t){e=Array.from(e);for(let n=0;n{if(!n.doNotResetEntireContent&&hp(i,t)){up(e,t,i);return}const[r,s]=ep(o);if(!o.start.isTouching(o.end)){e.remove(o)}if(!n.leaveUnmerged){np(e,r,s);i.removeDisallowedAttributes(r.parent.getChildren(),e)}fp(e,t,r);if(!n.doNotAutoparagraph&&cp(i,r)){dp(e,r,t)}r.detach();s.detach()})}function ep(e){const t=e.root.document.model;const n=e.start;let o=e.end;if(t.hasContent(e,{ignoreMarkers:true})){const n=tp(o);if(n&&o.isTouching(t.createPositionAt(n,0))){const n=t.createSelection(e);t.modifySelection(n,{direction:\"backward\"});o=n.getLastPosition()}}return[Km.fromPosition(n,\"toPrevious\"),Km.fromPosition(o,\"toNext\")]}function tp(e){const t=e.parent;const n=t.root.document.model.schema;const o=t.getAncestors({parentFirst:true,includeSelf:true});for(const e of o){if(n.isLimit(e)){return null}if(n.isBlock(e)){return e}}}function np(e,t,n){const o=e.model;if(!sp(e.model.schema,t,n)){return}const[i,r]=ap(t,n);if(!o.hasContent(i,{ignoreMarkers:true})&&o.hasContent(r,{ignoreMarkers:true})){ip(e,t,n,i.parent)}else{op(e,t,n,i.parent)}}function op(e,t,n,o){const i=t.parent;const r=n.parent;if(i==o||r==o){return}t=e.createPositionAfter(i);n=e.createPositionBefore(r);if(!n.isEqual(t)){e.insert(r,t)}e.merge(t);while(n.parent.isEmpty){const t=n.parent;n=e.createPositionBefore(t);e.remove(t)}if(!sp(e.model.schema,t,n)){return}op(e,t,n,o)}function ip(e,t,n,o){const i=t.parent;const r=n.parent;if(i==o||r==o){return}t=e.createPositionAfter(i);n=e.createPositionBefore(r);if(!n.isEqual(t)){e.insert(i,n)}while(t.parent.isEmpty){const n=t.parent;t=e.createPositionBefore(n);e.remove(n)}n=e.createPositionBefore(r);rp(e,n);if(!sp(e.model.schema,t,n)){return}ip(e,t,n,o)}function rp(e,t){const n=t.nodeBefore;const o=t.nodeAfter;if(n.name!=o.name){e.rename(n,o.name)}e.clearAttributes(n);e.setAttributes(Object.fromEntries(o.getAttributes()),n);e.merge(t)}function sp(e,t,n){const o=t.parent;const i=n.parent;if(o==i){return false}if(e.isLimit(o)||e.isLimit(i)){return false}return lp(t,n,e)}function ap(e,t){const n=e.getAncestors();const o=t.getAncestors();let i=0;while(n[i]&&n[i]==o[i]){i++}return[n[i],o[i]]}function cp(e,t){const n=e.checkChild(t,\"$text\");const o=e.checkChild(t,\"paragraph\");return!n&&o}function lp(e,t,n){const o=new ef(e,t);for(const e of o.getWalker()){if(n.isLimit(e.item)){return false}}return true}function dp(e,t,n){const o=e.createElement(\"paragraph\");e.insert(o,t);fp(e,n,e.createPositionAt(o,0))}function up(e,t){const n=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(n));dp(e,e.createPositionAt(n,0),t)}function hp(e,t){const n=e.getLimitElement(t);if(!t.containsEntireContent(n)){return false}const o=t.getFirstRange();if(o.start.parent==o.end.parent){return false}return e.checkChild(n,\"paragraph\")}function fp(e,t,n){if(t instanceof wf){e.setSelection(n)}else{t.setTo(n)}}const gp=' ,.?!:;\"-()';function mp(e,t,n={}){const o=e.schema;const i=n.direction!=\"backward\";const r=n.unit?n.unit:\"character\";const s=t.focus;const a=new Kh({boundaries:kp(s,i),singleCharacters:true,direction:i?\"forward\":\"backward\"});const c={walker:a,schema:o,isForward:i,unit:r};let l;while(l=a.next()){if(l.done){return}const n=pp(c,l.value);if(n){if(t instanceof wf){e.change(e=>{e.setSelectionFocus(n)})}else{t.setFocus(n)}return}}}function pp(e,t){if(t.type==\"text\"){if(e.unit===\"word\"){return wp(e.walker,e.isForward)}return bp(e.walker,e.unit,e.isForward)}if(t.type==(e.isForward?\"elementStart\":\"elementEnd\")){if(e.schema.isObject(t.item)){return Yh._createAt(t.item,e.isForward?\"after\":\"before\")}if(e.schema.checkChild(t.nextPosition,\"$text\")){return t.nextPosition}}else{if(e.schema.isLimit(t.item)){e.walker.skip(()=>true);return}if(e.schema.checkChild(t.nextPosition,\"$text\")){return t.nextPosition}}}function bp(e,t){const n=e.position.textNode;if(n){const o=n.data;let i=e.position.offset-n.startOffset;while(Dm(o,i)||t==\"character\"&&Fm(o,i)){e.next();i=e.position.offset-n.startOffset}}return e.position}function wp(e,t){let n=e.position.textNode;if(n){let o=e.position.offset-n.startOffset;while(!_p(n.data,o,t)&&!vp(n,o,t)){e.next();const i=t?e.position.nodeAfter:e.position.nodeBefore;if(i&&i.is(\"$text\")){const o=i.data.charAt(t?0:i.data.length-1);if(!gp.includes(o)){e.next();n=e.position.textNode}}o=e.position.offset-n.startOffset}}return e.position}function kp(e,t){const n=e.root;const o=Yh._createAt(n,t?\"end\":0);if(t){return new ef(e,o)}else{return new ef(o,e)}}function _p(e,t,n){const o=t+(n?0:-1);return gp.includes(e.charAt(o))}function vp(e,t,n){return t===(n?e.endOffset:0)}function yp(e,t){return e.change(e=>{const n=e.createDocumentFragment();const o=t.getFirstRange();if(!o||o.isCollapsed){return n}const i=o.start.root;const r=o.start.getCommonPath(o.end);const s=i.getNodeByPath(r);let a;if(o.start.parent==o.end.parent){a=o}else{a=e.createRange(e.createPositionAt(s,o.start.path[r.length]),e.createPositionAt(s,o.end.path[r.length]+1))}const c=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:true})){if(t.is(\"$textProxy\")){e.appendText(t.data,t.getAttributes(),n)}else{e.append(e.cloneElement(t,true),n)}}if(a!=o){const t=o._getTransformedByMove(a.start,e.createPositionAt(n,0),c)[0];const i=e.createRange(e.createPositionAt(n,0),t.start);const r=e.createRange(t.end,e.createPositionAt(n,\"end\"));xp(r,e);xp(i,e)}return n})}function xp(e,t){const n=[];Array.from(e.getItems({direction:\"backward\"})).map(e=>t.createRangeOn(e)).filter(t=>{const n=(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end));return n}).forEach(e=>{n.push(e.start.parent);t.remove(e)});n.forEach(e=>{let n=e;while(n.parent&&n.isEmpty){const e=t.createRangeOn(n);n=n.parent;t.remove(e)}})}function Cp(e){e.document.registerPostFixer(t=>Ap(t,e))}function Ap(e,t){const n=t.document.selection;const o=t.schema;const i=[];let r=false;for(const e of n.getRanges()){const t=Tp(e,o);if(t&&!t.isEqual(e)){i.push(t);r=true}else{i.push(e)}}if(r){e.setSelection(Ip(i),{backward:n.isBackward})}}function Tp(e,t){if(e.isCollapsed){return Pp(e,t)}return Sp(e,t)}function Pp(e,t){const n=e.start;const o=t.getNearestSelectionRange(n);if(!o){return null}if(!o.isCollapsed){return o}const i=o.start;if(n.isEqual(i)){return null}return new ef(i)}function Sp(e,t){const n=e.start;const o=e.end;const i=t.checkChild(n,\"$text\");const r=t.checkChild(o,\"$text\");const s=t.getLimitElement(n);const a=t.getLimitElement(o);if(s===a){if(i&&r){return null}if(Rp(n,o,t)){const e=n.nodeAfter&&t.isObject(n.nodeAfter);const i=e?null:t.getNearestSelectionRange(n,\"forward\");const r=o.nodeBefore&&t.isObject(o.nodeBefore);const s=r?null:t.getNearestSelectionRange(o,\"backward\");const a=i?i.start:n;const c=s?s.start:o;return new ef(a,c)}}const c=s&&!s.is(\"rootElement\");const l=a&&!a.is(\"rootElement\");if(c||l){const e=n.nodeAfter&&o.nodeBefore&&n.nodeAfter.parent===o.nodeBefore.parent;const i=c&&(!e||!Op(n.nodeAfter,t));const r=l&&(!e||!Op(o.nodeBefore,t));let d=n;let u=o;if(i){d=Yh._createBefore(Ep(s,t))}if(r){u=Yh._createAfter(Ep(a,t))}return new ef(d,u)}return null}function Ep(e,t){let n=e;let o=n;while(t.isLimit(o)&&o.parent){n=o;o=o.parent}return n}function Rp(e,t,n){const o=e.nodeAfter&&!n.isLimit(e.nodeAfter)||n.checkChild(e,\"$text\");const i=t.nodeBefore&&!n.isLimit(t.nodeBefore)||n.checkChild(t,\"$text\");return o||i}function Ip(e){const t=[];t.push(e.shift());for(const n of e){const e=t.pop();if(n.isIntersecting(e)){const o=e.start.isAfter(n.start)?n.start:e.start;const i=e.end.isAfter(n.end)?e.end:n.end;const r=new ef(o,i);t.push(r)}else{t.push(e);t.push(n)}}return t}function Op(e,t){return e&&t.isObject(e)}class Vp{constructor(){this.markers=new qm;this.document=new Hm(this);this.schema=new Sg;this._pendingChanges=[];this._currentWriter=null;[\"insertContent\",\"deleteContent\",\"modifySelection\",\"getSelectedContent\",\"applyOperation\"].forEach(e=>this.decorate(e));this.on(\"applyOperation\",(e,t)=>{const n=t[0];n._validate()},{priority:\"highest\"});this.schema.register(\"$root\",{isLimit:true});this.schema.register(\"$block\",{allowIn:\"$root\",isBlock:true});this.schema.register(\"$text\",{allowIn:\"$block\",isInline:true});this.schema.register(\"$clipboardHolder\",{allowContentOf:\"$root\",isLimit:true});this.schema.extend(\"$text\",{allowIn:\"$clipboardHolder\"});this.schema.register(\"$marker\");this.schema.addChildCheck((e,t)=>{if(t.name===\"$marker\"){return true}});Cp(this)}change(e){try{if(this._pendingChanges.length===0){this._pendingChanges.push({batch:new em,callback:e});return this._runPendingChanges()[0]}else{return e(this._currentWriter)}}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{if(typeof e===\"string\"){e=new em(e)}else if(typeof e==\"function\"){t=e;e=new em}this._pendingChanges.push({batch:e,callback:t});if(this._pendingChanges.length==1){this._runPendingChanges()}}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return Qm(this,e,t,n)}deleteContent(e,t){Zm(this,e,t)}modifySelection(e,t){mp(this,e,t)}getSelectedContent(e){return yp(this,e)}hasContent(e,t={}){const n=e instanceof Uh?ef._createIn(e):e;if(n.isCollapsed){return false}const{ignoreWhitespaces:o=false,ignoreMarkers:i=false}=t;if(!i){for(const e of this.markers.getMarkersIntersectingRange(n)){if(e.affectsData){return true}}}for(const e of n.getItems()){if(e.is(\"$textProxy\")){if(!o){return true}else if(e.data.search(/\\S/)!==-1){return true}}else if(this.schema.isObject(e)){return true}}return false}createPositionFromPath(e,t,n){return new Yh(e,t,n)}createPositionAt(e,t){return Yh._createAt(e,t)}createPositionAfter(e){return Yh._createAfter(e)}createPositionBefore(e){return Yh._createBefore(e)}createRange(e,t){return new ef(e,t)}createRangeIn(e){return ef._createIn(e)}createRangeOn(e){return ef._createOn(e)}createSelection(e,t,n){return new af(e,t,n)}createBatch(e){return new em(e)}createOperationFromJSON(e){return Gm.fromJSON(e,this.document)}destroy(){this.document.destroy();this.stopListening()}_runPendingChanges(){const e=[];this.fire(\"_beforeChanges\");while(this._pendingChanges.length){const t=this._pendingChanges[0].batch;this._currentWriter=new Cm(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n);this.document._handleChangeBlock(this._currentWriter);this._pendingChanges.shift();this._currentWriter=null}this.fire(\"_afterChanges\");return e}}ys(Vp,Yc);class Mp{constructor(){this._listener=Object.create(Jd)}listenTo(e){this._listener.listenTo(e,\"keydown\",(e,t)=>{this._listener.fire(\"_keydown:\"+Nl(t),t)})}set(e,t,n={}){const o=zl(e);const i=n.priority;this._listener.listenTo(this._listener,\"_keydown:\"+o,(e,n)=>{t(n,()=>{n.preventDefault();n.stopPropagation();e.stop()});e.return=true},{priority:i})}press(e){return!!this._listener.fire(\"_keydown:\"+Nl(e),e)}destroy(){this._listener.stopListening()}}class Np extends Mp{constructor(e){super();this.editor=e}set(e,t,n={}){if(typeof t==\"string\"){const e=t;t=(t,n)=>{this.editor.execute(e);n()}}super.set(e,t,n)}}class zp{constructor(e={}){this._context=e.context||new Ms({language:e.language});this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new Jr(e,this.constructor.defaultConfig);this.config.define(\"plugins\",t);this.config.define(this._context._getEditorConfig());this.plugins=new Cs(this,t,this._context.plugins);this.locale=this._context.locale;this.t=this.locale.t;this.commands=new Ag;this.set(\"state\",\"initializing\");this.once(\"ready\",()=>this.state=\"ready\",{priority:\"high\"});this.once(\"destroy\",()=>this.state=\"destroyed\",{priority:\"high\"});this.set(\"isReadOnly\",false);this.model=new Vp;const n=new Mc;this.data=new Jg(this.model,n);this.editing=new Cg(this.model,n);this.editing.view.document.bind(\"isReadOnly\").to(this);this.conversion=new Qg([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 Np(this);this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config;const t=e.get(\"plugins\");const n=e.get(\"removePlugins\")||[];const o=e.get(\"extraPlugins\")||[];return this.plugins.init(t.concat(o),n)}destroy(){let e=Promise.resolve();if(this.state==\"initializing\"){e=new Promise(e=>this.once(\"ready\",e))}return e.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()}).then(()=>this._context._removeEditor(this))}execute(...e){try{return this.commands.execute(...e)}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}}ys(zp,Yc);const Bp={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};var Dp=Bp;function Fp(e,t){if(e instanceof HTMLTextAreaElement){e.value=t}e.innerHTML=t}const Lp={updateSourceElement(){if(!this.sourceElement){throw new ss[\"b\"](\"editor-missing-sourceelement: Cannot update the source element of a detached editor.\",this)}Fp(this.sourceElement,this.data.get())}};var Hp=Lp;function jp(e){if(!ge(e.updateSourceElement)){throw new ss[\"b\"](\"attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.\",e)}const t=e.sourceElement;if(t&&t.tagName.toLowerCase()===\"textarea\"&&t.form){let n;const o=t.form;const i=()=>e.updateSourceElement();if(ge(o.submit)){n=o.submit;o.submit=()=>{i();n.apply(o)}}o.addEventListener(\"submit\",i);e.on(\"destroy\",()=>{o.removeEventListener(\"submit\",i);if(n){o.submit=n}})}}class qp{getHtml(e){const t=document.implementation.createHTMLDocument(\"\");const n=t.createElement(\"div\");n.appendChild(e);return n.innerHTML}}class Wp{constructor(e){this._domParser=new DOMParser;this._domConverter=new jd(e,{blockFillerMode:\"nbsp\"});this._htmlWriter=new qp}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}_toDom(e){const t=this._domParser.parseFromString(e,\"text/html\");const n=t.createDocumentFragment();const o=t.body.childNodes;while(o.length>0){n.appendChild(o[0])}return n}}class $p{constructor(e){this.editor=e;this._components=new Map}*names(){for(const e of this._components.values()){yield e.originalName}}add(e,t){if(this.has(e)){throw new ss[\"b\"](\"componentfactory-item-exists: The item already exists in the component factory.\",this,{name:e})}this._components.set(Up(e),{callback:t,originalName:e})}create(e){if(!this.has(e)){throw new ss[\"b\"](\"componentfactory-item-missing: The required component is not registered in the factory.\",this,{name:e})}return this._components.get(Up(e)).callback(this.editor.locale)}has(e){return this._components.has(Up(e))}}function Up(e){return String(e).toLowerCase()}class Gp{constructor(){this.set(\"isFocused\",false);this.set(\"focusedElement\",null);this._elements=new Set;this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e)){throw new ss[\"b\"](\"focusTracker-add-element-already-exist\",this)}this.listenTo(e,\"focus\",()=>this._focus(e),{useCapture:true});this.listenTo(e,\"blur\",()=>this._blur(),{useCapture:true});this._elements.add(e)}remove(e){if(e===this.focusedElement){this._blur(e)}if(this._elements.has(e)){this.stopListening(e);this._elements.delete(e)}}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout);this.focusedElement=e;this.isFocused=true}_blur(){clearTimeout(this._nextEventLoopTimeout);this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null;this.isFocused=false},0)}}ys(Gp,Jd);ys(Gp,Yc);class Kp{constructor(e){this.editor=e;this.componentFactory=new $p(e);this.focusTracker=new Gp;this._editableElementsMap=new Map;this.listenTo(e.editing.view.document,\"layoutChanged\",()=>this.update())}get element(){return null}update(){this.fire(\"update\")}destroy(){this.stopListening();this.focusTracker.destroy();for(const e of this._editableElementsMap.values()){e.ckeditorInstance=null}this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t);if(!t.ckeditorInstance){t.ckeditorInstance=this.editor}}getEditableElement(e=\"main\"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){console.warn(\"editor-ui-deprecated-editable-elements: \"+\"The EditorUI#_editableElements property has been deprecated and will be removed in the near future.\",{editorUI:this});return this._editableElementsMap}}ys(Kp,ds);function Jp({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:o,beforeFocus:i,afterBlur:r}){n.add(o.element);t.set(\"Alt+F10\",(e,t)=>{if(n.isFocused&&!o.focusTracker.isFocused){if(i){i()}o.focus();t()}});o.keystrokes.set(\"Esc\",(t,n)=>{if(o.focusTracker.isFocused){e.focus();if(r){r()}n()}})}function Yp(e){if(Array.isArray(e)){return{items:e}}if(!e){return{items:[]}}return Object.assign({items:[]},e)}var Qp=n(16);const Xp=new WeakMap;function Zp(e){const{view:t,element:n,text:o,isDirectHost:i=true}=e;const r=t.document;if(!Xp.has(r)){Xp.set(r,new Map);r.registerPostFixer(e=>ib(r,e))}Xp.get(r).set(n,{text:o,isDirectHost:i});t.change(e=>ib(r,e))}function eb(e,t){const n=t.document;e.change(e=>{if(!Xp.has(n)){return}const o=Xp.get(n);const i=o.get(t);e.removeAttribute(\"data-placeholder\",i.hostElement);nb(e,i.hostElement);o.delete(t)})}function tb(e,t){if(!t.hasClass(\"ck-placeholder\")){e.addClass(\"ck-placeholder\",t);return true}return false}function nb(e,t){if(t.hasClass(\"ck-placeholder\")){e.removeClass(\"ck-placeholder\",t);return true}return false}function ob(e){if(!e.isAttached()){return false}const t=!Array.from(e.getChildren()).some(e=>!e.is(\"uiElement\"));const n=e.document;if(!n.isFocused&&t){return true}const o=n.selection;const i=o.anchor;if(t&&i&&i.parent!==e){return true}return false}function ib(e,t){const n=Xp.get(e);let o=false;for(const[e,i]of n){if(rb(t,e,i)){o=true}}return o}function rb(e,t,n){const{text:o,isDirectHost:i}=n;const r=i?t:sb(t);let s=false;if(!r){return false}n.hostElement=r;if(r.getAttribute(\"data-placeholder\")!==o){e.setAttribute(\"data-placeholder\",o,r);s=true}if(ob(r)){if(tb(e,r)){s=true}}else if(nb(e,r)){s=true}return s}function sb(e){if(e.childCount===1){const t=e.getChild(0);if(t.is(\"element\")&&!t.is(\"uiElement\")){return t}}return null}class ab{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t});e.style.display=\"none\";if(t){e.parentNode.insertBefore(t,e.nextSibling)}}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display=\"\";if(t){t.remove()}});this._replacedElements=[]}}class cb extends Kp{constructor(e,t){super(e);this.view=t;this._toolbarConfig=Yp(e.config.get(\"toolbar\"));this._elementReplacer=new ab}get element(){return this.view.element}init(e){const t=this.editor;const n=this.view;const o=t.editing.view;const i=n.editable;const r=o.document.getRoot();i.name=r.rootName;n.render();const s=i.element;this.setEditableElement(i.name,s);this.focusTracker.add(s);n.editable.bind(\"isFocused\").to(this.focusTracker);o.attachDomRoot(s);if(e){this._elementReplacer.replace(e,this.element)}this._initPlaceholder();this._initToolbar();this.fire(\"ready\")}destroy(){const e=this.view;const t=this.editor.editing.view;this._elementReplacer.restore();t.detachDomRoot(e.editable.name);e.destroy();super.destroy()}_initToolbar(){const e=this.editor;const t=this.view;const n=e.editing.view;t.stickyPanel.bind(\"isActive\").to(this.focusTracker,\"isFocused\");t.stickyPanel.limiterElement=t.element;if(this._toolbarConfig.viewportTopOffset){t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset}t.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory);Jp({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor;const t=e.editing.view;const n=t.document.getRoot();const o=e.sourceElement;const i=e.config.get(\"placeholder\")||o&&o.tagName.toLowerCase()===\"textarea\"&&o.getAttribute(\"placeholder\");if(i){Zp({view:t,element:n,text:i,isDirectHost:false})}}}class lb extends xs{constructor(e=[]){super(e,{idProperty:\"viewUid\"});this.on(\"add\",(e,t,n)=>{this._renderViewIntoCollectionParent(t,n)});this.on(\"remove\",(e,t)=>{if(t.element&&this._parentElement){t.element.remove()}});this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const e of this){this._renderViewIntoCollectionParent(e)}}delegate(...e){if(!e.length||!db(e)){throw new ss[\"b\"](\"ui-viewcollection-delegate-wrong-events: All event names must be strings.\",this)}return{to:t=>{for(const n of this){for(const o of e){n.delegate(o).to(t)}}this.on(\"add\",(n,o)=>{for(const n of e){o.delegate(n).to(t)}});this.on(\"remove\",(n,o)=>{for(const n of e){o.stopDelegating(n,t)}})}}}_renderViewIntoCollectionParent(e,t){if(!e.isRendered){e.render()}if(e.element&&this._parentElement){this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}}function db(e){return e.every(e=>typeof e==\"string\")}const ub=\"http://www.w3.org/1999/xhtml\";class hb{constructor(e){Object.assign(this,xb(yb(e)));this._isRendered=false;this._revertData=null}render(){const e=this._renderNode({intoFragment:true});this._isRendered=true;return e}apply(e){this._revertData=zb();this._renderNode({node:e,isApplying:true,revertData:this._revertData});return e}revert(e){if(!this._revertData){throw new ss[\"b\"](\"ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.\",[this,e])}this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children){for(const n of t.children){if(Vb(n)){yield n}else if(Mb(n)){yield*e(n)}}}}yield*e(this)}static bind(e,t){return{to(n,o){return new gb({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:o})},if(n,o,i){return new mb({observable:e,emitter:t,attribute:n,valueIfTrue:o,callback:i})}}}static extend(e,t){if(e._isRendered){throw new ss[\"b\"](\"template-extend-render: Attempting to extend a template which has already been rendered.\",[this,e])}Ib(e,xb(yb(t)))}_renderNode(e){let t;if(e.node){t=this.tag&&this.text}else{t=this.tag?this.text:!this.text}if(t){throw new ss[\"b\"]('ui-template-wrong-syntax: Node definition must have either \"tag\" or \"text\" when rendering a new Node.',this)}if(this.text){return this._renderText(e)}else{return this._renderElement(e)}}_renderElement(e){let t=e.node;if(!t){t=e.node=document.createElementNS(this.ns||ub,this.tag)}this._renderAttributes(e);this._renderElementChildren(e);this._setUpListeners(e);return t}_renderText(e){let t=e.node;if(t){e.revertData.text=t.textContent}else{t=e.node=document.createTextNode(\"\")}if(pb(this.text)){this._bindToObservable({schema:this.text,updater:kb(t),data:e})}else{t.textContent=this.text.join(\"\")}return t}_renderAttributes(e){let t,n,o,i;if(!this.attributes){return}const r=e.node;const s=e.revertData;for(t in this.attributes){o=r.getAttribute(t);n=this.attributes[t];if(s){s.attributes[t]=o}i=ce(n[0])&&n[0].ns?n[0].ns:null;if(pb(n)){const a=i?n[0].value:n;if(s&&Bb(t)){a.unshift(o)}this._bindToObservable({schema:a,updater:_b(r,t,i),data:e})}else if(t==\"style\"&&typeof n[0]!==\"string\"){this._renderStyleAttribute(n[0],e)}else{if(s&&o&&Bb(t)){n.unshift(o)}n=n.map(e=>e?e.value||e:e).reduce((e,t)=>e.concat(t),[]).reduce(Eb,\"\");if(!Ob(n)){r.setAttributeNS(i,t,n)}}}}_renderStyleAttribute(e,t){const n=t.node;for(const o in e){const i=e[o];if(pb(i)){this._bindToObservable({schema:[i],updater:vb(n,o),data:t})}else{n.style[o]=i}}}_renderElementChildren(e){const t=e.node;const n=e.intoFragment?document.createDocumentFragment():t;const o=e.isApplying;let i=0;for(const r of this.children){if(Nb(r)){if(!o){r.setParent(t);for(const e of r){n.appendChild(e.element)}}}else if(Vb(r)){if(!o){if(!r.isRendered){r.render()}n.appendChild(r.element)}}else if(Sd(r)){n.appendChild(r)}else{if(o){const t=e.revertData;const o=zb();t.children.push(o);r._renderNode({node:n.childNodes[i++],isApplying:true,revertData:o})}else{n.appendChild(r.render())}}}if(e.intoFragment){t.appendChild(n)}}_setUpListeners(e){if(!this.eventListeners){return}for(const t in this.eventListeners){const n=this.eventListeners[t].map(n=>{const[o,i]=t.split(\"@\");return n.activateDomEventListener(o,i,e)});if(e.revertData){e.revertData.bindings.push(n)}}}_bindToObservable({schema:e,updater:t,data:n}){const o=n.revertData;wb(e,t,n);const i=e.filter(e=>!Ob(e)).filter(e=>e.observable).map(o=>o.activateAttributeListener(e,t,n));if(o){o.bindings.push(i)}}_revertTemplateFromNode(e,t){for(const e of t.bindings){for(const t of e){t()}}if(t.text){e.textContent=t.text;return}for(const n in t.attributes){const o=t.attributes[n];if(o===null){e.removeAttribute(n)}else{e.setAttribute(n,o)}}for(let n=0;nwb(e,t,n);this.emitter.listenTo(this.observable,\"change:\"+this.attribute,o);return()=>{this.emitter.stopListening(this.observable,\"change:\"+this.attribute,o)}}}class gb extends fb{activateDomEventListener(e,t,n){const o=(e,n)=>{if(!t||n.target.matches(t)){if(typeof this.eventNameOrFunction==\"function\"){this.eventNameOrFunction(n)}else{this.observable.fire(this.eventNameOrFunction,n)}}};this.emitter.listenTo(n.node,e,o);return()=>{this.emitter.stopListening(n.node,e,o)}}}class mb extends fb{getValue(e){const t=super.getValue(e);return Ob(t)?false:this.valueIfTrue||true}}function pb(e){if(!e){return false}if(e.value){e=e.value}if(Array.isArray(e)){return e.some(pb)}else if(e instanceof fb){return true}return false}function bb(e,t){return e.map(e=>{if(e instanceof fb){return e.getValue(t)}return e})}function wb(e,t,{node:n}){let o=bb(e,n);if(e.length==1&&e[0]instanceof mb){o=o[0]}else{o=o.reduce(Eb,\"\")}if(Ob(o)){t.remove()}else{t.set(o)}}function kb(e){return{set(t){e.textContent=t},remove(){e.textContent=\"\"}}}function _b(e,t,n){return{set(o){e.setAttributeNS(n,t,o)},remove(){e.removeAttributeNS(n,t)}}}function vb(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function yb(e){const t=Ur(e,e=>{if(e&&(e instanceof fb||Mb(e)||Vb(e)||Nb(e))){return e}});return t}function xb(e){if(typeof e==\"string\"){e=Tb(e)}else if(e.text){Pb(e)}if(e.on){e.eventListeners=Ab(e.on);delete e.on}if(!e.text){if(e.attributes){Cb(e.attributes)}const t=[];if(e.children){if(Nb(e.children)){t.push(e.children)}else{for(const n of e.children){if(Mb(n)||Vb(n)||Sd(n)){t.push(n)}else{t.push(new hb(n))}}}}e.children=t}return e}function Cb(e){for(const t in e){if(e[t].value){e[t].value=[].concat(e[t].value)}Sb(e,t)}}function Ab(e){for(const t in e){Sb(e,t)}return e}function Tb(e){return{text:[e]}}function Pb(e){if(!Array.isArray(e.text)){e.text=[e.text]}}function Sb(e,t){if(!Array.isArray(e[t])){e[t]=[e[t]]}}function Eb(e,t){if(Ob(t)){return e}else if(Ob(e)){return t}else{return`${e} ${t}`}}function Rb(e,t){for(const n in t){if(e[n]){e[n].push(...t[n])}else{e[n]=t[n]}}}function Ib(e,t){if(t.attributes){if(!e.attributes){e.attributes={}}Rb(e.attributes,t.attributes)}if(t.eventListeners){if(!e.eventListeners){e.eventListeners={}}Rb(e.eventListeners,t.eventListeners)}if(t.text){e.text.push(...t.text)}if(t.children&&t.children.length){if(e.children.length!=t.children.length){throw new ss[\"b\"](\"ui-template-extend-children-mismatch: The number of children in extended definition does not match.\",e)}let n=0;for(const o of t.children){Ib(e.children[n++],o)}}}function Ob(e){return!e&&e!==0}function Vb(e){return e instanceof Fb}function Mb(e){return e instanceof hb}function Nb(e){return e instanceof lb}function zb(){return{children:[],bindings:[],attributes:{}}}function Bb(e){return e==\"class\"||e==\"style\"}var Db=n(18);class Fb{constructor(e){this.element=null;this.isRendered=false;this.locale=e;this.t=e&&e.t;this._viewCollections=new xs;this._unboundChildren=this.createCollection();this._viewCollections.on(\"add\",(t,n)=>{n.locale=e});this.decorate(\"render\")}get bindTemplate(){if(this._bindTemplate){return this._bindTemplate}return this._bindTemplate=hb.bind(this,this)}createCollection(e){const t=new lb(e);this._viewCollections.add(t);return t}registerChild(e){if(!vs(e)){e=[e]}for(const t of e){this._unboundChildren.add(t)}}deregisterChild(e){if(!vs(e)){e=[e]}for(const t of e){this._unboundChildren.remove(t)}}setTemplate(e){this.template=new hb(e)}extendTemplate(e){hb.extend(this.template,e)}render(){if(this.isRendered){throw new ss[\"b\"](\"ui-view-render-already-rendered: This View has already been rendered.\",this)}if(this.template){this.element=this.template.render();this.registerChild(this.template.getViews())}this.isRendered=true}destroy(){this.stopListening();this._viewCollections.map(e=>e.destroy());if(this.template&&this.template._revertData){this.template.revert(this.element)}}}ys(Fb,Jd);ys(Fb,Yc);var Lb=\"[object String]\";function Hb(e){return typeof e==\"string\"||!Jt(e)&&T(e)&&_(e)==Lb}var jb=Hb;function qb(e,t,n={},o=[]){const i=n&&n.xmlns;const r=i?e.createElementNS(i,t):e.createElement(t);for(const e in n){r.setAttribute(e,n[e])}if(jb(o)||!vs(o)){o=[o]}for(let t of o){if(jb(t)){t=e.createTextNode(t)}r.appendChild(t)}return r}class Wb extends lb{constructor(e,t=[]){super(t);this.locale=e}attachToDom(){this._bodyCollectionContainer=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-reset_all\",\"ck-body\",\"ck-rounded-corners\"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(\".ck-body-wrapper\");if(!e){e=qb(document,\"div\",{class:\"ck-body-wrapper\"});document.body.appendChild(e)}e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy();if(this._bodyCollectionContainer){this._bodyCollectionContainer.remove()}const e=document.querySelector(\".ck-body-wrapper\");if(e&&e.childElementCount==0){e.remove()}}}var $b=n(20);class Ub extends Fb{constructor(e){super(e);this.body=new Wb(e)}render(){super.render();this.body.attachToDom()}destroy(){this.body.detachFromDom();return super.destroy()}}var Gb=n(22);class Kb extends Fb{constructor(e){super(e);this.set(\"text\");this.set(\"for\");this.id=`ck-editor__label_${ns()}`;const t=this.bindTemplate;this.setTemplate({tag:\"label\",attributes:{class:[\"ck\",\"ck-label\"],id:this.id,for:t.to(\"for\")},children:[{text:t.to(\"text\")}]})}}class Jb extends Ub{constructor(e){super(e);this.top=this.createCollection();this.main=this.createCollection();this._voiceLabelView=this._createVoiceLabel();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-reset\",\"ck-editor\",\"ck-rounded-corners\"],role:\"application\",dir:e.uiLanguageDirection,lang:e.uiLanguage,\"aria-labelledby\":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:\"div\",attributes:{class:[\"ck\",\"ck-editor__top\",\"ck-reset_all\"],role:\"presentation\"},children:this.top},{tag:\"div\",attributes:{class:[\"ck\",\"ck-editor__main\"],role:\"presentation\"},children:this.main}]})}_createVoiceLabel(){const e=this.t;const t=new Kb;t.text=e(\"Rich Text Editor\");t.extendTemplate({attributes:{class:\"ck-voice-label\"}});return t}}class Yb extends Fb{constructor(e,t,n){super(e);this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-content\",\"ck-editor__editable\",\"ck-rounded-corners\"],lang:e.contentLanguage,dir:e.contentLanguageDirection}});this.name=null;this.set(\"isFocused\",false);this._editableElement=n;this._hasExternalElement=!!this._editableElement;this._editingView=t}render(){super.render();if(this._hasExternalElement){this.template.apply(this.element=this._editableElement)}else{this._editableElement=this.element}this.on(\"change:isFocused\",()=>this._updateIsFocusedClasses());this._updateIsFocusedClasses()}destroy(){if(this._hasExternalElement){this.template.revert(this._editableElement)}super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;if(e.isRenderingInProgress){n(this)}else{t(this)}function t(t){e.change(n=>{const o=e.document.getRoot(t.name);n.addClass(t.isFocused?\"ck-focused\":\"ck-blurred\",o);n.removeClass(t.isFocused?\"ck-blurred\":\"ck-focused\",o)})}function n(o){e.once(\"change:isRenderingInProgress\",(e,i,r)=>{if(!r){t(o)}else{n(o)}})}}}class Qb extends Yb{constructor(e,t,n){super(e,t,n);this.extendTemplate({attributes:{role:\"textbox\",class:\"ck-editor__editable_inline\"}})}render(){super.render();const e=this._editingView;const t=this.t;e.change(n=>{const o=e.document.getRoot(this.name);n.setAttribute(\"aria-label\",t(\"Rich Text Editor, %0\",[this.name]),o)})}}function Xb(e){return t=>t+e}var Zb=n(24);const ew=Xb(\"px\");class tw extends Fb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"isActive\",false);this.set(\"isSticky\",false);this.set(\"limiterElement\",null);this.set(\"limiterBottomOffset\",50);this.set(\"viewportTopOffset\",0);this.set(\"_marginLeft\",null);this.set(\"_isStickyToTheLimiter\",false);this.set(\"_hasViewportTopOffset\",false);this.content=this.createCollection();this._contentPanelPlaceholder=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel__placeholder\"],style:{display:t.to(\"isSticky\",e=>e?\"block\":\"none\"),height:t.to(\"isSticky\",e=>e?ew(this._panelRect.height):null)}}}).render();this._contentPanel=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel__content\",t.if(\"isSticky\",\"ck-sticky-panel__content_sticky\"),t.if(\"_isStickyToTheLimiter\",\"ck-sticky-panel__content_sticky_bottom-limit\")],style:{width:t.to(\"isSticky\",e=>e?ew(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to(\"_hasViewportTopOffset\",e=>e?ew(this.viewportTopOffset):null),bottom:t.to(\"_isStickyToTheLimiter\",e=>e?ew(this.limiterBottomOffset):null),marginLeft:t.to(\"_marginLeft\")}},children:this.content}).render();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel\"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render();this._checkIfShouldBeSticky();this.listenTo(Bd.window,\"scroll\",()=>{this._checkIfShouldBeSticky()});this.listenTo(this,\"change:isActive\",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;if(!this.limiterElement){this.isSticky=false}else{t=this._limiterRect=this.limiterElement.getBoundingClientRect();this.isSticky=this.isActive&&t.top{this[t]();n()})}}}}get first(){return this.focusables.find(ow)||null}get last(){return this.focusables.filter(ow).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;if(this.focusTracker.focusedElement===null){return null}this.focusables.find((t,n)=>{const o=t.element===this.focusTracker.focusedElement;if(o){e=n}return o});return e}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){if(e){e.focus()}}_getFocusableItem(e){const t=this.current;const n=this.focusables.length;if(!n){return null}if(t===null){return this[e===1?\"first\":\"last\"]}let o=(t+n+e)%n;do{const t=this.focusables.get(o);if(ow(t)){return t}o=(o+n+e)%n}while(o!==t);return null}}function ow(e){return!!(e.focus&&Bd.window.getComputedStyle(e.element).display!=\"none\")}class iw extends Fb{constructor(e){super(e);this.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-toolbar__separator\"]}})}}const rw=100;class sw{constructor(e,t){if(!sw._observerInstance){sw._createObserver()}this._element=e;this._callback=t;sw._addElementCallback(e,t);sw._observerInstance.observe(e)}destroy(){sw._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){if(!sw._elementCallbacks){sw._elementCallbacks=new Map}let n=sw._elementCallbacks.get(e);if(!n){n=new Set;sw._elementCallbacks.set(e,n)}n.add(t)}static _deleteElementCallback(e,t){const n=sw._getElementCallbacks(e);if(n){n.delete(t);if(!n.size){sw._elementCallbacks.delete(e);sw._observerInstance.unobserve(e)}}if(sw._elementCallbacks&&!sw._elementCallbacks.size){sw._observerInstance=null;sw._elementCallbacks=null}}static _getElementCallbacks(e){if(!sw._elementCallbacks){return null}return sw._elementCallbacks.get(e)}static _createObserver(){let e;if(typeof Bd.window.ResizeObserver===\"function\"){e=Bd.window.ResizeObserver}else{e=aw}sw._observerInstance=new e(e=>{for(const t of e){if(!t.target.offsetParent){continue}const e=sw._getElementCallbacks(t.target);if(e){for(const n of e){n(t)}}}})}}sw._observerInstance=null;sw._elementCallbacks=null;class aw{constructor(e){this._callback=e;this._elements=new Set;this._previousRects=new Map;this._periodicCheckTimeout=null}observe(e){this._elements.add(e);this._checkElementRectsAndExecuteCallback();if(this._elements.size===1){this._startPeriodicCheck()}}unobserve(e){this._elements.delete(e);this._previousRects.delete(e);if(!this._elements.size){this._stopPeriodicCheck()}}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback();this._periodicCheckTimeout=setTimeout(e,rw)};this.listenTo(Bd.window,\"resize\",()=>{this._checkElementRectsAndExecuteCallback()});this._periodicCheckTimeout=setTimeout(e,rw)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout);this.stopListening();this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements){if(this._hasRectChanged(t)){e.push({target:t,contentRect:this._previousRects.get(t)})}}if(e.length){this._callback(e)}}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e)){return false}const t=new Th(e);const n=this._previousRects.get(e);const o=!n||!n.isEqual(t);this._previousRects.set(e,t);return o}}ys(aw,Jd);function cw(e){return e.bindTemplate.to(t=>{if(t.target===e.element){t.preventDefault()}})}class lw extends Fb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"isVisible\",false);this.set(\"position\",\"se\");this.children=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-reset\",\"ck-dropdown__panel\",t.to(\"position\",e=>`ck-dropdown__panel_${e}`),t.if(\"isVisible\",\"ck-dropdown__panel-visible\")]},children:this.children,on:{selectstart:t.to(e=>e.preventDefault())}})}focus(){if(this.children.length){this.children.first.focus()}}focusLast(){if(this.children.length){const e=this.children.last;if(typeof e.focusLast===\"function\"){e.focusLast()}else{e.focus()}}}}var dw=n(26);function uw(e){if(!e||!e.parentNode){return null}if(e.offsetParent===Bd.document.body){return null}return e.offsetParent}function hw({element:e,target:t,positions:n,limiter:o,fitInViewport:i}){if(ge(t)){t=t()}if(ge(o)){o=o()}const r=uw(e);const s=new Th(e);const a=new Th(t);let c;let l;if(!o&&!i){[l,c]=fw(n[0],a,s)}else{const e=o&&new Th(o).getVisible();const t=i&&new Th(Bd.window);const r=gw(n,{targetRect:a,elementRect:s,limiterRect:e,viewportRect:t});[l,c]=r||fw(n[0],a,s)}let d=ww(c);if(r){d=bw(d,r)}return{left:d.left,top:d.top,name:l}}function fw(e,t,n){const o=e(t,n);if(!o){return null}const{left:i,top:r,name:s}=o;return[s,n.clone().moveTo(i,r)]}function gw(e,t){const{elementRect:n,viewportRect:o}=t;const i=n.getArea();const r=mw(e,t);if(o){const e=r.filter(({viewportIntersectArea:e})=>e===i);const t=pw(e,i);if(t){return t}}return pw(r,i)}function mw(e,{targetRect:t,elementRect:n,limiterRect:o,viewportRect:i}){const r=[];const s=n.getArea();for(const a of e){const e=fw(a,t,n);if(!e){continue}const[c,l]=e;let d=0;let u=0;if(o){if(i){const e=o.getIntersection(i);if(e){d=e.getIntersectionArea(l)}}else{d=o.getIntersectionArea(l)}}if(i){u=i.getIntersectionArea(l)}const h={positionName:c,positionRect:l,limiterIntersectArea:d,viewportIntersectArea:u};if(d===s){return[h]}r.push(h)}return r}function pw(e,t){let n=0;let o;let i;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:c}of e){if(a===t){return[r,s]}const e=c**2+a**2;if(e>n){n=e;o=s;i=r}}return o?[i,o]:null}function bw({left:e,top:t},n){const o=ww(new Th(n));const i=Ch(n);e-=o.left;t-=o.top;e+=n.scrollLeft;t+=n.scrollTop;e-=i.left;t-=i.top;return{left:e,top:t}}function ww({left:e,top:t}){const{scrollX:n,scrollY:o}=Bd.window;return{left:e+n,top:t+o}}class kw extends Fb{constructor(e,t,n){super(e);const o=this.bindTemplate;this.buttonView=t;this.panelView=n;this.set(\"isOpen\",false);this.set(\"isEnabled\",true);this.set(\"class\");this.set(\"id\");this.set(\"panelPosition\",\"auto\");this.keystrokes=new Mp;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-dropdown\",o.to(\"class\"),o.if(\"isEnabled\",\"ck-disabled\",e=>!e)],id:o.to(\"id\"),\"aria-describedby\":o.to(\"ariaDescribedById\")},children:[t,n]});t.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\",()=>{if(!this.isOpen){return}if(this.panelPosition===\"auto\"){this.panelView.position=kw._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:true,positions:this._panelPositions}).name}else{this.panelView.position=this.panelPosition}});this.keystrokes.listenTo(this.element);const e=(e,t)=>{if(this.isOpen){this.buttonView.focus();this.isOpen=false;t()}};this.keystrokes.set(\"arrowdown\",(e,t)=>{if(this.buttonView.isEnabled&&!this.isOpen){this.isOpen=true;t()}});this.keystrokes.set(\"arrowright\",(e,t)=>{if(this.isOpen){t()}});this.keystrokes.set(\"arrowleft\",e);this.keystrokes.set(\"esc\",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:n,northWest:o}=kw.defaultPanelPositions;if(this.locale.uiLanguageDirection===\"ltr\"){return[e,t,n,o]}else{return[t,e,o,n]}}}kw.defaultPanelPositions={southEast:e=>({top:e.bottom,left:e.left,name:\"se\"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:\"sw\"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:\"ne\"}),northWest:(e,t)=>({top:e.bottom-t.height,left:e.left-t.width+e.width,name:\"nw\"})};kw._getOptimalPosition=hw;var _w=n(28);class vw extends Fb{constructor(){super();const e=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:e.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 e=(new DOMParser).parseFromString(this.content.trim(),\"image/svg+xml\");const t=e.querySelector(\"svg\");const n=t.getAttribute(\"viewBox\");if(n){this.viewBox=n}this.element.innerHTML=\"\";while(t.childNodes.length>0){this.element.appendChild(t.childNodes[0])}}}_colorFillPaths(){if(this.fillColor){this.element.querySelectorAll(\".ck-icon__fill\").forEach(e=>{e.style.fill=this.fillColor})}}}var yw=n(30);class xw extends Fb{constructor(e){super(e);this.set(\"text\",\"\");this.set(\"position\",\"s\");const t=this.bindTemplate;this.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-tooltip\",t.to(\"position\",e=>\"ck-tooltip_\"+e),t.if(\"text\",\"ck-hidden\",e=>!e.trim())]},children:[{tag:\"span\",attributes:{class:[\"ck\",\"ck-tooltip__text\"]},children:[{text:t.to(\"text\")}]}]})}}var Cw=n(32);class Aw extends Fb{constructor(e){super(e);const t=this.bindTemplate;const n=ns();this.set(\"class\");this.set(\"labelStyle\");this.set(\"icon\");this.set(\"isEnabled\",true);this.set(\"isOn\",false);this.set(\"isVisible\",true);this.set(\"isToggleable\",false);this.set(\"keystroke\");this.set(\"label\");this.set(\"tabindex\",-1);this.set(\"tooltip\");this.set(\"tooltipPosition\",\"s\");this.set(\"type\",\"button\");this.set(\"withText\",false);this.set(\"withKeystroke\",false);this.children=this.createCollection();this.tooltipView=this._createTooltipView();this.labelView=this._createLabelView(n);this.iconView=new vw;this.iconView.extendTemplate({attributes:{class:\"ck-button__icon\"}});this.keystrokeView=this._createKeystrokeView();this.bind(\"_tooltipString\").to(this,\"tooltip\",this,\"label\",this,\"keystroke\",this._getTooltipString.bind(this));this.setTemplate({tag:\"button\",attributes:{class:[\"ck\",\"ck-button\",t.to(\"class\"),t.if(\"isEnabled\",\"ck-disabled\",e=>!e),t.if(\"isVisible\",\"ck-hidden\",e=>!e),t.to(\"isOn\",e=>e?\"ck-on\":\"ck-off\"),t.if(\"withText\",\"ck-button_with-text\"),t.if(\"withKeystroke\",\"ck-button_with-keystroke\")],type:t.to(\"type\",e=>e?e:\"button\"),tabindex:t.to(\"tabindex\"),\"aria-labelledby\":`ck-editor__aria-label_${n}`,\"aria-disabled\":t.if(\"isEnabled\",true,e=>!e),\"aria-pressed\":t.to(\"isOn\",e=>this.isToggleable?String(e):false)},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{if(this.isEnabled){this.fire(\"execute\")}else{e.preventDefault()}})}})}render(){super.render();if(this.icon){this.iconView.bind(\"content\").to(this,\"icon\");this.children.add(this.iconView)}this.children.add(this.tooltipView);this.children.add(this.labelView);if(this.withKeystroke){this.children.add(this.keystrokeView)}}focus(){this.element.focus()}_createTooltipView(){const e=new xw;e.bind(\"text\").to(this,\"_tooltipString\");e.bind(\"position\").to(this,\"tooltipPosition\");return e}_createLabelView(e){const t=new Fb;const n=this.bindTemplate;t.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__label\"],style:n.to(\"labelStyle\"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to(\"label\")}]});return t}_createKeystrokeView(){const e=new Fb;e.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__keystroke\"]},children:[{text:this.bindTemplate.to(\"keystroke\",e=>Bl(e))}]});return e}_getTooltipString(e,t,n){if(e){if(typeof e==\"string\"){return e}else{if(n){n=Bl(n)}if(e instanceof Function){return e(t,n)}else{return`${t}${n?` (${n})`:\"\"}`}}}return\"\"}}var Tw='';class Pw extends Aw{constructor(e){super(e);this.arrowView=this._createArrowView();this.extendTemplate({attributes:{\"aria-haspopup\":true}});this.delegate(\"execute\").to(this,\"open\")}render(){super.render();this.children.add(this.arrowView)}_createArrowView(){const e=new vw;e.content=Tw;e.extendTemplate({attributes:{class:\"ck-dropdown__arrow\"}});return e}}var Sw=n(34);class Ew extends Fb{constructor(){super();this.items=this.createCollection();this.focusTracker=new Gp;this.keystrokes=new Mp;this._focusCycler=new nw({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 e of this.items){this.focusTracker.add(e.element)}this.items.on(\"add\",(e,t)=>{this.focusTracker.add(t.element)});this.items.on(\"remove\",(e,t)=>{this.focusTracker.remove(t.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Rw extends Fb{constructor(e){super(e);this.children=this.createCollection();this.setTemplate({tag:\"li\",attributes:{class:[\"ck\",\"ck-list__item\"]},children:this.children})}focus(){this.children.first.focus()}}class Iw extends Fb{constructor(e){super(e);this.setTemplate({tag:\"li\",attributes:{class:[\"ck\",\"ck-list__separator\"]}})}}var Ow=n(36);class Vw extends Aw{constructor(e){super(e);this.isToggleable=true;this.toggleSwitchView=this._createToggleView();this.extendTemplate({attributes:{class:\"ck-switchbutton\"}})}render(){super.render();this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Fb;e.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__toggle\"]},children:[{tag:\"span\",attributes:{class:[\"ck\",\"ck-button__toggle__inner\"]}}]});return e}}function Mw({emitter:e,activator:t,callback:n,contextElements:o}){e.listenTo(document,\"mousedown\",(e,{target:i})=>{if(!t()){return}for(const e of o){if(e.contains(i)){return}}n()})}var Nw=n(38);var zw=n(40);function Bw(e,t=Pw){const n=new t(e);const o=new lw(e);const i=new kw(e,n,o);n.bind(\"isEnabled\").to(i);if(n instanceof Pw){n.bind(\"isOn\").to(i,\"isOpen\")}else{n.arrowView.bind(\"isOn\").to(i,\"isOpen\")}Lw(i);return i}function Dw(e,t){const n=e.locale;const o=n.t;const i=e.toolbarView=new Uw(n);i.set(\"ariaLabel\",o(\"Dropdown toolbar\"));e.extendTemplate({attributes:{class:[\"ck-toolbar-dropdown\"]}});t.map(e=>i.items.add(e));e.panelView.children.add(i);i.items.delegate(\"execute\").to(e)}function Fw(e,t){const n=e.locale;const o=e.listView=new Ew(n);o.items.bindTo(t).using(({type:e,model:t})=>{if(e===\"separator\"){return new Iw(n)}else if(e===\"button\"||e===\"switchbutton\"){const o=new Rw(n);let i;if(e===\"button\"){i=new Aw(n)}else{i=new Vw(n)}i.bind(...Object.keys(t)).to(t);i.delegate(\"execute\").to(o);o.children.add(i);return o}});e.panelView.children.add(o);o.items.delegate(\"execute\").to(e)}function Lw(e){Hw(e);jw(e);qw(e)}function Hw(e){e.on(\"render\",()=>{Mw({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=false},contextElements:[e.element]})})}function jw(e){e.on(\"execute\",t=>{if(t.source instanceof Vw){return}e.isOpen=false})}function qw(e){e.keystrokes.set(\"arrowdown\",(t,n)=>{if(e.isOpen){e.panelView.focus();n()}});e.keystrokes.set(\"arrowup\",(t,n)=>{if(e.isOpen){e.panelView.focusLast();n()}})}var Ww='';var $w=n(42);class Uw extends Fb{constructor(e,t){super(e);const n=this.bindTemplate;const o=this.t;this.options=t||{};this.set(\"ariaLabel\",o(\"Editor toolbar\"));this.set(\"maxWidth\",\"auto\");this.items=this.createCollection();this.focusTracker=new Gp;this.keystrokes=new Mp;this.set(\"class\");this.set(\"isCompact\",false);this.itemsView=new Gw(e);this.children=this.createCollection();this.children.add(this.itemsView);this.focusables=this.createCollection();this._focusCycler=new nw({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[\"arrowleft\",\"arrowup\"],focusNext:[\"arrowright\",\"arrowdown\"]}});this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-toolbar\",n.to(\"class\"),n.if(\"isCompact\",\"ck-toolbar_compact\")],role:\"toolbar\",\"aria-label\":n.to(\"ariaLabel\"),style:{maxWidth:n.to(\"maxWidth\")}},children:this.children,on:{mousedown:cw(this)}});this._behavior=this.options.shouldGroupWhenFull?new Jw(this):new Kw(this)}render(){super.render();for(const e of this.items){this.focusTracker.add(e.element)}this.items.on(\"add\",(e,t)=>{this.focusTracker.add(t.element)});this.items.on(\"remove\",(e,t)=>{this.focusTracker.remove(t.element)});this.keystrokes.listenTo(this.element);this._behavior.render(this)}destroy(){this._behavior.destroy();return super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){this.items.addMany(e.map(e=>{if(e==\"|\"){return new iw}else if(t.has(e)){return t.create(e)}else{console.warn(Object(ss[\"a\"])(\"toolbarview-item-unavailable: The requested toolbar item is unavailable.\"),{name:e})}}).filter(e=>e!==undefined))}}class Gw extends Fb{constructor(e){super(e);this.children=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-toolbar__items\"]},children:this.children})}}class Kw{constructor(e){const t=e.bindTemplate;e.set(\"isVertical\",false);e.itemsView.children.bindTo(e.items).using(e=>e);e.focusables.bindTo(e.items).using(e=>e);e.extendTemplate({attributes:{class:[t.if(\"isVertical\",\"ck-toolbar_vertical\")]}})}render(){}destroy(){}}class Jw{constructor(e){this.viewChildren=e.children;this.viewFocusables=e.focusables;this.viewItemsView=e.itemsView;this.viewFocusTracker=e.focusTracker;this.viewLocale=e.locale;this.ungroupedItems=e.createCollection();this.groupedItems=e.createCollection();this.groupedItemsDropdown=this._createGroupedItemsDropdown();this.resizeObserver=null;this.cachedPadding=null;this.shouldUpdateGroupingOnNextResize=false;e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e);this.ungroupedItems.on(\"add\",this._updateFocusCycleableItems.bind(this));this.ungroupedItems.on(\"remove\",this._updateFocusCycleableItems.bind(this));e.children.on(\"add\",this._updateFocusCycleableItems.bind(this));e.children.on(\"remove\",this._updateFocusCycleableItems.bind(this));e.items.on(\"change\",(e,t)=>{const n=t.index;for(const e of t.removed){if(n>=this.ungroupedItems.length){this.groupedItems.remove(e)}else{this.ungroupedItems.remove(e)}}for(let e=n;ethis.ungroupedItems.length){this.groupedItems.add(o,e-this.ungroupedItems.length)}else{this.ungroupedItems.add(o,e)}}this._updateGrouping()});e.extendTemplate({attributes:{class:[\"ck-toolbar_grouping\"]}})}render(e){this.viewElement=e.element;this._enableGroupingOnResize();this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy();this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement)){return}if(!this.viewElement.offsetParent){this.shouldUpdateGroupingOnNextResize=true;return}let e;while(this._areItemsOverflowing){this._groupLastItem();e=true}if(!e&&this.groupedItems.length){while(this.groupedItems.length&&!this._areItemsOverflowing){this._ungroupFirstItem()}if(this._areItemsOverflowing){this._groupLastItem()}}}get _areItemsOverflowing(){if(!this.ungroupedItems.length){return false}const e=this.viewElement;const t=this.viewLocale.uiLanguageDirection;const n=new Th(e.lastChild);const o=new Th(e);if(!this.cachedPadding){const n=Bd.window.getComputedStyle(e);const o=t===\"ltr\"?\"paddingRight\":\"paddingLeft\";this.cachedPadding=Number.parseInt(n[o])}if(t===\"ltr\"){return n.right>o.right-this.cachedPadding}else{return n.left{if(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize){this.shouldUpdateGroupingOnNextResize=false;this._updateGrouping();e=t.contentRect.width}});this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on(\"change:maxWidth\",()=>{this._updateGrouping()})}_groupLastItem(){if(!this.groupedItems.length){this.viewChildren.add(new iw);this.viewChildren.add(this.groupedItemsDropdown);this.viewFocusTracker.add(this.groupedItemsDropdown.element)}this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first));if(!this.groupedItems.length){this.viewChildren.remove(this.groupedItemsDropdown);this.viewChildren.remove(this.viewChildren.last);this.viewFocusTracker.remove(this.groupedItemsDropdown.element)}}_createGroupedItemsDropdown(){const e=this.viewLocale;const t=e.t;const n=Bw(e);n.class=\"ck-toolbar__grouped-dropdown\";n.panelPosition=e.uiLanguageDirection===\"ltr\"?\"sw\":\"se\";Dw(n,[]);n.buttonView.set({label:t(\"Show more items\"),tooltip:true,icon:Ww});n.toolbarView.items.bindTo(this.groupedItems).using(e=>e);return n}_updateFocusCycleableItems(){this.viewFocusables.clear();this.ungroupedItems.map(e=>{this.viewFocusables.add(e)});if(this.groupedItems.length){this.viewFocusables.add(this.groupedItemsDropdown)}}}var Yw=n(44);class Qw extends Jb{constructor(e,t,n={}){super(e);this.stickyPanel=new tw(e);this.toolbar=new Uw(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull});this.editable=new Qb(e,t)}render(){super.render();this.stickyPanel.content.add(this.toolbar);this.top.add(this.stickyPanel);this.main.add(this.editable)}}function Xw(e){if(e instanceof HTMLTextAreaElement){return e.value}return e.innerHTML}class Zw extends zp{constructor(e,t){super(t);if(Kr(e)){this.sourceElement=e}this.data.processor=new Wp(this.data.viewDocument);this.model.document.createRoot();const n=!this.config.get(\"toolbar.shouldNotGroupWhenFull\");const o=new Qw(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new cb(this,o);jp(this)}destroy(){if(this.sourceElement){this.updateSourceElement()}this.ui.destroy();return super.destroy()}static create(e,t={}){return new Promise(n=>{const o=new this(e,t);n(o.initPlugins().then(()=>o.ui.init(Kr(e)?e:null)).then(()=>{if(!Kr(e)&&t.initialData){throw new ss[\"b\"](\"editor-create-initial-data: \"+\"The config.initialData option cannot be used together with initial data passed in Editor.create().\",null)}const n=t.initialData||ek(e);return o.data.init(n)}).then(()=>o.fire(\"ready\")).then(()=>o))})}}ys(Zw,Dp);ys(Zw,Hp);function ek(e){return Kr(e)?Xw(e):e}class tk{constructor(e){this.editor=e;this.set(\"isEnabled\",true);this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on(\"set:isEnabled\",nk,{priority:\"highest\"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off(\"set:isEnabled\",nk);this.isEnabled=true}}destroy(){this.stopListening()}static get isContextPlugin(){return false}}ys(tk,Yc);function nk(e){e.return=false;e.stop()}class ok{constructor(e){this.editor=e;this.set(\"value\",undefined);this.set(\"isEnabled\",false);this._disableStack=new Set;this.decorate(\"execute\");this.listenTo(this.editor.model.document,\"change\",()=>{this.refresh()});this.on(\"execute\",e=>{if(!this.isEnabled){e.stop()}},{priority:\"high\"});this.listenTo(e,\"change:isReadOnly\",(e,t,n)=>{if(n){this.forceDisabled(\"readOnlyMode\")}else{this.clearForceDisabled(\"readOnlyMode\")}})}refresh(){this.isEnabled=true}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on(\"set:isEnabled\",ik,{priority:\"highest\"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off(\"set:isEnabled\",ik);this.refresh()}}execute(){}destroy(){this.stopListening()}}ys(ok,Yc);function ik(e){e.return=false;e.stop()}function rk(e){const t=e.next();if(t.done){return null}return t.value}const sk=[\"left\",\"right\",\"center\",\"justify\"];function ak(e){return sk.includes(e)}function ck(e,t){if(t.contentLanguageDirection==\"rtl\"){return e===\"right\"}else{return e===\"left\"}}const lk=\"alignment\";class dk extends ok{refresh(){const e=this.editor;const t=e.locale;const n=rk(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!n&&this._canBeAligned(n);if(this.isEnabled&&n.hasAttribute(\"alignment\")){this.value=n.getAttribute(\"alignment\")}else{this.value=t.contentLanguageDirection===\"rtl\"?\"right\":\"left\"}}execute(e={}){const t=this.editor;const n=t.locale;const o=t.model;const i=o.document;const r=e.value;o.change(e=>{const t=Array.from(i.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e));const o=t[0].getAttribute(\"alignment\");const s=ck(r,n)||o===r||!r;if(s){uk(t,e)}else{hk(t,e,r)}})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,lk)}}function uk(e,t){for(const n of e){t.removeAttribute(lk,n)}}function hk(e,t,n){for(const o of e){t.setAttribute(lk,n,o)}}class fk extends tk{static get pluginName(){return\"AlignmentEditing\"}constructor(e){super(e);e.config.define(\"alignment\",{options:[...sk]})}init(){const e=this.editor;const t=e.locale;const n=e.model.schema;const o=e.config.get(\"alignment.options\").filter(ak);n.extend(\"$block\",{allowAttributes:\"alignment\"});e.model.schema.setAttributeProperties(\"alignment\",{isFormatting:true});const i=gk(o.filter(e=>!ck(e,t)));e.conversion.attributeToAttribute(i);e.commands.add(\"alignment\",new dk(e))}}function gk(e){const t={model:{key:\"alignment\",values:e.slice()},view:{}};for(const n of e){t.view[n]={key:\"style\",value:{\"text-align\":n}}}return t}var mk='';var pk='';var bk='';var wk='';const kk=new Map([[\"left\",mk],[\"right\",pk],[\"center\",bk],[\"justify\",wk]]);class _k extends tk{get localizedOptionTitles(){const e=this.editor.t;return{left:e(\"Align left\"),right:e(\"Align right\"),center:e(\"Align center\"),justify:e(\"Justify\")}}static get pluginName(){return\"AlignmentUI\"}init(){const e=this.editor;const t=e.ui.componentFactory;const n=e.t;const o=e.config.get(\"alignment.options\");o.filter(ak).forEach(e=>this._addButton(e));t.add(\"alignment\",e=>{const i=Bw(e);const r=o.map(e=>t.create(`alignment:${e}`));Dw(i,r);i.buttonView.set({label:n(\"Text alignment\"),tooltip:true});i.toolbarView.isVertical=true;i.toolbarView.ariaLabel=n(\"Text alignment toolbar\");i.extendTemplate({attributes:{class:\"ck-alignment-dropdown\"}});const s=e.contentLanguageDirection===\"rtl\"?pk:mk;i.buttonView.bind(\"icon\").toMany(r,\"isOn\",(...e)=>{const t=e.findIndex(e=>e);if(t<0){return s}return r[t].icon});i.bind(\"isEnabled\").toMany(r,\"isEnabled\",(...e)=>e.some(e=>e));return i})}_addButton(e){const t=this.editor;t.ui.componentFactory.add(`alignment:${e}`,n=>{const o=t.commands.get(\"alignment\");const i=new Aw(n);i.set({label:this.localizedOptionTitles[e],icon:kk.get(e),tooltip:true,isToggleable:true});i.bind(\"isEnabled\").to(o);i.bind(\"isOn\").to(o,\"value\",t=>t===e);this.listenTo(i,\"execute\",()=>{t.execute(\"alignment\",{value:e});t.editing.view.focus()});return i})}}class vk extends tk{static get requires(){return[fk,_k]}static get pluginName(){return\"Alignment\"}}function yk(e,t,n,o){let i;let r=null;if(typeof o==\"function\"){i=o}else{r=e.commands.get(o);i=()=>{e.execute(o)}}e.model.document.on(\"change:data\",(o,s)=>{if(r&&!r.isEnabled||!t.isEnabled){return}const a=rk(e.model.document.selection.getRanges());if(!a.isCollapsed){return}if(s.type==\"transparent\"){return}const c=Array.from(e.model.document.differ.getChanges());const l=c[0];if(c.length!=1||l.type!==\"insert\"||l.name!=\"$text\"||l.length!=1){return}const d=l.position.parent;if(d.is(\"element\",\"codeBlock\")){return}if(r&&r.value===true){return}const u=d.getChild(0);const h=e.model.createRangeOn(u);if(!h.containsRange(a)&&!a.end.isEqual(h.end)){return}const f=n.exec(u.data.substr(0,a.end.offset));if(!f){return}e.model.enqueueChange(e=>{const t=e.createPositionAt(d,0);const n=e.createPositionAt(d,f[0].length);const o=new ff(t,n);const r=i({match:f});if(r!==false){e.remove(o)}o.detach()})})}function xk(e,t,n,o){let i;let r;if(n instanceof RegExp){i=n}else{r=n}r=r||(e=>{let t;const n=[];const o=[];while((t=i.exec(e))!==null){if(t&&t.length<4){break}let{index:e,1:i,2:r,3:s}=t;const a=i+r+s;e+=t[0].length-a.length;const c=[e,e+i.length];const l=[e+i.length+r.length,e+i.length+r.length+s.length];n.push(c);n.push(l);o.push([e+i.length,e+i.length+r.length])}return{remove:n,format:o}});e.model.document.on(\"change:data\",(n,i)=>{if(i.type==\"transparent\"||!t.isEnabled){return}const s=e.model;const a=s.document.selection;if(!a.isCollapsed){return}const c=Array.from(s.document.differ.getChanges());const l=c[0];if(c.length!=1||l.type!==\"insert\"||l.name!=\"$text\"||l.length!=1){return}const d=a.focus;const u=d.parent;const{text:h,range:f}=Ak(s.createRange(s.createPositionAt(u,0),d),s);const g=r(h);const m=Ck(f.start,g.format,s);const p=Ck(f.start,g.remove,s);if(!(m.length&&p.length)){return}s.enqueueChange(e=>{const t=o(e,m);if(t===false){return}for(const t of p.reverse()){e.remove(t)}})})}function Ck(e,t,n){return t.filter(e=>e[0]!==undefined&&e[1]!==undefined).map(t=>n.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1])))}function Ak(e,t){let n=e.start;const o=Array.from(e.getItems()).reduce((e,o)=>{if(!(o.is(\"$text\")||o.is(\"$textProxy\"))||o.getAttribute(\"code\")){n=t.createPositionAfter(o);return\"\"}return e+o.data},\"\");return{text:o,range:t.createRange(n,e.end)}}class Tk extends tk{static get pluginName(){return\"Autoformat\"}afterInit(){this._addListAutoformats();this._addBasicStylesAutoformats();this._addHeadingAutoformats();this._addBlockQuoteAutoformats();this._addCodeBlockAutoformats()}_addListAutoformats(){const e=this.editor.commands;if(e.get(\"bulletedList\")){yk(this.editor,this,/^[*-]\\s$/,\"bulletedList\")}if(e.get(\"numberedList\")){yk(this.editor,this,/^1[.|)]\\s$/,\"numberedList\")}}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get(\"bold\")){const e=Pk(this.editor,\"bold\");xk(this.editor,this,/(\\*\\*)([^*]+)(\\*\\*)$/g,e);xk(this.editor,this,/(__)([^_]+)(__)$/g,e)}if(e.get(\"italic\")){const e=Pk(this.editor,\"italic\");xk(this.editor,this,/(?:^|[^*])(\\*)([^*_]+)(\\*)$/g,e);xk(this.editor,this,/(?:^|[^_])(_)([^_]+)(_)$/g,e)}if(e.get(\"code\")){const e=Pk(this.editor,\"code\");xk(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(e.get(\"strikethrough\")){const e=Pk(this.editor,\"strikethrough\");xk(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get(\"heading\");if(e){e.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(t=>{const n=t[7];const o=new RegExp(`^(#{${n}})\\\\s$`);yk(this.editor,this,o,()=>{if(!e.isEnabled||e.value===t){return false}this.editor.execute(\"heading\",{value:t})})})}}_addBlockQuoteAutoformats(){if(this.editor.commands.get(\"blockQuote\")){yk(this.editor,this,/^>\\s$/,\"blockQuote\")}}_addCodeBlockAutoformats(){if(this.editor.commands.get(\"codeBlock\")){yk(this.editor,this,/^```$/,\"codeBlock\")}}}function Pk(e,t){return(n,o)=>{const i=e.commands.get(t);if(!i.isEnabled){return false}const r=e.model.schema.getValidRanges(o,t);for(const e of r){n.setAttribute(t,true,e)}n.removeSelectionAttribute(t)}}function Sk(e,t){let n=e.start;const o=Array.from(e.getItems()).reduce((e,o)=>{if(!(o.is(\"$text\")||o.is(\"$textProxy\"))){n=t.createPositionAfter(o);return\"\"}return e+o.data},\"\");return{text:o,range:t.createRange(n,e.end)}}class Ek{constructor(e,t){this.model=e;this.testCallback=t;this.hasMatch=false;this.set(\"isEnabled\",true);this.on(\"change:isEnabled\",()=>{if(this.isEnabled){this._startListening()}else{this.stopListening(e.document.selection);this.stopListening(e.document)}});this._startListening()}_startListening(){const e=this.model;const t=e.document;this.listenTo(t.selection,\"change:range\",(e,{directChange:n})=>{if(!n){return}if(!t.selection.isCollapsed){if(this.hasMatch){this.fire(\"unmatched\");this.hasMatch=false}return}this._evaluateTextBeforeSelection(\"selection\")});this.listenTo(t,\"change:data\",(e,t)=>{if(t.type==\"transparent\"){return}this._evaluateTextBeforeSelection(\"data\",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model;const o=n.document;const i=o.selection;const r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus);const{text:s,range:a}=Sk(r,n);const c=this.testCallback(s);if(!c&&this.hasMatch){this.fire(\"unmatched\")}this.hasMatch=!!c;if(c){const n=Object.assign(t,{text:s,range:a});if(typeof c==\"object\"){Object.assign(n,c)}this.fire(`matched:${e}`,n)}}}ys(Ek,Yc);const Rk=4;const Ik=new RegExp(\"(^|\\\\s)\"+\"(\"+\"(\"+\"(?:(?:(?:https?|ftp):)?\\\\/\\\\/)\"+\"(?:\\\\S+(?::\\\\S*)?@)?\"+\"(?:\"+\"(?![-_])(?:[-\\\\w\\\\u00a1-\\\\uffff]{0,63}[^-_]\\\\.)+\"+\"(?:[a-z\\\\u00a1-\\\\uffff]{2,})\"+\")\"+\"(?::\\\\d{2,5})?\"+\"(?:[/?#]\\\\S*)?\"+\")\"+\"|\"+\"(\"+\"(www.|(\\\\S+@))\"+\"((?![-_])(?:[-\\\\w\\\\u00a1-\\\\uffff]{0,63}[^-_]\\\\.))+\"+\"(?:[a-z\\\\u00a1-\\\\uffff]{2,})\"+\")\"+\")$\",\"i\");const Ok=2;const Vk=/^[\\S]+@((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})$/i;class Mk extends tk{static get pluginName(){return\"AutoLink\"}init(){const e=this.editor;const t=e.model.document.selection;t.on(\"change:range\",()=>{this.isEnabled=!t.anchor.parent.is(\"element\",\"codeBlock\")});this._enableTypingHandling()}afterInit(){this._enableEnterHandling();this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor;const t=new Ek(e.model,e=>{if(!Nk(e)){return}const t=zk(e.substr(0,e.length-1));if(t){return{url:t}}});const n=e.plugins.get(\"Input\");t.on(\"matched:data\",(t,o)=>{const{batch:i,range:r,url:s}=o;if(!n.isInput(i)){return}const a=r.end.getShiftedBy(-1);const c=a.getShiftedBy(-s.length);const l=e.model.createRange(c,a);this._applyAutoLink(s,l)});t.bind(\"isEnabled\").to(this)}_enableEnterHandling(){const e=this.editor;const t=e.model;const n=e.commands.get(\"enter\");if(!n){return}n.on(\"execute\",()=>{const e=t.document.selection.getFirstPosition();const n=t.createRange(t.createPositionAt(e.parent.previousSibling,0),t.createPositionAt(e.parent.previousSibling,\"end\"));this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){const e=this.editor;const t=e.model;const n=e.commands.get(\"shiftEnter\");if(!n){return}n.on(\"execute\",()=>{const e=t.document.selection.getFirstPosition();const n=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model;const{text:n,range:o}=Sk(e,t);const i=zk(n);if(i){const e=t.createRange(o.end.getShiftedBy(-i.length),o.end);this._applyAutoLink(i,e)}}_applyAutoLink(e,t){const n=this.editor.model;if(!this.isEnabled||!Dk(t,n)){return}n.enqueueChange(n=>{const o=Bk(e)?`mailto:${e}`:e;n.setAttribute(\"linkHref\",o,t)})}}function Nk(e){return e.length>Rk&&e[e.length-1]===\" \"&&e[e.length-2]!==\" \"}function zk(e){const t=Ik.exec(e);return t?t[Ok]:null}function Bk(e){return Vk.exec(e)}function Dk(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),\"linkHref\")}class Fk extends ok{refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model;const n=t.schema;const o=t.document.selection;const i=Array.from(o.getSelectedBlocks());const r=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(!r){this._removeQuote(e,i.filter(Lk))}else{const t=i.filter(e=>Lk(e)||jk(n,e));this._applyQuote(e,t)}})}_getValue(){const e=this.editor.model.document.selection;const t=rk(e.getSelectedBlocks());return!!(t&&Lk(t))}_checkEnabled(){if(this.value){return true}const e=this.editor.model.document.selection;const t=this.editor.model.schema;const n=rk(e.getSelectedBlocks());if(!n){return false}return jk(t,n)}_removeQuote(e,t){Hk(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd){e.unwrap(t.start.parent);return}if(t.start.isAtStart){const n=e.createPositionBefore(t.start.parent);e.move(t,n);return}if(!t.end.isAtEnd){e.split(t.end)}const n=e.createPositionAfter(t.end.parent);e.move(t,n)})}_applyQuote(e,t){const n=[];Hk(e,t).reverse().forEach(t=>{let o=Lk(t.start);if(!o){o=e.createElement(\"blockQuote\");e.wrap(t,o)}n.push(o)});n.reverse().reduce((t,n)=>{if(t.nextSibling==n){e.merge(e.createPositionAfter(t));return t}return n})}}function Lk(e){return e.parent.name==\"blockQuote\"?e.parent:null}function Hk(e,t){let n;let o=0;const i=[];while(o{if(e.endsWith(\"blockQuote\")&&t.name==\"blockQuote\"){return false}});e.conversion.elementToElement({model:\"blockQuote\",view:\"blockquote\"});e.model.document.registerPostFixer(n=>{const o=e.model.document.differ.getChanges();for(const e of o){if(e.type==\"insert\"){const o=e.position.nodeAfter;if(!o){continue}if(o.is(\"element\",\"blockQuote\")&&o.isEmpty){n.remove(o);return true}else if(o.is(\"element\",\"blockQuote\")&&!t.checkChild(e.position,o)){n.unwrap(o);return true}else if(o.is(\"element\")){const e=n.createRangeIn(o);for(const o of e.getItems()){if(o.is(\"element\",\"blockQuote\")&&!t.checkChild(n.createPositionBefore(o),o)){n.unwrap(o);return true}}}}else if(e.type==\"remove\"){const t=e.position.parent;if(t.is(\"element\",\"blockQuote\")&&t.isEmpty){n.remove(t);return true}}}return false})}afterInit(){const e=this.editor;const t=e.commands.get(\"blockQuote\");this.listenTo(this.editor.editing.view.document,\"enter\",(e,n)=>{const o=this.editor.model.document;const i=o.selection.getLastPosition().parent;if(o.selection.isCollapsed&&i.isEmpty&&t.value){this.editor.execute(\"blockQuote\");this.editor.editing.view.scrollToTheSelection();n.preventDefault();e.stop()}})}}var Wk='';var $k=n(46);class Uk extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"blockQuote\",n=>{const o=e.commands.get(\"blockQuote\");const i=new Aw(n);i.set({label:t(\"Block quote\"),icon:Wk,tooltip:true,isToggleable:true});i.bind(\"isOn\",\"isEnabled\").to(o,\"value\",\"isEnabled\");this.listenTo(i,\"execute\",()=>{e.execute(\"blockQuote\");e.editing.view.focus()});return i})}}class Gk extends tk{static get requires(){return[qk,Uk]}static get pluginName(){return\"BlockQuote\"}}class Kk extends ok{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const t=e.document;this.value=this._getValueFromFirstAllowedNode();this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model;const n=t.document;const o=n.selection;const i=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(o.isCollapsed){if(i){e.setSelectionAttribute(this.attributeKey,true)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const n=t.schema.getValidRanges(o.getRanges(),this.attributeKey);for(const t of n){if(i){e.setAttribute(this.attributeKey,i,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}_getValueFromFirstAllowedNode(){const e=this.editor.model;const t=e.schema;const n=e.document.selection;if(n.isCollapsed){return n.hasAttribute(this.attributeKey)}for(const e of n.getRanges()){for(const n of e.getItems()){if(t.checkAttribute(n,this.attributeKey)){return n.hasAttribute(this.attributeKey)}}}return false}}const Jk=\"bold\";class Yk extends tk{static get pluginName(){return\"BoldEditing\"}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:Jk});e.model.schema.setAttributeProperties(Jk,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:Jk,view:\"strong\",upcastAlso:[\"b\",e=>{const t=e.getStyle(\"font-weight\");if(!t){return null}if(t==\"bold\"||Number(t)>=600){return{name:true,styles:[\"font-weight\"]}}}]});e.commands.add(Jk,new Kk(e,Jk));e.keystrokes.set(\"CTRL+B\",Jk)}}var Qk='';const Xk=\"bold\";class Zk extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(Xk,n=>{const o=e.commands.get(Xk);const i=new Aw(n);i.set({label:t(\"Bold\"),icon:Qk,keystroke:\"CTRL+B\",tooltip:true,isToggleable:true});i.bind(\"isOn\",\"isEnabled\").to(o,\"value\",\"isEnabled\");this.listenTo(i,\"execute\",()=>{e.execute(Xk);e.editing.view.focus()});return i})}}class e_ extends tk{static get requires(){return[Yk,Zk]}static get pluginName(){return\"Bold\"}}var t_='';class n_ extends tk{static get pluginName(){return\"CKFinderUI\"}init(){const e=this.editor;const t=e.ui.componentFactory;const n=e.t;t.add(\"ckfinder\",t=>{const o=e.commands.get(\"ckfinder\");const i=new Aw(t);i.set({label:n(\"Insert image or file\"),icon:t_,tooltip:true});i.bind(\"isEnabled\").to(o);i.on(\"execute\",()=>{e.execute(\"ckfinder\");e.editing.view.focus()});return i})}}class o_ extends Xd{observe(e){this.listenTo(e,\"load\",(e,t)=>{const n=t.target;if(n.tagName==\"IMG\"){this._fireEvents(t)}},{useCapture:true})}_fireEvents(e){if(this.isEnabled){this.document.fire(\"layoutChanged\");this.document.fire(\"imageLoaded\",e)}}}class i_{constructor(){this._stack=[]}add(e,t){const n=this._stack;const o=n[0];this._insertDescriptor(e);const i=n[0];if(o!==i&&!r_(o,i)){this.fire(\"change:top\",{oldDescriptor:o,newDescriptor:i,writer:t})}}remove(e,t){const n=this._stack;const o=n[0];this._removeDescriptor(e);const i=n[0];if(o!==i&&!r_(o,i)){this.fire(\"change:top\",{oldDescriptor:o,newDescriptor:i,writer:t})}}_insertDescriptor(e){const t=this._stack;const n=t.findIndex(t=>t.id===e.id);if(r_(e,t[n])){return}if(n>-1){t.splice(n,1)}let o=0;while(t[o]&&s_(t[o],e)){o++}t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack;const n=t.findIndex(t=>t.id===e);if(n>-1){t.splice(n,1)}}}ys(i_,ds);function r_(e,t){return e&&t&&e.priority==t.priority&&a_(e.classes)==a_(t.classes)}function s_(e,t){if(e.priority>t.priority){return true}else if(e.prioritya_(t.classes)}function a_(e){return Array.isArray(e)?e.sort().join(\",\"):e}var c_=n(48);const l_=Xb(\"px\");const d_=Bd.document.body;class u_ extends Fb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"top\",0);this.set(\"left\",0);this.set(\"position\",\"arrow_nw\");this.set(\"isVisible\",false);this.set(\"withArrow\",true);this.set(\"class\");this.content=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-balloon-panel\",t.to(\"position\",e=>`ck-balloon-panel_${e}`),t.if(\"isVisible\",\"ck-balloon-panel_visible\"),t.if(\"withArrow\",\"ck-balloon-panel_with-arrow\"),t.to(\"class\")],style:{top:t.to(\"top\",l_),left:t.to(\"left\",l_)}},children:this.content})}show(){this.isVisible=true}hide(){this.isVisible=false}attachTo(e){this.show();const t=u_.defaultPositions;const n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast],limiter:d_,fitInViewport:true},e);const o=u_._getOptimalPosition(n);const i=parseInt(o.left);const r=parseInt(o.top);const s=o.name;Object.assign(this,{top:r,left:i,position:s})}pin(e){this.unpin();this._pinWhenIsVisibleCallback=()=>{if(this.isVisible){this._startPinning(e)}else{this._stopPinning()}};this._startPinning(e);this.listenTo(this,\"change:isVisible\",this._pinWhenIsVisibleCallback)}unpin(){if(this._pinWhenIsVisibleCallback){this._stopPinning();this.stopListening(this,\"change:isVisible\",this._pinWhenIsVisibleCallback);this._pinWhenIsVisibleCallback=null;this.hide()}}_startPinning(e){this.attachTo(e);const t=h_(e.target);const n=e.limiter?h_(e.limiter):d_;this.listenTo(Bd.document,\"scroll\",(o,i)=>{const r=i.target;const s=t&&r.contains(t);const a=n&&r.contains(n);if(s||a||!t||!n){this.attachTo(e)}},{useCapture:true});this.listenTo(Bd.window,\"resize\",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Bd.document,\"scroll\");this.stopListening(Bd.window,\"resize\")}}function h_(e){if(Kr(e)){return e}if(xh(e)){return e.commonAncestorContainer}if(typeof e==\"function\"){return h_(e())}return null}u_.arrowHorizontalOffset=25;u_.arrowVerticalOffset=10;u_._getOptimalPosition=hw;u_.defaultPositions={northWestArrowSouthWest:(e,t)=>({top:f_(e,t),left:e.left-u_.arrowHorizontalOffset,name:\"arrow_sw\"}),northWestArrowSouthMiddleWest:(e,t)=>({top:f_(e,t),left:e.left-t.width*.25-u_.arrowHorizontalOffset,name:\"arrow_smw\"}),northWestArrowSouth:(e,t)=>({top:f_(e,t),left:e.left-t.width/2,name:\"arrow_s\"}),northWestArrowSouthMiddleEast:(e,t)=>({top:f_(e,t),left:e.left-t.width*.75+u_.arrowHorizontalOffset,name:\"arrow_sme\"}),northWestArrowSouthEast:(e,t)=>({top:f_(e,t),left:e.left-t.width+u_.arrowHorizontalOffset,name:\"arrow_se\"}),northArrowSouthWest:(e,t)=>({top:f_(e,t),left:e.left+e.width/2-u_.arrowHorizontalOffset,name:\"arrow_sw\"}),northArrowSouthMiddleWest:(e,t)=>({top:f_(e,t),left:e.left+e.width/2-t.width*.25-u_.arrowHorizontalOffset,name:\"arrow_smw\"}),northArrowSouth:(e,t)=>({top:f_(e,t),left:e.left+e.width/2-t.width/2,name:\"arrow_s\"}),northArrowSouthMiddleEast:(e,t)=>({top:f_(e,t),left:e.left+e.width/2-t.width*.75+u_.arrowHorizontalOffset,name:\"arrow_sme\"}),northArrowSouthEast:(e,t)=>({top:f_(e,t),left:e.left+e.width/2-t.width+u_.arrowHorizontalOffset,name:\"arrow_se\"}),northEastArrowSouthWest:(e,t)=>({top:f_(e,t),left:e.right-u_.arrowHorizontalOffset,name:\"arrow_sw\"}),northEastArrowSouthMiddleWest:(e,t)=>({top:f_(e,t),left:e.right-t.width*.25-u_.arrowHorizontalOffset,name:\"arrow_smw\"}),northEastArrowSouth:(e,t)=>({top:f_(e,t),left:e.right-t.width/2,name:\"arrow_s\"}),northEastArrowSouthMiddleEast:(e,t)=>({top:f_(e,t),left:e.right-t.width*.75+u_.arrowHorizontalOffset,name:\"arrow_sme\"}),northEastArrowSouthEast:(e,t)=>({top:f_(e,t),left:e.right-t.width+u_.arrowHorizontalOffset,name:\"arrow_se\"}),southWestArrowNorthWest:(e,t)=>({top:g_(e,t),left:e.left-u_.arrowHorizontalOffset,name:\"arrow_nw\"}),southWestArrowNorthMiddleWest:(e,t)=>({top:g_(e,t),left:e.left-t.width*.25-u_.arrowHorizontalOffset,name:\"arrow_nmw\"}),southWestArrowNorth:(e,t)=>({top:g_(e,t),left:e.left-t.width/2,name:\"arrow_n\"}),southWestArrowNorthMiddleEast:(e,t)=>({top:g_(e,t),left:e.left-t.width*.75+u_.arrowHorizontalOffset,name:\"arrow_nme\"}),southWestArrowNorthEast:(e,t)=>({top:g_(e,t),left:e.left-t.width+u_.arrowHorizontalOffset,name:\"arrow_ne\"}),southArrowNorthWest:(e,t)=>({top:g_(e,t),left:e.left+e.width/2-u_.arrowHorizontalOffset,name:\"arrow_nw\"}),southArrowNorthMiddleWest:(e,t)=>({top:g_(e,t),left:e.left+e.width/2-t.width*.25-u_.arrowHorizontalOffset,name:\"arrow_nmw\"}),southArrowNorth:(e,t)=>({top:g_(e,t),left:e.left+e.width/2-t.width/2,name:\"arrow_n\"}),southArrowNorthMiddleEast:(e,t)=>({top:g_(e,t),left:e.left+e.width/2-t.width*.75+u_.arrowHorizontalOffset,name:\"arrow_nme\"}),southArrowNorthEast:(e,t)=>({top:g_(e,t),left:e.left+e.width/2-t.width+u_.arrowHorizontalOffset,name:\"arrow_ne\"}),southEastArrowNorthWest:(e,t)=>({top:g_(e,t),left:e.right-u_.arrowHorizontalOffset,name:\"arrow_nw\"}),southEastArrowNorthMiddleWest:(e,t)=>({top:g_(e,t),left:e.right-t.width*.25-u_.arrowHorizontalOffset,name:\"arrow_nmw\"}),southEastArrowNorth:(e,t)=>({top:g_(e,t),left:e.right-t.width/2,name:\"arrow_n\"}),southEastArrowNorthMiddleEast:(e,t)=>({top:g_(e,t),left:e.right-t.width*.75+u_.arrowHorizontalOffset,name:\"arrow_nme\"}),southEastArrowNorthEast:(e,t)=>({top:g_(e,t),left:e.right-t.width+u_.arrowHorizontalOffset,name:\"arrow_ne\"})};function f_(e,t){return e.top-t.height-u_.arrowVerticalOffset}function g_(e){return e.bottom+u_.arrowVerticalOffset}var m_='';const p_=\"widget-type-around\";function b_(e,t,n){return e&&C_(e)&&!n.isInline(t)}function w_(e){return e.closest(\".ck-widget__type-around__button\")}function k_(e){return e.classList.contains(\"ck-widget__type-around__button_before\")?\"before\":\"after\"}function __(e,t){const n=e.closest(\".ck-widget\");return t.mapDomToView(n)}function v_(e){return e.getAttribute(p_)}const y_=\"ck-widget\";const x_=\"ck-widget_selected\";function C_(e){if(!e.is(\"element\")){return false}return!!e.getCustomProperty(\"widget\")}function A_(e,t,n={}){if(!e.is(\"containerElement\")){throw new ss[\"b\"](\"widget-to-widget-wrong-element-type: The element passed to toWidget() must be a container element instance.\",null,{element:e})}t.setAttribute(\"contenteditable\",\"false\",e);t.addClass(y_,e);t.setCustomProperty(\"widget\",true,e);e.getFillerOffset=V_;if(n.label){P_(e,n.label,t)}if(n.hasSelectionHandle){M_(e,t)}T_(e,t,(e,t,n)=>n.addClass(o(t.classes),e),(e,t,n)=>n.removeClass(o(t.classes),e));return e;function o(e){return Array.isArray(e)?e:[e]}}function T_(e,t,n,o){const i=new i_;i.on(\"change:top\",(t,i)=>{if(i.oldDescriptor){o(e,i.oldDescriptor,i.writer)}if(i.newDescriptor){n(e,i.newDescriptor,i.writer)}});t.setCustomProperty(\"addHighlight\",(e,t,n)=>i.add(t,n),e);t.setCustomProperty(\"removeHighlight\",(e,t,n)=>i.remove(t,n),e)}function P_(e,t,n){n.setCustomProperty(\"widgetLabel\",t,e)}function S_(e){const t=e.getCustomProperty(\"widgetLabel\");if(!t){return\"\"}return typeof t==\"function\"?t():t}function E_(e,t){t.addClass([\"ck-editor__editable\",\"ck-editor__nested-editable\"],e);t.setAttribute(\"contenteditable\",e.isReadOnly?\"false\":\"true\",e);e.on(\"change:isReadOnly\",(n,o,i)=>{t.setAttribute(\"contenteditable\",i?\"false\":\"true\",e)});e.on(\"change:isFocused\",(n,o,i)=>{if(i){t.addClass(\"ck-editor__nested-editable_focused\",e)}else{t.removeClass(\"ck-editor__nested-editable_focused\",e)}});return e}function R_(e,t){const n=e.getSelectedElement();if(n){const o=v_(e);if(o){return t.createPositionAt(n,o)}if(t.schema.isBlock(n)){return t.createPositionAfter(n)}}const o=e.getSelectedBlocks().next().value;if(o){if(o.isEmpty){return t.createPositionAt(o,0)}const n=t.createPositionAfter(o);if(e.focus.isTouching(n)){return n}return t.createPositionBefore(o)}return e.focus}function I_(e,t){return(n,o)=>{const{mapper:i,viewPosition:r}=o;const s=i.findMappedViewAncestor(r);if(!t(s)){return}const a=i.toModelElement(s);o.modelPosition=e.createPositionAt(a,r.isAtStart?\"before\":\"after\")}}function O_(e,t){const n=new Th(Bd.window);const o=n.getIntersection(e);const i=t.height+u_.arrowVerticalOffset;if(e.top-i>n.top||e.bottom+ie.is(\"element\",\"img\"))}function j_(e,t,n){const o=$_(e,n);return t.checkChild(o,\"image\")}function q_(e,t){const n=e.getSelectedElement();return n&&t.isObject(n)}function W_(e){return[...e.focus.getAncestors()].every(e=>!e.is(\"element\",\"image\"))}function $_(e,t){const n=R_(e,t);const o=n.parent;if(o.isEmpty&&!o.is(\"element\",\"$root\")){return o.parent}return o}function U_(){return t=>{t.on(\"element:figure\",e)};function e(e,t,n){if(!n.consumable.test(t.viewItem,{name:true,classes:\"image\"})){return}const o=H_(t.viewItem);if(!o||!o.hasAttribute(\"src\")||!n.consumable.test(o,{name:true})){return}const i=n.convertItem(o,t.modelCursor);const r=rk(i.modelRange.getItems());if(!r){return}n.convertChildren(t.viewItem,n.writer.createPositionAt(r,0));t.modelRange=i.modelRange;t.modelCursor=i.modelCursor}}function G_(){return t=>{t.on(\"attribute:srcset:image\",e)};function e(e,t,n){if(!n.consumable.consume(t.item,e.name)){return}const o=n.writer;const i=n.mapper.toViewElement(t.item);const r=H_(i);if(t.attributeNewValue===null){const e=t.attributeOldValue;if(e.data){o.removeAttribute(\"srcset\",r);o.removeAttribute(\"sizes\",r);if(e.width){o.removeAttribute(\"width\",r)}}}else{const e=t.attributeNewValue;if(e.data){o.setAttribute(\"srcset\",e.data,r);o.setAttribute(\"sizes\",\"100vw\",r);if(e.width){o.setAttribute(\"width\",e.width,r)}}}}}function K_(e){return n=>{n.on(`attribute:${e}:image`,t)};function t(e,t,n){if(!n.consumable.consume(t.item,e.name)){return}const o=n.writer;const i=n.mapper.toViewElement(t.item);const r=H_(i);o.setAttribute(t.attributeKey,t.attributeNewValue||\"\",r)}}class J_ extends ok{refresh(){this.isEnabled=L_(this.editor.model)}execute(e){const t=this.editor.model;t.change(n=>{const o=Array.isArray(e.source)?e.source:[e.source];for(const e of o){F_(n,t,{src:e})}})}}class Y_ extends tk{static get pluginName(){return\"ImageEditing\"}init(){const e=this.editor;const t=e.model.schema;const n=e.t;const o=e.conversion;e.editing.view.addObserver(o_);t.register(\"image\",{isObject:true,isBlock:true,allowWhere:\"$block\",allowAttributes:[\"alt\",\"src\",\"srcset\"]});o.for(\"dataDowncast\").elementToElement({model:\"image\",view:(e,t)=>Q_(t)});o.for(\"editingDowncast\").elementToElement({model:\"image\",view:(e,t)=>N_(Q_(t),t,n(\"image widget\"))});o.for(\"downcast\").add(K_(\"src\")).add(K_(\"alt\")).add(G_());o.for(\"upcast\").elementToElement({view:{name:\"img\",attributes:{src:true}},model:(e,t)=>t.createElement(\"image\",{src:e.getAttribute(\"src\")})}).attributeToAttribute({view:{name:\"img\",key:\"alt\"},model:\"alt\"}).attributeToAttribute({view:{name:\"img\",key:\"srcset\"},model:{key:\"srcset\",value:e=>{const t={data:e.getAttribute(\"srcset\")};if(e.hasAttribute(\"width\")){t.width=e.getAttribute(\"width\")}return t}}}).add(U_());e.commands.add(\"imageInsert\",new J_(e))}}function Q_(e){const t=e.createEmptyElement(\"img\");const n=e.createContainerElement(\"figure\",{class:\"image\"});e.insert(e.createPositionAt(n,0),t);return n}class X_ extends eh{constructor(e){super(e);this.domEventType=\"mousedown\"}onDomEvent(e){this.fire(e.type,e)}}class Z_ extends tk{static get pluginName(){return\"TwoStepCaretMovement\"}constructor(e){super(e);this.attributes=new Set;this._overrideUid=null}init(){const e=this.editor;const t=e.model;const n=e.editing.view;const o=e.locale;const i=t.document.selection;this.listenTo(n.document,\"keydown\",(e,t)=>{if(!i.isCollapsed){return}if(t.shiftKey||t.altKey||t.ctrlKey){return}const n=t.keyCode==Ml.arrowright;const r=t.keyCode==Ml.arrowleft;if(!n&&!r){return}const s=o.contentLanguageDirection;let a=false;if(s===\"ltr\"&&n||s===\"rtl\"&&r){a=this._handleForwardMovement(t)}else{a=this._handleBackwardMovement(t)}if(a===true){e.stop()}},{priority:is.get(\"high\")+1});this._isNextGravityRestorationSkipped=false;this.listenTo(i,\"change:range\",(e,t)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=false;return}if(!this._isGravityOverridden){return}if(!t.directChange&&iv(i.getFirstPosition(),this.attributes)){return}this._restoreGravity()})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes;const n=this.editor.model;const o=n.document.selection;const i=o.getFirstPosition();if(this._isGravityOverridden){return false}if(i.isAtStart&&ev(o,t)){return false}if(iv(i,t)){nv(e);this._overrideGravity();return true}}_handleBackwardMovement(e){const t=this.attributes;const n=this.editor.model;const o=n.document.selection;const i=o.getFirstPosition();if(this._isGravityOverridden){nv(e);this._restoreGravity();tv(n,t,i);return true}else{if(i.isAtStart){if(ev(o,t)){nv(e);tv(n,t,i);return true}return false}if(ov(i,t)){if(i.isAtEnd&&!ev(o,t)&&iv(i,t)){nv(e);tv(n,t,i);return true}this._isNextGravityRestorationSkipped=true;this._overrideGravity();return false}}}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid);this._overrideUid=null})}}function ev(e,t){for(const n of t){if(e.hasAttribute(n)){return true}}return false}function tv(e,t,n){const o=n.nodeBefore;e.change(e=>{if(o){e.setSelectionAttribute(o.getAttributes())}else{e.removeSelectionAttribute(t)}})}function nv(e){e.preventDefault()}function ov(e,t){const n=e.getShiftedBy(-1);return iv(n,t)}function iv(e,t){const{nodeBefore:n,nodeAfter:o}=e;for(const e of t){const t=n?n.getAttribute(e):undefined;const i=o?o.getAttribute(e):undefined;if(i!==t){return true}}return false}function rv(e,t,n,o){return o.createRange(sv(e,t,n,true,o),sv(e,t,n,false,o))}function sv(e,t,n,o,i){let r=e.textNode||(o?e.nodeBefore:e.nodeAfter);let s=null;while(r&&r.getAttribute(t)==n){s=r;r=o?r.previousSibling:r.nextSibling}return s?i.createPositionAt(s,o?\"before\":\"after\"):e}function av(e,t,n,o){const i=e.editing.view;const r=new Set;i.document.registerPostFixer(i=>{const s=e.model.document.selection;let a=false;if(s.hasAttribute(t)){const c=rv(s.getFirstPosition(),t,s.getAttribute(t),e.model);const l=e.editing.mapper.toViewRange(c);for(const e of l.getItems()){if(e.is(\"element\",n)&&!e.hasClass(o)){i.addClass(o,e);r.add(e);a=true}}}return a});e.conversion.for(\"editingDowncast\").add(e=>{e.on(\"insert\",t,{priority:\"highest\"});e.on(\"remove\",t,{priority:\"highest\"});e.on(\"attribute\",t,{priority:\"highest\"});e.on(\"selection\",t,{priority:\"highest\"});function t(){i.change(e=>{for(const t of r.values()){e.removeClass(o,t);r.delete(t)}})}})}class cv{constructor(e,t=20){this.model=e;this.size=0;this.limit=t;this.isLocked=false;this._changeCallback=(e,t)=>{if(t.type!=\"transparent\"&&t!==this._batch){this._reset(true)}};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(){if(!this._batch){this._batch=this.model.createBatch()}return this._batch}input(e){this.size+=e;if(this.size>=this.limit){this._reset(true)}}lock(){this.isLocked=true}unlock(){this.isLocked=false}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(e){if(!this.isLocked||e){this._batch=null;this.size=0}}}class lv extends ok{constructor(e,t){super(e);this._buffer=new cv(e.model,t);this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy();this._buffer.destroy()}execute(e={}){const t=this.editor.model;const n=t.document;const o=e.text||\"\";const i=o.length;const r=e.range?t.createSelection(e.range):n.selection;const s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock();this._batches.add(this._buffer.batch);t.deleteContent(r);if(o){t.insertContent(e.createText(o,n.selection.getAttributes()),r)}if(s){e.setSelection(s)}else if(!r.is(\"documentSelection\")){e.setSelection(r)}this._buffer.unlock();this._buffer.input(i)})}}function dv(e){let t=null;const n=e.model;const o=e.editing.view;const i=e.commands.get(\"input\");if(Tl.isAndroid){o.document.on(\"beforeinput\",(e,t)=>r(t),{priority:\"lowest\"})}else{o.document.on(\"keydown\",(e,t)=>r(t),{priority:\"lowest\"})}o.document.on(\"compositionstart\",s,{priority:\"lowest\"});o.document.on(\"compositionend\",()=>{t=n.createSelection(n.document.selection)},{priority:\"lowest\"});function r(e){const r=n.document;const s=o.document.isComposing;const c=t&&t.isEqual(r.selection);t=null;if(!i.isEnabled){return}if(hv(e)||r.selection.isCollapsed){return}if(s&&e.keyCode===229){return}if(!s&&e.keyCode===229&&c){return}a()}function s(){const e=n.document;const t=e.selection.rangeCount===1?e.selection.getFirstRange().isFlat:true;if(e.selection.isCollapsed||t){return}a()}function a(){const e=i.buffer;e.lock();const t=e.batch;i._batches.add(t);n.enqueueChange(t,()=>{n.deleteContent(n.document.selection)});e.unlock()}}const uv=[Nl(\"arrowUp\"),Nl(\"arrowRight\"),Nl(\"arrowDown\"),Nl(\"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 e=112;e<=135;e++){uv.push(e)}function hv(e){if(e.ctrlKey){return true}return uv.includes(e.keyCode)}function fv(e,t){const n=[];let o=0;let i;e.forEach(e=>{if(e==\"equal\"){r();o++}else if(e==\"insert\"){if(s(\"insert\")){i.values.push(t[o])}else{r();i={type:\"insert\",index:o,values:[t[o]]}}o++}else{if(s(\"delete\")){i.howMany++}else{r();i={type:\"delete\",index:o,howMany:1}}}});r();return n;function r(){if(i){n.push(i);i=null}}function s(e){return i&&i.type==e}}function gv(e){if(e.length==0){return false}for(const t of e){if(t.type===\"children\"&&!mv(t)){return true}}return false}function mv(e){if(e.newChildren.length-e.oldChildren.length!=1){return}const t=Ad(e.oldChildren,e.newChildren,pv);const n=fv(t,e.newChildren);if(n.length>1){return}const o=n[0];if(!(!!o.values[0]&&o.values[0].is(\"$text\"))){return}return o}function pv(e,t){if(!!e&&e.is(\"$text\")&&!!t&&t.is(\"$text\")){return e.data===t.data}else{return e===t}}function bv(e){e.editing.view.document.on(\"mutations\",(t,n,o)=>{new wv(e).handle(n,o)})}class wv{constructor(e){this.editor=e;this.editing=this.editor.editing}handle(e,t){if(gv(e)){this._handleContainerChildrenMutations(e,t)}else{for(const n of e){this._handleTextMutation(n,t);this._handleTextNodeInsertion(n)}}}_handleContainerChildrenMutations(e,t){const n=kv(e);if(!n){return}const o=this.editor.editing.view.domConverter;const i=o.mapViewToDom(n);const r=new jd(this.editor.editing.view.document);const s=this.editor.data.toModel(r.domToView(i)).getChild(0);const a=this.editor.editing.mapper.toModelElement(n);if(!a){return}const c=Array.from(s.getChildren());const l=Array.from(a.getChildren());const d=c[c.length-1];const u=l[l.length-1];const h=d&&d.is(\"element\",\"softBreak\");const f=u&&!u.is(\"element\",\"softBreak\");if(h&&f){c.pop()}const g=this.editor.model.schema;if(!_v(c,g)||!_v(l,g)){return}const m=c.map(e=>e.is(\"$text\")?e.data:\"@\").join(\"\").replace(/\\u00A0/g,\" \");const p=l.map(e=>e.is(\"$text\")?e.data:\"@\").join(\"\").replace(/\\u00A0/g,\" \");if(p===m){return}const b=Ad(p,m);const{firstChangeAt:w,insertions:k,deletions:_}=vv(b);let v=null;if(t){v=this.editing.mapper.toModelRange(t.getFirstRange())}const y=m.substr(w,k);const x=this.editor.model.createRange(this.editor.model.createPositionAt(a,w),this.editor.model.createPositionAt(a,w+_));this.editor.execute(\"input\",{text:y,range:x,resultRange:v})}_handleTextMutation(e,t){if(e.type!=\"text\"){return}const n=e.newText.replace(/\\u00A0/g,\" \");const o=e.oldText.replace(/\\u00A0/g,\" \");if(o===n){return}const i=Ad(o,n);const{firstChangeAt:r,insertions:s,deletions:a}=vv(i);let c=null;if(t){c=this.editing.mapper.toModelRange(t.getFirstRange())}const l=this.editing.view.createPositionAt(e.node,r);const d=this.editing.mapper.toModelPosition(l);const u=this.editor.model.createRange(d,d.getShiftedBy(a));const h=n.substr(r,s);this.editor.execute(\"input\",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(e){if(e.type!=\"children\"){return}const t=mv(e);const n=this.editing.view.createPositionAt(e.node,t.index);const o=this.editing.mapper.toModelPosition(n);const i=t.values[0].data;this.editor.execute(\"input\",{text:i.replace(/\\u00A0/g,\" \"),range:this.editor.model.createRange(o)})}}function kv(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:true}));if(!t){return}return t.getAncestors({includeSelf:true,parentFirst:true}).find(e=>e.is(\"containerElement\")||e.is(\"rootElement\"))}function _v(e,t){return e.every(e=>t.isInline(e))}function vv(e){let t=null;let n=null;for(let o=0;oe.kind===\"file\").map(e=>e.getAsFile())}class Av extends eh{constructor(e){super(e);const t=this.document;this.domEventType=[\"paste\",\"copy\",\"cut\",\"drop\",\"dragover\"];this.listenTo(t,\"paste\",n,{priority:\"low\"});this.listenTo(t,\"drop\",n,{priority:\"low\"});function n(e,n){n.preventDefault();const o=n.dropRange?[n.dropRange]:Array.from(t.selection.getRanges());const i=new es(t,\"clipboardInput\");t.fire(i,{dataTransfer:n.dataTransfer,targetRanges:o});if(i.stop.called){n.stopPropagation()}}}onDomEvent(e){const t={dataTransfer:new xv(e.clipboardData?e.clipboardData:e.dataTransfer)};if(e.type==\"drop\"){t.dropRange=Tv(this.view,e)}this.fire(e.type,e,t)}}function Tv(e,t){const n=t.target.ownerDocument;const o=t.clientX;const i=t.clientY;let r;if(n.caretRangeFromPoint&&n.caretRangeFromPoint(o,i)){r=n.caretRangeFromPoint(o,i)}else if(t.rangeParent){r=n.createRange();r.setStart(t.rangeParent,t.rangeOffset);r.collapse(true)}if(r){return e.domConverter.domRangeToView(r)}else{return e.document.selection.getFirstRange()}}function Pv(e){e=e.replace(//g,\">\").replace(/\\n/g,\"

\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\"  \");if(e.indexOf(\"

\")>-1){e=`

${e}

`}return e}function Sv(e){return e.replace(/(\\s+)<\\/span>/g,(e,t)=>{if(t.length==1){return\" \"}return t})}const Ev=[\"figcaption\",\"li\"];function Rv(e){let t=\"\";if(e.is(\"$text\")||e.is(\"$textProxy\")){t=e.data}else if(e.is(\"element\",\"img\")&&e.hasAttribute(\"alt\")){t=e.getAttribute(\"alt\")}else{let n=null;for(const o of e.getChildren()){const e=Rv(o);if(n&&(n.is(\"containerElement\")||o.is(\"containerElement\"))){if(Ev.includes(n.name)||Ev.includes(o.name)){t+=\"\\n\"}else{t+=\"\\n\\n\"}}t+=e;n=o}}return t}class Iv extends tk{static get pluginName(){return\"Clipboard\"}init(){const e=this.editor;const t=e.model.document;const n=e.editing.view;const o=n.document;this._htmlDataProcessor=new Wp(o);n.addObserver(Av);this.listenTo(o,\"clipboardInput\",t=>{if(e.isReadOnly){t.stop()}},{priority:\"highest\"});this.listenTo(o,\"clipboardInput\",(e,t)=>{const o=t.dataTransfer;let i=\"\";if(o.getData(\"text/html\")){i=Sv(o.getData(\"text/html\"))}else if(o.getData(\"text/plain\")){i=Pv(o.getData(\"text/plain\"))}i=this._htmlDataProcessor.toView(i);const r=new es(this,\"inputTransformation\");this.fire(r,{content:i,dataTransfer:o});if(r.stop.called){e.stop()}n.scrollToTheSelection()},{priority:\"low\"});this.listenTo(this,\"inputTransformation\",(e,t)=>{if(!t.content.isEmpty){const n=this.editor.data;const o=this.editor.model;const i=n.toModel(t.content,\"$clipboardHolder\");if(i.childCount==0){return}o.insertContent(i);e.stop()}},{priority:\"low\"});function i(n,i){const r=i.dataTransfer;i.preventDefault();const s=e.data.toView(e.model.getSelectedContent(t.selection));o.fire(\"clipboardOutput\",{dataTransfer:r,content:s,method:n.name})}this.listenTo(o,\"copy\",i,{priority:\"low\"});this.listenTo(o,\"cut\",(t,n)=>{if(e.isReadOnly){n.preventDefault()}else{i(t,n)}},{priority:\"low\"});this.listenTo(o,\"clipboardOutput\",(n,o)=>{if(!o.content.isEmpty){o.dataTransfer.setData(\"text/html\",this._htmlDataProcessor.toData(o.content));o.dataTransfer.setData(\"text/plain\",Rv(o.content))}if(o.method==\"cut\"){e.model.deleteContent(t.selection)}},{priority:\"low\"})}}class Ov{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){if(Array.isArray(e)){e.forEach(e=>this._definitions.add(e))}else{this._definitions.add(e)}}getDispatcher(){return e=>{e.on(\"attribute:linkHref\",(e,t,n)=>{if(!n.consumable.test(t.item,\"attribute:linkHref\")){return}const o=n.writer;const i=o.document.selection;for(const e of this._definitions){const r=o.createAttributeElement(\"a\",e.attributes,{priority:5});o.setCustomProperty(\"link\",true,r);if(e.callback(t.attributeNewValue)){if(t.item.is(\"selection\")){o.wrap(i.getFirstRange(),r)}else{o.wrap(n.mapper.toViewRange(t.range),r)}}else{o.unwrap(n.mapper.toViewRange(t.range),r)}}},{priority:\"high\"})}}getDispatcherForLinkedImage(){return e=>{e.on(\"attribute:linkHref:image\",(e,t,n)=>{const o=n.mapper.toViewElement(t.item);const i=Array.from(o.getChildren()).find(e=>e.name===\"a\");for(const e of this._definitions){const o=qs(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of o){if(e===\"class\"){n.writer.addClass(t,i)}else{n.writer.setAttribute(e,t,i)}}}else{for(const[e,t]of o){if(e===\"class\"){n.writer.removeClass(t,i)}else{n.writer.removeAttribute(e,i)}}}}})}}}function Vv(e,t,n){var o=e.length;n=n===undefined?o:n;return!t&&n>=o?e:Oa(e,t,n)}var Mv=Vv;var Nv=\"\\\\ud800-\\\\udfff\",zv=\"\\\\u0300-\\\\u036f\",Bv=\"\\\\ufe20-\\\\ufe2f\",Dv=\"\\\\u20d0-\\\\u20ff\",Fv=zv+Bv+Dv,Lv=\"\\\\ufe0e\\\\ufe0f\";var Hv=\"\\\\u200d\";var jv=RegExp(\"[\"+Hv+Nv+Fv+Lv+\"]\");function qv(e){return jv.test(e)}var Wv=qv;function $v(e){return e.split(\"\")}var Uv=$v;var Gv=\"\\\\ud800-\\\\udfff\",Kv=\"\\\\u0300-\\\\u036f\",Jv=\"\\\\ufe20-\\\\ufe2f\",Yv=\"\\\\u20d0-\\\\u20ff\",Qv=Kv+Jv+Yv,Xv=\"\\\\ufe0e\\\\ufe0f\";var Zv=\"[\"+Gv+\"]\",ey=\"[\"+Qv+\"]\",ty=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",ny=\"(?:\"+ey+\"|\"+ty+\")\",oy=\"[^\"+Gv+\"]\",iy=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",ry=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",sy=\"\\\\u200d\";var ay=ny+\"?\",cy=\"[\"+Xv+\"]?\",ly=\"(?:\"+sy+\"(?:\"+[oy,iy,ry].join(\"|\")+\")\"+cy+ay+\")*\",dy=cy+ay+ly,uy=\"(?:\"+[oy+ey+\"?\",ey,iy,ry,Zv].join(\"|\")+\")\";var hy=RegExp(ty+\"(?=\"+ty+\")|\"+uy+dy,\"g\");function fy(e){return e.match(hy)||[]}var gy=fy;function my(e){return Wv(e)?gy(e):Uv(e)}var py=my;function by(e){return function(t){t=va(t);var n=Wv(t)?py(t):undefined;var o=n?n[0]:t.charAt(0);var i=n?Mv(n,1).join(\"\"):t.slice(1);return o[e]()+i}}var wy=by;var ky=wy(\"toUpperCase\");var _y=ky;const vy=/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g;const yy=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;const xy=\"Ctrl+K\";function Cy(e){return e.is(\"attributeElement\")&&!!e.getCustomProperty(\"link\")}function Ay(e,t){const n=t.createAttributeElement(\"a\",{href:e},{priority:5});t.setCustomProperty(\"link\",true,n);return n}function Ty(e){e=String(e);return Py(e)?e:\"#\"}function Py(e){const t=e.replace(vy,\"\");return t.match(yy)}function Sy(e,t){const n={\"Open in a new tab\":e(\"Open in a new tab\"),Downloadable:e(\"Downloadable\")};t.forEach(e=>{if(e.label&&n[e.label]){e.label=n[e.label]}return e});return t}function Ey(e){const t=[];if(e){for(const[n,o]of Object.entries(e)){const e=Object.assign({},o,{id:`link${_y(n)}`});t.push(e)}}return t}function Ry(e,t){if(!e){return false}return e.is(\"element\",\"image\")&&t.checkAttribute(\"image\",\"linkHref\")}class Iy extends ok{constructor(e){super(e);this.manualDecorators=new xs;this.automaticDecorators=new Ov}restoreManualDecoratorStates(){for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}}refresh(){const e=this.editor.model;const t=e.document;const n=rk(t.selection.getSelectedBlocks());if(Ry(n,e.schema)){this.value=n.getAttribute(\"linkHref\");this.isEnabled=e.schema.checkAttribute(n,\"linkHref\")}else{this.value=t.selection.getAttribute(\"linkHref\");this.isEnabled=e.schema.checkAttributeInSelection(t.selection,\"linkHref\")}for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}}execute(e,t={}){const n=this.editor.model;const o=n.document.selection;const i=[];const r=[];for(const e in t){if(t[e]){i.push(e)}else{r.push(e)}}n.change(t=>{if(o.isCollapsed){const s=o.getFirstPosition();if(o.hasAttribute(\"linkHref\")){const a=rv(s,\"linkHref\",o.getAttribute(\"linkHref\"),n);t.setAttribute(\"linkHref\",e,a);i.forEach(e=>{t.setAttribute(e,true,a)});r.forEach(e=>{t.removeAttribute(e,a)});t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(e!==\"\"){const r=qs(o.getAttributes());r.set(\"linkHref\",e);i.forEach(e=>{r.set(e,true)});const a=t.createText(e,r);n.insertContent(a,s);t.setSelection(t.createPositionAfter(a))}[\"linkHref\",...i,...r].forEach(e=>{t.removeSelectionAttribute(e)})}else{const s=n.schema.getValidRanges(o.getRanges(),\"linkHref\");const a=[];for(const e of o.getSelectedBlocks()){if(n.schema.checkAttribute(e,\"linkHref\")){a.push(t.createRangeOn(e))}}const c=a.slice();for(const e of s){if(this._isRangeToUpdate(e,a)){c.push(e)}}for(const n of c){t.setAttribute(\"linkHref\",e,n);i.forEach(e=>{t.setAttribute(e,true,n)});r.forEach(e=>{t.removeAttribute(e,n)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model;const n=t.document;const o=rk(n.selection.getSelectedBlocks());if(Ry(o,t.schema)){return o.getAttribute(e)}return n.selection.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t){if(n.containsRange(e)){return false}}return true}}class Oy extends ok{refresh(){const e=this.editor.model;const t=e.document;const n=rk(t.selection.getSelectedBlocks());if(Ry(n,e.schema)){this.isEnabled=e.schema.checkAttribute(n,\"linkHref\")}else{this.isEnabled=e.schema.checkAttributeInSelection(t.selection,\"linkHref\")}}execute(){const e=this.editor;const t=this.editor.model;const n=t.document.selection;const o=e.commands.get(\"link\");t.change(e=>{const i=n.isCollapsed?[rv(n.getFirstPosition(),\"linkHref\",n.getAttribute(\"linkHref\"),t)]:n.getRanges();for(const t of i){e.removeAttribute(\"linkHref\",t);if(o){for(const n of o.manualDecorators){e.removeAttribute(n.id,t)}}}})}}class Vy{constructor({id:e,label:t,attributes:n,defaultValue:o}){this.id=e;this.set(\"value\");this.defaultValue=o;this.label=t;this.attributes=n}}ys(Vy,Yc);var My=n(50);const Ny=\"ck-link_selected\";const zy=\"automatic\";const By=\"manual\";const Dy=/^(https?:)?\\/\\//;class Fy extends tk{static get pluginName(){return\"LinkEditing\"}static get requires(){return[Z_,yv,Iv]}constructor(e){super(e);e.config.define(\"link\",{addTargetToExternalLinks:false})}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:\"linkHref\"});e.conversion.for(\"dataDowncast\").attributeToElement({model:\"linkHref\",view:Ay});e.conversion.for(\"editingDowncast\").attributeToElement({model:\"linkHref\",view:(e,t)=>Ay(Ty(e),t)});e.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:{href:true}},model:{key:\"linkHref\",value:e=>e.getAttribute(\"href\")}});e.commands.add(\"link\",new Iy(e));e.commands.add(\"unlink\",new Oy(e));const t=Sy(e.t,Ey(e.config.get(\"link.decorators\")));this._enableAutomaticDecorators(t.filter(e=>e.mode===zy));this._enableManualDecorators(t.filter(e=>e.mode===By));const n=e.plugins.get(Z_);n.registerAttribute(\"linkHref\");av(e,\"linkHref\",\"a\",Ny);this._enableInsertContentSelectionAttributesFixer();this._enableClickingAfterLink();this._enableTypingOverLink();this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor;const n=t.commands.get(\"link\");const o=n.automaticDecorators;if(t.config.get(\"link.addTargetToExternalLinks\")){o.add({id:\"linkIsExternal\",mode:zy,callback:e=>Dy.test(e),attributes:{target:\"_blank\",rel:\"noopener noreferrer\"}})}o.add(e);if(o.length){t.conversion.for(\"downcast\").add(o.getDispatcher())}}_enableManualDecorators(e){if(!e.length){return}const t=this.editor;const n=t.commands.get(\"link\");const o=n.manualDecorators;e.forEach(e=>{t.model.schema.extend(\"$text\",{allowAttributes:e.id});o.add(new Vy(e));t.conversion.for(\"downcast\").attributeToElement({model:e.id,view:(t,n)=>{if(t){const t=o.get(e.id).attributes;const i=n.createAttributeElement(\"a\",t,{priority:5});n.setCustomProperty(\"link\",true,i);return i}}});t.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:o.get(e.id).attributes},model:{key:e.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor;const t=e.model;const n=t.document.selection;const o=e.commands.get(\"link\");this.listenTo(t,\"insertContent\",()=>{const e=n.anchor.nodeBefore;const i=n.anchor.nodeAfter;if(!n.hasAttribute(\"linkHref\")){return}if(!e){return}if(!e.hasAttribute(\"linkHref\")){return}if(i&&i.hasAttribute(\"linkHref\")){return}t.change(e=>{Ly(e,o.manualDecorators)})},{priority:\"low\"})}_enableClickingAfterLink(){const e=this.editor;const t=e.commands.get(\"link\");e.editing.view.addObserver(X_);let n=false;this.listenTo(e.editing.view.document,\"mousedown\",()=>{n=true});this.listenTo(e.editing.view.document,\"selectionChange\",()=>{if(!n){return}n=false;const o=e.model.document.selection;if(!o.isCollapsed){return}if(!o.hasAttribute(\"linkHref\")){return}const i=o.getFirstPosition();const r=rv(i,\"linkHref\",o.getAttribute(\"linkHref\"),e.model);if(i.isTouching(r.start)||i.isTouching(r.end)){e.model.change(e=>{Ly(e,t.manualDecorators)})}})}_enableTypingOverLink(){const e=this.editor;const t=e.editing.view;let n;let o;this.listenTo(t.document,\"delete\",()=>{o=true},{priority:\"high\"});this.listenTo(e.model,\"deleteContent\",()=>{const t=e.model.document.selection;if(t.isCollapsed){return}if(o){o=false;return}if(!jy(e)){return}if(Hy(e.model)){n=t.getAttributes()}},{priority:\"high\"});this.listenTo(e.model,\"insertContent\",(t,[i])=>{o=false;if(!jy(e)){return}if(!n){return}e.model.change(e=>{for(const[t,o]of n){e.setAttribute(t,o,i)}});n=null},{priority:\"high\"})}_handleDeleteContentAfterLink(){const e=this.editor;const t=e.model;const n=t.document.selection;const o=e.editing.view;const i=e.commands.get(\"link\");let r=false;let s=false;this.listenTo(o.document,\"delete\",(e,t)=>{s=t.domEvent.keyCode===Ml.backspace},{priority:\"high\"});this.listenTo(t,\"deleteContent\",()=>{r=false;const e=n.getFirstPosition();const o=n.getAttribute(\"linkHref\");if(!o){return}const i=rv(e,\"linkHref\",o,t);r=i.containsPosition(e)||i.end.isEqual(e)},{priority:\"high\"});this.listenTo(t,\"deleteContent\",()=>{if(!s){return}s=false;if(r){return}e.model.enqueueChange(e=>{Ly(e,i.manualDecorators)})},{priority:\"low\"})}}function Ly(e,t){e.removeSelectionAttribute(\"linkHref\");for(const n of t){e.removeSelectionAttribute(n.id)}}function Hy(e){const t=e.document.selection;const n=t.getFirstPosition();const o=t.getLastPosition();const i=n.nodeAfter;if(!i){return false}if(!i.is(\"$text\")){return false}if(!i.hasAttribute(\"linkHref\")){return false}const r=o.textNode||o.nodeBefore;if(i===r){return true}const s=rv(n,\"linkHref\",i.getAttribute(\"linkHref\"),e);return s.containsRange(e.createRange(n,o),true)}function jy(e){const t=e.plugins.get(\"Input\");return t.isInput(e.model.change(e=>e.batch))}class qy{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return true}}ys(qy,Yc);class Wy extends qy{static get pluginName(){return\"Notification\"}init(){this.on(\"show:warning\",(e,t)=>{window.alert(t.message)},{priority:\"lowest\"})}showSuccess(e,t={}){this._showNotification({message:e,type:\"success\",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:\"info\",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:\"warning\",namespace:t.namespace,title:t.title})}_showNotification(e){const t=`show:${e.type}`+(e.namespace?`:${e.namespace}`:\"\");this.fire(t,{message:e.message,type:e.type,title:e.title||\"\"})}}class $y extends ok{constructor(e){super(e);this.stopListening(this.editor.model.document,\"change\");this.listenTo(this.editor.model.document,\"change\",()=>this.refresh(),{priority:\"low\"})}refresh(){const e=this.editor.commands.get(\"imageInsert\");const t=this.editor.commands.get(\"link\");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor;const t=this.editor.config.get(\"ckfinder.openerMethod\")||\"modal\";if(t!=\"popup\"&&t!=\"modal\"){throw new ss[\"b\"]('ckfinder-unknown-openerMethod: The openerMethod config option must by \"popup\" or \"modal\".',e)}const n=this.editor.config.get(\"ckfinder.options\")||{};n.chooseFiles=true;const o=n.onInit;if(!n.language){n.language=e.locale.uiLanguage}n.onInit=t=>{if(o){o(t)}t.on(\"files:choose\",n=>{const o=n.data.files.toArray();const i=o.filter(e=>!e.isImage());const r=o.filter(e=>e.isImage());for(const t of i){e.execute(\"link\",t.getUrl())}const s=[];for(const e of r){const n=e.getUrl();s.push(n?n:t.request(\"file:getProxyUrl\",{file:e}))}if(s.length){Uy(e,s)}});t.on(\"file:choose:resizedImage\",t=>{const n=t.data.resizedUrl;if(!n){const t=e.plugins.get(\"Notification\");const n=e.locale.t;t.showWarning(n(\"Could not obtain resized image URL.\"),{title:n(\"Selecting resized image failed\"),namespace:\"ckfinder\"});return}Uy(e,[n])})};window.CKFinder[t](n)}}function Uy(e,t){const n=e.commands.get(\"imageInsert\");if(!n.isEnabled){const t=e.plugins.get(\"Notification\");const n=e.locale.t;t.showWarning(n(\"Could not insert image at the current position.\"),{title:n(\"Inserting image failed\"),namespace:\"ckfinder\"});return}e.execute(\"imageInsert\",{source:t})}class Gy extends tk{static get pluginName(){return\"CKFinderEditing\"}static get requires(){return[Wy,Y_,Fy]}init(){const e=this.editor;e.commands.add(\"ckfinder\",new $y(e))}}class Ky extends qy{static get pluginName(){return\"PendingActions\"}init(){this.set(\"hasAny\",false);this._actions=new xs({idProperty:\"_id\"});this._actions.delegate(\"add\",\"remove\").to(this)}add(e){if(typeof e!==\"string\"){throw new ss[\"b\"](\"pendingactions-add-invalid-message: The message must be a string.\",this)}const t=Object.create(Yc);t.set(\"message\",e);this._actions.add(t);this.hasAny=true;return t}remove(e){this._actions.remove(e);this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Jy{constructor(){const e=new window.FileReader;this._reader=e;this._data=undefined;this.set(\"loaded\",0);e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;this.total=e.size;return new Promise((n,o)=>{t.onload=()=>{const e=t.result;this._data=e;n(e)};t.onerror=()=>{o(\"error\")};t.onabort=()=>{o(\"aborted\")};this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ys(Jy,Yc);class Yy extends tk{static get pluginName(){return\"FileRepository\"}static get requires(){return[Ky]}init(){this.loaders=new xs;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\",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter){console.warn(Object(ss[\"a\"])(\"filerepository-no-upload-adapter: Upload adapter is not defined.\"));return null}const t=new Qy(Promise.resolve(e),this.createUploadAdapter);this.loaders.add(t);this._loadersMap.set(e,t);if(e instanceof Promise){t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{})}t.on(\"change:uploaded\",()=>{let e=0;for(const t of this.loaders){e+=t.uploaded}this.uploaded=e});t.on(\"change:uploadTotal\",()=>{let e=0;for(const t of this.loaders){if(t.uploadTotal){e+=t.uploadTotal}}this.uploadTotal=e});return t}destroyLoader(e){const t=e instanceof Qy?e:this.getLoader(e);t._destroy();this.loaders.remove(t);this._loadersMap.forEach((e,n)=>{if(e===t){this._loadersMap.delete(n)}})}_updatePendingAction(){const e=this.editor.plugins.get(Ky);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t;const n=e=>`${t(\"Upload in progress\")} ${parseInt(e)}%.`;this._pendingAction=e.add(n(this.uploadedPercent));this._pendingAction.bind(\"message\").to(this,\"uploadedPercent\",n)}}else{e.remove(this._pendingAction);this._pendingAction=null}}}ys(Yy,Yc);class Qy{constructor(e,t){this.id=ns();this._filePromiseWrapper=this._createFilePromiseWrapper(e);this._adapter=t(this);this._reader=new Jy;this.set(\"status\",\"idle\");this.set(\"uploaded\",0);this.set(\"uploadTotal\",null);this.bind(\"uploadedPercent\").to(this,\"uploaded\",this,\"uploadTotal\",(e,t)=>t?e/t*100:0);this.set(\"uploadResponse\",null)}get file(){if(!this._filePromiseWrapper){return Promise.resolve(null)}else{return this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null)}}get data(){return this._reader.data}read(){if(this.status!=\"idle\"){throw new ss[\"b\"](\"filerepository-read-wrong-status: You cannot call read if the status is different than idle.\",this)}this.status=\"reading\";return this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!==\"reading\"){throw this.status}this.status=\"idle\";return e}).catch(e=>{if(e===\"aborted\"){this.status=\"aborted\";throw\"aborted\"}this.status=\"error\";throw this._reader.error?this._reader.error:e})}upload(){if(this.status!=\"idle\"){throw new ss[\"b\"](\"filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.\",this)}this.status=\"uploading\";return this.file.then(()=>this._adapter.upload()).then(e=>{this.uploadResponse=e;this.status=\"idle\";return e}).catch(e=>{if(this.status===\"aborted\"){throw\"aborted\"}this.status=\"error\";throw e})}abort(){const e=this.status;this.status=\"aborted\";if(!this._filePromiseWrapper.isFulfilled){this._filePromiseWrapper.promise.catch(()=>{});this._filePromiseWrapper.rejecter(\"aborted\")}else if(e==\"reading\"){this._reader.abort()}else if(e==\"uploading\"&&this._adapter.abort){this._adapter.abort()}this._destroy()}_destroy(){this._filePromiseWrapper=undefined;this._reader=undefined;this._adapter=undefined;this.uploadResponse=undefined}_createFilePromiseWrapper(e){const t={};t.promise=new Promise((n,o)=>{t.rejecter=o;t.isFulfilled=false;e.then(e=>{t.isFulfilled=true;n(e)}).catch(e=>{t.isFulfilled=true;o(e)})});return t}}ys(Qy,Yc);const Xy=\"ckCsrfToken\";const Zy=40;const ex=\"abcdefghijklmnopqrstuvwxyz0123456789\";function tx(){let e=nx(Xy);if(!e||e.length!=Zy){e=ix(Zy);ox(Xy,e)}return e}function nx(e){e=e.toLowerCase();const t=document.cookie.split(\";\");for(const n of t){const t=n.split(\"=\");const o=decodeURIComponent(t[0].trim().toLowerCase());if(o===e){return decodeURIComponent(t[1])}}return null}function ox(e,t){document.cookie=encodeURIComponent(e)+\"=\"+encodeURIComponent(t)+\";path=/\"}function ix(e){let t=\"\";const n=new Uint8Array(e);window.crypto.getRandomValues(n);for(let e=0;e.5?o.toUpperCase():o}return t}class rx extends tk{static get requires(){return[Yy]}static get pluginName(){return\"CKFinderUploadAdapter\"}init(){const e=this.editor.config.get(\"ckfinder.uploadUrl\");if(!e){return}this.editor.plugins.get(Yy).createUploadAdapter=t=>new sx(t,e,this.editor.t)}}class sx{constructor(e,t,n){this.loader=e;this.url=t;this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest();this._initListeners(t,n,e);this._sendRequest(e)}))}abort(){if(this.xhr){this.xhr.abort()}}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open(\"POST\",this.url,true);e.responseType=\"json\"}_initListeners(e,t,n){const o=this.xhr;const i=this.loader;const r=this.t;const s=r(\"Cannot upload file:\")+` ${n.name}.`;o.addEventListener(\"error\",()=>t(s));o.addEventListener(\"abort\",()=>t());o.addEventListener(\"load\",()=>{const n=o.response;if(!n||!n.uploaded){return t(n&&n.error&&n.error.message?n.error.message:s)}e({default:n.url})});if(o.upload){o.upload.addEventListener(\"progress\",e=>{if(e.lengthComputable){i.uploadTotal=e.total;i.uploaded=e.loaded}})}}_sendRequest(e){const t=new FormData;t.append(\"upload\",e);t.append(\"ckCsrfToken\",tx());this.xhr.send(t)}}class ax extends tk{static get pluginName(){return\"CKFinder\"}static get requires(){return[Gy,n_,rx]}}const cx=\"code\";const lx=\"ck-code_selected\";class dx extends tk{static get pluginName(){return\"CodeEditing\"}static get requires(){return[Z_]}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:cx});e.model.schema.setAttributeProperties(cx,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:cx,view:\"code\",upcastAlso:{styles:{\"word-wrap\":\"break-word\"}}});e.commands.add(cx,new Kk(e,cx));e.plugins.get(Z_).registerAttribute(cx);av(e,cx,\"code\",lx)}}var ux='';var hx=n(11);const fx=\"code\";class gx extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(fx,n=>{const o=e.commands.get(fx);const i=new Aw(n);i.set({label:t(\"Code\"),icon:ux,tooltip:true,isToggleable:true});i.bind(\"isOn\",\"isEnabled\").to(o,\"value\",\"isEnabled\");this.listenTo(i,\"execute\",()=>{e.execute(fx);e.editing.view.focus()});return i})}}class mx extends tk{static get requires(){return[dx,gx]}static get pluginName(){return\"Code\"}}function*px(e,t){for(const n of t){if(n&&e.getAttributeProperties(n[0]).copyOnEnter){yield n}}}class bx extends ok{execute(){const e=this.editor.model;const t=e.document;e.change(n=>{kx(e,n,t.selection);this.fire(\"afterExecute\",{writer:n})})}refresh(){const e=this.editor.model;const t=e.document;this.isEnabled=wx(e.schema,t.selection)}}function wx(e,t){if(t.rangeCount>1){return false}const n=t.anchor;if(!n||!e.checkChild(n,\"softBreak\")){return false}const o=t.getFirstRange();const i=o.start.parent;const r=o.end.parent;if((vx(i,e)||vx(r,e))&&i!==r){return false}return true}function kx(e,t,n){const o=n.isCollapsed;const i=n.getFirstRange();const r=i.start.parent;const s=i.end.parent;const a=r==s;if(o){const o=px(e.schema,n.getAttributes());_x(e,t,i.end);t.removeSelectionAttribute(n.getAttributeKeys());t.setSelectionAttribute(o)}else{const o=!(i.start.isAtStart&&i.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:o});if(a){_x(e,t,n.focus)}else{if(o){t.setSelection(s,0)}}}}function _x(e,t,n){const o=t.createElement(\"softBreak\");e.insertContent(o,n);t.setSelection(o,\"after\")}function vx(e,t){if(e.is(\"rootElement\")){return false}return t.isLimit(e)||vx(e.parent,t)}class yx extends Xd{constructor(e){super(e);const t=this.document;t.on(\"keydown\",(e,n)=>{if(this.isEnabled&&n.keyCode==Ml.enter){let o;t.once(\"enter\",e=>o=e,{priority:\"highest\"});t.fire(\"enter\",new Zu(t,n.domEvent,{isSoft:n.shiftKey}));if(o&&o.stop.called){e.stop()}}})}observe(){}}class xx extends tk{static get pluginName(){return\"ShiftEnter\"}init(){const e=this.editor;const t=e.model.schema;const n=e.conversion;const o=e.editing.view;const i=o.document;t.register(\"softBreak\",{allowWhere:\"$text\",isInline:true});n.for(\"upcast\").elementToElement({model:\"softBreak\",view:\"br\"});n.for(\"downcast\").elementToElement({model:\"softBreak\",view:(e,t)=>t.createEmptyElement(\"br\")});o.addObserver(yx);e.commands.add(\"shiftEnter\",new bx(e));this.listenTo(i,\"enter\",(t,n)=>{n.preventDefault();if(!n.isSoft){return}e.execute(\"shiftEnter\");o.scrollToTheSelection()},{priority:\"low\"})}}function Cx(e){const t=e.t;const n=e.config.get(\"codeBlock.languages\");for(const e of n){if(e.label===\"Plain text\"){e.label=t(\"Plain text\")}if(e.class===undefined){e.class=`language-${e.language}`}}return n}function Ax(e,t,n){const o={};for(const i of e){if(t===\"class\"){o[i[t].split(\" \").shift()]=i[n]}else{o[i[t]]=i[n]}}return o}function Tx(e){return e.data.match(/^(\\s*)/)[0]}function Px(e,t){const n=e.createDocumentFragment();const o=t.split(\"\\n\").map(t=>e.createText(t));const i=o[o.length-1];for(const t of o){e.append(t,n);if(t!==i){e.appendElement(\"softBreak\",n)}}return n}function Sx(e){const t=e.document.selection;const n=[];if(t.isCollapsed){n.push(t.anchor)}else{const o=t.getFirstRange().getWalker({ignoreElementEnd:true,direction:\"backward\"});for(const{item:t}of o){if(t.is(\"$textProxy\")&&t.parent.is(\"element\",\"codeBlock\")){const o=Tx(t.textNode);const{parent:i,startOffset:r}=t.textNode;const s=e.createPositionAt(i,r+o.length);n.push(s)}}}return n}function Ex(e){const t=rk(e.getSelectedBlocks());return t&&t.is(\"element\",\"codeBlock\")}class Rx extends ok{refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor;const n=t.model;const o=n.document.selection;const i=Cx(t);const r=i[0];const s=Array.from(o.getSelectedBlocks());const a=e.forceValue===undefined?!this.value:e.forceValue;const c=e.language||r.language;n.change(e=>{if(a){this._applyCodeBlock(e,s,c)}else{this._removeCodeBlock(e,s)}})}_getValue(){const e=this.editor.model.document.selection;const t=rk(e.getSelectedBlocks());const n=!!(t&&t.is(\"element\",\"codeBlock\"));return n?t.getAttribute(\"language\"):false}_checkEnabled(){if(this.value){return true}const e=this.editor.model.document.selection;const t=this.editor.model.schema;const n=rk(e.getSelectedBlocks());if(!n){return false}return Ix(t,n)}_applyCodeBlock(e,t,n){const o=this.editor.model.schema;const i=t.filter(e=>Ix(o,e));for(const t of i){e.rename(t,\"codeBlock\");e.setAttribute(\"language\",n,t);o.removeDisallowedAttributes([t],e)}i.reverse().forEach((t,n)=>{const o=i[n+1];if(t.previousSibling===o){e.appendElement(\"softBreak\",o);e.merge(e.createPositionBefore(t))}})}_removeCodeBlock(e,t){const n=t.filter(e=>e.is(\"element\",\"codeBlock\"));for(const t of n){const n=e.createRangeOn(t);for(const t of Array.from(n.getItems()).reverse()){if(t.is(\"element\",\"softBreak\")&&t.parent.is(\"element\",\"codeBlock\")){const{position:n}=e.split(e.createPositionBefore(t));e.rename(n.nodeAfter,\"paragraph\");e.removeAttribute(\"language\",n.nodeAfter);e.remove(t)}}e.rename(t,\"paragraph\");e.removeAttribute(\"language\",t)}}}function Ix(e,t){if(t.is(\"rootElement\")||e.isLimit(t)){return false}return e.checkChild(t.parent,\"codeBlock\")}class Ox extends ok{constructor(e){super(e);this._indentSequence=e.config.get(\"codeBlock.indentSequence\")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor;const t=e.model;t.change(e=>{const n=Sx(t);for(const t of n){e.insertText(this._indentSequence,t)}})}_checkEnabled(){if(!this._indentSequence){return false}return Ex(this.editor.model.document.selection)}}class Vx extends ok{constructor(e){super(e);this._indentSequence=e.config.get(\"codeBlock.indentSequence\")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor;const t=e.model;t.change(e=>{const n=Sx(t);for(const t of n){const n=Mx(this.editor.model,t,this._indentSequence);if(n){e.remove(n)}}})}_checkEnabled(){if(!this._indentSequence){return false}const e=this.editor.model;if(!Ex(e.document.selection)){return false}return Sx(e).some(t=>Mx(e,t,this._indentSequence))}}function Mx(e,t,n){const o=Nx(t);if(!o){return null}const i=Tx(o);const r=i.lastIndexOf(n);if(r+n.length!==i.length){return null}if(r===-1){return null}const{parent:s,startOffset:a}=o;return e.createRange(e.createPositionAt(s,a+r),e.createPositionAt(s,a+r+n.length))}function Nx(e){let t=e.parent.getChild(e.index);if(!t||t.is(\"element\",\"softBreak\")){t=e.nodeBefore}if(!t||t.is(\"element\",\"softBreak\")){return null}return t}function zx(e,t,n=false){const o=Ax(t,\"language\",\"class\");const i=Ax(t,\"language\",\"label\");return(t,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,\"insert\")){return}const d=r.item.getAttribute(\"language\");const u=c.toViewPosition(e.createPositionBefore(r.item));const h={};if(n){h[\"data-language\"]=i[d];h.spellcheck=\"false\"}const f=a.createContainerElement(\"pre\",h);const g=a.createContainerElement(\"code\",{class:o[d]||null});a.insert(a.createPositionAt(f,0),g);a.insert(u,f);c.bindElements(r.item,g)}}function Bx(e){return(t,n,o)=>{if(n.item.parent.name!==\"codeBlock\"){return}const{writer:i,mapper:r,consumable:s}=o;if(!s.consume(n.item,\"insert\")){return}const a=r.toViewPosition(e.createPositionBefore(n.item));i.insert(a,i.createText(\"\\n\"))}}function Dx(e,t){const n=Ax(t,\"class\",\"language\");const o=t[0].language;return(t,i,r)=>{const s=i.viewItem;const a=s.getChild(0);if(!a||!a.is(\"element\",\"code\")){return}const{consumable:c,writer:l}=r;if(!c.test(s,{name:true})||!c.test(a,{name:true})){return}const d=l.createElement(\"codeBlock\");const u=[...a.getClassNames()];if(!u.length){u.push(\"\")}for(const e of u){const t=n[e];if(t){l.setAttribute(\"language\",t,d);break}}if(!d.hasAttribute(\"language\")){l.setAttribute(\"language\",o,d)}const h=[...e.createRangeIn(a)].filter(e=>e.type===\"text\").map(({item:e})=>e.data).join(\"\");const f=Px(l,h);l.append(f,d);const g=r.splitToAllowedParent(d,i.modelCursor);if(!g){return}l.insert(d,g.position);c.consume(s,{name:true});c.consume(a,{name:true});const m=r.getSplitParts(d);i.modelRange=l.createRange(r.writer.createPositionBefore(d),r.writer.createPositionAfter(m[m.length-1]));if(g.cursorParent){i.modelCursor=l.createPositionAt(g.cursorParent,0)}else{i.modelCursor=i.modelRange.end}}}const Fx=\"paragraph\";class Lx extends tk{static get pluginName(){return\"CodeBlockEditing\"}static get requires(){return[xx]}constructor(e){super(e);e.config.define(\"codeBlock\",{languages:[{language:\"plaintext\",label:\"Plain text\"},{language:\"c\",label:\"C\"},{language:\"cs\",label:\"C#\"},{language:\"cpp\",label:\"C++\"},{language:\"css\",label:\"CSS\"},{language:\"diff\",label:\"Diff\"},{language:\"html\",label:\"HTML\"},{language:\"java\",label:\"Java\"},{language:\"javascript\",label:\"JavaScript\"},{language:\"php\",label:\"PHP\"},{language:\"python\",label:\"Python\"},{language:\"ruby\",label:\"Ruby\"},{language:\"typescript\",label:\"TypeScript\"},{language:\"xml\",label:\"XML\"}],indentSequence:\"\\t\"})}init(){const e=this.editor;const t=e.model.schema;const n=e.model;const o=Cx(e);e.commands.add(\"codeBlock\",new Rx(e));e.commands.add(\"indentCodeBlock\",new Ox(e));e.commands.add(\"outdentCodeBlock\",new Vx(e));const i=e=>(t,n)=>{const o=this.editor.commands.get(e);if(o.isEnabled){this.editor.execute(e);n()}};e.keystrokes.set(\"Tab\",i(\"indentCodeBlock\"));e.keystrokes.set(\"Shift+Tab\",i(\"outdentCodeBlock\"));t.register(\"codeBlock\",{allowWhere:\"$block\",isBlock:true,allowAttributes:[\"language\"]});t.extend(\"$text\",{allowIn:\"codeBlock\"});t.addAttributeCheck(e=>{if(e.endsWith(\"codeBlock $text\")){return false}});e.editing.downcastDispatcher.on(\"insert:codeBlock\",zx(n,o,true));e.data.downcastDispatcher.on(\"insert:codeBlock\",zx(n,o));e.data.downcastDispatcher.on(\"insert:softBreak\",Bx(n),{priority:\"high\"});e.data.upcastDispatcher.on(\"element:pre\",Dx(e.editing.view,o));this.listenTo(e.editing.view.document,\"clipboardInput\",(e,t)=>{const o=n.document.selection;if(!o.anchor.parent.is(\"element\",\"codeBlock\")){return}const i=t.dataTransfer.getData(\"text/plain\");n.change(t=>{n.insertContent(Px(t,i),o);e.stop()})});this.listenTo(n,\"getSelectedContent\",(e,[o])=>{const i=o.anchor;if(o.isCollapsed||!i.parent.is(\"element\",\"codeBlock\")||!i.hasSameParentAs(o.focus)){return}n.change(n=>{const r=e.return;if(r.childCount>1||o.containsEntireContent(i.parent)){const t=n.createElement(\"codeBlock\",i.parent.getAttributes());n.append(r,t);const o=n.createDocumentFragment();n.append(t,o);e.return=o}else{const e=r.getChild(0);if(t.checkAttribute(e,\"code\")){n.setAttribute(\"code\",true,e)}}})})}afterInit(){const e=this.editor;const t=e.commands;const n=t.get(\"indent\");const o=t.get(\"outdent\");if(n){n.registerChildCommand(t.get(\"indentCodeBlock\"))}if(o){o.registerChildCommand(t.get(\"outdentCodeBlock\"))}this.listenTo(e.editing.view.document,\"enter\",(t,n)=>{const o=e.model.document.selection.getLastPosition().parent;if(!o.is(\"element\",\"codeBlock\")){return}jx(e,n.isSoft)||qx(e,n.isSoft)||Hx(e);n.preventDefault();t.stop()})}}function Hx(e){const t=e.model;const n=t.document;const o=n.selection.getLastPosition();const i=o.nodeBefore||o.textNode;let r;if(i&&i.is(\"$text\")){r=Tx(i)}e.model.change(t=>{e.execute(\"shiftEnter\");if(r){t.insertText(r,n.selection.anchor)}})}function jx(e,t){const n=e.model;const o=n.document;const i=e.editing.view;const r=o.selection.getLastPosition();const s=r.nodeAfter;if(t||!o.selection.isCollapsed||!r.isAtStart){return false}if(!s||!s.is(\"element\",\"softBreak\")){return false}e.model.change(t=>{e.execute(\"enter\");const n=o.selection.anchor.parent.previousSibling;t.rename(n,Fx);t.setSelection(n,\"in\");e.model.schema.removeDisallowedAttributes([n],t);t.remove(s)});i.scrollToTheSelection();return true}function qx(e,t){const n=e.model;const o=n.document;const i=e.editing.view;const r=o.selection.getLastPosition();const s=r.nodeBefore;let a;if(t||!o.selection.isCollapsed||!r.isAtEnd||!s){return false}if(s.is(\"element\",\"softBreak\")){a=n.createRangeOn(s)}else if(s.is(\"$text\")&&!s.data.match(/\\S/)&&s.previousSibling&&s.previousSibling.is(\"element\",\"softBreak\")){a=n.createRange(n.createPositionBefore(s.previousSibling),n.createPositionAfter(s))}else{return false}e.model.change(t=>{t.remove(a);e.execute(\"enter\");const n=o.selection.anchor.parent;t.rename(n,Fx);e.model.schema.removeDisallowedAttributes([n],t)});i.scrollToTheSelection();return true}class Wx{constructor(e,t){if(t){$c(this,t)}if(e){this.set(e)}}}ys(Wx,Yc);var $x=n(53);class Ux extends Fb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"icon\");this.set(\"isEnabled\",true);this.set(\"isOn\",false);this.set(\"isToggleable\",false);this.set(\"isVisible\",true);this.set(\"keystroke\");this.set(\"label\");this.set(\"tabindex\",-1);this.set(\"tooltip\");this.set(\"tooltipPosition\",\"s\");this.set(\"type\",\"button\");this.set(\"withText\",false);this.children=this.createCollection();this.actionView=this._createActionView();this.arrowView=this._createArrowView();this.keystrokes=new Mp;this.focusTracker=new Gp;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-splitbutton\",t.if(\"isVisible\",\"ck-hidden\",e=>!e),this.arrowView.bindTemplate.if(\"isOn\",\"ck-splitbutton_open\")]},children:this.children})}render(){super.render();this.children.add(this.actionView);this.children.add(this.arrowView);this.focusTracker.add(this.actionView.element);this.focusTracker.add(this.arrowView.element);this.keystrokes.listenTo(this.element);this.keystrokes.set(\"arrowright\",(e,t)=>{if(this.focusTracker.focusedElement===this.actionView.element){this.arrowView.focus();t()}});this.keystrokes.set(\"arrowleft\",(e,t)=>{if(this.focusTracker.focusedElement===this.arrowView.element){this.actionView.focus();t()}})}focus(){this.actionView.focus()}_createActionView(){const e=new Aw;e.bind(\"icon\",\"isEnabled\",\"isOn\",\"isToggleable\",\"keystroke\",\"label\",\"tabindex\",\"tooltip\",\"tooltipPosition\",\"type\",\"withText\").to(this);e.extendTemplate({attributes:{class:\"ck-splitbutton__action\"}});e.delegate(\"execute\").to(this);return e}_createArrowView(){const e=new Aw;const t=e.bindTemplate;e.icon=Tw;e.extendTemplate({attributes:{class:\"ck-splitbutton__arrow\",\"aria-haspopup\":true,\"aria-expanded\":t.to(\"isOn\",e=>String(e))}});e.bind(\"isEnabled\").to(this);e.delegate(\"execute\").to(this,\"open\");return e}}var Gx='';var Kx=n(55);class Jx extends tk{init(){const e=this.editor;const t=e.t;const n=e.ui.componentFactory;const o=Cx(e);const i=o[0];n.add(\"codeBlock\",n=>{const r=e.commands.get(\"codeBlock\");const s=Bw(n,Ux);const a=s.buttonView;a.set({label:t(\"Insert code block\"),tooltip:true,icon:Gx,isToggleable:true});a.bind(\"isOn\").to(r,\"value\",e=>!!e);a.on(\"execute\",()=>{e.execute(\"codeBlock\",{language:i.language});e.editing.view.focus()});s.on(\"execute\",t=>{e.execute(\"codeBlock\",{language:t.source._codeBlockLanguage,forceValue:true});e.editing.view.focus()});s.class=\"ck-code-block-dropdown\";s.bind(\"isEnabled\").to(r);Fw(s,this._getLanguageListItemDefinitions(o));return s})}_getLanguageListItemDefinitions(e){const t=this.editor;const n=t.commands.get(\"codeBlock\");const o=new xs;for(const t of e){const e={type:\"button\",model:new Wx({_codeBlockLanguage:t.language,label:t.label,withText:true})};e.model.bind(\"isOn\").to(n,\"value\",t=>t===e.model._codeBlockLanguage);o.add(e)}return o}}class Yx extends tk{static get requires(){return[Lx,Jx]}static get pluginName(){return\"CodeBlock\"}}class Qx extends ok{execute(){const e=this.editor.model;const t=e.document;e.change(n=>{Xx(this.editor.model,n,t.selection,e.schema);this.fire(\"afterExecute\",{writer:n})})}}function Xx(e,t,n,o){const i=n.isCollapsed;const r=n.getFirstRange();const s=r.start.parent;const a=r.end.parent;if(o.isLimit(s)||o.isLimit(a)){if(!i&&s==a){e.deleteContent(n)}return}if(i){const e=px(t.model.schema,n.getAttributes());Zx(t,r.start);t.setSelectionAttribute(e)}else{const o=!(r.start.isAtStart&&r.end.isAtEnd);const i=s==a;e.deleteContent(n,{leaveUnmerged:o});if(o){if(i){Zx(t,n.focus)}else{t.setSelection(a,0)}}}}function Zx(e,t){e.split(t);e.setSelection(t.parent.nextSibling,0)}class eC extends tk{static get pluginName(){return\"Enter\"}init(){const e=this.editor;const t=e.editing.view;const n=t.document;t.addObserver(yx);e.commands.add(\"enter\",new Qx(e));this.listenTo(n,\"enter\",(n,o)=>{o.preventDefault();if(o.isSoft){return}e.execute(\"enter\");t.scrollToTheSelection()},{priority:\"low\"})}}class tC extends ok{execute(){const e=this.editor.model;const t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!nC(e.schema,n)){do{n=n.parent;if(!n){return}}while(!nC(e.schema,n))}e.change(e=>{e.setSelection(n,\"in\")})}}function nC(e,t){return e.isLimit(t)&&(e.checkChild(t,\"$text\")||e.checkChild(t,\"paragraph\"))}const oC=zl(\"Ctrl+A\");class iC extends tk{static get pluginName(){return\"SelectAllEditing\"}init(){const e=this.editor;const t=e.editing.view;const n=t.document;e.commands.add(\"selectAll\",new tC(e));this.listenTo(n,\"keydown\",(t,n)=>{if(Nl(n)===oC){e.execute(\"selectAll\");n.preventDefault()}})}}var rC='';class sC extends tk{static get pluginName(){return\"SelectAllUI\"}init(){const e=this.editor;e.ui.componentFactory.add(\"selectAll\",t=>{const n=e.commands.get(\"selectAll\");const o=new Aw(t);const i=t.t;o.set({label:i(\"Select all\"),icon:rC,keystroke:\"Ctrl+A\",tooltip:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>{e.execute(\"selectAll\");e.editing.view.focus()});return o})}}class aC extends tk{static get requires(){return[iC,sC]}static get pluginName(){return\"SelectAll\"}}class cC extends ok{constructor(e,t){super(e);this.direction=t;this._buffer=new cv(e.model,e.config.get(\"typing.undoStep\"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model;const n=t.document;t.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const i=o.createSelection(e.selection||n.selection);const r=i.isCollapsed;if(i.isCollapsed){t.modifySelection(i,{direction:this.direction,unit:e.unit})}if(this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1)){this._replaceEntireContentWithParagraph(o);return}if(i.isCollapsed){return}let s=0;i.getFirstRange().getMinimalFlatRanges().forEach(e=>{s+=gl(e.getWalker({singleCharacters:true,ignoreElementEnd:true,shallow:true}))});t.deleteContent(i,{doNotResetEntireContent:r,direction:this.direction});this._buffer.input(s);o.setSelection(i);this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1){return false}const t=this.editor.model;const n=t.document;const o=n.selection;const i=t.schema.getLimitElement(o);const r=o.isCollapsed&&o.containsEntireContent(i);if(!r){return false}if(!t.schema.checkChild(i,\"paragraph\")){return false}const s=i.getChild(0);if(s&&s.name===\"paragraph\"){return false}return true}_replaceEntireContentWithParagraph(e){const t=this.editor.model;const n=t.document;const o=n.selection;const i=t.schema.getLimitElement(o);const r=e.createElement(\"paragraph\");e.remove(e.createRangeIn(i));e.insert(r,i);e.setSelection(r,0)}}class lC extends Xd{constructor(e){super(e);const t=e.document;let n=0;t.on(\"keyup\",(e,t)=>{if(t.keyCode==Ml.delete||t.keyCode==Ml.backspace){n=0}});t.on(\"keydown\",(e,t)=>{const i={};if(t.keyCode==Ml.delete){i.direction=\"forward\";i.unit=\"character\"}else if(t.keyCode==Ml.backspace){i.direction=\"backward\";i.unit=\"codePoint\"}else{return}const r=Tl.isMac?t.altKey:t.ctrlKey;i.unit=r?\"word\":i.unit;i.sequence=++n;o(e,t.domEvent,i)});if(Tl.isAndroid){t.on(\"beforeinput\",(t,n)=>{if(n.domEvent.inputType!=\"deleteContentBackward\"){return}const i={unit:\"codepoint\",direction:\"backward\",sequence:1};const r=n.domTarget.ownerDocument.defaultView.getSelection();if(r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset){i.selectionToRemove=e.domConverter.domSelectionToView(r)}o(t,n.domEvent,i)})}function o(e,n,o){let i;t.once(\"delete\",e=>i=e,{priority:Number.POSITIVE_INFINITY});t.fire(\"delete\",new Zu(t,n,o));if(i&&i.stop.called){e.stop()}}}observe(){}}class dC extends tk{static get pluginName(){return\"Delete\"}init(){const e=this.editor;const t=e.editing.view;const n=t.document;t.addObserver(lC);e.commands.add(\"forwardDelete\",new cC(e,\"forward\"));e.commands.add(\"delete\",new cC(e,\"backward\"));this.listenTo(n,\"delete\",(n,o)=>{const i={unit:o.unit,sequence:o.sequence};if(o.selectionToRemove){const t=e.model.createSelection();const n=[];for(const t of o.selectionToRemove.getRanges()){n.push(e.editing.mapper.toModelRange(t))}t.setTo(n);i.selection=t}e.execute(o.direction==\"forward\"?\"forwardDelete\":\"delete\",i);o.preventDefault();t.scrollToTheSelection()});if(Tl.isAndroid){let e=null;this.listenTo(n,\"delete\",(t,n)=>{const o=n.domTarget.ownerDocument.defaultView.getSelection();e={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}},{priority:\"lowest\"});this.listenTo(n,\"keyup\",(t,n)=>{if(e){const t=n.domTarget.ownerDocument.defaultView.getSelection();t.collapse(e.anchorNode,e.anchorOffset);t.extend(e.focusNode,e.focusOffset);e=null}})}}}class uC extends tk{static get requires(){return[yv,dC]}static get pluginName(){return\"Typing\"}}const hC=new Map;function fC(e,t,n){let o=hC.get(e);if(!o){o=new Map;hC.set(e,o)}o.set(t,n)}function gC(e,t){const n=hC.get(e);if(n&&n.has(t)){return n.get(t)}return mC}function mC(e){return[e]}function pC(e,t,n={}){const o=gC(e.constructor,t.constructor);try{e=e.clone();return o(e,t,n)}catch(e){throw e}}function bC(e,t,n){e=e.slice();t=t.slice();const o=new wC(n.document,n.useRelations,n.forceWeakRemove);o.setOriginalOperations(e);o.setOriginalOperations(t);const i=o.originalOperations;if(e.length==0||t.length==0){return{operationsA:e,operationsB:t,originalOperations:i}}const r=new WeakMap;for(const t of e){r.set(t,0)}const s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;while(a{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const o=e.range.getDifference(t.range).map(t=>new gm(t,e.key,e.oldValue,e.newValue,0));const i=e.range.getIntersection(t.range);if(i){if(n.aIsStrong){o.push(new gm(i,t.key,t.newValue,e.newValue,0))}}if(o.length==0){return[new $m(0)]}return o}else{return[e]}});fC(gm,bm,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const n=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes);const o=n.map(t=>new gm(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const n=vC(t,e.key,e.oldValue);if(n){o.unshift(n)}}return o}e.range=e.range._getTransformedByInsertion(t.position,t.howMany,false)[0];return[e]});function vC(e,t,n){const o=e.nodes;const i=o.getNode(0).getAttribute(t);if(i==n){return null}const r=new ef(e.position,e.position.getShiftedBy(e.howMany));return new gm(r,t,i,n,0)}fC(gm,vm,(e,t)=>{const n=[];if(e.range.start.hasSameParentAs(t.deletionPosition)){if(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition)){n.push(ef._createFromPositionAndShift(t.graveyardPosition,1))}}const o=e.range._getTransformedByMergeOperation(t);if(!o.isCollapsed){n.push(o)}return n.map(t=>new gm(t,e.key,e.oldValue,e.newValue,e.baseVersion))});fC(gm,pm,(e,t)=>{const n=yC(e.range,t);return n.map(t=>new gm(t,e.key,e.oldValue,e.newValue,e.baseVersion))});function yC(e,t){const n=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);let o=null;let i=[];if(n.containsRange(e,true)){o=e}else if(e.start.hasSameParentAs(n.start)){i=e.getDifference(n);o=e.getIntersection(n)}else{i=[e]}const r=[];for(let e of i){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const n=t.getMovedRangeStart();const o=e.start.hasSameParentAs(n);e=e._getTransformedByInsertion(n,t.howMany,o);r.push(...e)}if(o){r.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,false)[0])}return r}fC(gm,ym,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.range.end.offset++}return[e]}if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const n=e.clone();n.range=new ef(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition));e.range.end=t.splitPosition.clone();e.range.end.stickiness=\"toPrevious\";return[e,n]}e.range=e.range._getTransformedBySplitOperation(t);return[e]});fC(bm,gm,(e,t)=>{const n=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const o=vC(e,t.key,t.newValue);if(o){n.push(o)}}return n});fC(bm,bm,(e,t,n)=>{if(e.position.isEqual(t.position)&&n.aIsStrong){return[e]}e.position=e.position._getTransformedByInsertOperation(t);return[e]});fC(bm,pm,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});fC(bm,ym,(e,t)=>{e.position=e.position._getTransformedBySplitOperation(t);return[e]});fC(bm,vm,(e,t)=>{e.position=e.position._getTransformedByMergeOperation(t);return[e]});fC(wm,bm,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]}if(e.newRange){e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]}return[e]});fC(wm,wm,(e,t,n)=>{if(e.name==t.name){if(n.aIsStrong){e.oldRange=t.newRange?t.newRange.clone():null}else{return[new $m(0)]}}return[e]});fC(wm,vm,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByMergeOperation(t)}if(e.newRange){e.newRange=e.newRange._getTransformedByMergeOperation(t)}return[e]});fC(wm,pm,(e,t,n)=>{if(e.oldRange){e.oldRange=ef._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))}if(e.newRange){if(n.abRelation){const o=ef._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if(n.abRelation.side==\"left\"&&t.targetPosition.isEqual(e.newRange.start)){e.newRange.start.path=n.abRelation.path;e.newRange.end=o.end;return[e]}else if(n.abRelation.side==\"right\"&&t.targetPosition.isEqual(e.newRange.end)){e.newRange.start=o.start;e.newRange.end.path=n.abRelation.path;return[e]}}e.newRange=ef._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]});fC(wm,ym,(e,t,n)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedBySplitOperation(t)}if(e.newRange){if(n.abRelation){const o=e.newRange._getTransformedBySplitOperation(t);if(e.newRange.start.isEqual(t.splitPosition)&&n.abRelation.wasStartBeforeMergedElement){e.newRange.start=Yh._createAt(t.insertionPosition)}else if(e.newRange.start.isEqual(t.splitPosition)&&!n.abRelation.wasInLeftElement){e.newRange.start=Yh._createAt(t.moveTargetPosition)}if(e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasInRightElement){e.newRange.end=Yh._createAt(t.moveTargetPosition)}else if(e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasEndBeforeMergedElement){e.newRange.end=Yh._createAt(t.insertionPosition)}else{e.newRange.end=o.end}return[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]});fC(vm,bm,(e,t)=>{if(e.sourcePosition.hasSameParentAs(t.position)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t);e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t);return[e]});fC(vm,vm,(e,t,n)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(!n.bWasUndone){return[new $m(0)]}else{const n=t.graveyardPosition.path.slice();n.push(0);e.sourcePosition=new Yh(t.graveyardPosition.root,n);e.howMany=0;return[e]}}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!n.bWasUndone&&n.abRelation!=\"splitAtSource\"){const o=e.targetPosition.root.rootName==\"$graveyard\";const i=t.targetPosition.root.rootName==\"$graveyard\";const r=o&&!i;const s=i&&!o;const a=s||!r&&n.aIsStrong;if(a){const n=t.targetPosition._getTransformedByMergeOperation(t);const o=e.targetPosition._getTransformedByMergeOperation(t);return[new pm(n,e.howMany,o,0)]}else{return[new $m(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t);e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);if(!e.graveyardPosition.isEqual(t.graveyardPosition)||!n.aIsStrong){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});fC(vm,pm,(e,t,n)=>{const o=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);if(t.type==\"remove\"&&!n.bWasUndone&&!n.forceWeakRemove){if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)){return[new $m(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}if(e.sourcePosition.hasSameParentAs(t.sourcePosition)){e.howMany-=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t);e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t);if(!e.graveyardPosition.isEqual(t.targetPosition)){e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}return[e]});fC(vm,ym,(e,t,n)=>{if(t.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1);if(e.deletionPosition.isEqual(t.graveyardPosition)){e.howMany=t.howMany}}if(e.targetPosition.isEqual(t.splitPosition)){const o=t.howMany!=0;const i=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(o||i||n.abRelation==\"mergeTargetNotMoved\"){e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.isEqual(t.splitPosition)){if(n.abRelation==\"mergeSourceNotMoved\"){e.howMany=0;e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}if(n.abRelation==\"mergeSameElement\"||e.sourcePosition.offset>0){e.sourcePosition=t.moveTargetPosition.clone();e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.hasSameParentAs(t.splitPosition)){e.howMany=t.splitPosition.offset}e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]});fC(pm,bm,(e,t)=>{const n=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const o=n._getTransformedByInsertOperation(t,false)[0];e.sourcePosition=o.start;e.howMany=o.end.offset-o.start.offset;if(!e.targetPosition.isEqual(t.position)){e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)}return[e]});fC(pm,pm,(e,t,n)=>{const o=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const i=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);let r=n.aIsStrong;let s=!n.aIsStrong;if(n.abRelation==\"insertBefore\"||n.baRelation==\"insertAfter\"){s=true}else if(n.abRelation==\"insertAfter\"||n.baRelation==\"insertBefore\"){s=false}let a;if(e.targetPosition.isEqual(t.targetPosition)&&s){a=e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}else{a=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}if(xC(e,t)&&xC(t,e)){return[t.getReversed()]}const c=o.containsPosition(t.targetPosition);if(c&&o.containsRange(i,true)){o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return CC([o],a)}const l=i.containsPosition(e.targetPosition);if(l&&i.containsRange(o,true)){o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart());o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart());return CC([o],a)}const d=Ns(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(d==\"prefix\"||d==\"extension\"){o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return CC([o],a)}if(e.type==\"remove\"&&t.type!=\"remove\"&&!n.aWasUndone&&!n.forceWeakRemove){r=true}else if(e.type!=\"remove\"&&t.type==\"remove\"&&!n.bWasUndone&&!n.forceWeakRemove){r=false}const u=[];const h=o.getDifference(i);for(const e of h){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany);e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const n=Ns(e.start.getParentPath(),t.getMovedRangeStart().getParentPath())==\"same\";const o=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,n);u.push(...o)}const f=o.getIntersection(i);if(f!==null&&r){f.start=f.start._getCombined(t.sourcePosition,t.getMovedRangeStart());f.end=f.end._getCombined(t.sourcePosition,t.getMovedRangeStart());if(u.length===0){u.push(f)}else if(u.length==1){if(i.start.isBefore(o.start)||i.start.isEqual(o.start)){u.unshift(f)}else{u.push(f)}}else{u.splice(1,0,f)}}if(u.length===0){return[new $m(e.baseVersion)]}return CC(u,a)});fC(pm,ym,(e,t,n)=>{let o=e.targetPosition.clone();if(!e.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||n.abRelation==\"moveTargetAfter\"){o=e.targetPosition._getTransformedBySplitOperation(t)}const i=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);if(i.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.howMany++}e.targetPosition=o;return[e]}if(i.start.hasSameParentAs(t.splitPosition)&&i.containsPosition(t.splitPosition)){let e=new ef(t.splitPosition,i.end);e=e._getTransformedBySplitOperation(t);const n=[new ef(i.start,t.splitPosition),e];return CC(n,o)}if(e.targetPosition.isEqual(t.splitPosition)&&n.abRelation==\"insertAtSource\"){o=t.moveTargetPosition}if(e.targetPosition.isEqual(t.insertionPosition)&&n.abRelation==\"insertBetween\"){o=e.targetPosition}const r=i._getTransformedBySplitOperation(t);const s=[r];if(t.graveyardPosition){const o=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);if(e.howMany>1&&o&&!n.aWasUndone){s.push(ef._createFromPositionAndShift(t.insertionPosition,1))}}return CC(s,o)});fC(pm,vm,(e,t,n)=>{const o=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition)){if(e.type==\"remove\"&&!n.forceWeakRemove){if(!n.aWasUndone){const n=[];let o=t.graveyardPosition.clone();let i=t.targetPosition._getTransformedByMergeOperation(t);if(e.howMany>1){n.push(new pm(e.sourcePosition,e.howMany-1,e.targetPosition,0));o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1);i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1)}const r=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition);const s=new pm(o,1,r,0);const a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Yh(s.targetPosition.root,a);i=i._getTransformedByMove(o,r,1);const l=new pm(i,t.howMany,c,0);n.push(s);n.push(l);return n}}else{if(e.howMany==1){if(!n.bWasUndone){return[new $m(0)]}else{e.sourcePosition=t.graveyardPosition.clone();e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]}}}}const i=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const r=i._getTransformedByMergeOperation(t);e.sourcePosition=r.start;e.howMany=r.end.offset-r.start.offset;e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]});fC(km,bm,(e,t)=>{e.position=e.position._getTransformedByInsertOperation(t);return[e]});fC(km,vm,(e,t)=>{if(e.position.isEqual(t.deletionPosition)){e.position=t.graveyardPosition.clone();e.position.stickiness=\"toNext\";return[e]}e.position=e.position._getTransformedByMergeOperation(t);return[e]});fC(km,pm,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});fC(km,km,(e,t,n)=>{if(e.position.isEqual(t.position)){if(n.aIsStrong){e.oldName=t.newName}else{return[new $m(0)]}}return[e]});fC(km,ym,(e,t)=>{const n=e.position.path;const o=t.splitPosition.getParentPath();if(Ns(n,o)==\"same\"&&!t.graveyardPosition){const t=new km(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}e.position=e.position._getTransformedBySplitOperation(t);return[e]});fC(_m,_m,(e,t,n)=>{if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue){return[new $m(0)]}else{e.oldValue=t.newValue}}return[e]});fC(ym,bm,(e,t)=>{if(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!n.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const o=new Yh(t.graveyardPosition.root,n);const i=ym.getInsertionPosition(new Yh(t.graveyardPosition.root,n));const r=new ym(o,0,null,0);r.insertionPosition=i;e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=ym.getInsertionPosition(e.splitPosition);e.graveyardPosition=r.insertionPosition.clone();e.graveyardPosition.stickiness=\"toNext\";return[r,e]}if(e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)){e.howMany--}if(e.splitPosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=ym.getInsertionPosition(e.splitPosition);if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});fC(ym,pm,(e,t,n)=>{const o=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const i=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!n.bWasUndone&&i){const n=e.splitPosition._getTransformedByMoveOperation(t);const o=e.graveyardPosition._getTransformedByMoveOperation(t);const i=o.path.slice();i.push(0);const r=new Yh(o.root,i);const s=new pm(n,e.howMany,r,0);return[s]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){const n=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);e.howMany-=n;if(e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition){return[new $m(0)]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){return[new $m(0)]}if(n.abRelation==\"splitBefore\"){e.howMany=0;e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t);return[e]}}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const o=e.splitPosition.root.rootName==\"$graveyard\";const i=t.splitPosition.root.rootName==\"$graveyard\";const r=o&&!i;const s=i&&!o;const a=s||!r&&n.aIsStrong;if(a){const n=[];if(t.howMany){n.push(new pm(t.moveTargetPosition,t.howMany,t.splitPosition,0))}if(e.howMany){n.push(new pm(e.splitPosition,e.howMany,e.moveTargetPosition,0))}return n}else{return[new $m(0)]}}if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)}if(e.splitPosition.isEqual(t.insertionPosition)&&n.abRelation==\"splitBefore\"){e.howMany++;return[e]}if(t.splitPosition.isEqual(e.insertionPosition)&&n.baRelation==\"splitBefore\"){const n=t.insertionPosition.path.slice();n.push(0);const o=new Yh(t.insertionPosition.root,n);const i=new pm(e.insertionPosition,1,o,0);return[e,i]}if(e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection;const n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n});this.refresh()}clearStack(){this._stack=[];this.refresh()}_restoreSelection(e,t,n){const o=this.editor.model;const i=o.document;const r=[];const s=e.map(e=>e.getTransformedByOperations(n));const a=s.flat();for(const e of s){const t=e.filter(e=>!PC(e,a));TC(t);const n=t.find(e=>e.root!=i.graveyard);if(n){r.push(n)}}if(r.length){o.change(e=>{e.setSelection(r,{backward:t})})}}_undo(e,t){const n=this.editor.model;const o=n.document;this._createdBatches.add(t);const i=e.operations.slice().filter(e=>e.isDocumentOperation);i.reverse();for(const e of i){const i=e.baseVersion+1;const r=Array.from(o.history.getOperations(i));const s=bC([e.getReversed()],r,{useRelations:true,document:this.editor.model.document,padWithNoOps:false,forceWeakRemove:true});const a=s.operationsA;for(const i of a){t.addOperation(i);n.applyOperation(i);o.history.setOperationAsUndone(e,i)}}}}function TC(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,true))}class SC extends AC{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1;const n=this._stack.splice(t,1)[0];const o=this.editor.model.createBatch(\"transparent\");this.editor.model.enqueueChange(o,()=>{this._undo(n.batch,o);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e);this.fire(\"revert\",n.batch,o)});this.refresh()}}class EC extends AC{execute(){const e=this._stack.pop();const t=this.editor.model.createBatch(\"transparent\");this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1];const o=n.baseVersion+1;const i=this.editor.model.document.history.getOperations(o);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i);this._undo(e.batch,t)});this.refresh()}}class RC extends tk{static get pluginName(){return\"UndoEditing\"}constructor(e){super(e);this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new SC(e);this._redoCommand=new EC(e);e.commands.add(\"undo\",this._undoCommand);e.commands.add(\"redo\",this._redoCommand);this.listenTo(e.model,\"applyOperation\",(e,t)=>{const n=t[0];if(!n.isDocumentOperation){return}const o=n.batch;const i=this._redoCommand._createdBatches.has(o);const r=this._undoCommand._createdBatches.has(o);const s=this._batchRegistry.has(o);if(s||o.type==\"transparent\"&&!i&&!r){return}else{if(i){this._undoCommand.addBatch(o)}else if(!r){this._undoCommand.addBatch(o);this._redoCommand.clearStack()}}this._batchRegistry.add(o)},{priority:\"highest\"});this.listenTo(this._undoCommand,\"revert\",(e,t,n)=>{this._redoCommand.addBatch(n)});e.keystrokes.set(\"CTRL+Z\",\"undo\");e.keystrokes.set(\"CTRL+Y\",\"redo\");e.keystrokes.set(\"CTRL+SHIFT+Z\",\"redo\")}}var IC='';var OC='';class VC extends tk{init(){const e=this.editor;const t=e.locale;const n=e.t;const o=t.uiLanguageDirection==\"ltr\"?IC:OC;const i=t.uiLanguageDirection==\"ltr\"?OC:IC;this._addButton(\"undo\",n(\"Undo\"),\"CTRL+Z\",o);this._addButton(\"redo\",n(\"Redo\"),\"CTRL+Y\",i)}_addButton(e,t,n,o){const i=this.editor;i.ui.componentFactory.add(e,r=>{const s=i.commands.get(e);const a=new Aw(r);a.set({label:t,icon:o,keystroke:n,tooltip:true});a.bind(\"isEnabled\").to(s,\"isEnabled\");this.listenTo(a,\"execute\",()=>{i.execute(e);i.editing.view.focus()});return a})}}class MC extends tk{static get requires(){return[RC,VC]}static get pluginName(){return\"Undo\"}}class NC extends tk{static get requires(){return[Iv,eC,aC,xx,uC,MC]}static get pluginName(){return\"Essentials\"}}class zC extends ok{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const t=e.document;this.value=t.selection.getAttribute(this.attributeKey);this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model;const n=t.document;const o=n.selection;const i=e.value;t.change(e=>{if(o.isCollapsed){if(i){e.setSelectionAttribute(this.attributeKey,i)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const n=t.schema.getValidRanges(o.getRanges(),this.attributeKey);for(const t of n){if(i){e.setAttribute(this.attributeKey,i,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}}var BC='';class DC extends Aw{constructor(e){super(e);const t=this.bindTemplate;this.set(\"color\");this.set(\"hasBorder\");this.icon=BC;this.extendTemplate({attributes:{style:{backgroundColor:t.to(\"color\")},class:[\"ck\",\"ck-color-grid__tile\",t.if(\"hasBorder\",\"ck-color-table__color-tile_bordered\")]}})}render(){super.render();this.iconView.fillColor=\"hsl(0, 0%, 100%)\"}}var FC=n(57);class LC extends Fb{constructor(e,t){super(e);const n=t&&t.colorDefinitions||[];const o={};if(t&&t.columns){o.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`}this.set(\"selectedColor\");this.items=this.createCollection();this.focusTracker=new Gp;this.keystrokes=new Mp;this._focusCycler=new nw({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"arrowleft\",focusNext:\"arrowright\"}});this.items.on(\"add\",(e,t)=>{t.isOn=t.color===this.selectedColor});n.forEach(e=>{const t=new DC;t.set({color:e.color,label:e.label,tooltip:true,hasBorder:e.options.hasBorder});t.on(\"execute\",()=>{this.fire(\"execute\",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})});this.items.add(t)});this.setTemplate({tag:\"div\",children:this.items,attributes:{class:[\"ck\",\"ck-color-grid\"],style:o}});this.on(\"change:selectedColor\",(e,t,n)=>{for(const e of this.items){e.isOn=e.color===n}})}focus(){if(this.items.length){this.items.first.focus()}}focusLast(){if(this.items.length){this.items.last.focus()}}render(){super.render();for(const e of this.items){this.focusTracker.add(e.element)}this.items.on(\"add\",(e,t)=>{this.focusTracker.add(t.element)});this.items.on(\"remove\",(e,t)=>{this.focusTracker.remove(t.element)});this.keystrokes.listenTo(this.element)}}class HC extends xs{constructor(e){super(e);this.set(\"isEmpty\",true);this.on(\"change\",()=>{this.set(\"isEmpty\",this.length===0)})}add(e,t){if(this.find(t=>t.color===e.color)){return}super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}ys(HC,Yc);var jC='';var qC=n(59);class WC extends Fb{constructor(e,{colors:t,columns:n,removeButtonLabel:o,documentColorsLabel:i,documentColorsCount:r}){super(e);this.items=this.createCollection();this.colorDefinitions=t;this.focusTracker=new Gp;this.keystrokes=new Mp;this.set(\"selectedColor\");this.removeButtonLabel=o;this.columns=n;this.documentColors=new HC;this.documentColorsCount=r;this._focusCycler=new nw({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"arrowup\",focusNext:\"arrowdown\"}});this._documentColorsLabel=i;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-color-table\"]},children:this.items});this.items.add(this._removeColorButton())}updateDocumentColors(e,t){const n=e.document;const o=this.documentColorsCount;this.documentColors.clear();for(const i of n.getRootNames()){const r=n.getRoot(i);const s=e.createRangeIn(r);for(const e of s.getItems()){if(e.is(\"$textProxy\")&&e.hasAttribute(t)){this._addColorToDocumentColors(e.getAttribute(t));if(this.documentColors.length>=o){return}}}}}updateSelectedColors(){const e=this.documentColorsGrid;const t=this.staticColorsGrid;const n=this.selectedColor;t.selectedColor=n;if(e){e.selectedColor=n}}render(){super.render();for(const e of this.items){this.focusTracker.add(e.element)}this.keystrokes.listenTo(this.element)}appendGrids(){if(this.staticColorsGrid){return}this.staticColorsGrid=this._createStaticColorsGrid();this.items.add(this.staticColorsGrid);if(this.documentColorsCount){const e=hb.bind(this.documentColors,this.documentColors);const t=new Kb(this.locale);t.text=this._documentColorsLabel;t.extendTemplate({attributes:{class:[\"ck\",\"ck-color-grid__label\",e.if(\"isEmpty\",\"ck-hidden\")]}});this.items.add(t);this.documentColorsGrid=this._createDocumentColorsGrid();this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const e=new Aw;e.set({withText:true,icon:jC,tooltip:true,label:this.removeButtonLabel});e.class=\"ck-color-table__remove-color\";e.on(\"execute\",()=>{this.fire(\"execute\",{value:null})});return e}_createStaticColorsGrid(){const e=new LC(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});e.delegate(\"execute\").to(this);return e}_createDocumentColorsGrid(){const e=hb.bind(this.documentColors,this.documentColors);const t=new LC(this.locale,{columns:this.columns});t.delegate(\"execute\").to(this);t.extendTemplate({attributes:{class:e.if(\"isEmpty\",\"ck-hidden\")}});t.items.bindTo(this.documentColors).using(e=>{const t=new DC;t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder});if(e.label){t.set({label:e.label,tooltip:true})}t.on(\"execute\",()=>{this.fire(\"execute\",{value:e.color})});return t});this.documentColors.on(\"change:isEmpty\",(e,n,o)=>{if(o){t.selectedColor=null}});return t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);if(!t){this.documentColors.add({color:e,label:e,options:{hasBorder:false}})}else{this.documentColors.add(Object.assign({},t))}}}const $C=\"fontSize\";const UC=\"fontFamily\";const GC=\"fontColor\";const KC=\"fontBackgroundColor\";function JC(e,t){const n={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t){n.model.values.push(e.model);n.view[e.model]=e.view;if(e.upcastAlso){n.upcastAlso[e.model]=e.upcastAlso}}return n}function YC(e){return t=>ZC(t.getStyle(e))}function QC(e){return(t,n)=>n.createAttributeElement(\"span\",{style:`${e}:${t}`},{priority:7})}function XC({dropdownView:e,colors:t,columns:n,removeButtonLabel:o,documentColorsLabel:i,documentColorsCount:r}){const s=e.locale;const a=new WC(s,{colors:t,columns:n,removeButtonLabel:o,documentColorsLabel:i,documentColorsCount:r});e.colorTableView=a;e.panelView.children.add(a);a.delegate(\"execute\").to(e,\"execute\");return a}function ZC(e){return e.replace(/\\s/g,\"\")}class eA extends zC{constructor(e){super(e,KC)}}const tA=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;const nA=/^rgb\\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\\)$/i;const oA=/^rgba\\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\\.?[0-9]+)\\)$/i;const iA=/^hsl\\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\\.?[0-9]+)?\\)$/i;const rA=/^hsla\\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\\.?[0-9]+)\\)$/i;const sA=new Set([\"black\",\"silver\",\"gray\",\"white\",\"maroon\",\"red\",\"purple\",\"fuchsia\",\"green\",\"lime\",\"olive\",\"yellow\",\"navy\",\"blue\",\"teal\",\"aqua\",\"orange\",\"aliceblue\",\"antiquewhite\",\"aquamarine\",\"azure\",\"beige\",\"bisque\",\"blanchedalmond\",\"blueviolet\",\"brown\",\"burlywood\",\"cadetblue\",\"chartreuse\",\"chocolate\",\"coral\",\"cornflowerblue\",\"cornsilk\",\"crimson\",\"cyan\",\"darkblue\",\"darkcyan\",\"darkgoldenrod\",\"darkgray\",\"darkgreen\",\"darkgrey\",\"darkkhaki\",\"darkmagenta\",\"darkolivegreen\",\"darkorange\",\"darkorchid\",\"darkred\",\"darksalmon\",\"darkseagreen\",\"darkslateblue\",\"darkslategray\",\"darkslategrey\",\"darkturquoise\",\"darkviolet\",\"deeppink\",\"deepskyblue\",\"dimgray\",\"dimgrey\",\"dodgerblue\",\"firebrick\",\"floralwhite\",\"forestgreen\",\"gainsboro\",\"ghostwhite\",\"gold\",\"goldenrod\",\"greenyellow\",\"grey\",\"honeydew\",\"hotpink\",\"indianred\",\"indigo\",\"ivory\",\"khaki\",\"lavender\",\"lavenderblush\",\"lawngreen\",\"lemonchiffon\",\"lightblue\",\"lightcoral\",\"lightcyan\",\"lightgoldenrodyellow\",\"lightgray\",\"lightgreen\",\"lightgrey\",\"lightpink\",\"lightsalmon\",\"lightseagreen\",\"lightskyblue\",\"lightslategray\",\"lightslategrey\",\"lightsteelblue\",\"lightyellow\",\"limegreen\",\"linen\",\"magenta\",\"mediumaquamarine\",\"mediumblue\",\"mediumorchid\",\"mediumpurple\",\"mediumseagreen\",\"mediumslateblue\",\"mediumspringgreen\",\"mediumturquoise\",\"mediumvioletred\",\"midnightblue\",\"mintcream\",\"mistyrose\",\"moccasin\",\"navajowhite\",\"oldlace\",\"olivedrab\",\"orangered\",\"orchid\",\"palegoldenrod\",\"palegreen\",\"paleturquoise\",\"palevioletred\",\"papayawhip\",\"peachpuff\",\"peru\",\"pink\",\"plum\",\"powderblue\",\"rosybrown\",\"royalblue\",\"saddlebrown\",\"salmon\",\"sandybrown\",\"seagreen\",\"seashell\",\"sienna\",\"skyblue\",\"slateblue\",\"slategray\",\"slategrey\",\"snow\",\"springgreen\",\"steelblue\",\"tan\",\"thistle\",\"tomato\",\"turquoise\",\"violet\",\"wheat\",\"whitesmoke\",\"yellowgreen\",\"rebeccapurple\",\"currentcolor\",\"transparent\"]);function aA(e){if(e.startsWith(\"#\")){return tA.test(e)}if(e.startsWith(\"rgb\")){return nA.test(e)||oA.test(e)}if(e.startsWith(\"hsl\")){return iA.test(e)||rA.test(e)}return sA.has(e.toLowerCase())}const cA=[\"none\",\"hidden\",\"dotted\",\"dashed\",\"solid\",\"double\",\"groove\",\"ridge\",\"inset\",\"outset\"];function lA(e){return cA.includes(e)}const dA=/^([+-]?[0-9]*[.]?[0-9]+(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function uA(e){return dA.test(e)}const hA=/^[+-]?[0-9]*[.]?[0-9]+%$/;function fA(e){return hA.test(e)}const gA=[\"repeat-x\",\"repeat-y\",\"repeat\",\"space\",\"round\",\"no-repeat\"];function mA(e){return gA.includes(e)}const pA=[\"center\",\"top\",\"bottom\",\"left\",\"right\"];function bA(e){return pA.includes(e)}const wA=[\"fixed\",\"scroll\",\"local\"];function kA(e){return wA.includes(e)}const _A=/^url\\(/;function vA(e){return _A.test(e)}function yA(e=\"\"){if(e===\"\"){return{top:undefined,right:undefined,bottom:undefined,left:undefined}}const t=TA(e);const n=t[0];const o=t[2]||n;const i=t[1]||n;const r=t[3]||i;return{top:n,bottom:o,right:i,left:r}}function xA(e){return t=>{const{top:n,right:o,bottom:i,left:r}=t;const s=[];if(![n,o,r,i].every(e=>!!e)){if(n){s.push([e+\"-top\",n])}if(o){s.push([e+\"-right\",o])}if(i){s.push([e+\"-bottom\",i])}if(r){s.push([e+\"-left\",r])}}else{s.push([e,CA(t)])}return s}}function CA({top:e,right:t,bottom:n,left:o}){const i=[];if(o!==t){i.push(e,t,n,o)}else if(n!==e){i.push(e,t,n)}else if(t!==e){i.push(e,t)}else{i.push(e)}return i.join(\" \")}function AA(e){return t=>({path:e,value:yA(t)})}function TA(e){return e.replace(/, /g,\",\").split(\" \").map(e=>e.replace(/,/g,\", \"))}function PA(e){e.setNormalizer(\"background\",SA);e.setNormalizer(\"background-color\",e=>({path:\"background.color\",value:e}));e.setReducer(\"background\",e=>{const t=[];t.push([\"background-color\",e.color]);return t})}function SA(e){const t={};const n=TA(e);for(const e of n){if(mA(e)){t.repeat=t.repeat||[];t.repeat.push(e)}else if(bA(e)){t.position=t.position||[];t.position.push(e)}else if(kA(e)){t.attachment=e}else if(aA(e)){t.color=e}else if(vA(e)){t.image=e}}return{path:\"background\",value:t}}class EA extends tk{static get pluginName(){return\"FontBackgroundColorEditing\"}constructor(e){super(e);e.config.define(KC,{colors:[{color:\"hsl(0, 0%, 0%)\",label:\"Black\"},{color:\"hsl(0, 0%, 30%)\",label:\"Dim grey\"},{color:\"hsl(0, 0%, 60%)\",label:\"Grey\"},{color:\"hsl(0, 0%, 90%)\",label:\"Light grey\"},{color:\"hsl(0, 0%, 100%)\",label:\"White\",hasBorder:true},{color:\"hsl(0, 75%, 60%)\",label:\"Red\"},{color:\"hsl(30, 75%, 60%)\",label:\"Orange\"},{color:\"hsl(60, 75%, 60%)\",label:\"Yellow\"},{color:\"hsl(90, 75%, 60%)\",label:\"Light green\"},{color:\"hsl(120, 75%, 60%)\",label:\"Green\"},{color:\"hsl(150, 75%, 60%)\",label:\"Aquamarine\"},{color:\"hsl(180, 75%, 60%)\",label:\"Turquoise\"},{color:\"hsl(210, 75%, 60%)\",label:\"Light blue\"},{color:\"hsl(240, 75%, 60%)\",label:\"Blue\"},{color:\"hsl(270, 75%, 60%)\",label:\"Purple\"}],columns:5});e.data.addStyleProcessorRules(PA);e.conversion.for(\"upcast\").elementToAttribute({view:{name:\"span\",styles:{\"background-color\":/[\\s\\S]+/}},model:{key:KC,value:YC(\"background-color\")}});e.conversion.for(\"downcast\").attributeToElement({model:KC,view:QC(\"background-color\")});e.commands.add(KC,new eA(e));e.model.schema.extend(\"$text\",{allowAttributes:KC});e.model.schema.setAttributeProperties(KC,{isFormatting:true,copyOnEnter:true})}}function RA(e,t){const n=e.t;const o={Black:n(\"Black\"),\"Dim grey\":n(\"Dim grey\"),Grey:n(\"Grey\"),\"Light grey\":n(\"Light grey\"),White:n(\"White\"),Red:n(\"Red\"),Orange:n(\"Orange\"),Yellow:n(\"Yellow\"),\"Light green\":n(\"Light green\"),Green:n(\"Green\"),Aquamarine:n(\"Aquamarine\"),Turquoise:n(\"Turquoise\"),\"Light blue\":n(\"Light blue\"),Blue:n(\"Blue\"),Purple:n(\"Purple\")};return t.map(e=>{const t=o[e.label];if(t&&t!=e.label){e.label=t}return e})}function IA(e){return e.map(OA).filter(e=>!!e)}function OA(e){if(typeof e===\"string\"){return{model:e,label:e,hasBorder:false,view:{name:\"span\",styles:{color:e}}}}else{return{model:e.color,label:e.label||e.color,hasBorder:e.hasBorder===undefined?false:e.hasBorder,view:{name:\"span\",styles:{color:`${e.color}`}}}}}class VA extends tk{constructor(e,{commandName:t,icon:n,componentName:o,dropdownLabel:i}){super(e);this.commandName=t;this.componentName=o;this.icon=n;this.dropdownLabel=i;this.columns=e.config.get(`${this.componentName}.columns`);this.colorTableView}init(){const e=this.editor;const t=e.locale;const n=t.t;const o=e.commands.get(this.commandName);const i=IA(e.config.get(this.componentName).colors);const r=RA(t,i);const s=e.config.get(`${this.componentName}.documentColors`);e.ui.componentFactory.add(this.componentName,t=>{const i=Bw(t);this.colorTableView=XC({dropdownView:i,colors:r.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:n(\"Remove color\"),documentColorsLabel:s!==0?n(\"Document colors\"):undefined,documentColorsCount:s===undefined?this.columns:s});this.colorTableView.bind(\"selectedColor\").to(o,\"value\");i.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:true});i.extendTemplate({attributes:{class:\"ck-color-ui-dropdown\"}});i.bind(\"isEnabled\").to(o);i.on(\"execute\",(t,n)=>{e.execute(this.commandName,n);e.editing.view.focus()});i.on(\"change:isOpen\",(t,n,o)=>{i.colorTableView.appendGrids();if(o){if(s!==0){this.colorTableView.updateDocumentColors(e.model,this.componentName)}this.colorTableView.updateSelectedColors()}});return i})}}var MA='';class NA extends VA{constructor(e){const t=e.locale.t;super(e,{commandName:KC,componentName:KC,icon:MA,dropdownLabel:t(\"Font Background Color\")})}static get pluginName(){return\"FontBackgroundColorUI\"}}class zA extends tk{static get requires(){return[EA,NA]}static get pluginName(){return\"FontBackgroundColor\"}}class BA extends zC{constructor(e){super(e,GC)}}class DA extends tk{static get pluginName(){return\"FontColorEditing\"}constructor(e){super(e);e.config.define(GC,{colors:[{color:\"hsl(0, 0%, 0%)\",label:\"Black\"},{color:\"hsl(0, 0%, 30%)\",label:\"Dim grey\"},{color:\"hsl(0, 0%, 60%)\",label:\"Grey\"},{color:\"hsl(0, 0%, 90%)\",label:\"Light grey\"},{color:\"hsl(0, 0%, 100%)\",label:\"White\",hasBorder:true},{color:\"hsl(0, 75%, 60%)\",label:\"Red\"},{color:\"hsl(30, 75%, 60%)\",label:\"Orange\"},{color:\"hsl(60, 75%, 60%)\",label:\"Yellow\"},{color:\"hsl(90, 75%, 60%)\",label:\"Light green\"},{color:\"hsl(120, 75%, 60%)\",label:\"Green\"},{color:\"hsl(150, 75%, 60%)\",label:\"Aquamarine\"},{color:\"hsl(180, 75%, 60%)\",label:\"Turquoise\"},{color:\"hsl(210, 75%, 60%)\",label:\"Light blue\"},{color:\"hsl(240, 75%, 60%)\",label:\"Blue\"},{color:\"hsl(270, 75%, 60%)\",label:\"Purple\"}],columns:5});e.conversion.for(\"upcast\").elementToAttribute({view:{name:\"span\",styles:{color:/[\\s\\S]+/}},model:{key:GC,value:YC(\"color\")}});e.conversion.for(\"downcast\").attributeToElement({model:GC,view:QC(\"color\")});e.commands.add(GC,new BA(e));e.model.schema.extend(\"$text\",{allowAttributes:GC});e.model.schema.setAttributeProperties(GC,{isFormatting:true,copyOnEnter:true})}}var FA='';class LA extends VA{constructor(e){const t=e.locale.t;super(e,{commandName:GC,componentName:GC,icon:FA,dropdownLabel:t(\"Font Color\")})}static get pluginName(){return\"FontColorUI\"}}class HA extends tk{static get requires(){return[DA,LA]}static get pluginName(){return\"FontColor\"}}class jA extends zC{constructor(e){super(e,UC)}}function qA(e){return e.map(WA).filter(e=>!!e)}function WA(e){if(typeof e===\"object\"){return e}if(e===\"default\"){return{title:\"Default\",model:undefined}}if(typeof e!==\"string\"){return}return $A(e)}function $A(e){const t=e.replace(/\"|'/g,\"\").split(\",\");const n=t[0];const o=t.map(UA).join(\", \");return{title:n,model:o,view:{name:\"span\",styles:{\"font-family\":o},priority:7}}}function UA(e){e=e.trim();if(e.indexOf(\" \")>0){e=`'${e}'`}return e}class GA extends tk{static get pluginName(){return\"FontFamilyEditing\"}constructor(e){super(e);e.config.define(UC,{options:[\"default\",\"Arial, Helvetica, sans-serif\",\"Courier New, Courier, monospace\",\"Georgia, serif\",\"Lucida Sans Unicode, Lucida Grande, sans-serif\",\"Tahoma, Geneva, sans-serif\",\"Times New Roman, Times, serif\",\"Trebuchet MS, Helvetica, sans-serif\",\"Verdana, Geneva, sans-serif\"],supportAllValues:false})}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:UC});e.model.schema.setAttributeProperties(UC,{isFormatting:true,copyOnEnter:true});const t=qA(e.config.get(\"fontFamily.options\")).filter(e=>e.model);const n=JC(UC,t);if(e.config.get(\"fontFamily.supportAllValues\")){this._prepareAnyValueConverters()}else{e.conversion.attributeToElement(n)}e.commands.add(UC,new jA(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for(\"downcast\").attributeToElement({model:UC,view:(e,t)=>t.createAttributeElement(\"span\",{style:\"font-family:\"+e},{priority:7})});e.conversion.for(\"upcast\").attributeToAttribute({model:{key:UC,value:e=>e.getStyle(\"font-family\")},view:{name:\"span\",styles:{\"font-family\":/.*/}}})}}var KA='';class JA extends tk{init(){const e=this.editor;const t=e.t;const n=this._getLocalizedOptions();const o=e.commands.get(UC);e.ui.componentFactory.add(UC,i=>{const r=Bw(i);Fw(r,YA(n,o));r.buttonView.set({label:t(\"Font Family\"),icon:KA,tooltip:true});r.extendTemplate({attributes:{class:\"ck-font-family-dropdown\"}});r.bind(\"isEnabled\").to(o);this.listenTo(r,\"execute\",t=>{e.execute(t.source.commandName,{value:t.source.commandParam});e.editing.view.focus()});return r})}_getLocalizedOptions(){const e=this.editor;const t=e.t;const n=qA(e.config.get(UC).options);return n.map(e=>{if(e.title===\"Default\"){e.title=t(\"Default\")}return e})}}function YA(e,t){const n=new xs;for(const o of e){const e={type:\"button\",model:new Wx({commandName:UC,commandParam:o.model,label:o.title,withText:true})};e.model.bind(\"isOn\").to(t,\"value\",e=>{if(e===o.model){return true}if(!e||!o.model){return false}return e.split(\",\")[0].replace(/'/g,\"\").toLowerCase()===o.model.toLowerCase()});if(o.view&&o.view.styles){e.model.set(\"labelStyle\",`font-family: ${o.view.styles[\"font-family\"]}`)}n.add(e)}return n}class QA extends tk{static get requires(){return[GA,JA]}static get pluginName(){return\"FontFamily\"}}class XA extends zC{constructor(e){super(e,$C)}}function ZA(e){return e.map(e=>tT(e)).filter(e=>!!e)}const eT={get tiny(){return{title:\"Tiny\",model:\"tiny\",view:{name:\"span\",classes:\"text-tiny\",priority:7}}},get small(){return{title:\"Small\",model:\"small\",view:{name:\"span\",classes:\"text-small\",priority:7}}},get big(){return{title:\"Big\",model:\"big\",view:{name:\"span\",classes:\"text-big\",priority:7}}},get huge(){return{title:\"Huge\",model:\"huge\",view:{name:\"span\",classes:\"text-huge\",priority:7}}}};function tT(e){if(rT(e)){return oT(e)}const t=iT(e);if(t){return oT(t)}if(e===\"default\"){return{model:undefined,title:\"Default\"}}if(sT(e)){return}return nT(e)}function nT(e){if(typeof e===\"number\"||typeof e===\"string\"){e={title:String(e),model:`${parseFloat(e)}px`}}e.view={name:\"span\",styles:{\"font-size\":e.model}};return oT(e)}function oT(e){if(!e.view.priority){e.view.priority=7}return e}function iT(e){return eT[e]||eT[e.model]}function rT(e){return typeof e===\"object\"&&e.title&&e.model&&e.view}function sT(e){let t;if(typeof e===\"object\"){if(!e.model){throw new ss[\"b\"](\"font-size-invalid-definition: Provided font size definition is invalid.\",null,e)}else{t=parseFloat(e.model)}}else{t=parseFloat(e)}return isNaN(t)}class aT extends tk{static get pluginName(){return\"FontSizeEditing\"}constructor(e){super(e);e.config.define($C,{options:[\"tiny\",\"small\",\"default\",\"big\",\"huge\"],supportAllValues:false})}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:$C});e.model.schema.setAttributeProperties($C,{isFormatting:true,copyOnEnter:true});const t=e.config.get(\"fontSize.supportAllValues\");const n=ZA(this.editor.config.get(\"fontSize.options\")).filter(e=>e.model);const o=JC($C,n);if(t){this._prepareAnyValueConverters(o)}else{e.conversion.attributeToElement(o)}e.commands.add($C,new XA(e))}_prepareAnyValueConverters(e){const t=this.editor;const n=e.model.values.filter(e=>!String(e).match(/[\\d.]+[\\w%]+/));if(n.length){throw new ss[\"b\"](\"font-size-invalid-use-of-named-presets: \"+\"If config.fontSize.supportAllValues is set to true, you need to use numerical values as font size options.\",null,{presets:n})}t.conversion.for(\"downcast\").attributeToElement({model:$C,view:(e,t)=>{if(!e){return}return t.createAttributeElement(\"span\",{style:\"font-size:\"+e},{priority:7})}});t.conversion.for(\"upcast\").attributeToAttribute({model:{key:$C,value:e=>e.getStyle(\"font-size\")},view:{name:\"span\"}})}}var cT='';var lT=n(61);class dT extends tk{init(){const e=this.editor;const t=e.t;const n=this._getLocalizedOptions();const o=e.commands.get($C);e.ui.componentFactory.add($C,i=>{const r=Bw(i);Fw(r,uT(n,o));r.buttonView.set({label:t(\"Font Size\"),icon:cT,tooltip:true});r.extendTemplate({attributes:{class:[\"ck-font-size-dropdown\"]}});r.bind(\"isEnabled\").to(o);this.listenTo(r,\"execute\",t=>{e.execute(t.source.commandName,{value:t.source.commandParam});e.editing.view.focus()});return r})}_getLocalizedOptions(){const e=this.editor;const t=e.t;const n={Default:t(\"Default\"),Tiny:t(\"Tiny\"),Small:t(\"Small\"),Big:t(\"Big\"),Huge:t(\"Huge\")};const o=ZA(e.config.get($C).options);return o.map(e=>{const t=n[e.title];if(t&&t!=e.title){e=Object.assign({},e,{title:t})}return e})}}function uT(e,t){const n=new xs;for(const o of e){const e={type:\"button\",model:new Wx({commandName:$C,commandParam:o.model,label:o.title,class:\"ck-fontsize-option\",withText:true})};if(o.view&&o.view.styles){e.model.set(\"labelStyle\",`font-size:${o.view.styles[\"font-size\"]}`)}if(o.view&&o.view.classes){e.model.set(\"class\",`${e.model.class} ${o.view.classes}`)}e.model.bind(\"isOn\").to(t,\"value\",e=>e===o.model);n.add(e)}return n}class hT extends tk{static get requires(){return[aT,dT]}static get pluginName(){return\"FontSize\"}}class fT extends ok{refresh(){const e=this.editor.model;const t=e.document;const n=rk(t.selection.getSelectedBlocks());this.value=!!n&&n.is(\"element\",\"paragraph\");this.isEnabled=!!n&&gT(n,e.schema)}execute(e={}){const t=this.editor.model;const n=t.document;t.change(o=>{const i=(e.selection||n.selection).getSelectedBlocks();for(const e of i){if(!e.is(\"element\",\"paragraph\")&&gT(e,t.schema)){o.rename(e,\"paragraph\")}}})}}function gT(e,t){return t.checkChild(e.parent,\"paragraph\")&&!t.isObject(e)}class mT extends ok{execute(e){const t=this.editor.model;let n=e.position;t.change(e=>{const o=e.createElement(\"paragraph\");if(!t.schema.checkChild(n.parent,o)){const i=t.schema.findAllowedParent(n,o);if(!i){return}n=e.split(n,i).position}t.insertContent(o,n);e.setSelection(o,\"in\")})}}class pT extends tk{static get pluginName(){return\"Paragraph\"}init(){const e=this.editor;const t=e.model;const n=e.data;e.commands.add(\"paragraph\",new fT(e));e.commands.add(\"insertParagraph\",new mT(e));t.schema.register(\"paragraph\",{inheritAllFrom:\"$block\"});e.conversion.elementToElement({model:\"paragraph\",view:\"p\"});e.conversion.for(\"upcast\").elementToElement({model:(e,t)=>{if(!pT.paragraphLikeElements.has(e.name)){return null}if(e.isEmpty){return null}return t.createElement(\"paragraph\")},converterPriority:\"low\"});n.upcastDispatcher.on(\"element\",(e,t,n)=>{if(!n.consumable.test(t.viewItem,{name:t.viewItem.name})){return}if(wT(t.viewItem,t.modelCursor,n.schema)){Object.assign(t,bT(t.viewItem,t.modelCursor,n))}},{priority:\"low\"});n.upcastDispatcher.on(\"text\",(e,t,n)=>{if(t.modelRange){return}if(wT(t.viewItem,t.modelCursor,n.schema)){Object.assign(t,bT(t.viewItem,t.modelCursor,n))}},{priority:\"lowest\"});t.document.registerPostFixer(e=>this._autoparagraphEmptyRoots(e));e.data.on(\"ready\",()=>{t.enqueueChange(\"transparent\",e=>this._autoparagraphEmptyRoots(e))},{priority:\"lowest\"})}_autoparagraphEmptyRoots(e){const t=this.editor.model;for(const n of t.document.getRootNames()){const o=t.document.getRoot(n);if(o.isEmpty&&o.rootName!=\"$graveyard\"){if(t.schema.checkChild(o,\"paragraph\")){e.insertElement(\"paragraph\",o);return true}}}}}pT.paragraphLikeElements=new Set([\"blockquote\",\"dd\",\"div\",\"dt\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"p\",\"td\"]);function bT(e,t,n){const o=n.writer.createElement(\"paragraph\");n.writer.insert(o,t);return n.convertItem(e,n.writer.createPositionAt(o,0))}function wT(e,t,n){const o=n.createContext(t);if(!n.checkChild(o,\"paragraph\")){return false}if(!n.checkChild(o.push(\"paragraph\"),e)){return false}return true}class kT extends ok{constructor(e,t){super(e);this.modelElements=t}refresh(){const e=rk(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name;this.isEnabled=!!e&&this.modelElements.some(t=>_T(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model;const n=t.document;const o=e.value;t.change(e=>{const i=Array.from(n.selection.getSelectedBlocks()).filter(e=>_T(e,o,t.schema));for(const t of i){if(!t.is(\"element\",o)){e.rename(t,o)}}})}}function _T(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const vT=\"paragraph\";class yT extends tk{static get pluginName(){return\"HeadingEditing\"}constructor(e){super(e);e.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[pT]}init(){const e=this.editor;const t=e.config.get(\"heading.options\");const n=[];for(const o of t){if(o.model!==vT){e.model.schema.register(o.model,{inheritAllFrom:\"$block\"});e.conversion.elementToElement(o);n.push(o.model)}}this._addDefaultH1Conversion(e);e.commands.add(\"heading\",new kT(e,n))}afterInit(){const e=this.editor;const t=e.commands.get(\"enter\");const n=e.config.get(\"heading.options\");if(t){this.listenTo(t,\"afterExecute\",(t,o)=>{const i=e.model.document.selection.getFirstPosition().parent;const r=n.some(e=>i.is(\"element\",e.model));if(r&&!i.is(\"element\",vT)&&i.childCount===0){o.writer.rename(i,vT)}})}}_addDefaultH1Conversion(e){e.conversion.for(\"upcast\").elementToElement({model:\"heading1\",view:\"h1\",converterPriority:is.get(\"low\")+1})}}function xT(e){const t=e.t;const n={Paragraph:t(\"Paragraph\"),\"Heading 1\":t(\"Heading 1\"),\"Heading 2\":t(\"Heading 2\"),\"Heading 3\":t(\"Heading 3\"),\"Heading 4\":t(\"Heading 4\"),\"Heading 5\":t(\"Heading 5\"),\"Heading 6\":t(\"Heading 6\")};return e.config.get(\"heading.options\").map(e=>{const t=n[e.title];if(t&&t!=e.title){e.title=t}return e})}var CT=n(12);class AT extends tk{init(){const e=this.editor;const t=e.t;const n=xT(e);const o=t(\"Choose heading\");const i=t(\"Heading\");e.ui.componentFactory.add(\"heading\",t=>{const r={};const s=new xs;const a=e.commands.get(\"heading\");const c=e.commands.get(\"paragraph\");const l=[a];for(const e of n){const t={type:\"button\",model:new Wx({label:e.title,class:e.class,withText:true})};if(e.model===\"paragraph\"){t.model.bind(\"isOn\").to(c,\"value\");t.model.set(\"commandName\",\"paragraph\");l.push(c)}else{t.model.bind(\"isOn\").to(a,\"value\",t=>t===e.model);t.model.set({commandName:\"heading\",commandValue:e.model})}s.add(t);r[e.model]=e.title}const d=Bw(t);Fw(d,s);d.buttonView.set({isOn:false,withText:true,tooltip:i});d.extendTemplate({attributes:{class:[\"ck-heading-dropdown\"]}});d.bind(\"isEnabled\").toMany(l,\"isEnabled\",(...e)=>e.some(e=>e));d.buttonView.bind(\"label\").to(a,\"value\",c,\"value\",(e,t)=>{const n=e||t&&\"paragraph\";return r[n]?r[n]:o});this.listenTo(d,\"execute\",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:undefined);e.editing.view.focus()});return d})}}class TT extends tk{static get requires(){return[yT,AT]}static get pluginName(){return\"Heading\"}}class PT extends ok{refresh(){const e=this.editor.model;const t=e.document;this.value=t.selection.getAttribute(\"highlight\");this.isEnabled=e.schema.checkAttributeInSelection(t.selection,\"highlight\")}execute(e={}){const t=this.editor.model;const n=t.document;const o=n.selection;const i=e.value;t.change(e=>{const n=t.schema.getValidRanges(o.getRanges(),\"highlight\");if(o.isCollapsed){const t=o.getFirstPosition();if(o.hasAttribute(\"highlight\")){const n=e=>e.item.hasAttribute(\"highlight\")&&e.item.getAttribute(\"highlight\")===this.value;const o=t.getLastMatchingPosition(n,{direction:\"backward\"});const r=t.getLastMatchingPosition(n);const s=e.createRange(o,r);if(!i||this.value===i){e.removeAttribute(\"highlight\",s);e.removeSelectionAttribute(\"highlight\")}else{e.setAttribute(\"highlight\",i,s);e.setSelectionAttribute(\"highlight\",i)}}else if(i){e.setSelectionAttribute(\"highlight\",i)}}else{for(const t of n){if(i){e.setAttribute(\"highlight\",i,t)}else{e.removeAttribute(\"highlight\",t)}}}})}}class ST extends tk{static get pluginName(){return\"HighlightEditing\"}constructor(e){super(e);e.config.define(\"highlight\",{options:[{model:\"yellowMarker\",class:\"marker-yellow\",title:\"Yellow marker\",color:\"var(--ck-highlight-marker-yellow)\",type:\"marker\"},{model:\"greenMarker\",class:\"marker-green\",title:\"Green marker\",color:\"var(--ck-highlight-marker-green)\",type:\"marker\"},{model:\"pinkMarker\",class:\"marker-pink\",title:\"Pink marker\",color:\"var(--ck-highlight-marker-pink)\",type:\"marker\"},{model:\"blueMarker\",class:\"marker-blue\",title:\"Blue marker\",color:\"var(--ck-highlight-marker-blue)\",type:\"marker\"},{model:\"redPen\",class:\"pen-red\",title:\"Red pen\",color:\"var(--ck-highlight-pen-red)\",type:\"pen\"},{model:\"greenPen\",class:\"pen-green\",title:\"Green pen\",color:\"var(--ck-highlight-pen-green)\",type:\"pen\"}]})}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:\"highlight\"});const t=e.config.get(\"highlight.options\");e.conversion.attributeToElement(ET(t));e.commands.add(\"highlight\",new PT(e))}}function ET(e){const t={model:{key:\"highlight\",values:[]},view:{}};for(const n of e){t.model.values.push(n.model);t.view[n.model]={name:\"mark\",classes:n.class}}return t}var RT='';var IT='';var OT=n(64);class VT extends tk{get localizedOptionTitles(){const e=this.editor.t;return{\"Yellow marker\":e(\"Yellow marker\"),\"Green marker\":e(\"Green marker\"),\"Pink marker\":e(\"Pink marker\"),\"Blue marker\":e(\"Blue marker\"),\"Red pen\":e(\"Red pen\"),\"Green pen\":e(\"Green pen\")}}static get pluginName(){return\"HighlightUI\"}init(){const e=this.editor.config.get(\"highlight.options\");for(const t of e){this._addHighlighterButton(t)}this._addRemoveHighlightButton();this._addDropdown(e)}_addRemoveHighlightButton(){const e=this.editor.t;this._addButton(\"removeHighlight\",e(\"Remove highlight\"),jC)}_addHighlighterButton(e){const t=this.editor.commands.get(\"highlight\");this._addButton(\"highlight:\"+e.model,e.title,NT(e.type),e.model,n);function n(n){n.bind(\"isEnabled\").to(t,\"isEnabled\");n.bind(\"isOn\").to(t,\"value\",t=>t===e.model);n.iconView.fillColor=e.color;n.isToggleable=true}}_addButton(e,t,n,o,i=(()=>{})){const r=this.editor;r.ui.componentFactory.add(e,e=>{const s=new Aw(e);const a=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;s.set({label:a,icon:n,tooltip:true});s.on(\"execute\",()=>{r.execute(\"highlight\",{value:o});r.editing.view.focus()});i(s);return s})}_addDropdown(e){const t=this.editor;const n=t.t;const o=t.ui.componentFactory;const i=e[0];const r=e.reduce((e,t)=>{e[t.model]=t;return e},{});o.add(\"highlight\",s=>{const a=t.commands.get(\"highlight\");const c=Bw(s,Ux);const l=c.buttonView;l.set({tooltip:n(\"Highlight\"),lastExecuted:i.model,commandValue:i.model,isToggleable:true});l.bind(\"icon\").to(a,\"value\",e=>NT(u(e,\"type\")));l.bind(\"color\").to(a,\"value\",e=>u(e,\"color\"));l.bind(\"commandValue\").to(a,\"value\",e=>u(e,\"model\"));l.bind(\"isOn\").to(a,\"value\",e=>!!e);l.delegate(\"execute\").to(c);const d=e.map(e=>{const t=o.create(\"highlight:\"+e.model);this.listenTo(t,\"execute\",()=>c.buttonView.set({lastExecuted:e.model}));return t});c.bind(\"isEnabled\").toMany(d,\"isEnabled\",(...e)=>e.some(e=>e));d.push(new iw);d.push(o.create(\"removeHighlight\"));Dw(c,d);MT(c);c.toolbarView.ariaLabel=n(\"Text highlight toolbar\");l.on(\"execute\",()=>{t.execute(\"highlight\",{value:l.commandValue});t.editing.view.focus()});function u(e,t){const n=!e||e===l.lastExecuted?l.lastExecuted:e;return r[n][t]}return c})}}function MT(e){const t=e.buttonView.actionView;t.iconView.bind(\"fillColor\").to(e.buttonView,\"color\")}function NT(e){return e===\"marker\"?RT:IT}class zT extends tk{static get requires(){return[ST,VT]}static get pluginName(){return\"Highlight\"}}var BT='\\n';var DT=n(66);const FT=[\"before\",\"after\"];const LT=(new DOMParser).parseFromString(BT,\"image/svg+xml\").firstChild;const HT=\"ck-widget__type-around_disabled\";class jT extends tk{static get pluginName(){return\"WidgetTypeAround\"}constructor(e){super(e);this._currentFakeCaretModelElement=null}init(){const e=this.editor;const t=e.editing.view;this.on(\"change:isEnabled\",(n,o,i)=>{t.change(e=>{for(const n of t.document.roots){if(i){e.removeClass(HT,n)}else{e.addClass(HT,n)}}});if(!i){e.model.change(e=>{e.removeSelectionAttribute(p_)})}});this._enableTypeAroundUIInjection();this._enableInsertingParagraphsOnButtonClick();this._enableInsertingParagraphsOnEnterKeypress();this._enableInsertingParagraphsOnTypingKeystroke();this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();this._enableDeleteIntegration();this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor;const o=n.editing.view;n.execute(\"insertParagraph\",{position:n.model.createPositionAt(e,t)});o.focus();o.scrollToTheSelection()}_listenToIfEnabled(e,t,n,o){this.listenTo(e,t,(...e)=>{if(this.isEnabled){n(...e)}},o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor;const t=e.model;const n=t.document.selection;const o=v_(n);if(!o){return false}const i=n.getSelectedElement();this._insertParagraph(i,o);return true}_enableTypeAroundUIInjection(){const e=this.editor;const t=e.model.schema;const n=e.locale.t;const o={before:n(\"Insert paragraph before block\"),after:n(\"Insert paragraph after block\")};e.editing.downcastDispatcher.on(\"insert\",(e,n,i)=>{const r=i.mapper.toViewElement(n.item);if(b_(r,n.item,t)){qT(i.writer,o,r)}},{priority:\"low\"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor;const t=e.model;const n=t.document.selection;const o=t.schema;const i=e.editing.view;this._listenToIfEnabled(i.document,\"keydown\",(e,t)=>{if(Dl(t.keyCode)){this._handleArrowKeyPress(e,t)}},{priority:is.get(\"high\")+10});this._listenToIfEnabled(n,\"change:range\",(t,n)=>{if(!n.directChange){return}e.model.change(e=>{e.removeSelectionAttribute(p_)})});this._listenToIfEnabled(t.document,\"change:data\",()=>{const t=n.getSelectedElement();if(t){const n=e.editing.mapper.toViewElement(t);if(b_(n,t,o)){return}}e.model.change(e=>{e.removeSelectionAttribute(p_)})});this._listenToIfEnabled(e.editing.downcastDispatcher,\"selection\",(e,t,n)=>{const i=n.writer;if(this._currentFakeCaretModelElement){const e=n.mapper.toViewElement(this._currentFakeCaretModelElement);if(e){i.removeClass(FT.map(r),e);this._currentFakeCaretModelElement=null}}const s=t.selection.getSelectedElement();if(!s){return}const a=n.mapper.toViewElement(s);if(!b_(a,s,o)){return}const c=v_(t.selection);if(!c){return}i.addClass(r(c),a);this._currentFakeCaretModelElement=s});this._listenToIfEnabled(e.ui.focusTracker,\"change:isFocused\",(t,n,o)=>{if(!o){e.model.change(e=>{e.removeSelectionAttribute(p_)})}});function r(e){return`ck-widget_type-around_show-fake-caret_${e}`}}_handleArrowKeyPress(e,t){const n=this.editor;const o=n.model;const i=o.document.selection;const r=o.schema;const s=n.editing.view;const a=t.keyCode;const c=Ll(a,n.locale.contentLanguageDirection);const l=s.document.selection.getSelectedElement();const d=n.editing.mapper.toModelElement(l);let u;if(b_(l,d,r)){u=this._handleArrowKeyPressOnSelectedWidget(c)}else if(i.isCollapsed){u=this._handleArrowKeyPressWhenSelectionNextToAWidget(c)}if(u){t.preventDefault();e.stop()}}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor;const n=t.model;const o=n.document.selection;const i=v_(o);return n.change(t=>{if(i){const n=i===(e?\"after\":\"before\");if(!n){t.removeSelectionAttribute(p_);return true}}else{t.setSelectionAttribute(p_,e?\"after\":\"before\");return true}return false})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor;const n=t.model;const o=n.schema;const i=t.plugins.get(\"Widget\");const r=i._getObjectElementNextToSelection(e);const s=t.editing.mapper.toViewElement(r);if(b_(s,r,o)){n.change(t=>{i._setSelectionOverElement(r);t.setSelectionAttribute(p_,e?\"before\":\"after\")});return true}return false}_enableInsertingParagraphsOnButtonClick(){const e=this.editor;const t=e.editing.view;this._listenToIfEnabled(t.document,\"mousedown\",(n,o)=>{const i=w_(o.domTarget);if(!i){return}const r=k_(i);const s=__(i,t.domConverter);const a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r);o.preventDefault();n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor;const t=e.editing.view;this._listenToIfEnabled(t.document,\"enter\",(n,o)=>{const i=t.document.selection.getSelectedElement();const r=e.editing.mapper.toModelElement(i);const s=e.model.schema;let a;if(this._insertParagraphAccordingToFakeCaretPosition()){a=true}else if(b_(i,r,s)){this._insertParagraph(r,o.isSoft?\"before\":\"after\");a=true}if(a){o.preventDefault();n.stop()}})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor;const t=e.editing.view;const n=[Ml.enter,Ml.delete,Ml.backspace];this._listenToIfEnabled(t.document,\"keydown\",(e,t)=>{if(!n.includes(t.keyCode)&&!hv(t)){this._insertParagraphAccordingToFakeCaretPosition()}},{priority:is.get(\"high\")+1})}_enableDeleteIntegration(){const e=this.editor;const t=e.editing.view;const n=e.model;const o=n.schema;this._listenToIfEnabled(t.document,\"delete\",(t,i)=>{const r=v_(n.document.selection);if(!r){return}const s=i.direction;const a=n.document.selection.getSelectedElement();const c=r===\"before\";const l=s==\"forward\";const d=c===l;if(d){e.execute(\"delete\",{selection:n.createSelection(a,\"on\")})}else{const t=o.getNearestSelectionRange(n.createPositionAt(a,r),s);if(t){if(!t.isCollapsed){n.change(n=>{n.setSelection(t);e.execute(l?\"forwardDelete\":\"delete\")})}else{const i=n.createSelection(t.start);n.modifySelection(i,{direction:s});if(!i.focus.isEqual(t.start)){n.change(n=>{n.setSelection(t);e.execute(l?\"forwardDelete\":\"delete\")})}else{const e=UT(o,t.start.parent);n.deleteContent(n.createSelection(e,\"on\"),{doNotAutoparagraph:true})}}}}i.preventDefault();t.stop()},{priority:is.get(\"high\")+1})}_enableInsertContentIntegration(){const e=this.editor;const t=this.editor.model;const n=t.document.selection;this._listenToIfEnabled(e.model,\"insertContent\",(e,[o,i])=>{if(i&&!i.is(\"documentSelection\")){return}const r=v_(n);if(!r){return}e.stop();return t.change(e=>{const i=n.getSelectedElement();const s=t.createPositionAt(i,r);const a=e.createSelection(s);const c=t.insertContent(o,a);e.setSelection(a);return c})},{priority:\"high\"})}}function qT(e,t,n){const o=e.createUIElement(\"div\",{class:\"ck ck-reset_all ck-widget__type-around\"},(function(e){const n=this.toDomElement(e);WT(n,t);$T(n);return n}));e.insert(e.createPositionAt(n,\"end\"),o)}function WT(e,t){for(const n of FT){const o=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-widget__type-around__button\",`ck-widget__type-around__button_${n}`],title:t[n]},children:[e.ownerDocument.importNode(LT,true)]});e.appendChild(o.render())}}function $T(e){const t=new hb({tag:\"div\",attributes:{class:[\"ck\",\"ck-widget__type-around__fake-caret\"]}});e.appendChild(t.render())}function UT(e,t){let n=t;for(const o of t.getAncestors({parentFirst:true})){if(o.childCount>1||e.isLimit(o)){break}n=o}return n}var GT=n(68);class KT extends tk{static get pluginName(){return\"Widget\"}static get requires(){return[jT]}init(){const e=this.editor.editing.view;const t=e.document;this._previouslySelected=new Set;this.editor.editing.downcastDispatcher.on(\"selection\",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const o=n.writer;const i=o.document.selection;const r=i.getSelectedElement();let s=null;for(const e of i.getRanges()){for(const t of e){const e=t.item;if(C_(e)&&!YT(e,s)){o.addClass(x_,e);this._previouslySelected.add(e);s=e;if(e==r){o.setSelection(i.getRanges(),{fake:true,label:S_(r)})}}}}},{priority:\"low\"});e.addObserver(X_);this.listenTo(t,\"mousedown\",(...e)=>this._onMousedown(...e));this.listenTo(t,\"keydown\",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{priority:\"high\"});this.listenTo(t,\"keydown\",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{priority:is.get(\"high\")-20});this.listenTo(t,\"delete\",(e,t)=>{if(this._handleDelete(t.direction==\"forward\")){t.preventDefault();e.stop()}},{priority:\"high\"})}_onMousedown(e,t){const n=this.editor;const o=n.editing.view;const i=o.document;let r=t.target;if(JT(r)){if((Tl.isSafari||Tl.isGecko)&&t.domEvent.detail>=3){const e=n.editing.mapper;const o=r.is(\"attributeElement\")?r.findAncestor(e=>!e.is(\"attributeElement\")):r;const i=e.toModelElement(o);t.preventDefault();this.editor.model.change(e=>{e.setSelection(i,\"in\")})}return}if(!C_(r)){r=r.findAncestor(C_);if(!r){return}}t.preventDefault();if(!i.isFocused){o.focus()}const s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode;if(!Dl(n)){return}const o=this.editor.model;const i=o.schema;const r=o.document.selection;const s=r.getSelectedElement();const a=Ll(n,this.editor.locale.contentLanguageDirection);if(s&&i.isObject(s)){const n=a?r.getLastPosition():r.getFirstPosition();const s=i.getNearestSelectionRange(n,a?\"forward\":\"backward\");if(s){o.change(e=>{e.setSelection(s)});t.preventDefault();e.stop()}return}if(!r.isCollapsed){return}const c=this._getObjectElementNextToSelection(a);if(c&&i.isObject(c)){this._setSelectionOverElement(c);t.preventDefault();e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=t.keyCode;if(!Dl(n)){return}const o=this.editor.model;const i=o.schema;const r=o.document.selection.getSelectedElement();if(r&&i.isObject(r)){t.preventDefault();e.stop()}}_handleDelete(e){if(this.editor.isReadOnly){return}const t=this.editor.model.document;const n=t.selection;if(!n.isCollapsed){return}const o=this._getObjectElementNextToSelection(e);if(o){this.editor.model.change(e=>{let t=n.anchor.parent;while(t.isEmpty){const n=t;t=n.parent;e.remove(n)}this._setSelectionOverElement(o)});return true}}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model;const n=t.schema;const o=t.document.selection;const i=t.createSelection(o);t.modifySelection(i,{direction:e?\"forward\":\"backward\"});const r=e?i.focus.nodeBefore:i.focus.nodeAfter;if(!!r&&n.isObject(r)){return r}return null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected){e.removeClass(x_,t)}this._previouslySelected.clear()}}function JT(e){while(e){if(e.is(\"editableElement\")&&!e.is(\"rootElement\")){return true}if(C_(e)){return false}e=e.parent}return false}function YT(e,t){if(!t){return false}return Array.from(e.getAncestors()).includes(t)}class QT extends ok{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=D_(e);if(D_(e)&&e.hasAttribute(\"alt\")){this.value=e.getAttribute(\"alt\")}else{this.value=false}}execute(e){const t=this.editor.model;const n=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute(\"alt\",e.newValue,n)})}}class XT extends tk{static get pluginName(){return\"ImageTextAlternativeEditing\"}init(){this.editor.commands.add(\"imageTextAlternative\",new QT(this.editor))}}var ZT=n(70);class eP extends Fb{constructor(e,t){super(e);const n=`ck-labeled-field-view-${ns()}`;const o=`ck-labeled-field-view-status-${ns()}`;this.fieldView=t(this,n,o);this.set(\"label\");this.set(\"isEnabled\",true);this.set(\"errorText\",null);this.set(\"infoText\",null);this.set(\"class\");this.labelView=this._createLabelView(n);this.statusView=this._createStatusView(o);this.bind(\"_statusText\").to(this,\"errorText\",this,\"infoText\",(e,t)=>e||t);const i=this.bindTemplate;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-labeled-field-view\",i.to(\"class\"),i.if(\"isEnabled\",\"ck-disabled\",e=>!e)]},children:[this.labelView,this.fieldView,this.statusView]})}_createLabelView(e){const t=new Kb(this.locale);t.for=e;t.bind(\"text\").to(this,\"label\");return t}_createStatusView(e){const t=new Fb(this.locale);const n=this.bindTemplate;t.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-labeled-field-view__status\",n.if(\"errorText\",\"ck-labeled-field-view__status_error\"),n.if(\"_statusText\",\"ck-hidden\",e=>!e)],id:e,role:n.if(\"errorText\",\"alert\")},children:[{text:n.to(\"_statusText\")}]});return t}focus(){this.fieldView.focus()}}var tP=n(72);class nP extends Fb{constructor(e){super(e);this.set(\"value\");this.set(\"id\");this.set(\"placeholder\");this.set(\"isReadOnly\",false);this.set(\"hasError\",false);this.set(\"ariaDescribedById\");const t=this.bindTemplate;this.setTemplate({tag:\"input\",attributes:{type:\"text\",class:[\"ck\",\"ck-input\",\"ck-input-text\",t.if(\"hasError\",\"ck-error\")],id:t.to(\"id\"),placeholder:t.to(\"placeholder\"),readonly:t.to(\"isReadOnly\"),\"aria-invalid\":t.if(\"hasError\",true),\"aria-describedby\":t.to(\"ariaDescribedById\")},on:{input:t.to(\"input\")}})}render(){super.render();const e=e=>{this.element.value=!e&&e!==0?\"\":e};e(this.value);this.on(\"change:value\",(t,n,o)=>{e(o)})}select(){this.element.select()}focus(){this.element.focus()}}function oP(e,t,n){const o=new nP(e.locale);o.set({id:t,ariaDescribedById:n});o.bind(\"isReadOnly\").to(e,\"isEnabled\",e=>!e);o.bind(\"hasError\").to(e,\"errorText\",e=>!!e);o.on(\"input\",()=>{e.errorText=null});return o}function iP(e,t,n){const o=Bw(e.locale);o.set({id:t,ariaDescribedById:n});o.bind(\"isEnabled\").to(e);return o}function rP({view:e}){e.listenTo(e.element,\"submit\",(t,n)=>{n.preventDefault();e.fire(\"submit\")},{useCapture:true})}var sP='';var aP='';var cP=n(74);class lP extends Fb{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Gp;this.keystrokes=new Mp;this.labeledInput=this._createLabeledInputView();this.saveButtonView=this._createButton(t(\"Save\"),sP,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(t(\"Cancel\"),aP,\"ck-button-cancel\",\"cancel\");this._focusables=new lb;this._focusCycler=new nw({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);rP({view:this});[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)})}_createButton(e,t,n,o){const i=new Aw(this.locale);i.set({label:e,icon:t,tooltip:true});i.extendTemplate({attributes:{class:n}});if(o){i.delegate(\"execute\").to(this,o)}return i}_createLabeledInputView(){const e=this.locale.t;const t=new eP(this.locale,oP);t.label=e(\"Text alternative\");t.fieldView.placeholder=e(\"Text alternative\");return t}}var dP='';var uP='';var hP=n(76);var fP=n(78);const gP=Xb(\"px\");class mP extends tk{static get pluginName(){return\"ContextualBalloon\"}constructor(e){super(e);this.positionLimiter=()=>{const e=this.editor.editing.view;const t=e.document;const n=t.selection.editableElement;if(n){return e.domConverter.mapViewToDom(n.root)}return null};this.set(\"visibleView\",null);this.view=new u_(e.locale);e.ui.view.body.add(this.view);e.ui.focusTracker.add(this.view.element);this._viewToStack=new Map;this._idToStack=new Map;this.set(\"_numberOfStacks\",0);this.set(\"_singleViewMode\",false);this._rotatorView=this._createRotatorView();this._fakePanelsView=this._createFakePanelsView()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view)){throw new ss[\"b\"](\"contextualballoon-add-view-exist: Cannot add configuration of the same view twice.\",[this,e])}const t=e.stackId||\"main\";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]]));this._viewToStack.set(e.view,this._idToStack.get(t));this._numberOfStacks=this._idToStack.size;if(!this._visibleStack||e.singleViewMode){this.showStack(t)}return}const n=this._idToStack.get(t);if(e.singleViewMode){this.showStack(t)}n.set(e.view,e);this._viewToStack.set(e.view,n);if(n===this._visibleStack){this._showView(e)}}remove(e){if(!this.hasView(e)){throw new ss[\"b\"](\"contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.\",[this,e])}const t=this._viewToStack.get(e);if(this._singleViewMode&&this.visibleView===e){this._singleViewMode=false}if(this.visibleView===e){if(t.size===1){if(this._idToStack.size>1){this._showNextStack()}else{this.view.hide();this.visibleView=null;this._rotatorView.hideView()}}else{this._showView(Array.from(t.values())[t.size-2])}}if(t.size===1){this._idToStack.delete(this._getStackId(t));this._numberOfStacks=this._idToStack.size}else{t.delete(e)}this._viewToStack.delete(e)}updatePosition(e){if(e){this._visibleStack.get(this.visibleView).position=e}this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t){throw new ss[\"b\"](\"contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.\",this)}if(this._visibleStack===t){return}this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){const t=Array.from(this._idToStack.entries()).find(t=>t[1]===e);return t[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;if(!e[t]){t=0}this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;if(!e[t]){t=e.length-1}this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new pP(this.editor.locale);const t=this.editor.locale.t;this.view.content.add(e);e.bind(\"isNavigationVisible\").to(this,\"_numberOfStacks\",this,\"_singleViewMode\",(e,t)=>!t&&e>1);e.on(\"change:isNavigationVisible\",()=>this.updatePosition(),{priority:\"low\"});e.bind(\"counter\").to(this,\"visibleView\",this,\"_numberOfStacks\",(e,n)=>{if(n<2){return\"\"}const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t(\"%0 of %1\",[o,n])});e.buttonNextView.on(\"execute\",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showNextStack()});e.buttonPrevView.on(\"execute\",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showPrevStack()});return e}_createFakePanelsView(){const e=new bP(this.editor.locale,this.view);e.bind(\"numberOfPanels\").to(this,\"_numberOfStacks\",this,\"_singleViewMode\",(e,t)=>{const n=!t&&e>=2;return n?Math.min(e-1,2):0});e.listenTo(this.view,\"change:top\",()=>e.updatePosition());e.listenTo(this.view,\"change:left\",()=>e.updatePosition());this.editor.ui.view.body.add(e);return e}_showView({view:e,balloonClassName:t=\"\",withArrow:n=true,singleViewMode:o=false}){this.view.class=t;this.view.withArrow=n;this._rotatorView.showView(e);this.visibleView=e;this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition();if(o){this._singleViewMode=true}}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;if(e&&!e.limiter){e=Object.assign({},e,{limiter:this.positionLimiter})}return e}}class pP extends Fb{constructor(e){super(e);const t=e.t;const n=this.bindTemplate;this.set(\"isNavigationVisible\",true);this.focusTracker=new Gp;this.buttonPrevView=this._createButtonView(t(\"Previous\"),dP);this.buttonNextView=this._createButtonView(t(\"Next\"),uP);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\",e=>e?\"\":\"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(e){this.hideView();this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new Aw(this.locale);n.set({label:e,icon:t,tooltip:true});return n}}class bP extends Fb{constructor(e,t){super(e);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=t;this.setTemplate({tag:\"div\",attributes:{class:[\"ck-fake-panel\",n.to(\"numberOfPanels\",e=>e?\"\":\"ck-hidden\")],style:{top:n.to(\"top\",gP),left:n.to(\"left\",gP),width:n.to(\"width\",gP),height:n.to(\"height\",gP)}},children:this.content});this.on(\"change:numberOfPanels\",(e,t,n,o)=>{if(n>o){this._addPanels(n-o)}else{this._removePanels(o-n)}this.updatePosition()})}_addPanels(e){while(e--){const e=new Fb;e.setTemplate({tag:\"div\"});this.content.add(e);this.registerChild(e)}}_removePanels(e){while(e--){const e=this.content.last;this.content.remove(e);this.deregisterChild(e);e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView;const{width:n,height:o}=new Th(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:o})}}}var wP='';function kP(e){const t=e.plugins.get(\"ContextualBalloon\");if(B_(e.editing.view.document.selection)){const n=_P(e);t.updatePosition(n)}}function _P(e){const t=e.editing.view;const n=u_.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class vP extends tk{static get requires(){return[mP]}static get pluginName(){return\"ImageTextAlternativeUI\"}init(){this._createButton();this._createForm()}destroy(){super.destroy();this._form.destroy()}_createButton(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"imageTextAlternative\",n=>{const o=e.commands.get(\"imageTextAlternative\");const i=new Aw(n);i.set({label:t(\"Change image text alternative\"),icon:wP,tooltip:true});i.bind(\"isEnabled\").to(o,\"isEnabled\");this.listenTo(i,\"execute\",()=>{this._showForm()});return i})}_createForm(){const e=this.editor;const t=e.editing.view;const n=t.document;this._balloon=this.editor.plugins.get(\"ContextualBalloon\");this._form=new lP(e.locale);this._form.render();this.listenTo(this._form,\"submit\",()=>{e.execute(\"imageTextAlternative\",{newValue:this._form.labeledInput.fieldView.element.value});this._hideForm(true)});this.listenTo(this._form,\"cancel\",()=>{this._hideForm(true)});this._form.keystrokes.set(\"Esc\",(e,t)=>{this._hideForm(true);t()});this.listenTo(e.ui,\"update\",()=>{if(!B_(n.selection)){this._hideForm(true)}else if(this._isVisible){kP(e)}});Mw({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible){return}const e=this.editor;const t=e.commands.get(\"imageTextAlternative\");const n=this._form.labeledInput;if(!this._isInBalloon){this._balloon.add({view:this._form,position:_P(e)})}n.fieldView.value=n.fieldView.element.value=t.value||\"\";this._form.labeledInput.fieldView.select()}_hideForm(e){if(!this._isInBalloon){return}if(this._form.focusTracker.isFocused){this._form.saveButtonView.focus()}this._balloon.remove(this._form);if(e){this.editor.editing.view.focus()}}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class yP extends tk{static get requires(){return[XT,vP]}static get pluginName(){return\"ImageTextAlternative\"}}var xP=n(80);class CP extends tk{static get requires(){return[Y_,KT,yP]}static get pluginName(){return\"Image\"}}function AP(e,t){return n=>{const o=n.createEditableElement(\"figcaption\");n.setCustomProperty(\"imageCaption\",true,o);Zp({view:e,element:o,text:t});return E_(o,n)}}function TP(e){return!!e.getCustomProperty(\"imageCaption\")}function PP(e){for(const t of e.getChildren()){if(!!t&&t.is(\"element\",\"caption\")){return t}}return null}function SP(e){const t=e.parent;if(e.name==\"figcaption\"&&t&&t.name==\"figure\"&&t.hasClass(\"image\")){return{name:true}}return null}class EP extends tk{static get pluginName(){return\"ImageCaptionEditing\"}init(){const e=this.editor;const t=e.editing.view;const n=e.model.schema;const o=e.data;const i=e.editing;const r=e.t;n.register(\"caption\",{allowIn:\"image\",allowContentOf:\"$block\",isLimit:true});e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e));e.conversion.for(\"upcast\").elementToElement({view:SP,model:\"caption\"});const s=e=>e.createContainerElement(\"figcaption\");o.downcastDispatcher.on(\"insert:caption\",RP(s,false));const a=AP(t,r(\"Enter image caption\"));i.downcastDispatcher.on(\"insert:caption\",RP(a));i.downcastDispatcher.on(\"insert\",this._fixCaptionVisibility(e=>e.item),{priority:\"high\"});i.downcastDispatcher.on(\"remove\",this._fixCaptionVisibility(e=>e.position.parent),{priority:\"high\"});t.document.registerPostFixer(e=>this._updateCaptionVisibility(e))}_updateCaptionVisibility(e){const t=this.editor.editing.mapper;const n=this._lastSelectedCaption;let o;const i=this.editor.model.document.selection;const r=i.getSelectedElement();if(r&&r.is(\"element\",\"image\")){const e=PP(r);o=t.toViewElement(e)}const s=i.getFirstPosition();const a=OP(s.parent);if(a){o=t.toViewElement(a)}if(o){if(n){if(n===o){return MP(o,e)}else{VP(n,e);this._lastSelectedCaption=o;return MP(o,e)}}else{this._lastSelectedCaption=o;return MP(o,e)}}else{if(n){const t=VP(n,e);this._lastSelectedCaption=null;return t}else{return false}}}_fixCaptionVisibility(e){return(t,n,o)=>{const i=e(n);const r=OP(i);const s=this.editor.editing.mapper;const a=o.writer;if(r){const e=s.toViewElement(r);if(e){if(r.childCount){a.removeClass(\"ck-hidden\",e)}else{a.addClass(\"ck-hidden\",e)}}}}}_insertMissingModelCaptionElement(e){const t=this.editor.model;const n=t.document.differ.getChanges();const o=[];for(const e of n){if(e.type==\"insert\"&&e.name!=\"$text\"){const n=e.position.nodeAfter;if(n.is(\"element\",\"image\")&&!PP(n)){o.push(n)}if(!n.is(\"element\",\"image\")&&n.childCount){for(const e of t.createRangeIn(n).getItems()){if(e.is(\"element\",\"image\")&&!PP(e)){o.push(e)}}}}}for(const t of o){e.appendElement(\"caption\",t)}return!!o.length}}function RP(e,t=true){return(n,o,i)=>{const r=o.item;if(!r.childCount&&!t){return}if(D_(r.parent)){if(!i.consumable.consume(o.item,\"insert\")){return}const t=i.mapper.toViewElement(o.range.start.parent);const n=e(i.writer);const s=i.writer;if(!r.childCount){s.addClass(\"ck-hidden\",n)}IP(n,o.item,t,i)}}}function IP(e,t,n,o){const i=o.writer.createPositionAt(n,\"end\");o.writer.insert(i,e);o.mapper.bindElements(t,e)}function OP(e){const t=e.getAncestors({includeSelf:true});const n=t.find(e=>e.name==\"caption\");if(n&&n.parent&&n.parent.name==\"image\"){return n}return null}function VP(e,t){if(!e.childCount&&!e.hasClass(\"ck-hidden\")){t.addClass(\"ck-hidden\",e);return true}return false}function MP(e,t){if(e.hasClass(\"ck-hidden\")){t.removeClass(\"ck-hidden\",e);return true}return false}var NP=n(82);class zP extends tk{static get requires(){return[EP]}static get pluginName(){return\"ImageCaption\"}}class BP extends ok{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=D_(e);if(!e||!e.hasAttribute(\"width\")){this.value=null}else{this.value={width:e.getAttribute(\"width\"),height:null}}}execute(e){const t=this.editor.model;const n=t.document.selection.getSelectedElement();this.value={width:e.width,height:null};if(n){t.change(t=>{t.setAttribute(\"width\",e.width,n)})}}}class DP extends tk{static get pluginName(){return\"ImageResizeEditing\"}constructor(e){super(e);e.config.define(\"image\",{resizeUnit:\"%\",resizeOptions:[{name:\"imageResize:original\",value:null,icon:\"original\"},{name:\"imageResize:25\",value:\"25\",icon:\"small\"},{name:\"imageResize:50\",value:\"50\",icon:\"medium\"},{name:\"imageResize:75\",value:\"75\",icon:\"large\"}]})}init(){const e=this.editor;const t=new BP(e);this._registerSchema();this._registerConverters();e.commands.add(\"imageResize\",t)}_registerSchema(){this.editor.model.schema.extend(\"image\",{allowAttributes:\"width\"});this.editor.model.schema.setAttributeProperties(\"width\",{isFormatting:true})}_registerConverters(){const e=this.editor;e.conversion.for(\"downcast\").add(e=>e.on(\"attribute:width:image\",(e,t,n)=>{if(!n.consumable.consume(t.item,e.name)){return}const o=n.writer;const i=n.mapper.toViewElement(t.item);if(t.attributeNewValue!==null){o.setStyle(\"width\",t.attributeNewValue,i);o.addClass(\"image_resized\",i)}else{o.removeStyle(\"width\",i);o.removeClass(\"image_resized\",i)}}));e.conversion.for(\"upcast\").attributeToAttribute({view:{name:\"figure\",styles:{width:/.+/}},model:{key:\"width\",value:e=>e.getStyle(\"width\")}})}}var FP='';var LP='';var HP='';var jP='';const qP={small:FP,medium:LP,large:HP,original:jP};class WP extends tk{static get requires(){return[DP]}static get pluginName(){return\"ImageResizeButtons\"}constructor(e){super(e);this._resizeUnit=e.config.get(\"image.resizeUnit\")}init(){const e=this.editor;const t=e.config.get(\"image.resizeOptions\");const n=e.commands.get(\"imageResize\");this.bind(\"isEnabled\").to(n);for(const e of t){this._registerImageResizeButton(e)}this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor;const{name:n,value:o,icon:i}=e;const r=o?o+this._resizeUnit:null;t.ui.componentFactory.add(n,o=>{const s=new Aw(o);const a=t.commands.get(\"imageResize\");const c=this._getOptionLabelValue(e,true);if(!qP[i]){throw new ss[\"b\"](\"imageresizebuttons-missing-icon: \"+'The resize option \"'+n+'\" misses the \"icon\" property '+\"or the property value doesn't match any of available icons.\",t,e)}s.set({label:c,icon:qP[i],tooltip:c,isToggleable:true});s.bind(\"isEnabled\").to(this);s.bind(\"isOn\").to(a,\"value\",$P(r));this.listenTo(s,\"execute\",()=>{t.execute(\"imageResize\",{width:r})});return s})}_registerImageResizeDropdown(e){const t=this.editor;const n=t.t;const o=e.find(e=>!e.value);t.ui.componentFactory.add(\"imageResize\",i=>{const r=t.commands.get(\"imageResize\");const s=Bw(i,Pw);const a=s.buttonView;a.set({tooltip:n(\"Resize image\"),commandValue:o.value,icon:LP,isToggleable:true,label:this._getOptionLabelValue(o),withText:true,class:\"ck-resize-image-button\"});a.bind(\"label\").to(r,\"value\",e=>{if(e&&e.width){return e.width}else{return this._getOptionLabelValue(o)}});s.bind(\"isOn\").to(r);s.bind(\"isEnabled\").to(this);Fw(s,this._getResizeDropdownListItemDefinitions(e,r));s.listView.ariaLabel=n(\"Image resize list\");this.listenTo(s,\"execute\",e=>{t.execute(e.source.commandName,{width:e.source.commandValue});t.editing.view.focus()});return s})}_getOptionLabelValue(e,t){const n=this.editor.t;if(e.label){return e.label}else if(t){if(e.value){return n(\"Resize image to %0\",e.value+this._resizeUnit)}else{return n(\"Resize image to the original size\")}}else{if(e.value){return e.value+this._resizeUnit}else{return n(\"Original\")}}}_getResizeDropdownListItemDefinitions(e,t){const n=new xs;e.map(e=>{const o=e.value?e.value+this._resizeUnit:null;const i={type:\"button\",model:new Wx({commandName:\"imageResize\",commandValue:o,label:this._getOptionLabelValue(e),withText:true,icon:null})};i.model.bind(\"isOn\").to(t,\"value\",$P(o));n.add(i)});return n}}function $P(e){return t=>{if(e===null&&t===e){return true}return t&&t.width===e}}class UP{constructor(e){this.set(\"activeHandlePosition\",null);this.set(\"proposedWidthPercents\",null);this.set(\"proposedWidth\",null);this.set(\"proposedHeight\",null);this.set(\"proposedHandleHostWidth\",null);this.set(\"proposedHandleHostHeight\",null);this._options=e;this._referenceCoordinates=null}begin(e,t,n){const o=new Th(t);this.activeHandlePosition=YP(e);this._referenceCoordinates=KP(t,QP(this.activeHandlePosition));this.originalWidth=o.width;this.originalHeight=o.height;this.aspectRatio=o.width/o.height;const i=n.style.width;if(i&&i.match(/^\\d+\\.?\\d*%$/)){this.originalWidthPercents=parseFloat(i)}else{this.originalWidthPercents=GP(n,o)}}update(e){this.proposedWidth=e.width;this.proposedHeight=e.height;this.proposedWidthPercents=e.widthPercents;this.proposedHandleHostWidth=e.handleHostWidth;this.proposedHandleHostHeight=e.handleHostHeight}}ys(UP,Yc);function GP(e,t){const n=e.parentElement;const o=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);return t.width/o*100}function KP(e,t){const n=new Th(e);const o=t.split(\"-\");const i={x:o[1]==\"right\"?n.right:n.left,y:o[0]==\"bottom\"?n.bottom:n.top};i.x+=e.ownerDocument.defaultView.scrollX;i.y+=e.ownerDocument.defaultView.scrollY;return i}function JP(e){return`ck-widget__resizer__handle-${e}`}function YP(e){const t=[\"top-left\",\"top-right\",\"bottom-right\",\"bottom-left\"];for(const n of t){if(e.classList.contains(JP(n))){return n}}}function QP(e){const t=e.split(\"-\");const n={top:\"bottom\",bottom:\"top\",left:\"right\",right:\"left\"};return`${n[t[0]]}-${n[t[1]]}`}class XP{constructor(e){this._options=e;this._domResizerWrapper=null;this._viewResizerWrapper=null;this.set(\"isEnabled\",true);this.decorate(\"begin\");this.decorate(\"cancel\");this.decorate(\"commit\");this.decorate(\"updateSize\");this.on(\"commit\",e=>{if(!this.state.proposedWidth&&!this.state.proposedWidthPercents){this._cleanup();e.stop()}},{priority:\"high\"});this.on(\"change:isEnabled\",()=>{if(this.isEnabled){this.redraw()}})}attach(){const e=this;const t=this._options.viewElement;const n=this._options.editor.editing.view;n.change(n=>{const o=n.createUIElement(\"div\",{class:\"ck ck-reset_all ck-widget__resizer\"},(function(t){const n=this.toDomElement(t);e._appendHandles(n);e._appendSizeUI(n);e._domResizerWrapper=n;e.on(\"change:isEnabled\",(e,t,o)=>{n.style.display=o?\"\":\"none\"});n.style.display=e.isEnabled?\"\":\"none\";return n}));n.insert(n.createPositionAt(t,\"end\"),o);n.addClass(\"ck-widget_with-resizer\",t);this._viewResizerWrapper=o})}begin(e){this.state=new UP(this._options);this._sizeUI.bindToState(this._options,this.state);this._initialViewWidth=this._options.viewElement.getStyle(\"width\");this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);const n=this._options.editor.editing.view;n.change(e=>{const n=this._options.unit||\"%\";const o=(n===\"%\"?t.widthPercents:t.width)+n;e.setStyle(\"width\",o,this._options.viewElement)});const o=this._getHandleHost();const i=new Th(o);t.handleHostWidth=Math.round(i.width);t.handleHostHeight=Math.round(i.height);const r=new Th(o);t.width=Math.round(r.width);t.height=Math.round(r.height);this.redraw(i);this.state.update(t)}commit(){const e=this._options.unit||\"%\";const t=(e===\"%\"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup();this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!nS(t)){return}const n=t.parentElement;const o=this._getHandleHost();const i=this._viewResizerWrapper;const r=[i.getStyle(\"width\"),i.getStyle(\"height\"),i.getStyle(\"left\"),i.getStyle(\"top\")];let s;if(n.isSameNode(o)){const t=e||new Th(o);s=[t.width+\"px\",t.height+\"px\",undefined,undefined]}else{s=[o.offsetWidth+\"px\",o.offsetHeight+\"px\",o.offsetLeft+\"px\",o.offsetTop+\"px\"]}if(Ns(r,s)!==\"same\"){this._options.editor.editing.view.change(e=>{e.setStyle({width:s[0],height:s[1],left:s[2],top:s[3]},i)})}}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains(\"ck-widget__resizer__handle\")}_cleanup(){this._sizeUI.dismiss();this._sizeUI.isVisible=false;const e=this._options.editor.editing.view;e.change(e=>{e.setStyle(\"width\",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state;const n=tS(e);const o=this._options.isCentered?this._options.isCentered(this):true;const i={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};if(o&&t.activeHandlePosition.endsWith(\"-right\")){i.x=n.x-(t._referenceCoordinates.x+t.originalWidth)}if(o){i.x*=2}const r={width:Math.abs(t.originalWidth+i.x),height:Math.abs(t.originalHeight+i.y)};r.dominant=r.width/t.aspectRatio>r.height?\"width\":\"height\";r.max=r[r.dominant];const s={width:r.width,height:r.height};if(r.dominant==\"width\"){s.height=s.width/t.aspectRatio}else{s.width=s.height*t.aspectRatio}return{width:Math.round(s.width),height:Math.round(s.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}_appendHandles(e){const t=[\"top-left\",\"top-right\",\"bottom-right\",\"bottom-left\"];for(const n of t){e.appendChild(new hb({tag:\"div\",attributes:{class:`ck-widget__resizer__handle ${eS(n)}`}}).render())}}_appendSizeUI(e){const t=new ZP;t.render();this._sizeUI=t;e.appendChild(t.element)}}ys(XP,Yc);class ZP extends Fb{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-size-view\",e.to(\"activeHandlePosition\",e=>e?`ck-orientation-${e}`:\"\")],style:{display:e.if(\"isVisible\",\"none\",e=>!e)}},children:[{text:e.to(\"label\")}]})}bindToState(e,t){this.bind(\"isVisible\").to(t,\"proposedWidth\",t,\"proposedHeight\",(e,t)=>e!==null&&t!==null);this.bind(\"label\").to(t,\"proposedHandleHostWidth\",t,\"proposedHandleHostHeight\",t,\"proposedWidthPercents\",(t,n,o)=>{if(e.unit===\"px\"){return`${t}×${n}`}else{return`${o}%`}});this.bind(\"activeHandlePosition\").to(t)}dismiss(){this.unbind();this.isVisible=false}}function eS(e){return`ck-widget__resizer__handle-${e}`}function tS(e){return{x:e.pageX,y:e.pageY}}function nS(e){return e&&e.ownerDocument&&e.ownerDocument.contains(e)}var oS=\"Expected a function\";function iS(e,t,n){var o=true,i=true;if(typeof e!=\"function\"){throw new TypeError(oS)}if(ce(n)){o=\"leading\"in n?!!n.leading:o;i=\"trailing\"in n?!!n.trailing:i}return ph(e,t,{leading:o,maxWait:t,trailing:i})}var rS=iS;var sS=n(84);class aS extends tk{static get pluginName(){return\"WidgetResize\"}init(){this.set(\"_visibleResizer\",null);this.set(\"_activeResizer\",null);this._resizers=new Map;const e=Bd.window.document;this.editor.model.schema.setAttributeProperties(\"width\",{isFormatting:true});this.editor.editing.view.addObserver(X_);this._observer=Object.create(Jd);this.listenTo(this.editor.editing.view.document,\"mousedown\",this._mouseDownListener.bind(this),{priority:\"high\"});this._observer.listenTo(e,\"mousemove\",this._mouseMoveListener.bind(this));this._observer.listenTo(e,\"mouseup\",this._mouseUpListener.bind(this));const t=()=>{if(this._visibleResizer){this._visibleResizer.redraw()}};const n=rS(t,200);this.on(\"change:_visibleResizer\",t);this.editor.ui.on(\"update\",n);this._observer.listenTo(Bd.window,\"resize\",n);const o=this.editor.editing.view.document.selection;o.on(\"change\",()=>{const e=o.getSelectedElement();this._visibleResizer=this._getResizerByViewElement(e)||null})}destroy(){this._observer.stopListening();for(const e of this._resizers.values()){e.destroy()}}attachTo(e){const t=new XP(e);const n=this.editor.plugins;t.attach();if(n.has(\"WidgetToolbarRepository\")){const e=n.get(\"WidgetToolbarRepository\");t.on(\"begin\",()=>{e.forceDisabled(\"resize\")},{priority:\"lowest\"});t.on(\"cancel\",()=>{e.clearForceDisabled(\"resize\")},{priority:\"highest\"});t.on(\"commit\",()=>{e.clearForceDisabled(\"resize\")},{priority:\"highest\"})}this._resizers.set(e.viewElement,t);return t}_getResizerByHandle(e){for(const t of this._resizers.values()){if(t.containsHandle(e)){return t}}}_getResizerByViewElement(e){return this._resizers.get(e)}_mouseDownListener(e,t){const n=t.domTarget;if(!XP.isResizeHandle(n)){return}this._activeResizer=this._getResizerByHandle(n);if(this._activeResizer){this._activeResizer.begin(n);e.stop();t.preventDefault()}}_mouseMoveListener(e,t){if(this._activeResizer){this._activeResizer.updateSize(t)}}_mouseUpListener(){if(this._activeResizer){this._activeResizer.commit();this._activeResizer=null}}}ys(aS,Yc);class cS extends tk{static get requires(){return[aS]}static get pluginName(){return\"ImageResizeHandles\"}init(){const e=this.editor;const t=e.commands.get(\"imageResize\");this.bind(\"isEnabled\").to(t);e.editing.downcastDispatcher.on(\"insert:image\",(t,n,o)=>{const i=o.mapper.toViewElement(n.item);const r=e.plugins.get(aS).attachTo({unit:e.config.get(\"image.resizeUnit\"),modelElement:n.item,viewElement:i,editor:e,getHandleHost(e){return e.querySelector(\"img\")},getResizeHost(e){return e},isCentered(){const e=n.item.getAttribute(\"imageStyle\");return!e||e==\"full\"||e==\"alignCenter\"},onCommit(t){e.execute(\"imageResize\",{width:t})}});r.on(\"updateSize\",()=>{if(!i.hasClass(\"image_resized\")){e.editing.view.change(e=>{e.addClass(\"image_resized\",i)})}});r.bind(\"isEnabled\").to(this)},{priority:\"low\"})}}var lS=n(86);class dS extends tk{static get requires(){return[DP,cS,WP]}static get pluginName(){return\"ImageResize\"}}class uS extends ok{constructor(e,t){super(e);this.defaultStyle=false;this.styles=t.reduce((e,t)=>{e[t.name]=t;if(t.isDefault){this.defaultStyle=t.name}return e},{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=D_(e);if(!e){this.value=false}else if(e.hasAttribute(\"imageStyle\")){const t=e.getAttribute(\"imageStyle\");this.value=this.styles[t]?t:false}else{this.value=this.defaultStyle}}execute(e){const t=e.value;const n=this.editor.model;const o=n.document.selection.getSelectedElement();n.change(e=>{if(this.styles[t].isDefault){e.removeAttribute(\"imageStyle\",o)}else{e.setAttribute(\"imageStyle\",t,o)}})}}function hS(e){return(t,n,o)=>{if(!o.consumable.consume(n.item,t.name)){return}const i=gS(n.attributeNewValue,e);const r=gS(n.attributeOldValue,e);const s=o.mapper.toViewElement(n.item);const a=o.writer;if(r){a.removeClass(r.className,s)}if(i){a.addClass(i.className,s)}}}function fS(e){const t=e.filter(e=>!e.isDefault);return(e,n,o)=>{if(!n.modelRange){return}const i=n.viewItem;const r=rk(n.modelRange.getItems());if(!o.schema.checkAttribute(r,\"imageStyle\")){return}for(const e of t){if(o.consumable.consume(i,{classes:e.className})){o.writer.setAttribute(\"imageStyle\",e.name,r)}}}}function gS(e,t){for(const n of t){if(n.name===e){return n}}}var mS='';var pS='';var bS='';var wS='';const kS={full:{name:\"full\",title:\"Full size image\",icon:mS,isDefault:true},side:{name:\"side\",title:\"Side image\",icon:wS,className:\"image-style-side\"},alignLeft:{name:\"alignLeft\",title:\"Left aligned image\",icon:pS,className:\"image-style-align-left\"},alignCenter:{name:\"alignCenter\",title:\"Centered image\",icon:bS,className:\"image-style-align-center\"},alignRight:{name:\"alignRight\",title:\"Right aligned image\",icon:wS,className:\"image-style-align-right\"}};const _S={full:mS,left:pS,right:wS,center:bS};function vS(e=[]){return e.map(yS)}function yS(e){if(typeof e==\"string\"){const t=e;if(kS[t]){e=Object.assign({},kS[t])}else{console.warn(Object(ss[\"a\"])(\"image-style-not-found: There is no such image style of given name.\"),{name:t});e={name:t}}}else if(kS[e.name]){const t=kS[e.name];const n=Object.assign({},e);for(const o in t){if(!Object.prototype.hasOwnProperty.call(e,o)){n[o]=t[o]}}e=n}if(typeof e.icon==\"string\"&&_S[e.icon]){e.icon=_S[e.icon]}return e}class xS extends tk{static get pluginName(){return\"ImageStyleEditing\"}init(){const e=this.editor;const t=e.model.schema;const n=e.data;const o=e.editing;e.config.define(\"image.styles\",[\"full\",\"side\"]);const i=vS(e.config.get(\"image.styles\"));t.extend(\"image\",{allowAttributes:\"imageStyle\"});const r=hS(i);o.downcastDispatcher.on(\"attribute:imageStyle:image\",r);n.downcastDispatcher.on(\"attribute:imageStyle:image\",r);n.upcastDispatcher.on(\"element:figure\",fS(i),{priority:\"low\"});e.commands.add(\"imageStyle\",new uS(e,i))}}var CS=n(88);class AS extends tk{static get pluginName(){return\"ImageStyleUI\"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{\"Full size image\":e(\"Full size image\"),\"Side image\":e(\"Side image\"),\"Left aligned image\":e(\"Left aligned image\"),\"Centered image\":e(\"Centered image\"),\"Right aligned image\":e(\"Right aligned image\")}}init(){const e=this.editor;const t=e.config.get(\"image.styles\");const n=TS(vS(t),this.localizedDefaultStylesTitles);for(const e of n){this._createButton(e)}}_createButton(e){const t=this.editor;const n=`imageStyle:${e.name}`;t.ui.componentFactory.add(n,n=>{const o=t.commands.get(\"imageStyle\");const i=new Aw(n);i.set({label:e.title,icon:e.icon,tooltip:true,isToggleable:true});i.bind(\"isEnabled\").to(o,\"isEnabled\");i.bind(\"isOn\").to(o,\"value\",t=>t===e.name);this.listenTo(i,\"execute\",()=>{t.execute(\"imageStyle\",{value:e.name});t.editing.view.focus()});return i})}}function TS(e,t){for(const n of e){if(t[n.title]){n.title=t[n.title]}}return e}class PS extends tk{static get requires(){return[xS,AS]}static get pluginName(){return\"ImageStyle\"}}class SS extends tk{static get requires(){return[mP]}static get pluginName(){return\"WidgetToolbarRepository\"}init(){const e=this.editor;if(e.plugins.has(\"BalloonToolbar\")){const t=e.plugins.get(\"BalloonToolbar\");this.listenTo(t,\"show\",t=>{if(IS(e.editing.view.document.selection)){t.stop()}},{priority:\"high\"})}this._toolbarDefinitions=new Map;this._balloon=this.editor.plugins.get(\"ContextualBalloon\");this.on(\"change:isEnabled\",()=>{this._updateToolbarsVisibility()});this.listenTo(e.ui,\"update\",()=>{this._updateToolbarsVisibility()});this.listenTo(e.ui.focusTracker,\"change:isFocused\",()=>{this._updateToolbarsVisibility()},{priority:\"low\"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values()){e.view.destroy()}}register(e,{ariaLabel:t,items:n,getRelatedElement:o,balloonClassName:i=\"ck-toolbar-container\"}){if(!n.length){console.warn(Object(ss[\"a\"])(\"widget-toolbar-no-items: Trying to register a toolbar without items.\"),{toolbarId:e});return}const r=this.editor;const s=r.t;const a=new Uw(r.locale);a.ariaLabel=t||s(\"Widget toolbar\");if(this._toolbarDefinitions.has(e)){throw new ss[\"b\"](\"widget-toolbar-duplicated: Toolbar with the given id was already added.\",this,{toolbarId:e})}a.fillFromConfig(n,r.ui.componentFactory);this._toolbarDefinitions.set(e,{view:a,getRelatedElement:o,balloonClassName:i})}_updateToolbarsVisibility(){let e=0;let t=null;let n=null;for(const o of this._toolbarDefinitions.values()){const i=o.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!i){if(this._isToolbarInBalloon(o)){this._hideToolbar(o)}}else if(!this.editor.ui.focusTracker.isFocused){if(this._isToolbarVisible(o)){this._hideToolbar(o)}}else{const r=i.getAncestors().length;if(r>e){e=r;t=i;n=o}}}if(n){this._showToolbar(n,t)}}_hideToolbar(e){this._balloon.remove(e.view);this.stopListening(this._balloon,\"change:visibleView\")}_showToolbar(e,t){if(this._isToolbarVisible(e)){ES(this.editor,t)}else if(!this._isToolbarInBalloon(e)){this._balloon.add({view:e.view,position:RS(this.editor,t),balloonClassName:e.balloonClassName});this.listenTo(this._balloon,\"change:visibleView\",()=>{for(const e of this._toolbarDefinitions.values()){if(this._isToolbarVisible(e)){const t=e.getRelatedElement(this.editor.editing.view.document.selection);ES(this.editor,t)}}})}}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function ES(e,t){const n=e.plugins.get(\"ContextualBalloon\");const o=RS(e,t);n.updatePosition(o)}function RS(e,t){const n=e.editing.view;const o=u_.defaultPositions;return{target:n.domConverter.mapViewToDom(t),positions:[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast,O_]}}function IS(e){const t=e.getSelectedElement();return!!(t&&C_(t))}class OS extends tk{static get requires(){return[SS]}static get pluginName(){return\"ImageToolbar\"}afterInit(){const e=this.editor;const t=e.t;const n=e.plugins.get(SS);n.register(\"image\",{ariaLabel:t(\"Image toolbar\"),items:e.config.get(\"image.toolbar\")||[],getRelatedElement:B_})}}class VS extends Fb{constructor(e){super(e);this.buttonView=new Aw(e);this._fileInputView=new MS(e);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 MS extends Fb{constructor(e){super(e);this.set(\"acceptedType\");this.set(\"allowMultipleFiles\",false);const t=this.bindTemplate;this.setTemplate({tag:\"input\",attributes:{class:[\"ck-hidden\"],type:\"file\",tabindex:\"-1\",accept:t.to(\"acceptedType\"),multiple:t.to(\"allowMultipleFiles\")},on:{change:t.to(()=>{if(this.element&&this.element.files&&this.element.files.length){this.fire(\"done\",this.element.files)}this.element.value=\"\"})}})}open(){this.element.click()}}var NS='';function zS(e){const t=e.map(e=>e.replace(\"+\",\"\\\\+\"));return new RegExp(`^image\\\\/(${t.join(\"|\")})$`)}function BS(e){return new Promise((t,n)=>{const o=e.getAttribute(\"src\");fetch(o).then(e=>e.blob()).then(e=>{const n=FS(e,o);const i=n.replace(\"image/\",\"\");const r=`image.${i}`;const s=new File([e],r,{type:n});t(s)}).catch(n)})}function DS(e){if(!e.is(\"element\",\"img\")||!e.getAttribute(\"src\")){return false}return e.getAttribute(\"src\").match(/^data:image\\/\\w+;base64,/g)||e.getAttribute(\"src\").match(/^blob:/g)}function FS(e,t){if(e.type){return e.type}else if(t.match(/data:(image\\/\\w+);base64/)){return t.match(/data:(image\\/\\w+);base64/)[1].toLowerCase()}else{return\"image/jpeg\"}}class LS extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"imageUpload\",n=>{const o=new VS(n);const i=e.commands.get(\"imageUpload\");const r=e.config.get(\"image.upload.types\");const s=zS(r);o.set({acceptedType:r.map(e=>`image/${e}`).join(\",\"),allowMultipleFiles:true});o.buttonView.set({label:t(\"Insert image\"),icon:NS,tooltip:true});o.buttonView.bind(\"isEnabled\").to(i);o.on(\"done\",(t,n)=>{const o=Array.from(n).filter(e=>s.test(e.type));if(o.length){e.execute(\"imageUpload\",{file:o})}});return o})}}var HS='';var jS=n(90);var qS=n(92);var WS=n(94);class $S extends tk{constructor(e){super(e);this.placeholder=\"data:image/svg+xml;utf8,\"+encodeURIComponent(HS)}init(){const e=this.editor;e.editing.downcastDispatcher.on(\"attribute:uploadStatus:image\",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const o=this.editor;const i=t.item;const r=i.getAttribute(\"uploadId\");if(!n.consumable.consume(t.item,e.name)){return}const s=o.plugins.get(Yy);const a=r?t.attributeNewValue:null;const c=this.placeholder;const l=o.editing.mapper.toViewElement(i);const d=n.writer;if(a==\"reading\"){US(l,d);KS(c,l,d);return}if(a==\"uploading\"){const e=s.loaders.get(r);US(l,d);if(!e){KS(c,l,d)}else{JS(l,d);YS(l,d,e,o.editing.view);oE(l,d,e)}return}if(a==\"complete\"&&s.loaders.get(r)){XS(l,d,o.editing.view)}QS(l,d);JS(l,d);GS(l,d)}}function US(e,t){if(!e.hasClass(\"ck-appear\")){t.addClass(\"ck-appear\",e)}}function GS(e,t){t.removeClass(\"ck-appear\",e)}function KS(e,t,n){if(!t.hasClass(\"ck-image-upload-placeholder\")){n.addClass(\"ck-image-upload-placeholder\",t)}const o=H_(t);if(o.getAttribute(\"src\")!==e){n.setAttribute(\"src\",e,o)}if(!tE(t,\"placeholder\")){n.insert(n.createPositionAfter(o),eE(n))}}function JS(e,t){if(e.hasClass(\"ck-image-upload-placeholder\")){t.removeClass(\"ck-image-upload-placeholder\",e)}nE(e,t,\"placeholder\")}function YS(e,t,n,o){const i=ZS(t);t.insert(t.createPositionAt(e,\"end\"),i);n.on(\"change:uploadedPercent\",(e,t,n)=>{o.change(e=>{e.setStyle(\"width\",n+\"%\",i)})})}function QS(e,t){nE(e,t,\"progressBar\")}function XS(e,t,n){const o=t.createUIElement(\"div\",{class:\"ck-image-upload-complete-icon\"});t.insert(t.createPositionAt(e,\"end\"),o);setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(o)))},3e3)}function ZS(e){const t=e.createUIElement(\"div\",{class:\"ck-progress-bar\"});e.setCustomProperty(\"progressBar\",true,t);return t}function eE(e){const t=e.createUIElement(\"div\",{class:\"ck-upload-placeholder-loader\"});e.setCustomProperty(\"placeholder\",true,t);return t}function tE(e,t){for(const n of e.getChildren()){if(n.getCustomProperty(t)){return n}}}function nE(e,t,n){const o=tE(e,n);if(o){t.remove(t.createRangeOn(o))}}function oE(e,t,n){if(n.data){const o=H_(e);t.setAttribute(\"src\",n.data,o)}}class iE{constructor(e){this.document=e}createDocumentFragment(e){return new Jl(this.document,e)}createElement(e,t,n){return new Dc(this.document,e,t,n)}createText(e){return new Ls(this.document,e)}clone(e,t=false){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;if(t){return this.removeChildren(t.getChildIndex(e),1,t)}return[]}replace(e,t){const n=e.parent;if(n){const o=n.getChildIndex(e);this.removeChildren(o,1,n);this.insertChild(o,t,n);return true}return false}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e);this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new Dc(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){if(M(e)&&n===undefined){n=t}n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,n){return new ml(e,t,n)}}class rE extends ok{refresh(){this.isEnabled=L_(this.editor.model)}execute(e){const t=this.editor;const n=t.model;const o=t.plugins.get(Yy);n.change(t=>{const i=Array.isArray(e.file)?e.file:[e.file];for(const e of i){sE(t,n,o,e)}})}}function sE(e,t,n,o){const i=n.createLoader(o);if(!i){return}F_(e,t,{uploadId:i.id})}class aE extends tk{static get requires(){return[Yy,Wy,Iv]}static get pluginName(){return\"ImageUploadEditing\"}constructor(e){super(e);e.config.define(\"image\",{upload:{types:[\"jpeg\",\"png\",\"gif\",\"bmp\",\"webp\",\"tiff\"]}})}init(){const e=this.editor;const t=e.model.document;const n=e.model.schema;const o=e.conversion;const i=e.plugins.get(Yy);const r=zS(e.config.get(\"image.upload.types\"));n.extend(\"image\",{allowAttributes:[\"uploadId\",\"uploadStatus\"]});e.commands.add(\"imageUpload\",new rE(e));o.for(\"upcast\").attributeToAttribute({view:{name:\"img\",key:\"uploadId\"},model:\"uploadId\"});this.listenTo(e.editing.view.document,\"clipboardInput\",(t,n)=>{if(cE(n.dataTransfer)){return}const o=Array.from(n.dataTransfer.files).filter(e=>{if(!e){return false}return r.test(e.type)});const i=n.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(n=>{n.setSelection(i);if(o.length){t.stop();e.model.enqueueChange(\"default\",()=>{e.execute(\"imageUpload\",{file:o})})}})});this.listenTo(e.plugins.get(Iv),\"inputTransformation\",(t,n)=>{const o=Array.from(e.editing.view.createRangeIn(n.content)).filter(e=>DS(e.item)&&!e.item.getAttribute(\"uploadProcessed\")).map(e=>({promise:BS(e.item),imageElement:e.item}));if(!o.length){return}const r=new iE(e.editing.view.document);for(const e of o){r.setAttribute(\"uploadProcessed\",true,e.imageElement);const t=i.createLoader(e.promise);if(t){r.setAttribute(\"src\",\"\",e.imageElement);r.setAttribute(\"uploadId\",t.id,e.imageElement)}}});e.editing.view.document.on(\"dragover\",(e,t)=>{t.preventDefault()});t.on(\"change\",()=>{const n=t.differ.getChanges({includeChangesInGraveyard:true});for(const t of n){if(t.type==\"insert\"&&t.name!=\"$text\"){const n=t.position.nodeAfter;const o=t.position.root.rootName==\"$graveyard\";for(const t of lE(e,n)){const e=t.getAttribute(\"uploadId\");if(!e){continue}const n=i.loaders.get(e);if(!n){continue}if(o){n.abort()}else if(n.status==\"idle\"){this._readAndUpload(n,t)}}}}})}_readAndUpload(e,t){const n=this.editor;const o=n.model;const i=n.locale.t;const r=n.plugins.get(Yy);const s=n.plugins.get(Wy);o.enqueueChange(\"transparent\",e=>{e.setAttribute(\"uploadStatus\",\"reading\",t)});return e.read().then(()=>{const i=e.upload();if(Tl.isSafari){const e=n.editing.mapper.toViewElement(t);const o=H_(e);n.editing.view.once(\"render\",()=>{if(!o.parent){return}const e=n.editing.view.domConverter.mapViewToDom(o.parent);if(!e){return}const t=e.style.display;e.style.display=\"none\";e._ckHack=e.offsetHeight;e.style.display=t})}o.enqueueChange(\"transparent\",e=>{e.setAttribute(\"uploadStatus\",\"uploading\",t)});return i}).then(e=>{o.enqueueChange(\"transparent\",n=>{n.setAttributes({uploadStatus:\"complete\",src:e.default},t);this._parseAndSetSrcsetAttributeOnImage(e,t,n)});a()}).catch(n=>{if(e.status!==\"error\"&&e.status!==\"aborted\"){throw n}if(e.status==\"error\"&&n){s.showWarning(n,{title:i(\"Upload failed\"),namespace:\"upload\"})}a();o.enqueueChange(\"transparent\",e=>{e.remove(t)})});function a(){o.enqueueChange(\"transparent\",e=>{e.removeAttribute(\"uploadId\",t);e.removeAttribute(\"uploadStatus\",t)});r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let o=0;const i=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t)){o=Math.max(o,t);return true}}).map(t=>`${e[t]} ${t}w`).join(\", \");if(i!=\"\"){n.setAttribute(\"srcset\",{data:i,width:o},t)}}}function cE(e){return Array.from(e.types).includes(\"text/html\")&&e.getData(\"text/html\")!==\"\"}function lE(e,t){return Array.from(e.model.createRangeOn(t)).filter(e=>e.item.is(\"element\",\"image\")).map(e=>e.item)}class dE extends tk{static get pluginName(){return\"ImageUpload\"}static get requires(){return[aE,LS,$S]}}class uE extends ok{constructor(e){super(e);this._childCommands=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return t.execute(e)}registerChildCommand(e){this._childCommands.push(e);e.on(\"change:isEnabled\",()=>this._checkEnabled());this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(e=>e.isEnabled)}}class hE extends tk{static get pluginName(){return\"IndentEditing\"}init(){const e=this.editor;e.commands.add(\"indent\",new uE(e));e.commands.add(\"outdent\",new uE(e))}}var fE='';var gE='';class mE extends tk{static get pluginName(){return\"IndentUI\"}init(){const e=this.editor;const t=e.locale;const n=e.t;const o=t.uiLanguageDirection==\"ltr\"?fE:gE;const i=t.uiLanguageDirection==\"ltr\"?gE:fE;this._defineButton(\"indent\",n(\"Increase indent\"),o);this._defineButton(\"outdent\",n(\"Decrease indent\"),i)}_defineButton(e,t,n){const o=this.editor;o.ui.componentFactory.add(e,i=>{const r=o.commands.get(e);const s=new Aw(i);s.set({label:t,icon:n,tooltip:true});s.bind(\"isOn\",\"isEnabled\").to(r,\"value\",\"isEnabled\");this.listenTo(s,\"execute\",()=>{o.execute(e);o.editing.view.focus()});return s})}}class pE extends tk{static get pluginName(){return\"Indent\"}static get requires(){return[hE,mE]}}const bE=\"italic\";class wE extends tk{static get pluginName(){return\"ItalicEditing\"}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:bE});e.model.schema.setAttributeProperties(bE,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:bE,view:\"i\",upcastAlso:[\"em\",{styles:{\"font-style\":\"italic\"}}]});e.commands.add(bE,new Kk(e,bE));e.keystrokes.set(\"CTRL+I\",bE)}}var kE='';const _E=\"italic\";class vE extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(_E,n=>{const o=e.commands.get(_E);const i=new Aw(n);i.set({label:t(\"Italic\"),icon:kE,keystroke:\"CTRL+I\",tooltip:true,isToggleable:true});i.bind(\"isOn\",\"isEnabled\").to(o,\"value\",\"isEnabled\");this.listenTo(i,\"execute\",()=>{e.execute(_E);e.editing.view.focus()});return i})}}class yE extends tk{static get requires(){return[wE,vE]}static get pluginName(){return\"Italic\"}}class xE extends eh{constructor(e){super(e);this.domEventType=\"click\"}onDomEvent(e){this.fire(e.type,e)}}var CE=n(96);class AE extends Fb{constructor(e,t,n){super(e);const o=e.t;this.focusTracker=new Gp;this.keystrokes=new Mp;this.urlInputView=this._createUrlInput(n);this.saveButtonView=this._createButton(o(\"Save\"),sP,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(o(\"Cancel\"),aP,\"ck-button-cancel\",\"cancel\");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t);this.children=this._createFormChildren(t.manualDecorators);this._focusables=new lb;this._focusCycler=new nw({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}});const i=[\"ck\",\"ck-link-form\"];if(t.manualDecorators.length){i.push(\"ck-link-form_layout-vertical\")}this.setTemplate({tag:\"form\",attributes:{class:i,tabindex:\"-1\"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>{e[t.name]=t.isOn;return e},{})}render(){super.render();rP({view:this});const e=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(e=\"https://\"){const t=this.locale.t;const n=new eP(this.locale,oP);n.label=t(\"Link URL\");n.fieldView.placeholder=e+\"example.com\";return n}_createButton(e,t,n,o){const i=new Aw(this.locale);i.set({label:e,icon:t,tooltip:true});i.extendTemplate({attributes:{class:n}});if(o){i.delegate(\"execute\").to(this,o)}return i}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const o=new Vw(this.locale);o.set({name:n.id,label:n.label,withText:true});o.bind(\"isOn\").toMany([n,e],\"value\",(e,t)=>t===undefined&&e===undefined?n.defaultValue:e);o.on(\"execute\",()=>{n.set(\"value\",!o.isOn)});t.add(o)}return t}_createFormChildren(e){const t=this.createCollection();t.add(this.urlInputView);if(e.length){const e=new Fb;e.setTemplate({tag:\"ul\",children:this._manualDecoratorSwitches.map(e=>({tag:\"li\",children:[e],attributes:{class:[\"ck\",\"ck-list__item\"]}})),attributes:{class:[\"ck\",\"ck-reset\",\"ck-list\"]}});t.add(e)}t.add(this.saveButtonView);t.add(this.cancelButtonView);return t}}var TE='';var PE='';var SE=n(98);class EE extends Fb{constructor(e){super(e);const t=e.t;this.focusTracker=new Gp;this.keystrokes=new Mp;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(t(\"Unlink\"),TE,\"unlink\");this.editButtonView=this._createButton(t(\"Edit link\"),PE,\"edit\");this.set(\"href\");this._focusables=new lb;this._focusCycler=new nw({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();const e=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const o=new Aw(this.locale);o.set({label:e,icon:t,tooltip:true});o.delegate(\"execute\").to(this,n);return o}_createPreviewButton(){const e=new Aw(this.locale);const t=this.bindTemplate;const n=this.t;e.set({withText:true,tooltip:n(\"Open link in new tab\")});e.extendTemplate({attributes:{class:[\"ck\",\"ck-link-actions__preview\"],href:t.to(\"href\",e=>e&&Ty(e)),target:\"_blank\",rel:\"noopener noreferrer\"}});e.bind(\"label\").to(this,\"href\",e=>e||n(\"This link has no URL\"));e.bind(\"isEnabled\").to(this,\"href\",e=>!!e);e.template.tag=\"a\";e.template.eventListeners={};return e}}var RE='';const IE=/^((\\w+:(\\/{2,})?)|(\\W))/i;const OE=/[\\w-]+@[\\w-]+\\.+[\\w-]+/i;const VE=\"link-ui\";class ME extends tk{static get requires(){return[mP]}static get pluginName(){return\"LinkUI\"}init(){const e=this.editor;e.editing.view.addObserver(xE);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=e.plugins.get(mP);this._createToolbarLinkButton();this._enableUserBalloonInteractions();e.conversion.for(\"editingDowncast\").markerToHighlight({model:VE,view:{classes:[\"ck-fake-link-selection\"]}});e.conversion.for(\"editingDowncast\").markerToElement({model:VE,view:{name:\"span\",classes:[\"ck-fake-link-selection\",\"ck-fake-link-selection_collapsed\"]}})}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const e=this.editor;const t=new EE(e.locale);const n=e.commands.get(\"link\");const o=e.commands.get(\"unlink\");t.bind(\"href\").to(n,\"value\");t.editButtonView.bind(\"isEnabled\").to(n);t.unlinkButtonView.bind(\"isEnabled\").to(o);this.listenTo(t,\"edit\",()=>{this._addFormView()});this.listenTo(t,\"unlink\",()=>{e.execute(\"unlink\");this._hideUI()});t.keystrokes.set(\"Esc\",(e,t)=>{this._hideUI();t()});t.keystrokes.set(xy,(e,t)=>{this._addFormView();t()});return t}_createFormView(){const e=this.editor;const t=e.commands.get(\"link\");const n=e.config.get(\"link.defaultProtocol\");const o=new AE(e.locale,t,n);o.urlInputView.fieldView.bind(\"value\").to(t,\"value\");o.urlInputView.bind(\"isReadOnly\").to(t,\"isEnabled\",e=>!e);o.saveButtonView.bind(\"isEnabled\").to(t);this.listenTo(o,\"submit\",()=>{const{value:t}=o.urlInputView.fieldView.element;const i=!!n&&!IE.test(t);const r=OE.test(t);const s=r?\"mailto:\":n;const a=t&&i?s+t:t;e.execute(\"link\",a,o.getDecoratorSwitchesState());this._closeFormView()});this.listenTo(o,\"cancel\",()=>{this._closeFormView()});o.keystrokes.set(\"Esc\",(e,t)=>{this._closeFormView();t()});return o}_createToolbarLinkButton(){const e=this.editor;const t=e.commands.get(\"link\");const n=e.t;e.keystrokes.set(xy,(e,t)=>{t();this._showUI(true)});e.ui.componentFactory.add(\"link\",e=>{const o=new Aw(e);o.isEnabled=true;o.label=n(\"Link\");o.icon=RE;o.keystroke=xy;o.tooltip=true;o.isToggleable=true;o.bind(\"isEnabled\").to(t,\"isEnabled\");o.bind(\"isOn\").to(t,\"value\",e=>!!e);this.listenTo(o,\"execute\",()=>this._showUI(true));return o})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,\"click\",()=>{const e=this._getSelectedLinkElement();if(e){this._showUI()}});this.editor.keystrokes.set(\"Tab\",(e,t)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();t()}},{priority:\"high\"});this.editor.keystrokes.set(\"Esc\",(e,t)=>{if(this._isUIVisible){this._hideUI();t()}});Mw({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){if(this._areActionsInPanel){return}this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel){return}const e=this.editor;const t=e.commands.get(\"link\");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});if(this._balloon.visibleView===this.formView){this.formView.urlInputView.fieldView.select()}this.formView.urlInputView.fieldView.element.value=t.value||\"\"}_closeFormView(){const e=this.editor.commands.get(\"link\");e.restoreManualDecoratorStates();if(e.value!==undefined){this._removeFormView()}else{this._hideUI()}}_removeFormView(){if(this._isFormInPanel){this.formView.saveButtonView.focus();this._balloon.remove(this.formView);this.editor.editing.view.focus();this._hideFakeVisualSelection()}}_showUI(e=false){if(!this._getSelectedLinkElement()){this._addActionsView();if(e){this._balloon.showStack(\"main\")}this._addFormView();this._showFakeVisualSelection()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(e){this._balloon.showStack(\"main\")}}this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel){return}const e=this.editor;this.stopListening(e.ui,\"update\");this.stopListening(this._balloon,\"change:visibleView\");e.editing.view.focus();this._removeFormView();this._balloon.remove(this.actionsView);this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor;const t=e.editing.view.document;let n=this._getSelectedLinkElement();let o=r();const i=()=>{const e=this._getSelectedLinkElement();const t=r();if(n&&!e||!n&&t!==o){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}n=e;o=t};function r(){return t.selection.focus.getAncestors().reverse().find(e=>e.is(\"element\"))}this.listenTo(e.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(){const e=this._balloon.visibleView;return e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view;const t=e.document;const n=this._getSelectedLinkElement();const o=n?e.domConverter.mapViewToDom(n):e.domConverter.viewRangeToDom(t.selection.getFirstRange());return{target:o}}_getSelectedLinkElement(){const e=this.editor.editing.view;const t=e.document.selection;if(t.isCollapsed){return NE(t.getFirstPosition())}else{const n=t.getFirstRange().getTrimmed();const o=NE(n.start);const i=NE(n.end);if(!o||o!=i){return null}if(e.createRangeIn(o).getTrimmed().isEqual(n)){return o}else{return null}}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{if(e.markers.has(VE)){t.updateMarker(VE,{range:e.document.selection.getFirstRange()})}else{t.addMarker(VE,{usingOperation:false,affectsData:false,range:e.document.selection.getFirstRange()})}})}_hideFakeVisualSelection(){const e=this.editor.model;if(e.markers.has(VE)){e.change(e=>{e.removeMarker(VE)})}}}function NE(e){return e.getAncestors().find(e=>Cy(e))}class zE extends tk{static get requires(){return[Fy,ME]}static get pluginName(){return\"Link\"}}class BE extends ok{constructor(e,t){super(e);this.type=t}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;const n=Array.from(t.selection.getSelectedBlocks()).filter(t=>FE(t,e.schema));const o=this.value===true;e.change(e=>{if(o){let t=n[n.length-1].nextSibling;let o=Number.POSITIVE_INFINITY;let i=[];while(t&&t.name==\"listItem\"&&t.getAttribute(\"listIndent\")!==0){const e=t.getAttribute(\"listIndent\");if(e=n){if(r>i.getAttribute(\"listIndent\")){r=i.getAttribute(\"listIndent\")}if(i.getAttribute(\"listIndent\")==r){e[t?\"unshift\":\"push\"](i)}i=i[t?\"previousSibling\":\"nextSibling\"]}}}function FE(e,t){return t.checkChild(e.parent,\"listItem\")&&!t.isObject(e)}class LE extends ok{constructor(e,t){super(e);this._indentBy=t==\"forward\"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=n[n.length-1];let o=t.nextSibling;while(o&&o.name==\"listItem\"&&o.getAttribute(\"listIndent\")>t.getAttribute(\"listIndent\")){n.push(o);o=o.nextSibling}if(this._indentBy<0){n=n.reverse()}for(const t of n){const n=t.getAttribute(\"listIndent\")+this._indentBy;if(n<0){e.rename(t,\"paragraph\")}else{e.setAttribute(\"listIndent\",n,t)}}})}_checkEnabled(){const e=rk(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is(\"element\",\"listItem\")){return false}if(this._indentBy>0){const t=e.getAttribute(\"listIndent\");const n=e.getAttribute(\"listType\");let o=e.previousSibling;while(o&&o.is(\"element\",\"listItem\")&&o.getAttribute(\"listIndent\")>=t){if(o.getAttribute(\"listIndent\")==t){return o.getAttribute(\"listType\")==n}o=o.previousSibling}return false}return true}}function HE(e){const t=e.createContainerElement(\"li\");t.getFillerOffset=JE;return t}function jE(e,t){const n=t.mapper;const o=t.writer;const i=e.getAttribute(\"listType\")==\"numbered\"?\"ol\":\"ul\";const r=HE(o);const s=o.createContainerElement(i,null);o.insert(o.createPositionAt(s,0),r);n.bindElements(e,r);return r}function qE(e,t,n,o){const i=t.parent;const r=n.mapper;const s=n.writer;let a=r.toViewPosition(o.createPositionBefore(e));const c=UE(e.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:e.getAttribute(\"listIndent\")});const l=e.previousSibling;if(c&&c.getAttribute(\"listIndent\")==e.getAttribute(\"listIndent\")){const e=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(e))}else{if(l&&l.name==\"listItem\"){a=r.toViewPosition(o.createPositionAt(l,\"end\"));const e=r.findMappedViewAncestor(a);const t=KE(e);if(t){a=s.createPositionBefore(t)}else{a=s.createPositionAt(e,\"end\")}}else{a=r.toViewPosition(o.createPositionBefore(e))}}a=$E(a);s.insert(a,i);if(l&&l.name==\"listItem\"){const e=r.toViewElement(l);const n=s.createRange(s.createPositionAt(e,0),a);const o=n.getWalker({ignoreElementEnd:true});for(const e of o){if(e.item.is(\"element\",\"li\")){const n=s.breakContainer(s.createPositionBefore(e.item));const i=e.item.parent;const r=s.createPositionAt(t,\"end\");WE(s,r.nodeBefore,r.nodeAfter);s.move(s.createRangeOn(i),r);o.position=n}}}else{const n=i.nextSibling;if(n&&(n.is(\"element\",\"ul\")||n.is(\"element\",\"ol\"))){let o=null;for(const t of n.getChildren()){const n=r.toModelElement(t);if(n&&n.getAttribute(\"listIndent\")>e.getAttribute(\"listIndent\")){o=t}else{break}}if(o){s.breakContainer(s.createPositionAfter(o));s.move(s.createRangeOn(o.parent),s.createPositionAt(t,\"end\"))}}}WE(s,i,i.nextSibling);WE(s,i.previousSibling,i)}function WE(e,t,n){if(!t||!n||t.name!=\"ul\"&&t.name!=\"ol\"){return null}if(t.name!=n.name||t.getAttribute(\"class\")!==n.getAttribute(\"class\")){return null}return e.mergeContainers(e.createPositionAfter(t))}function $E(e){return e.getLastMatchingPosition(e=>e.item.is(\"uiElement\"))}function UE(e,t){const n=!!t.sameIndent;const o=!!t.smallerIndent;const i=t.listIndent;let r=e;while(r&&r.name==\"listItem\"){const e=r.getAttribute(\"listIndent\");if(n&&i==e||o&&i>e){return r}r=r.previousSibling}return null}function GE(e,t,n,o){e.ui.componentFactory.add(t,i=>{const r=e.commands.get(t);const s=new Aw(i);s.set({label:n,icon:o,tooltip:true,isToggleable:true});s.bind(\"isOn\",\"isEnabled\").to(r,\"value\",\"isEnabled\");s.on(\"execute\",()=>{e.execute(t);e.editing.view.focus()});return s})}function KE(e){for(const t of e.getChildren()){if(t.name==\"ul\"||t.name==\"ol\"){return t}}return null}function JE(){const e=!this.isEmpty&&(this.getChild(0).name==\"ul\"||this.getChild(0).name==\"ol\");if(this.isEmpty||e){return 0}return qc.call(this)}function YE(e){return(t,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;const s=jE(r,o);qE(r,s,o,e)}}function QE(e){return(t,n,o)=>{const i=o.mapper.toViewPosition(n.position);const r=i.getLastMatchingPosition(e=>!e.item.is(\"element\",\"li\"));const s=r.nodeAfter;const a=o.writer;a.breakContainer(a.createPositionBefore(s));a.breakContainer(a.createPositionAfter(s));const c=s.parent;const l=c.previousSibling;const d=a.createRangeOn(c);const u=a.remove(d);if(l&&l.nextSibling){WE(a,l,l.nextSibling)}const h=o.mapper.toModelElement(s);hR(h.getAttribute(\"listIndent\")+1,n.position,d.start,s,o,e);for(const e of a.createRangeIn(u).getItems()){o.mapper.unbindViewElement(e)}t.stop()}}function XE(e,t,n){if(!n.consumable.consume(t.item,\"attribute:listType\")){return}const o=n.mapper.toViewElement(t.item);const i=n.writer;i.breakContainer(i.createPositionBefore(o));i.breakContainer(i.createPositionAfter(o));const r=o.parent;const s=t.attributeNewValue==\"numbered\"?\"ol\":\"ul\";i.rename(s,r)}function ZE(e,t,n){const o=n.mapper.toViewElement(t.item);const i=o.parent;const r=n.writer;WE(r,i,i.nextSibling);WE(r,i.previousSibling,i);for(const e of t.item.getChildren()){n.consumable.consume(e,\"insert\")}}function eR(e){return(t,n,o)=>{if(!o.consumable.consume(n.item,\"attribute:listIndent\")){return}const i=o.mapper.toViewElement(n.item);const r=o.writer;r.breakContainer(r.createPositionBefore(i));r.breakContainer(r.createPositionAfter(i));const s=i.parent;const a=s.previousSibling;const c=r.createRangeOn(s);r.remove(c);if(a&&a.nextSibling){WE(r,a,a.nextSibling)}hR(n.attributeOldValue+1,n.range.start,c.start,i,o,e);qE(n.item,i,o,e);for(const e of n.item.getChildren()){o.consumable.consume(e,\"insert\")}}}function tR(e,t,n){if(t.item.name!=\"listItem\"){let e=n.mapper.toViewPosition(t.range.start);const o=n.writer;const i=[];while(e.parent.name==\"ul\"||e.parent.name==\"ol\"){e=o.breakContainer(e);if(e.parent.name!=\"li\"){break}const t=e;const n=o.createPositionAt(e.parent,\"end\");if(!t.isEqual(n)){const e=o.remove(o.createRange(t,n));i.push(e)}e=o.createPositionAfter(e.parent)}if(i.length>0){for(let t=0;t0){const t=WE(o,n,n.nextSibling);if(t&&t.parent==n){e.offset--}}}WE(o,e.nodeBefore,e.nodeAfter)}}}function nR(e,t,n){const o=n.mapper.toViewPosition(t.position);const i=o.nodeBefore;const r=o.nodeAfter;WE(n.writer,i,r)}function oR(e,t,n){if(n.consumable.consume(t.viewItem,{name:true})){const e=n.writer;const o=e.createElement(\"listItem\");const i=gR(t.viewItem);e.setAttribute(\"listIndent\",i,o);const r=t.viewItem.parent&&t.viewItem.parent.name==\"ol\"?\"numbered\":\"bulleted\";e.setAttribute(\"listType\",r,o);const s=n.splitToAllowedParent(o,t.modelCursor);if(!s){return}e.insert(o,s.position);const a=dR(o,t.viewItem.getChildren(),n);t.modelRange=e.createRange(t.modelCursor,a);if(s.cursorParent){t.modelCursor=e.createPositionAt(s.cursorParent,0)}else{t.modelCursor=t.modelRange.end}}}function iR(e,t,n){if(n.consumable.test(t.viewItem,{name:true})){const e=Array.from(t.viewItem.getChildren());for(const t of e){const e=!(t.is(\"element\",\"li\")||fR(t));if(e){t._remove()}}}}function rR(e,t,n){if(n.consumable.test(t.viewItem,{name:true})){if(t.viewItem.childCount===0){return}const e=[...t.viewItem.getChildren()];let n=false;let o=true;for(const t of e){if(n&&!fR(t)){t._remove()}if(t.is(\"$text\")){if(o){t._data=t.data.replace(/^\\s+/,\"\")}if(!t.nextSibling||fR(t.nextSibling)){t._data=t.data.replace(/\\s+$/,\"\")}}else if(fR(t)){n=true}o=false}}}function sR(e){return(t,n)=>{if(n.isPhantom){return}const o=n.modelPosition.nodeBefore;if(o&&o.is(\"element\",\"listItem\")){const t=n.mapper.toViewElement(o);const i=t.getAncestors().find(fR);const r=e.createPositionAt(t,0).getWalker();for(const e of r){if(e.type==\"elementStart\"&&e.item.is(\"element\",\"li\")){n.viewPosition=e.previousPosition;break}else if(e.type==\"elementEnd\"&&e.item==i){n.viewPosition=e.nextPosition;break}}}}}function aR(e){return(t,n)=>{const o=n.viewPosition;const i=o.parent;const r=n.mapper;if(i.name==\"ul\"||i.name==\"ol\"){if(!o.isAtEnd){const t=r.toModelElement(o.nodeAfter);n.modelPosition=e.createPositionBefore(t)}else{const t=r.toModelElement(o.nodeBefore);const i=r.getModelLength(o.nodeBefore);n.modelPosition=e.createPositionBefore(t).getShiftedBy(i)}t.stop()}else if(i.name==\"li\"&&o.nodeBefore&&(o.nodeBefore.name==\"ul\"||o.nodeBefore.name==\"ol\")){const s=r.toModelElement(i);let a=1;let c=o.nodeBefore;while(c&&fR(c)){a+=r.getModelLength(c);c=c.previousSibling}n.modelPosition=e.createPositionBefore(s).getShiftedBy(a);t.stop()}}}function cR(e,t){const n=e.document.differ.getChanges();const o=new Map;let i=false;for(const o of n){if(o.type==\"insert\"&&o.name==\"listItem\"){r(o.position)}else if(o.type==\"insert\"&&o.name!=\"listItem\"){if(o.name!=\"$text\"){const n=o.position.nodeAfter;if(n.hasAttribute(\"listIndent\")){t.removeAttribute(\"listIndent\",n);i=true}if(n.hasAttribute(\"listType\")){t.removeAttribute(\"listType\",n);i=true}for(const t of Array.from(e.createRangeIn(n)).filter(e=>e.item.is(\"element\",\"listItem\"))){r(t.previousPosition)}}const n=o.position.getShiftedBy(o.length);r(n)}else if(o.type==\"remove\"&&o.name==\"listItem\"){r(o.position)}else if(o.type==\"attribute\"&&o.attributeKey==\"listIndent\"){r(o.range.start)}else if(o.type==\"attribute\"&&o.attributeKey==\"listType\"){r(o.range.start)}}for(const e of o.values()){s(e);a(e)}return i;function r(e){const t=e.nodeBefore;if(!t||!t.is(\"element\",\"listItem\")){const t=e.nodeAfter;if(t&&t.is(\"element\",\"listItem\")){o.set(t,t)}}else{let e=t;if(o.has(e)){return}for(let t=e.previousSibling;t&&t.is(\"element\",\"listItem\");t=e.previousSibling){e=t;if(o.has(e)){return}}o.set(t,e)}}function s(e){let n=0;let o=null;while(e&&e.is(\"element\",\"listItem\")){const r=e.getAttribute(\"listIndent\");if(r>n){let s;if(o===null){o=r-n;s=n}else{if(o>r){o=r}s=r-o}t.setAttribute(\"listIndent\",s,e);i=true}else{o=null;n=e.getAttribute(\"listIndent\")+1}e=e.nextSibling}}function a(e){let n=[];let o=null;while(e&&e.is(\"element\",\"listItem\")){const r=e.getAttribute(\"listIndent\");if(o&&o.getAttribute(\"listIndent\")>r){n=n.slice(0,r+1)}if(r!=0){if(n[r]){const o=n[r];if(e.getAttribute(\"listType\")!=o){t.setAttribute(\"listType\",o,e);i=true}}else{n[r]=e.getAttribute(\"listType\")}}o=e;e=e.nextSibling}}}function lR(e,[t,n]){let o=t.is(\"documentFragment\")?t.getChild(0):t;let i;if(!n){i=this.document.selection}else{i=this.createSelection(n)}if(o&&o.is(\"element\",\"listItem\")){const e=i.getFirstPosition();let t=null;if(e.parent.is(\"element\",\"listItem\")){t=e.parent}else if(e.nodeBefore&&e.nodeBefore.is(\"element\",\"listItem\")){t=e.nodeBefore}if(t){const e=t.getAttribute(\"listIndent\");if(e>0){while(o&&o.is(\"element\",\"listItem\")){o._setAttribute(\"listIndent\",o.getAttribute(\"listIndent\")+e);o=o.nextSibling}}}}}function dR(e,t,n){const{writer:o,schema:i}=n;let r=o.createPositionAfter(e);for(const s of t){if(s.name==\"ul\"||s.name==\"ol\"){r=n.convertItem(s,r).modelCursor}else{const t=n.convertItem(s,o.createPositionAt(e,\"end\"));const a=t.modelRange.start.nodeAfter;const c=a&&a.is(\"element\")&&!i.checkChild(e,a.name);if(c){if(t.modelCursor.parent.is(\"element\",\"listItem\")){e=t.modelCursor.parent}else{e=uR(t.modelCursor)}r=o.createPositionAfter(e)}}}return r}function uR(e){const t=new Kh({startPosition:e});let n;do{n=t.next()}while(!n.value.item.is(\"element\",\"listItem\"));return n.value.item}function hR(e,t,n,o,i,r){const s=UE(t.nodeBefore,{sameIndent:true,smallerIndent:true,listIndent:e,foo:\"b\"});const a=i.mapper;const c=i.writer;const l=s?s.getAttribute(\"listIndent\"):null;let d;if(!s){d=n}else if(l==e){const e=a.toViewElement(s).parent;d=c.createPositionAfter(e)}else{const e=r.createPositionAt(s,\"end\");d=a.toViewPosition(e)}d=$E(d);for(const e of[...o.getChildren()]){if(fR(e)){d=c.move(c.createRangeOn(e),d).end;WE(c,e,e.nextSibling);WE(c,e.previousSibling,e)}}}function fR(e){return e.is(\"element\",\"ol\")||e.is(\"element\",\"ul\")}function gR(e){let t=0;let n=e.parent;while(n){if(n.is(\"element\",\"li\")){t++}else{const e=n.previousSibling;if(e&&e.is(\"element\",\"li\")){t++}}n=n.parent}return t}class mR extends tk{static get pluginName(){return\"ListEditing\"}static get requires(){return[pT]}init(){const e=this.editor;e.model.schema.register(\"listItem\",{inheritAllFrom:\"$block\",allowAttributes:[\"listType\",\"listIndent\"]});const t=e.data;const n=e.editing;e.model.document.registerPostFixer(t=>cR(e.model,t));n.mapper.registerViewToModelLength(\"li\",pR);t.mapper.registerViewToModelLength(\"li\",pR);n.mapper.on(\"modelToViewPosition\",sR(n.view));n.mapper.on(\"viewToModelPosition\",aR(e.model));t.mapper.on(\"modelToViewPosition\",sR(n.view));e.conversion.for(\"editingDowncast\").add(t=>{t.on(\"insert\",tR,{priority:\"high\"});t.on(\"insert:listItem\",YE(e.model));t.on(\"attribute:listType:listItem\",XE,{priority:\"high\"});t.on(\"attribute:listType:listItem\",ZE,{priority:\"low\"});t.on(\"attribute:listIndent:listItem\",eR(e.model));t.on(\"remove:listItem\",QE(e.model));t.on(\"remove\",nR,{priority:\"low\"})});e.conversion.for(\"dataDowncast\").add(t=>{t.on(\"insert\",tR,{priority:\"high\"});t.on(\"insert:listItem\",YE(e.model))});e.conversion.for(\"upcast\").add(e=>{e.on(\"element:ul\",iR,{priority:\"high\"});e.on(\"element:ol\",iR,{priority:\"high\"});e.on(\"element:li\",rR,{priority:\"high\"});e.on(\"element:li\",oR)});e.model.on(\"insertContent\",lR,{priority:\"high\"});e.commands.add(\"numberedList\",new BE(e,\"numbered\"));e.commands.add(\"bulletedList\",new BE(e,\"bulleted\"));e.commands.add(\"indentList\",new LE(e,\"forward\"));e.commands.add(\"outdentList\",new LE(e,\"backward\"));const o=n.view.document;this.listenTo(o,\"enter\",(e,t)=>{const n=this.editor.model.document;const o=n.selection.getLastPosition().parent;if(n.selection.isCollapsed&&o.name==\"listItem\"&&o.isEmpty){this.editor.execute(\"outdentList\");t.preventDefault();e.stop()}});this.listenTo(o,\"delete\",(e,t)=>{if(t.direction!==\"backward\"){return}const n=this.editor.model.document.selection;if(!n.isCollapsed){return}const o=n.getFirstPosition();if(!o.isAtStart){return}const i=o.parent;if(i.name!==\"listItem\"){return}const r=i.previousSibling&&i.previousSibling.name===\"listItem\";if(r){return}this.editor.execute(\"outdentList\");t.preventDefault();e.stop()},{priority:\"high\"});const i=e=>(t,n)=>{const o=this.editor.commands.get(e);if(o.isEnabled){this.editor.execute(e);n()}};e.keystrokes.set(\"Tab\",i(\"indentList\"));e.keystrokes.set(\"Shift+Tab\",i(\"outdentList\"))}afterInit(){const e=this.editor.commands;const t=e.get(\"indent\");const n=e.get(\"outdent\");if(t){t.registerChildCommand(e.get(\"indentList\"))}if(n){n.registerChildCommand(e.get(\"outdentList\"))}}}function pR(e){let t=1;for(const n of e.getChildren()){if(n.name==\"ul\"||n.name==\"ol\"){for(const e of n.getChildren()){t+=pR(e)}}}return t}var bR='';var wR='';class kR extends tk{init(){const e=this.editor.t;GE(this.editor,\"numberedList\",e(\"Numbered List\"),bR);GE(this.editor,\"bulletedList\",e(\"Bulleted List\"),wR)}}class _R extends tk{static get requires(){return[mR,kR]}static get pluginName(){return\"List\"}}class vR extends ok{refresh(){this.isEnabled=yR(this.editor.model)}execute(){const e=this.editor.model;e.change(t=>{const n=t.createElement(\"pageBreak\");e.insertContent(n);let o=n.nextSibling;const i=o&&e.schema.checkChild(o,\"$text\");if(!i&&e.schema.checkChild(n.parent,\"paragraph\")){o=t.createElement(\"paragraph\");e.insertContent(o,t.createPositionAfter(n))}if(o){t.setSelection(o,0)}})}}function yR(e){const t=e.schema;const n=e.document.selection;return xR(n,t,e)&&!CR(n,t)}function xR(e,t,n){const o=AR(e,n);return t.checkChild(o,\"pageBreak\")}function CR(e,t){const n=e.getSelectedElement();return n&&t.isObject(n)}function AR(e,t){const n=R_(e,t);const o=n.parent;if(o.isEmpty&&!o.is(\"element\",\"$root\")){return o.parent}return o}var TR=n(100);class PR extends tk{static get pluginName(){return\"PageBreakEditing\"}init(){const e=this.editor;const t=e.model.schema;const n=e.t;const o=e.conversion;t.register(\"pageBreak\",{isObject:true,allowWhere:\"$block\"});o.for(\"dataDowncast\").elementToElement({model:\"pageBreak\",view:(e,t)=>{const n=t.createContainerElement(\"div\",{class:\"page-break\",style:\"page-break-after: always\"});const o=t.createContainerElement(\"span\",{style:\"display: none\"});t.insert(t.createPositionAt(n,0),o);return n}});o.for(\"editingDowncast\").elementToElement({model:\"pageBreak\",view:(e,t)=>{const o=n(\"Page break\");const i=t.createContainerElement(\"div\");const r=t.createContainerElement(\"span\");const s=t.createText(n(\"Page break\"));t.addClass(\"page-break\",i);t.setCustomProperty(\"pageBreak\",true,i);t.addClass(\"page-break__label\",r);t.insert(t.createPositionAt(i,0),r);t.insert(t.createPositionAt(r,0),s);return SR(i,t,o)}});o.for(\"upcast\").elementToElement({view:e=>{const t=e.getStyle(\"page-break-before\")==\"always\";const n=e.getStyle(\"page-break-after\")==\"always\";if(!t&&!n){return}if(e.childCount==1){const t=e.getChild(0);if(!t.is(\"element\",\"span\")||t.getStyle(\"display\")!=\"none\"||t.childCount!=1){return}const n=t.getChild(0);if(!n.is(\"$text\")||n.data!==\" \"){return}}else if(e.childCount>1){return}return{name:true}},model:\"pageBreak\",converterPriority:\"high\"});e.commands.add(\"pageBreak\",new vR(e))}}function SR(e,t,n){t.setCustomProperty(\"pageBreak\",true,e);return A_(e,t,{label:n})}var ER='';class RR extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"pageBreak\",n=>{const o=e.commands.get(\"pageBreak\");const i=new Aw(n);i.set({label:t(\"Page break\"),icon:ER,tooltip:true});i.bind(\"isEnabled\").to(o,\"isEnabled\");this.listenTo(i,\"execute\",()=>{e.execute(\"pageBreak\");e.editing.view.focus()});return i})}}class IR extends tk{static get requires(){return[PR,RR]}static get pluginName(){return\"PageBreak\"}}function OR(e,t){for(const n of e.getChildren()){if(n.is(\"element\",\"b\")&&n.getStyle(\"font-weight\")===\"normal\"){const o=e.getChildIndex(n);t.remove(n);t.insertChild(o,n.getChildren(),e)}}}function VR(e,t){if(!e.childCount){return}const n=new iE(e.document);const o=NR(e,n);if(!o.length){return}let i=null;let r=1;o.forEach((e,s)=>{const a=HR(o[s-1],e);const c=a?null:o[s-1];const l=qR(c,e);if(a){i=null;r=1}if(!i||l!==0){const o=zR(e,t);if(!i){i=BR(o,e.element,n)}else if(e.indent>r){const e=i.getChild(i.childCount-1);const t=e.getChild(e.childCount-1);i=BR(o,t,n);r+=1}else if(e.indent[\\s]*?)[\\r\\n]+(\\s*<\\/span>)/g,\"$1$2\").replace(/<\\/span>/g,\"\").replace(/ <\\//g,\" <\\/o:p>/g,\" \").replace(/( |\\u00A0)<\\/o:p>/g,\"\").replace(/>(\\s*[\\r\\n]\\s*)<\")}function KR(e){e.querySelectorAll(\"span[style*=spacerun]\").forEach(e=>{const t=e.innerText.length||0;e.innerHTML=Array(t+1).join(\"  \").substr(0,t)})}function JR(e){return e.replace(/(\\s+)<\\/span>/g,(e,t)=>t.length===1?\" \":Array(t.length+1).join(\"  \").substr(0,t.length))}function YR(e,t){const n=new DOMParser;e=e.replace(/