{"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){t[\"en\"]=Object.assign(t[\"en\"]||{},{a:\"Image toolbar\",b:\"Media toolbar\",c:\"Table toolbar\",d:\"Special characters\",e:\"Block quote\",f:\"Choose heading\",g:\"Heading\",h:\"Increase indent\",i:\"Decrease indent\",j:\"Link\",k:\"Numbered List\",l:\"Bulleted List\",m:\"media widget\",n:\"Insert media\",o:\"The URL must not be empty.\",p:\"This media URL is not supported.\",q:\"Bold\",r:\"Italic\",s:\"Code\",t:\"Strikethrough\",u:\"Underline\",v:\"image widget\",w:\"Enter image caption\",x:\"Full size image\",y:\"Side image\",z:\"Left aligned image\",aa:\"Centered image\",ab:\"Right aligned image\",ac:\"Insert image\",ad:\"Upload failed\",ae:\"Widget toolbar\",af:\"Table properties\",ag:\"Cell properties\",ah:\"Remove Format\",ai:\"Horizontal line\",aj:\"Yellow marker\",ak:\"Green marker\",al:\"Pink marker\",am:\"Blue marker\",an:\"Red pen\",ao:\"Green pen\",ap:\"Remove highlight\",aq:\"Highlight\",ar:\"Text highlight toolbar\",as:\"Upload in progress\",at:\"Character categories\",au:\"Font Family\",av:\"Default\",aw:\"Font Size\",ax:\"Tiny\",ay:\"Small\",az:\"Big\",ba:\"Huge\",bb:\"Font Color\",bc:\"Font Background Color\",bd:\"Change image text alternative\",be:\"Dropdown toolbar\",bf:\"Rich Text Editor\",bg:\"None\",bh:\"Solid\",bi:\"Dotted\",bj:\"Dashed\",bk:\"Double\",bl:\"Groove\",bm:\"Ridge\",bn:\"Inset\",bo:\"Outset\",bp:'The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".',bq:'The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".',br:\"Black\",bs:\"Dim grey\",bt:\"Grey\",bu:\"Light grey\",bv:\"White\",bw:\"Red\",bx:\"Orange\",by:\"Yellow\",bz:\"Light green\",ca:\"Green\",cb:\"Aquamarine\",cc:\"Turquoise\",cd:\"Light blue\",ce:\"Blue\",cf:\"Purple\",cg:\"Border\",ch:\"Style\",ci:\"Width\",cj:\"Color\",ck:\"Background\",cl:\"Dimensions\",cm:\"Height\",cn:\"Padding\",co:\"Table cell text alignment\",cp:\"Horizontal text alignment toolbar\",cq:\"Vertical text alignment toolbar\",cr:\"Save\",cs:\"Cancel\",ct:\"Align cell text to the left\",cu:\"Align cell text to the center\",cv:\"Align cell text to the right\",cw:\"Justify cell text\",cx:\"Align cell text to the top\",cy:\"Align cell text to the middle\",cz:\"Align cell text to the bottom\",da:\"Remove color\",db:\"Document colors\",dc:\"%0 of %1\",dd:\"Previous\",de:\"Next\",df:\"Undo\",dg:\"Redo\",dh:\"Text alternative\",di:\"Editor toolbar\",dj:\"Show more items\",dk:\"Alignment\",dl:\"Table alignment toolbar\",dm:\"Align table to the left\",dn:\"Center table\",do:\"Align table to the right\",dp:\"Paste the media URL in the input.\",dq:\"Tip: Paste the URL into the content to embed faster.\",dr:\"Media URL\",ds:\"Unlink\",dt:\"Edit link\",du:\"Open link in new tab\",dv:\"This link has no URL\",dw:\"Link URL\",dx:\"Open in a new tab\",dy:\"Downloadable\",dz:\"Paragraph\",ea:\"Heading 1\",eb:\"Heading 2\",ec:\"Heading 3\",ed:\"Heading 4\",ee:\"Heading 5\",ef:\"Heading 6\",eg:\"Insert code block\",eh:\"Align left\",ei:\"Align right\",ej:\"Align center\",ek:\"Justify\",el:\"Text alignment\",em:\"Text alignment toolbar\",en:\"Rich Text Editor, %0\",eo:\"Insert table\",ep:\"Header column\",eq:\"Insert column left\",er:\"Insert column right\",es:\"Delete column\",et:\"Column\",eu:\"Header row\",ev:\"Insert row below\",ew:\"Insert row above\",ex:\"Delete row\",ey:\"Row\",ez:\"Merge cell up\",fa:\"Merge cell right\",fb:\"Merge cell down\",fc:\"Merge cell left\",fd:\"Split cell vertically\",fe:\"Split cell horizontally\",ff:\"Merge cells\",fg:\"Plain text\"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function t(e,i){if(typeof exports===\"object\"&&typeof module===\"object\")module.exports=i();else if(typeof define===\"function\"&&define.amd)define([],i);else if(typeof exports===\"object\")exports[\"ClassicEditor\"]=i();else e[\"ClassicEditor\"]=i()})(window,(function(){return function(t){var e={};function i(n){if(e[n]){return e[n].exports}var o=e[n]={i:n,l:false,exports:{}};t[n].call(o.exports,o,o.exports,i);o.l=true;return o.exports}i.m=t;i.c=e;i.d=function(t,e,n){if(!i.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:n})}};i.r=function(t){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(t,\"__esModule\",{value:true})};i.t=function(t,e){if(e&1)t=i(t);if(e&8)return t;if(e&4&&typeof t===\"object\"&&t&&t.__esModule)return t;var n=Object.create(null);i.r(n);Object.defineProperty(n,\"default\",{enumerable:true,value:t});if(e&2&&typeof t!=\"string\")for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n};i.n=function(t){var e=t&&t.__esModule?function e(){return t[\"default\"]}:function e(){return t};i.d(e,\"a\",e);return e};i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};i.p=\"\";return i(i.s=132)}([function(t,e,i){\"use strict\";i.d(e,\"b\",(function(){return o}));i.d(e,\"a\",(function(){return r}));const n=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class o extends Error{constructor(t,e,i){t=r(t);if(i){t+=\" \"+JSON.stringify(i)}super(t);this.name=\"CKEditorError\";this.context=e;this.data=i}is(t){return t===\"CKEditorError\"}static rethrowUnexpectedError(t,e){if(t.is&&t.is(\"CKEditorError\")){throw t}const i=new o(t.message,e);i.stack=t.stack;throw i}}function r(t){const e=t.match(/^([^:]+):/);if(!e){return t}return t+` Read more: ${n}#error-${e[1]}\\n`}},function(t,e,i){\"use strict\";var n=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(i){if(typeof e[i]===\"undefined\"){var n=document.querySelector(i);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement){try{n=n.contentDocument.head}catch(t){n=null}}e[i]=n}return e[i]}}();var r=[];function s(t){var e=-1;for(var i=0;i
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\" \");if(t.indexOf(\"
\")>-1){t=`
${t}
`}return t}function ey(t){return t.replace(/(\\s+)<\\/span>/g,(t,e)=>{if(e.length==1){return\" \"}return e})}const iy=[\"figcaption\",\"li\"];function ny(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 i=null;for(const n of t.getChildren()){const t=ny(n);if(i&&(i.is(\"containerElement\")||n.is(\"containerElement\"))){if(iy.includes(i.name)||iy.includes(n.name)){e+=\"\\n\"}else{e+=\"\\n\\n\"}}e+=t;i=n}}return e}class oy extends Ow{static get pluginName(){return\"Clipboard\"}init(){const t=this.editor;const e=t.model.document;const i=t.editing.view;const n=i.document;this._htmlDataProcessor=new vp;i.addObserver(Zv);this.listenTo(n,\"clipboardInput\",e=>{if(t.isReadOnly){e.stop()}},{priority:\"highest\"});this.listenTo(n,\"clipboardInput\",(t,e)=>{const n=e.dataTransfer;let o=\"\";if(n.getData(\"text/html\")){o=ey(n.getData(\"text/html\"))}else if(n.getData(\"text/plain\")){o=ty(n.getData(\"text/plain\"))}o=this._htmlDataProcessor.toView(o);this.fire(\"inputTransformation\",{content:o,dataTransfer:n});i.scrollToTheSelection()},{priority:\"low\"});this.listenTo(this,\"inputTransformation\",(t,e)=>{if(!e.content.isEmpty){const t=this.editor.data;const i=this.editor.model;const n=t.toModel(e.content,\"$clipboardHolder\");if(n.childCount==0){return}i.insertContent(n)}},{priority:\"low\"});function o(i,o){const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));n.fire(\"clipboardOutput\",{dataTransfer:r,content:s,method:i.name})}this.listenTo(n,\"copy\",o,{priority:\"low\"});this.listenTo(n,\"cut\",(e,i)=>{if(t.isReadOnly){i.preventDefault()}else{o(e,i)}},{priority:\"low\"});this.listenTo(n,\"clipboardOutput\",(i,n)=>{if(!n.content.isEmpty){n.dataTransfer.setData(\"text/html\",this._htmlDataProcessor.toData(n.content));n.dataTransfer.setData(\"text/plain\",ny(n.content))}if(n.method==\"cut\"){t.model.deleteContent(e.selection)}},{priority:\"low\"})}}class ry{createDocumentFragment(t){return new ql(t)}createElement(t,e,i){return new zc(t,e,i)}createText(t){return new Ds(t)}clone(t,e=false){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,i){return i._insertChild(t,e)}removeChildren(t,e,i){return i._removeChildren(t,e)}remove(t){const e=t.parent;if(e){return this.removeChildren(e.getChildIndex(t),1,e)}return[]}replace(t,e){const i=t.parent;if(i){const n=i.getChildIndex(t);this.removeChildren(n,1,i);this.insertChild(n,e,i);return true}return false}unwrapElement(t){const e=t.parent;if(e){const i=e.getChildIndex(t);this.remove(t);this.insertChild(i,t.getChildren(),e)}}rename(t,e){const i=new zc(t,e.getAttributes(),e.getChildren());return this.replace(e,i)?i:null}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){if(R(t)&&i===undefined){i=e}i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return ul._createAt(t,e)}createPositionAfter(t){return ul._createAfter(t)}createPositionBefore(t){return ul._createBefore(t)}createRange(t,e){return new hl(t,e)}createRangeOn(t){return hl._createOn(t)}createRangeIn(t){return hl._createIn(t)}createSelection(t,e,i){return new ml(t,e,i)}}class sy extends zw{refresh(){this.isEnabled=Hk(this.editor.model)}execute(t){const e=this.editor;const i=e.model;const n=e.plugins.get(Mv);i.change(e=>{const o=Array.isArray(t.file)?t.file:[t.file];for(const t of o){ay(e,i,n,t)}})}}function ay(t,e,i,n){const o=i.createLoader(n);if(!o){return}Fk(t,e,{uploadId:o.id})}class cy extends Ow{static get requires(){return[Mv,Qv,oy]}static get pluginName(){return\"ImageUploadEditing\"}constructor(t){super(t);t.config.define(\"image\",{upload:{types:[\"jpeg\",\"png\",\"gif\",\"bmp\",\"webp\",\"tiff\"]}})}init(){const t=this.editor;const e=t.model.document;const i=t.model.schema;const n=t.conversion;const o=t.plugins.get(Mv);const r=vv(t.config.get(\"image.upload.types\"));i.extend(\"image\",{allowAttributes:[\"uploadId\",\"uploadStatus\"]});t.commands.add(\"imageUpload\",new sy(t));n.for(\"upcast\").attributeToAttribute({view:{name:\"img\",key:\"uploadId\"},model:\"uploadId\"});this.listenTo(t.editing.view.document,\"clipboardInput\",(e,i)=>{if(ly(i.dataTransfer)){return}const n=Array.from(i.dataTransfer.files).filter(t=>{if(!t){return false}return r.test(t.type)});const o=i.targetRanges.map(e=>t.editing.mapper.toModelRange(e));t.model.change(i=>{i.setSelection(o);if(n.length){e.stop();t.model.enqueueChange(\"default\",()=>{t.execute(\"imageUpload\",{file:n})})}})});this.listenTo(t.plugins.get(oy),\"inputTransformation\",(e,i)=>{const n=Array.from(t.editing.view.createRangeIn(i.content)).filter(t=>xv(t.item)&&!t.item.getAttribute(\"uploadProcessed\")).map(t=>({promise:yv(t.item),imageElement:t.item}));if(!n.length){return}const r=new ry;for(const t of n){r.setAttribute(\"uploadProcessed\",true,t.imageElement);const e=o.createLoader(t.promise);if(e){r.setAttribute(\"src\",\"\",t.imageElement);r.setAttribute(\"uploadId\",e.id,t.imageElement)}}});t.editing.view.document.on(\"dragover\",(t,e)=>{e.preventDefault()});e.on(\"change\",()=>{const i=e.differ.getChanges({includeChangesInGraveyard:true});for(const e of i){if(e.type==\"insert\"&&e.name!=\"$text\"){const i=e.position.nodeAfter;const n=e.position.root.rootName==\"$graveyard\";for(const e of dy(t,i)){const t=e.getAttribute(\"uploadId\");if(!t){continue}const i=o.loaders.get(t);if(!i){continue}if(n){i.abort()}else if(i.status==\"idle\"){this._readAndUpload(i,e)}}}}})}_readAndUpload(t,e){const i=this.editor;const n=i.model;const o=i.locale.t;const r=i.plugins.get(Mv);const s=i.plugins.get(Qv);n.enqueueChange(\"transparent\",t=>{t.setAttribute(\"uploadStatus\",\"reading\",e)});return t.read().then(()=>{const o=t.upload();if(Tl.isSafari){const t=i.editing.mapper.toViewElement(e);const n=t.getChild(0);i.editing.view.once(\"render\",()=>{if(!n.parent){return}const t=i.editing.view.domConverter.mapViewToDom(n.parent);if(!t){return}const e=t.style.display;t.style.display=\"none\";t._ckHack=t.offsetHeight;t.style.display=e})}n.enqueueChange(\"transparent\",t=>{t.setAttribute(\"uploadStatus\",\"uploading\",e)});return o}).then(t=>{n.enqueueChange(\"transparent\",i=>{i.setAttributes({uploadStatus:\"complete\",src:t.default},e);this._parseAndSetSrcsetAttributeOnImage(t,e,i)});a()}).catch(i=>{if(t.status!==\"error\"&&t.status!==\"aborted\"){throw i}if(t.status==\"error\"&&i){s.showWarning(i,{title:o(\"ad\"),namespace:\"upload\"})}a();n.enqueueChange(\"transparent\",t=>{t.remove(e)})});function a(){n.enqueueChange(\"transparent\",t=>{t.removeAttribute(\"uploadId\",e);t.removeAttribute(\"uploadStatus\",e)});r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,i){let n=0;const o=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e)){n=Math.max(n,e);return true}}).map(e=>`${t[e]} ${e}w`).join(\", \");if(o!=\"\"){i.setAttribute(\"srcset\",{data:o,width:n},e)}}}function ly(t){return Array.from(t.types).includes(\"text/html\")&&t.getData(\"text/html\")!==\"\"}function dy(t,e){return Array.from(t.model.createRangeOn(e)).filter(t=>t.item.is(\"image\")).map(t=>t.item)}class uy extends Ow{static get pluginName(){return\"ImageUpload\"}static get requires(){return[cy,Tv,Lv]}}class hy extends zw{constructor(t){super(t);this._childCommands=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();e.execute(t)}registerChildCommand(t){this._childCommands.push(t);t.on(\"change:isEnabled\",()=>this._checkEnabled());this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(t=>t.isEnabled)}}class fy extends Ow{static get pluginName(){return\"IndentEditing\"}init(){const t=this.editor;t.commands.add(\"indent\",new hy(t));t.commands.add(\"outdent\",new hy(t))}}var gy='';var my='';class py extends Ow{static get pluginName(){return\"IndentUI\"}init(){const t=this.editor;const e=t.locale;const i=t.t;const n=e.uiLanguageDirection==\"ltr\"?gy:my;const o=e.uiLanguageDirection==\"ltr\"?my:gy;this._defineButton(\"indent\",i(\"h\"),n);this._defineButton(\"outdent\",i(\"i\"),o)}_defineButton(t,e,i){const n=this.editor;n.ui.componentFactory.add(t,o=>{const r=n.commands.get(t);const s=new Xb(o);s.set({label:e,icon:i,tooltip:true});s.bind(\"isOn\",\"isEnabled\").to(r,\"value\",\"isEnabled\");this.listenTo(s,\"execute\",()=>{n.execute(t);n.editing.view.focus()});return s})}}class by extends Ow{static get pluginName(){return\"Indent\"}static get requires(){return[fy,py]}}const wy=\"italic\";class ky extends Ow{static get pluginName(){return\"ItalicEditing\"}init(){const t=this.editor;t.model.schema.extend(\"$text\",{allowAttributes:wy});t.model.schema.setAttributeProperties(wy,{isFormatting:true,copyOnEnter:true});t.conversion.attributeToElement({model:wy,view:\"i\",upcastAlso:[\"em\",{styles:{\"font-style\":\"italic\"}}]});t.commands.add(wy,new Qw(t,wy));t.keystrokes.set(\"CTRL+I\",wy)}}var _y='';const vy=\"italic\";class yy extends Ow{init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add(vy,i=>{const n=t.commands.get(vy);const o=new Xb(i);o.set({label:e(\"r\"),icon:_y,keystroke:\"CTRL+I\",tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>{t.execute(vy);t.editing.view.focus()});return o})}}class xy extends Ow{static get requires(){return[ky,yy]}static get pluginName(){return\"Italic\"}}function Cy(t,e,i){return i.createRange(Ay(t,e,true,i),Ay(t,e,false,i))}function Ay(t,e,i,n){let o=t.textNode||(i?t.nodeBefore:t.nodeAfter);let r=null;while(o&&o.getAttribute(\"linkHref\")==e){r=o;o=i?o.previousSibling:o.nextSibling}return r?n.createPositionAt(r,i?\"before\":\"after\"):t}class Ty extends zw{constructor(t){super(t);this.manualDecorators=new ys}restoreManualDecoratorStates(){for(const t of this.manualDecorators){t.value=this._getDecoratorStateFromModel(t.id)}}refresh(){const t=this.editor.model;const e=t.document;this.value=e.selection.getAttribute(\"linkHref\");for(const t of this.manualDecorators){t.value=this._getDecoratorStateFromModel(t.id)}this.isEnabled=t.schema.checkAttributeInSelection(e.selection,\"linkHref\")}execute(t,e={}){const i=this.editor.model;const n=i.document.selection;const o=[];const r=[];for(const t in e){if(e[t]){o.push(t)}else{r.push(t)}}i.change(e=>{if(n.isCollapsed){const s=n.getFirstPosition();if(n.hasAttribute(\"linkHref\")){const a=Cy(s,n.getAttribute(\"linkHref\"),i);e.setAttribute(\"linkHref\",t,a);o.forEach(t=>{e.setAttribute(t,true,a)});r.forEach(t=>{e.removeAttribute(t,a)});e.setSelection(a)}else if(t!==\"\"){const r=Hs(n.getAttributes());r.set(\"linkHref\",t);o.forEach(t=>{r.set(t,true)});const a=e.createText(t,r);i.insertContent(a,s);e.setSelection(e.createRangeOn(a))}}else{const s=i.schema.getValidRanges(n.getRanges(),\"linkHref\");for(const i of s){e.setAttribute(\"linkHref\",t,i);o.forEach(t=>{e.setAttribute(t,true,i)});r.forEach(t=>{e.removeAttribute(t,i)})}}})}_getDecoratorStateFromModel(t){const e=this.editor.model.document;return e.selection.getAttribute(t)||false}}class Py extends zw{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute(\"linkHref\")}execute(){const t=this.editor;const e=this.editor.model;const i=e.document.selection;const n=t.commands.get(\"link\");e.change(t=>{const o=i.isCollapsed?[Cy(i.getFirstPosition(),i.getAttribute(\"linkHref\"),e)]:i.getRanges();for(const e of o){t.removeAttribute(\"linkHref\",e);if(n){for(const i of n.manualDecorators){t.removeAttribute(i.id,e)}}}})}}function Sy(t,e,i){var n=t.length;i=i===undefined?n:i;return!e&&i>=n?t:Ia(t,e,i)}var Ey=Sy;var My=\"\\\\ud800-\\\\udfff\",Iy=\"\\\\u0300-\\\\u036f\",Ny=\"\\\\ufe20-\\\\ufe2f\",Oy=\"\\\\u20d0-\\\\u20ff\",Ry=Iy+Ny+Oy,Vy=\"\\\\ufe0e\\\\ufe0f\";var Ly=\"\\\\u200d\";var zy=RegExp(\"[\"+Ly+My+Ry+Vy+\"]\");function Dy(t){return zy.test(t)}var By=Dy;function jy(t){return t.split(\"\")}var Fy=jy;var Hy=\"\\\\ud800-\\\\udfff\",Uy=\"\\\\u0300-\\\\u036f\",Wy=\"\\\\ufe20-\\\\ufe2f\",qy=\"\\\\u20d0-\\\\u20ff\",$y=Uy+Wy+qy,Gy=\"\\\\ufe0e\\\\ufe0f\";var Yy=\"[\"+Hy+\"]\",Qy=\"[\"+$y+\"]\",Ky=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",Jy=\"(?:\"+Qy+\"|\"+Ky+\")\",Zy=\"[^\"+Hy+\"]\",Xy=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",tx=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",ex=\"\\\\u200d\";var ix=Jy+\"?\",nx=\"[\"+Gy+\"]?\",ox=\"(?:\"+ex+\"(?:\"+[Zy,Xy,tx].join(\"|\")+\")\"+nx+ix+\")*\",rx=nx+ix+ox,sx=\"(?:\"+[Zy+Qy+\"?\",Qy,Xy,tx,Yy].join(\"|\")+\")\";var ax=RegExp(Ky+\"(?=\"+Ky+\")|\"+sx+rx,\"g\");function cx(t){return t.match(ax)||[]}var lx=cx;function dx(t){return By(t)?lx(t):Fy(t)}var ux=dx;function hx(t){return function(e){e=_a(e);var i=By(e)?ux(e):undefined;var n=i?i[0]:e.charAt(0);var o=i?Ey(i,1).join(\"\"):e.slice(1);return n[t]()+o}}var fx=hx;var gx=fx(\"toUpperCase\");var mx=gx;const px=/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g;const bx=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function wx(t){return t.is(\"attributeElement\")&&!!t.getCustomProperty(\"link\")}function kx(t,e){const i=e.createAttributeElement(\"a\",{href:t},{priority:5});e.setCustomProperty(\"link\",true,i);return i}function _x(t){t=String(t);return vx(t)?t:\"#\"}function vx(t){const e=t.replace(px,\"\");return e.match(bx)}function yx(t,e){const i={\"Open in a new tab\":t(\"dx\"),Downloadable:t(\"dy\")};e.forEach(t=>{if(t.label&&i[t.label]){t.label=i[t.label]}return t});return e}function xx(t){const e=[];if(t){for(const[i,n]of Object.entries(t)){const t=Object.assign({},n,{id:`link${mx(i)}`});e.push(t)}}return e}class Cx{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){if(Array.isArray(t)){t.forEach(t=>this._definitions.add(t))}else{this._definitions.add(t)}}getDispatcher(){return t=>{t.on(\"attribute:linkHref\",(t,e,i)=>{if(!i.consumable.test(e.item,\"attribute:linkHref\")){return}const n=i.writer;const o=n.document.selection;for(const t of this._definitions){const r=n.createAttributeElement(\"a\",t.attributes,{priority:5});n.setCustomProperty(\"link\",true,r);if(t.callback(e.attributeNewValue)){if(e.item.is(\"selection\")){n.wrap(o.getFirstRange(),r)}else{n.wrap(i.mapper.toViewRange(e.range),r)}}else{n.unwrap(i.mapper.toViewRange(e.range),r)}}},{priority:\"high\"})}}}class Ax{constructor({id:t,label:e,attributes:i}){this.id=t;this.set(\"value\");this.label=e;this.attributes=i}}vs(Ax,Qc);function Tx({view:t,model:e,emitter:i,attribute:n,locale:o}){const r=new Px(e,i,n);const s=e.document.selection;i.listenTo(t.document,\"keydown\",(t,e)=>{if(!s.isCollapsed){return}if(e.shiftKey||e.altKey||e.ctrlKey){return}const i=e.keyCode==Vl.arrowright;const n=e.keyCode==Vl.arrowleft;if(!i&&!n){return}const a=s.getFirstPosition();const c=o.contentLanguageDirection;let l;if(c===\"ltr\"&&i||c===\"rtl\"&&n){l=r.handleForwardMovement(a,e)}else{l=r.handleBackwardMovement(a,e)}if(l){t.stop()}},{priority:os.get(\"high\")+1})}class Px{constructor(t,e,i){this.model=t;this.attribute=i;this._modelSelection=t.document.selection;this._overrideUid=null;this._isNextGravityRestorationSkipped=false;e.listenTo(this._modelSelection,\"change:range\",(t,e)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=false;return}if(!this._isGravityOverridden){return}if(!e.directChange&&Sx(this._modelSelection.getFirstPosition(),i)){return}this._restoreGravity()})}handleForwardMovement(t,e){const i=this.attribute;if(this._isGravityOverridden){return}if(t.isAtStart&&this._hasSelectionAttribute){return}if(Ix(t,i)&&this._hasSelectionAttribute){this._preventCaretMovement(e);this._removeSelectionAttribute();return true}if(Ex(t,i)){this._preventCaretMovement(e);this._overrideGravity();return true}if(Mx(t,i)&&this._hasSelectionAttribute){this._preventCaretMovement(e);this._overrideGravity();return true}}handleBackwardMovement(t,e){const i=this.attribute;if(this._isGravityOverridden){if(Ix(t,i)&&this._hasSelectionAttribute){this._preventCaretMovement(e);this._restoreGravity();this._removeSelectionAttribute();return true}else{this._preventCaretMovement(e);this._restoreGravity();if(t.isAtStart){this._removeSelectionAttribute()}return true}}else{if(Ix(t,i)&&!this._hasSelectionAttribute){this._preventCaretMovement(e);this._setSelectionAttributeFromTheNodeBefore(t);return true}if(t.isAtEnd&&Mx(t,i)){if(this._hasSelectionAttribute){if(Nx(t,i)){this._skipNextAutomaticGravityRestoration();this._overrideGravity()}return}else{this._preventCaretMovement(e);this._setSelectionAttributeFromTheNodeBefore(t);return true}}if(t.isAtStart){if(this._hasSelectionAttribute){this._removeSelectionAttribute();this._preventCaretMovement(e);return true}return}if(Nx(t,i)){this._skipNextAutomaticGravityRestoration();this._overrideGravity()}}}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.model.change(t=>{t.restoreSelectionGravity(this._overrideUid);this._overrideUid=null})}_preventCaretMovement(t){t.preventDefault()}_removeSelectionAttribute(){this.model.change(t=>{t.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(t){const e=this.attribute;this.model.change(i=>{i.setSelectionAttribute(this.attribute,t.nodeBefore.getAttribute(e))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=true}}function Sx(t,e){return Ex(t,e)||Mx(t,e)}function Ex(t,e){const{nodeBefore:i,nodeAfter:n}=t;const o=i?i.hasAttribute(e):false;const r=n?n.hasAttribute(e):false;return r&&(!o||i.getAttribute(e)!==n.getAttribute(e))}function Mx(t,e){const{nodeBefore:i,nodeAfter:n}=t;const o=i?i.hasAttribute(e):false;const r=n?n.hasAttribute(e):false;return o&&(!r||i.getAttribute(e)!==n.getAttribute(e))}function Ix(t,e){const{nodeBefore:i,nodeAfter:n}=t;const o=i?i.hasAttribute(e):false;const r=n?n.hasAttribute(e):false;if(!r||!o){return}return n.getAttribute(e)!==i.getAttribute(e)}function Nx(t,e){return Sx(t.getShiftedBy(-1),e)}var Ox=i(75);const Rx=\"ck-link_selected\";const Vx=\"automatic\";const Lx=\"manual\";const zx=/^(https?:)?\\/\\//;class Dx extends Ow{static get pluginName(){return\"LinkEditing\"}constructor(t){super(t);t.config.define(\"link\",{addTargetToExternalLinks:false})}init(){const t=this.editor;const e=t.locale;t.model.schema.extend(\"$text\",{allowAttributes:\"linkHref\"});t.conversion.for(\"dataDowncast\").attributeToElement({model:\"linkHref\",view:kx});t.conversion.for(\"editingDowncast\").attributeToElement({model:\"linkHref\",view:(t,e)=>kx(_x(t),e)});t.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:{href:true}},model:{key:\"linkHref\",value:t=>t.getAttribute(\"href\")}});t.commands.add(\"link\",new Ty(t));t.commands.add(\"unlink\",new Py(t));const i=yx(t.t,xx(t.config.get(\"link.decorators\")));this._enableAutomaticDecorators(i.filter(t=>t.mode===Vx));this._enableManualDecorators(i.filter(t=>t.mode===Lx));Tx({view:t.editing.view,model:t.model,emitter:this,attribute:\"linkHref\",locale:e});this._setupLinkHighlight()}_enableAutomaticDecorators(t){const e=this.editor;const i=new Cx;if(e.config.get(\"link.addTargetToExternalLinks\")){i.add({id:\"linkIsExternal\",mode:Vx,callback:t=>zx.test(t),attributes:{target:\"_blank\",rel:\"noopener noreferrer\"}})}i.add(t);if(i.length){e.conversion.for(\"downcast\").add(i.getDispatcher())}}_enableManualDecorators(t){if(!t.length){return}const e=this.editor;const i=e.commands.get(\"link\");const n=i.manualDecorators;t.forEach(t=>{e.model.schema.extend(\"$text\",{allowAttributes:t.id});n.add(new Ax(t));e.conversion.for(\"downcast\").attributeToElement({model:t.id,view:(e,i)=>{if(e){const e=n.get(t.id).attributes;const o=i.createAttributeElement(\"a\",e,{priority:5});i.setCustomProperty(\"link\",true,o);return o}}});e.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:n.get(t.id).attributes},model:{key:t.id}})})}_setupLinkHighlight(){const t=this.editor;const e=t.editing.view;const i=new Set;e.document.registerPostFixer(e=>{const n=t.model.document.selection;let o=false;if(n.hasAttribute(\"linkHref\")){const r=Cy(n.getFirstPosition(),n.getAttribute(\"linkHref\"),t.model);const s=t.editing.mapper.toViewRange(r);for(const t of s.getItems()){if(t.is(\"a\")&&!t.hasClass(Rx)){e.addClass(Rx,t);i.add(t);o=true}}}return o});t.conversion.for(\"editingDowncast\").add(t=>{t.on(\"insert\",n,{priority:\"highest\"});t.on(\"remove\",n,{priority:\"highest\"});t.on(\"attribute\",n,{priority:\"highest\"});t.on(\"selection\",n,{priority:\"highest\"});function n(){e.change(t=>{for(const e of i.values()){t.removeClass(Rx,e);i.delete(e)}})}})}}class Bx extends Ku{constructor(t){super(t);this.domEventType=\"click\"}onDomEvent(t){this.fire(t.type,t)}}var jx=i(77);class Fx extends pb{constructor(t,e=[]){super(t);const i=t.t;this.focusTracker=new Cp;this.keystrokes=new up;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(i(\"cr\"),h_,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(i(\"cs\"),f_,\"ck-button-cancel\",\"cancel\");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e);this.children=this._createFormChildren(e);this._focusables=new jp;this._focusCycler=new Ob({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}});const n=[\"ck\",\"ck-link-form\"];if(e.length){n.push(\"ck-link-form_layout-vertical\")}this.setTemplate({tag:\"form\",attributes:{class:n,tabindex:\"-1\"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>{t[e.name]=e.isOn;return t},{})}render(){super.render();u_({view:this});const t=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];t.forEach(t=>{this._focusables.add(t);this.focusTracker.add(t.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t;const e=new c_(this.locale,d_);e.label=t(\"dw\");e.inputView.placeholder=\"https://example.com\";return e}_createButton(t,e,i,n){const o=new Xb(this.locale);o.set({label:t,icon:e,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate(\"execute\").to(this,n)}return o}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const i of t){const t=new aw(this.locale);t.set({name:i.id,label:i.label,withText:true});t.bind(\"isOn\").to(i,\"value\");t.on(\"execute\",()=>{i.set(\"value\",!t.isOn)});e.add(t)}return e}_createFormChildren(t){const e=this.createCollection();e.add(this.urlInputView);if(t.length){const t=new pb;t.setTemplate({tag:\"ul\",children:this._manualDecoratorSwitches.map(t=>({tag:\"li\",children:[t],attributes:{class:[\"ck\",\"ck-list__item\"]}})),attributes:{class:[\"ck\",\"ck-reset\",\"ck-list\"]}});e.add(t)}e.add(this.saveButtonView);e.add(this.cancelButtonView);return e}}var Hx='';var Ux='';var Wx=i(79);class qx extends pb{constructor(t){super(t);const e=t.t;this.focusTracker=new Cp;this.keystrokes=new up;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(e(\"ds\"),Hx,\"unlink\");this.editButtonView=this._createButton(e(\"dt\"),Ux,\"edit\");this.set(\"href\");this._focusables=new jp;this._focusCycler=new Ob({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 t=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];t.forEach(t=>{this._focusables.add(t);this.focusTracker.add(t.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,i){const n=new Xb(this.locale);n.set({label:t,icon:e,tooltip:true});n.delegate(\"execute\").to(this,i);return n}_createPreviewButton(){const t=new Xb(this.locale);const e=this.bindTemplate;const i=this.t;t.set({withText:true,tooltip:i(\"du\")});t.extendTemplate({attributes:{class:[\"ck\",\"ck-link-actions__preview\"],href:e.to(\"href\",t=>t&&_x(t)),target:\"_blank\",rel:\"noopener noreferrer\"}});t.bind(\"label\").to(this,\"href\",t=>t||i(\"dv\"));t.bind(\"isEnabled\").to(this,\"href\",t=>!!t);t.template.tag=\"a\";t.template.eventListeners={};return t}}var $x='';const Gx=\"Ctrl+K\";class Yx extends Ow{static get requires(){return[S_]}static get pluginName(){return\"LinkUI\"}init(){const t=this.editor;t.editing.view.addObserver(Bx);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=t.plugins.get(S_);this._createToolbarLinkButton();this._enableUserBalloonInteractions()}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const t=this.editor;const e=new qx(t.locale);const i=t.commands.get(\"link\");const n=t.commands.get(\"unlink\");e.bind(\"href\").to(i,\"value\");e.editButtonView.bind(\"isEnabled\").to(i);e.unlinkButtonView.bind(\"isEnabled\").to(n);this.listenTo(e,\"edit\",()=>{this._addFormView()});this.listenTo(e,\"unlink\",()=>{t.execute(\"unlink\");this._hideUI()});e.keystrokes.set(\"Esc\",(t,e)=>{this._hideUI();e()});e.keystrokes.set(Gx,(t,e)=>{this._addFormView();e()});return e}_createFormView(){const t=this.editor;const e=t.commands.get(\"link\");const i=new Fx(t.locale,e.manualDecorators);i.urlInputView.bind(\"value\").to(e,\"value\");i.urlInputView.bind(\"isReadOnly\").to(e,\"isEnabled\",t=>!t);i.saveButtonView.bind(\"isEnabled\").to(e);this.listenTo(i,\"submit\",()=>{t.execute(\"link\",i.urlInputView.inputView.element.value,i.getDecoratorSwitchesState());this._closeFormView()});this.listenTo(i,\"cancel\",()=>{this._closeFormView()});i.keystrokes.set(\"Esc\",(t,e)=>{this._closeFormView();e()});return i}_createToolbarLinkButton(){const t=this.editor;const e=t.commands.get(\"link\");const i=t.t;t.keystrokes.set(Gx,(t,e)=>{e();this._showUI(true)});t.ui.componentFactory.add(\"link\",t=>{const n=new Xb(t);n.isEnabled=true;n.label=i(\"j\");n.icon=$x;n.keystroke=Gx;n.tooltip=true;n.isToggleable=true;n.bind(\"isEnabled\").to(e,\"isEnabled\");n.bind(\"isOn\").to(e,\"value\",t=>!!t);this.listenTo(n,\"execute\",()=>this._showUI(true));return n})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,\"click\",()=>{const t=this._getSelectedLinkElement();if(t){this._showUI()}});this.editor.keystrokes.set(\"Tab\",(t,e)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();e()}},{priority:\"high\"});this.editor.keystrokes.set(\"Esc\",(t,e)=>{if(this._isUIVisible){this._hideUI();e()}});cw({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 t=this.editor;const e=t.commands.get(\"link\");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});if(this._balloon.visibleView===this.formView){this.formView.urlInputView.select()}this.formView.urlInputView.inputView.element.value=e.value||\"\"}_closeFormView(){const t=this.editor.commands.get(\"link\");t.restoreManualDecoratorStates();if(t.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()}}_showUI(t=false){if(!this._getSelectedLinkElement()){this._addActionsView();if(t){this._balloon.showStack(\"main\")}this._addFormView()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(t){this._balloon.showStack(\"main\")}}this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel){return}const t=this.editor;this.stopListening(t.ui,\"update\");this.stopListening(this._balloon,\"change:visibleView\");t.editing.view.focus();this._removeFormView();this._balloon.remove(this.actionsView)}_startUpdatingUI(){const t=this.editor;const e=t.editing.view.document;let i=this._getSelectedLinkElement();let n=r();const o=()=>{const t=this._getSelectedLinkElement();const e=r();if(i&&!t||!i&&e!==n){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}i=t;n=e};function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is(\"element\"))}this.listenTo(t.ui,\"update\",o);this.listenTo(this._balloon,\"change:visibleView\",o)}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 t=this._balloon.visibleView;return t==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view;const e=t.document;const i=this._getSelectedLinkElement();const n=i?t.domConverter.mapViewToDom(i):t.domConverter.viewRangeToDom(e.selection.getFirstRange());return{target:n}}_getSelectedLinkElement(){const t=this.editor.editing.view;const e=t.document.selection;if(e.isCollapsed){return Qx(e.getFirstPosition())}else{const i=e.getFirstRange().getTrimmed();const n=Qx(i.start);const o=Qx(i.end);if(!n||n!=o){return null}if(t.createRangeIn(n).getTrimmed().isEqual(i)){return n}else{return null}}}}function Qx(t){return t.getAncestors().find(t=>wx(t))}class Kx extends Ow{static get requires(){return[Dx,Yx]}static get pluginName(){return\"Link\"}}class Jx extends zw{constructor(t,e){super(t);this.type=e}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model;const e=t.document;const i=Array.from(e.selection.getSelectedBlocks()).filter(e=>Xx(e,t.schema));const n=this.value===true;t.change(t=>{if(n){let e=i[i.length-1].nextSibling;let n=Number.POSITIVE_INFINITY;let o=[];while(e&&e.name==\"listItem\"&&e.getAttribute(\"listIndent\")!==0){const t=e.getAttribute(\"listIndent\");if(t