{"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(t){const e=t[\"en-gb\"]=t[\"en-gb\"]||{};e.dictionary=Object.assign(e.dictionary||{},{\"%0 of %1\":\"%0 of %1\",\"Align center\":\"Align center\",\"Align left\":\"Align left\",\"Align right\":\"Align right\",\"Block quote\":\"Block quote\",Bold:\"Bold\",\"Bulleted List\":\"Bulleted List\",Cancel:\"Cancel\",\"Centered image\":\"Centred image\",\"Change image text alternative\":\"Change image text alternative\",\"Characters: %0\":\"Characters: %0\",\"Choose heading\":\"Choose heading\",Column:\"Column\",\"Decrease indent\":\"Decrease indent\",\"Delete column\":\"Delete column\",\"Delete row\":\"Delete row\",Downloadable:\"Downloadable\",\"Dropdown toolbar\":\"\",\"Edit link\":\"Edit link\",\"Editor toolbar\":\"\",\"Enter image caption\":\"Enter image caption\",\"Full size image\":\"Full size image\",\"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\",\"Image toolbar\":\"\",\"image widget\":\"Image widget\",\"Increase indent\":\"Increase indent\",\"Insert column left\":\"Insert column left\",\"Insert column right\":\"Insert column right\",\"Insert image\":\"Insert image\",\"Insert media\":\"Insert media\",\"Insert row above\":\"Insert row above\",\"Insert row below\":\"Insert row below\",\"Insert table\":\"Insert table\",Italic:\"Italic\",Justify:\"Justify\",\"Left aligned image\":\"Left aligned image\",Link:\"Link\",\"Link URL\":\"Link URL\",\"Media URL\":\"Media URL\",\"media widget\":\"Media widget\",\"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\",Next:\"Next\",\"Numbered List\":\"Numbered List\",\"Open in a new tab\":\"Open in a new tab\",\"Open link in new tab\":\"Open link in new tab\",Paragraph:\"Paragraph\",\"Paste the media URL in the input.\":\"Paste the media URL in the input.\",Previous:\"Previous\",Redo:\"Redo\",\"Rich Text Editor\":\"Rich Text Editor\",\"Rich Text Editor, %0\":\"Rich Text Editor, %0\",\"Right aligned image\":\"Right aligned image\",Row:\"Row\",Save:\"Save\",\"Select column\":\"\",\"Select row\":\"\",\"Show more items\":\"\",\"Side image\":\"Side image\",\"Split cell horizontally\":\"Split cell horizontally\",\"Split cell vertically\":\"Split cell vertically\",Subscript:\"Subscript\",Superscript:\"Superscript\",\"Table toolbar\":\"\",\"Text alignment\":\"Text alignment\",\"Text alignment toolbar\":\"\",\"Text alternative\":\"Text alternative\",\"The URL must not be empty.\":\"The URL must not be empty.\",\"This link has no URL\":\"This link has no URL\",\"This media URL is not supported.\":\"This media URL is not supported.\",\"Tip: Paste the URL into the content to embed faster.\":\"Tip: Paste the URL into the content to embed faster.\",Underline:\"Underline\",Undo:\"Undo\",Unlink:\"Unlink\",\"Upload failed\":\"Upload failed\",\"Upload in progress\":\"Upload in progress\",\"Words: %0\":\"Words: %0\"});e.getPluralForm=function(t){return t!=1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function t(e,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 e[\"ClassicEditor\"]=n()})(window,(function(){return function(t){var e={};function n(i){if(e[i]){return e[i].exports}var o=e[i]={i:i,l:false,exports:{}};t[i].call(o.exports,o,o.exports,n);o.l=true;return o.exports}n.m=t;n.c=e;n.d=function(t,e,i){if(!n.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:i})}};n.r=function(t){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(t,\"__esModule\",{value:true})};n.t=function(t,e){if(e&1)t=n(t);if(e&8)return t;if(e&4&&typeof t===\"object\"&&t&&t.__esModule)return t;var i=Object.create(null);n.r(i);Object.defineProperty(i,\"default\",{enumerable:true,value:t});if(e&2&&typeof t!=\"string\")for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i};n.n=function(t){var e=t&&t.__esModule?function e(){return t[\"default\"]}:function e(){return t};n.d(e,\"a\",e);return e};n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};n.p=\"\";return n(n.s=100)}([function(t,e,n){\"use strict\";n.d(e,\"b\",(function(){return o}));n.d(e,\"a\",(function(){return s}));const i=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class o extends Error{constructor(t,e,n){t=s(t);if(n){t+=\" \"+JSON.stringify(n)}super(t);this.name=\"CKEditorError\";this.context=e;this.data=n}is(t){return t===\"CKEditorError\"}static rethrowUnexpectedError(t,e){if(t.is&&t.is(\"CKEditorError\")){throw t}const n=new o(t.message,e);n.stack=t.stack;throw n}}function s(t){const e=t.match(/^([^:]+):/);if(!e){return t}return t+` Read more: ${i}#error-${e[1]}\\n`}},function(t,e,n){\"use strict\";var i=function t(){var e;return function t(){if(typeof e===\"undefined\"){e=Boolean(window&&document&&document.all&&!window.atob)}return e}}();var o=function t(){var e={};return function t(n){if(typeof e[n]===\"undefined\"){var i=document.querySelector(n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement){try{i=i.contentDocument.head}catch(t){i=null}}e[n]=i}return e[n]}}();var s=[];function r(t){var e=-1;for(var n=0;n
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\" \");if(t.indexOf(\"
\")>-1){t=`
${t}
`}return t}function E_(t){return t.replace(/(\\s+)<\\/span>/g,(t,e)=>{if(e.length==1){return\" \"}return e})}const M_=[\"figcaption\",\"li\"];function I_(t){let e=\"\";if(t.is(\"text\")||t.is(\"textProxy\")){e=t.data}else if(t.is(\"img\")&&t.hasAttribute(\"alt\")){e=t.getAttribute(\"alt\")}else{let n=null;for(const i of t.getChildren()){const t=I_(i);if(n&&(n.is(\"containerElement\")||i.is(\"containerElement\"))){if(M_.includes(n.name)||M_.includes(i.name)){e+=\"\\n\"}else{e+=\"\\n\\n\"}}e+=t;n=i}}return e}class N_ extends Dw{static get pluginName(){return\"Clipboard\"}init(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const i=n.document;this._htmlDataProcessor=new Ap(i);n.addObserver(C_);this.listenTo(i,\"clipboardInput\",e=>{if(t.isReadOnly){e.stop()}},{priority:\"highest\"});this.listenTo(i,\"clipboardInput\",(t,e)=>{const i=e.dataTransfer;let o=\"\";if(i.getData(\"text/html\")){o=E_(i.getData(\"text/html\"))}else if(i.getData(\"text/plain\")){o=S_(i.getData(\"text/plain\"))}o=this._htmlDataProcessor.toView(o);const s=new tr(this,\"inputTransformation\");this.fire(s,{content:o,dataTransfer:i});if(s.stop.called){t.stop()}n.scrollToTheSelection()},{priority:\"low\"});this.listenTo(this,\"inputTransformation\",(t,e)=>{if(!e.content.isEmpty){const n=this.editor.data;const i=this.editor.model;const o=n.toModel(e.content,\"$clipboardHolder\");if(o.childCount==0){return}i.insertContent(o);t.stop()}},{priority:\"low\"});function o(n,o){const s=o.dataTransfer;o.preventDefault();const r=t.data.toView(t.model.getSelectedContent(e.selection));i.fire(\"clipboardOutput\",{dataTransfer:s,content:r,method:n.name})}this.listenTo(i,\"copy\",o,{priority:\"low\"});this.listenTo(i,\"cut\",(e,n)=>{if(t.isReadOnly){n.preventDefault()}else{o(e,n)}},{priority:\"low\"});this.listenTo(i,\"clipboardOutput\",(n,i)=>{if(!i.content.isEmpty){i.dataTransfer.setData(\"text/html\",this._htmlDataProcessor.toData(i.content));i.dataTransfer.setData(\"text/plain\",I_(i.content))}if(i.method==\"cut\"){t.model.deleteContent(e.selection)}},{priority:\"low\"})}}function*O_(t,e){for(const n of e){if(n&&t.getAttributeProperties(n[0]).copyOnEnter){yield n}}}class R_ extends zw{execute(){const t=this.editor.model;const e=t.document;t.change(n=>{D_(this.editor.model,n,e.selection,t.schema);this.fire(\"afterExecute\",{writer:n})})}}function D_(t,e,n,i){const o=n.isCollapsed;const s=n.getFirstRange();const r=s.start.parent;const a=s.end.parent;if(i.isLimit(r)||i.isLimit(a)){if(!o&&r==a){t.deleteContent(n)}return}if(o){const t=O_(e.model.schema,n.getAttributes());L_(e,s.start);e.setSelectionAttribute(t)}else{const i=!(s.start.isAtStart&&s.end.isAtEnd);const o=r==a;t.deleteContent(n,{leaveUnmerged:i});if(i){if(o){L_(e,n.focus)}else{e.setSelection(a,0)}}}}function L_(t,e){t.split(e);t.setSelection(e.parent.nextSibling,0)}class z_ extends Yd{constructor(t){super(t);const e=this.document;e.on(\"keydown\",(t,n)=>{if(this.isEnabled&&n.keyCode==Rl.enter){let i;e.once(\"enter\",t=>i=t,{priority:\"highest\"});e.fire(\"enter\",new Gu(e,n.domEvent,{isSoft:n.shiftKey}));if(i&&i.stop.called){t.stop()}}})}observe(){}}class V_ extends Dw{static get pluginName(){return\"Enter\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;e.addObserver(z_);t.commands.add(\"enter\",new R_(t));this.listenTo(n,\"enter\",(n,i)=>{i.preventDefault();if(i.isSoft){return}t.execute(\"enter\");e.scrollToTheSelection()},{priority:\"low\"})}}class j_ extends zw{execute(){const t=this.editor.model;const e=t.document;t.change(n=>{F_(t,n,e.selection);this.fire(\"afterExecute\",{writer:n})})}refresh(){const t=this.editor.model;const e=t.document;this.isEnabled=B_(t.schema,e.selection)}}function B_(t,e){if(e.rangeCount>1){return false}const n=e.anchor;if(!n||!t.checkChild(n,\"softBreak\")){return false}const i=e.getFirstRange();const o=i.start.parent;const s=i.end.parent;if((U_(o,t)||U_(s,t))&&o!==s){return false}return true}function F_(t,e,n){const i=n.isCollapsed;const o=n.getFirstRange();const s=o.start.parent;const r=o.end.parent;const a=s==r;if(i){const i=O_(t.schema,n.getAttributes());H_(t,e,o.end);e.removeSelectionAttribute(n.getAttributeKeys());e.setSelectionAttribute(i)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:i});if(a){H_(t,e,n.focus)}else{if(i){e.setSelection(r,0)}}}}function H_(t,e,n){const i=e.createElement(\"softBreak\");t.insertContent(i,n);e.setSelection(i,\"after\")}function U_(t,e){if(t.is(\"rootElement\")){return false}return e.isLimit(t)||U_(t.parent,e)}class W_ extends Dw{static get pluginName(){return\"ShiftEnter\"}init(){const t=this.editor;const e=t.model.schema;const n=t.conversion;const i=t.editing.view;const o=i.document;e.register(\"softBreak\",{allowWhere:\"$text\",isInline:true});n.for(\"upcast\").elementToElement({model:\"softBreak\",view:\"br\"});n.for(\"downcast\").elementToElement({model:\"softBreak\",view:(t,e)=>e.createEmptyElement(\"br\")});i.addObserver(z_);t.commands.add(\"shiftEnter\",new j_(t));this.listenTo(o,\"enter\",(e,n)=>{n.preventDefault();if(!n.isSoft){return}t.execute(\"shiftEnter\");i.scrollToTheSelection()},{priority:\"low\"})}}class q_ extends zw{execute(){const t=this.editor.model;const e=t.schema.getLimitElement(t.document.selection);t.change(t=>{t.setSelection(e,\"in\")})}}const $_=Ll(\"Ctrl+A\");class Y_ extends Dw{static get pluginName(){return\"SelectAllEditing\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;t.commands.add(\"selectAll\",new q_(t));this.listenTo(n,\"keydown\",(e,n)=>{if(Dl(n)===$_){t.execute(\"selectAll\");n.preventDefault()}})}}var G_='';class Q_ extends Dw{static get pluginName(){return\"SelectAllUI\"}init(){const t=this.editor;t.ui.componentFactory.add(\"selectAll\",e=>{const n=t.commands.get(\"selectAll\");const i=new sw(e);const o=e.t;i.set({label:o(\"Select all\"),icon:G_,keystroke:\"Ctrl+A\",tooltip:true});i.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(i,\"execute\",()=>{t.execute(\"selectAll\");t.editing.view.focus()});return i})}}class K_ extends Dw{static get requires(){return[Y_,Q_]}static get pluginName(){return\"SelectAll\"}}class J_{constructor(t,e=20){this.model=t;this.size=0;this.limit=e;this.isLocked=false;this._changeCallback=(t,e)=>{if(e.type!=\"transparent\"&&e!==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(t){this.size+=t;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(t){if(!this.isLocked||t){this._batch=null;this.size=0}}}class Z_ extends zw{constructor(t,e){super(t);this._buffer=new J_(t.model,e);this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy();this._buffer.destroy()}execute(t={}){const e=this.editor.model;const n=e.document;const i=t.text||\"\";const o=i.length;const s=t.range?e.createSelection(t.range):n.selection;const r=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{this._buffer.lock();e.deleteContent(s);if(i){e.insertContent(t.createText(i,n.selection.getAttributes()),s)}if(r){t.setSelection(r)}else if(!s.is(\"documentSelection\")){t.setSelection(s)}this._buffer.unlock();this._buffer.input(o);this._batches.add(this._buffer.batch)})}}function X_(t){let e=null;const n=t.model;const i=t.editing.view;const o=t.commands.get(\"input\");if(Cl.isAndroid){i.document.on(\"beforeinput\",(t,e)=>s(e),{priority:\"lowest\"})}else{i.document.on(\"keydown\",(t,e)=>s(e),{priority:\"lowest\"})}i.document.on(\"compositionstart\",r,{priority:\"lowest\"});i.document.on(\"compositionend\",()=>{e=n.createSelection(n.document.selection)},{priority:\"lowest\"});function s(t){const s=n.document;const r=i.document.isComposing;const c=e&&e.isEqual(s.selection);e=null;if(!o.isEnabled){return}if(ek(t)||s.selection.isCollapsed){return}if(r&&t.keyCode===229){return}if(!r&&t.keyCode===229&&c){return}a()}function r(){const t=n.document;const e=t.selection.rangeCount===1?t.selection.getFirstRange().isFlat:true;if(t.selection.isCollapsed||e){return}a()}function a(){const t=o.buffer;t.lock();n.enqueueChange(t.batch,()=>{n.deleteContent(n.document.selection)});t.unlock()}}const tk=[Dl(\"arrowUp\"),Dl(\"arrowRight\"),Dl(\"arrowDown\"),Dl(\"arrowLeft\"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++){tk.push(t)}function ek(t){if(t.ctrlKey){return true}return tk.includes(t.keyCode)}function nk(t,e){const n=[];let i=0;let o;t.forEach(t=>{if(t==\"equal\"){s();i++}else if(t==\"insert\"){if(r(\"insert\")){o.values.push(e[i])}else{s();o={type:\"insert\",index:i,values:[e[i]]}}i++}else{if(r(\"delete\")){o.howMany++}else{s();o={type:\"delete\",index:i,howMany:1}}}});s();return n;function s(){if(o){n.push(o);o=null}}function r(t){return o&&o.type==t}}function ik(t){if(t.length==0){return false}for(const e of t){if(e.type===\"children\"&&!ok(e)){return true}}return false}function ok(t){if(t.newChildren.length-t.oldChildren.length!=1){return}const e=kd(t.oldChildren,t.newChildren,sk);const n=nk(e,t.newChildren);if(n.length>1){return}const i=n[0];if(!(!!i.values[0]&&i.values[0].is(\"text\"))){return}return i}function sk(t,e){if(!!t&&t.is(\"text\")&&!!e&&e.is(\"text\")){return t.data===e.data}else{return t===e}}function rk(t){t.editing.view.document.on(\"mutations\",(e,n,i)=>{new ak(t).handle(n,i)})}class ak{constructor(t){this.editor=t;this.editing=this.editor.editing}handle(t,e){if(ik(t)){this._handleContainerChildrenMutations(t,e)}else{for(const n of t){this._handleTextMutation(n,e);this._handleTextNodeInsertion(n)}}}_handleContainerChildrenMutations(t,e){const n=ck(t);if(!n){return}const i=this.editor.editing.view.domConverter;const o=i.mapViewToDom(n);const s=new zd(this.editor.editing.view.document);const r=this.editor.data.toModel(s.domToView(o)).getChild(0);const a=this.editor.editing.mapper.toModelElement(n);if(!a){return}const c=Array.from(r.getChildren());const l=Array.from(a.getChildren());const d=c[c.length-1];const u=l[l.length-1];if(d&&d.is(\"softBreak\")&&u&&!u.is(\"softBreak\")){c.pop()}const h=this.editor.model.schema;if(!lk(c,h)||!lk(l,h)){return}const f=c.map(t=>t.is(\"text\")?t.data:\"@\").join(\"\").replace(/\\u00A0/g,\" \");const m=l.map(t=>t.is(\"text\")?t.data:\"@\").join(\"\").replace(/\\u00A0/g,\" \");if(m===f){return}const g=kd(m,f);const{firstChangeAt:p,insertions:b,deletions:w}=dk(g);let _=null;if(e){_=this.editing.mapper.toModelRange(e.getFirstRange())}const k=f.substr(p,b);const v=this.editor.model.createRange(this.editor.model.createPositionAt(a,p),this.editor.model.createPositionAt(a,p+w));this.editor.execute(\"input\",{text:k,range:v,resultRange:_})}_handleTextMutation(t,e){if(t.type!=\"text\"){return}const n=t.newText.replace(/\\u00A0/g,\" \");const i=t.oldText.replace(/\\u00A0/g,\" \");if(i===n){return}const o=kd(i,n);const{firstChangeAt:s,insertions:r,deletions:a}=dk(o);let c=null;if(e){c=this.editing.mapper.toModelRange(e.getFirstRange())}const l=this.editing.view.createPositionAt(t.node,s);const d=this.editing.mapper.toModelPosition(l);const u=this.editor.model.createRange(d,d.getShiftedBy(a));const h=n.substr(s,r);this.editor.execute(\"input\",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(t){if(t.type!=\"children\"){return}const e=ok(t);const n=this.editing.view.createPositionAt(t.node,e.index);const i=this.editing.mapper.toModelPosition(n);const o=e.values[0].data;this.editor.execute(\"input\",{text:o.replace(/\\u00A0/g,\" \"),range:this.editor.model.createRange(i)})}}function ck(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:true}));if(!e){return}return e.getAncestors({includeSelf:true,parentFirst:true}).find(t=>t.is(\"containerElement\")||t.is(\"rootElement\"))}function lk(t,e){return t.every(t=>e.isInline(t))}function dk(t){let e=null;let n=null;for(let i=0;i