{"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
\").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