diff --git a/core/assets/vendor/ckeditor5/alignment/alignment.js b/core/assets/vendor/ckeditor5/alignment/alignment.js index f987ace38e5..a12ce5c1951 100644 --- a/core/assets/vendor/ckeditor5/alignment/alignment.js +++ b/core/assets/vendor/ckeditor5/alignment/alignment.js @@ -1,5 +1,5 @@ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Align center":"Align center","Align left":"Align left","Align right":"Align right",Justify:"Justify","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var t={704:(t,e,n)=>{t.exports=n(79)("./src/core.js")},273:(t,e,n)=>{t.exports=n(79)("./src/ui.js")},209:(t,e,n)=>{t.exports=n(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";n.r(i),n.d(i,{Alignment:()=>f,AlignmentEditing:()=>g,AlignmentUI:()=>d});var t=n(704),e=n(209);const o=["left","right","center","justify"];function r(t){return o.includes(t)}function a(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}function s(t){const n=t.map((t=>{let e;return e="string"==typeof t?{name:t}:t,e})).filter((t=>{const n=!!o.includes(t.name);return n||(0,e.logWarning)("alignment-config-name-not-recognized",{option:t}),n})),i=n.filter((t=>!!t.className)).length;if(i&&i{const r=o.slice(i+1);if(r.some((t=>t.name==n.name)))throw new e.CKEditorError("alignment-config-name-already-defined",{option:n,configuredOptions:t});if(n.className){if(r.some((t=>t.className==n.className)))throw new e.CKEditorError("alignment-config-classname-already-defined",{option:n,configuredOptions:t})}})),n}const l="alignment";class c extends t.Command{refresh(){const t=this.editor.locale,n=(0,e.first)(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!n&&this._canBeAligned(n),this.isEnabled&&n.hasAttribute("alignment")?this.value=n.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,n=e.locale,i=e.model,o=i.document,r=t.value;i.change((t=>{const e=Array.from(o.selection.getSelectedBlocks()).filter((t=>this._canBeAligned(t))),i=e[0].getAttribute("alignment");a(r,n)||i===r||!r?function(t,e){for(const n of t)e.removeAttribute(l,n)}(e,t):function(t,e,n){for(const i of t)e.setAttribute(l,n,i)}(e,t,r)}))}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,l)}}class g extends t.Plugin{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:[...o.map((t=>({name:t})))]})}init(){const t=this.editor,e=t.locale,n=t.model.schema,i=s(t.config.get("alignment.options")).filter((t=>r(t.name)&&!a(t.name,e))),o=i.some((t=>!!t.className));n.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),o?t.conversion.attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map((t=>t.name))},view:{}};for(const n of t)e.view[n.name]={key:"class",value:n.className};return e}(i)):t.conversion.for("downcast").attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map((t=>t.name))},view:{}};for(const{name:n}of t)e.view[n]={key:"style",value:{"text-align":n}};return e}(i));const l=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return e}(i);for(const e of l)t.conversion.for("upcast").attributeToAttribute(e);const g=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return e}(i);for(const e of g)t.conversion.for("upcast").attributeToAttribute(e);t.commands.add("alignment",new c(t))}}var u=n(273);const m=new Map([["left",t.icons.alignLeft],["right",t.icons.alignRight],["center",t.icons.alignCenter],["justify",t.icons.alignJustify]]);class d extends t.Plugin{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t,i=s(t.config.get("alignment.options"));i.map((t=>t.name)).filter(r).forEach((t=>this._addButton(t))),e.add("alignment",(o=>{const r=(0,u.createDropdown)(o),a=i.map((t=>e.create(`alignment:${t.name}`)));(0,u.addToolbarToDropdown)(r,a,{enableActiveItemFocusOnDropdownOpen:!0}),r.buttonView.set({label:n("Text alignment"),tooltip:!0}),r.toolbarView.isVertical=!0,r.toolbarView.ariaLabel=n("Text alignment toolbar"),r.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===o.contentLanguageDirection?m.get("right"):m.get("left");return r.buttonView.bind("icon").toMany(a,"isOn",((...t)=>{const e=t.findIndex((t=>t));return e<0?s:a[e].icon})),r.bind("isEnabled").toMany(a,"isEnabled",((...t)=>t.some((t=>t)))),this.listenTo(r,"execute",(()=>{t.editing.view.focus()})),r}))}_addButton(t){const e=this.editor;e.ui.componentFactory.add(`alignment:${t}`,(n=>{const i=e.commands.get("alignment"),o=new u.ButtonView(n);return o.set({label:this.localizedOptionTitles[t],icon:m.get(t),tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i),o.bind("isOn").to(i,"value",(e=>e===t)),this.listenTo(o,"execute",(()=>{e.execute("alignment",{value:t}),e.editing.view.focus()})),o}))}}class f extends t.Plugin{static get requires(){return[g,d]}static get pluginName(){return"Alignment"}}})(),(window.CKEditor5=window.CKEditor5||{}).alignment=i})(); \ No newline at end of file + */(()=>{var t={704:(t,e,n)=>{t.exports=n(79)("./src/core.js")},273:(t,e,n)=>{t.exports=n(79)("./src/ui.js")},209:(t,e,n)=>{t.exports=n(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";n.r(i),n.d(i,{Alignment:()=>f,AlignmentEditing:()=>g,AlignmentUI:()=>d});var t=n(704),e=n(209);const o=["left","right","center","justify"];function r(t){return o.includes(t)}function a(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}function s(t){const n=t.map((t=>{let e;return e="string"==typeof t?{name:t}:t,e})).filter((t=>{const n=o.includes(t.name);return n||(0,e.logWarning)("alignment-config-name-not-recognized",{option:t}),n})),i=n.filter((t=>Boolean(t.className))).length;if(i&&i{const r=o.slice(i+1);if(r.some((t=>t.name==n.name)))throw new e.CKEditorError("alignment-config-name-already-defined",{option:n,configuredOptions:t});if(n.className){if(r.some((t=>t.className==n.className)))throw new e.CKEditorError("alignment-config-classname-already-defined",{option:n,configuredOptions:t})}})),n}const l="alignment";class c extends t.Command{refresh(){const t=this.editor.locale,n=(0,e.first)(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=Boolean(n)&&this._canBeAligned(n),this.isEnabled&&n.hasAttribute("alignment")?this.value=n.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,n=e.locale,i=e.model,o=i.document,r=t.value;i.change((t=>{const e=Array.from(o.selection.getSelectedBlocks()).filter((t=>this._canBeAligned(t))),i=e[0].getAttribute("alignment");a(r,n)||i===r||!r?function(t,e){for(const n of t)e.removeAttribute(l,n)}(e,t):function(t,e,n){for(const i of t)e.setAttribute(l,n,i)}(e,t,r)}))}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,l)}}class g extends t.Plugin{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:o.map((t=>({name:t})))})}init(){const t=this.editor,e=t.locale,n=t.model.schema,i=s(t.config.get("alignment.options")).filter((t=>r(t.name)&&!a(t.name,e))),o=i.some((t=>!!t.className));n.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),o?t.conversion.attributeToAttribute(function(t){const e={};for(const n of t)e[n.name]={key:"class",value:n.className};const n={model:{key:"alignment",values:t.map((t=>t.name))},view:e};return n}(i)):t.conversion.for("downcast").attributeToAttribute(function(t){const e={};for(const{name:n}of t)e[n]={key:"style",value:{"text-align":n}};const n={model:{key:"alignment",values:t.map((t=>t.name))},view:e};return n}(i));const l=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return e}(i);for(const e of l)t.conversion.for("upcast").attributeToAttribute(e);const g=function(t){const e=[];for(const{name:n}of t)e.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return e}(i);for(const e of g)t.conversion.for("upcast").attributeToAttribute(e);t.commands.add("alignment",new c(t))}}var u=n(273);const m=new Map([["left",t.icons.alignLeft],["right",t.icons.alignRight],["center",t.icons.alignCenter],["justify",t.icons.alignJustify]]);class d extends t.Plugin{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t,i=s(t.config.get("alignment.options"));i.map((t=>t.name)).filter(r).forEach((t=>this._addButton(t))),e.add("alignment",(o=>{const r=(0,u.createDropdown)(o);(0,u.addToolbarToDropdown)(r,(()=>i.map((t=>e.create(`alignment:${t.name}`)))),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:n("Text alignment toolbar")}),r.buttonView.set({label:n("Text alignment"),tooltip:!0}),r.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const a="rtl"===o.contentLanguageDirection?m.get("right"):m.get("left"),s=t.commands.get("alignment");return r.buttonView.bind("icon").to(s,"value",(t=>m.get(t)||a)),r.bind("isEnabled").to(s,"isEnabled"),this.listenTo(r,"execute",(()=>{t.editing.view.focus()})),r}))}_addButton(t){const e=this.editor;e.ui.componentFactory.add(`alignment:${t}`,(n=>{const i=e.commands.get("alignment"),o=new u.ButtonView(n);return o.set({label:this.localizedOptionTitles[t],icon:m.get(t),tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i),o.bind("isOn").to(i,"value",(e=>e===t)),this.listenTo(o,"execute",(()=>{e.execute("alignment",{value:t}),e.editing.view.focus()})),o}))}}class f extends t.Plugin{static get requires(){return[g,d]}static get pluginName(){return"Alignment"}}})(),(window.CKEditor5=window.CKEditor5||{}).alignment=i})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/alignment/translations/ug.js b/core/assets/vendor/ckeditor5/alignment/translations/ug.js index 74c6a0ee3ca..a8c649305d6 100644 --- a/core/assets/vendor/ckeditor5/alignment/translations/ug.js +++ b/core/assets/vendor/ckeditor5/alignment/translations/ug.js @@ -1 +1 @@ -!function(n){const i=n.ug=n.ug||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"ئوتتۇرىغا توغرىلاش","Align left":"سولغا توغرىلاش","Align right":"ئوڭغا توغرىلاش",Justify:"تەكشىلەش","Text alignment":"تېكىست توغرىلاش","Text alignment toolbar":"تېكىست توغرىلاش قورالبالدىقى"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file +!function(n){const i=n.ug=n.ug||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"ئوتتۇرىغا توغرىلاش","Align left":"سولغا توغرىلاش","Align right":"ئوڭغا توغرىلاش",Justify:"ئوڭ سولدىن توغرىلا","Text alignment":"تېكىست توغرىلاش","Text alignment toolbar":"تېكىست توغرىلاش قورالبالدىقى"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/basic-styles/basic-styles.js b/core/assets/vendor/ckeditor5/basic-styles/basic-styles.js index 931d36fc00d..b4baf5050d6 100644 --- a/core/assets/vendor/ckeditor5/basic-styles/basic-styles.js +++ b/core/assets/vendor/ckeditor5/basic-styles/basic-styles.js @@ -1,5 +1,5 @@ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{Bold:"Bold",Code:"Code",Italic:"Italic",Strikethrough:"Strikethrough",Subscript:"Subscript",Superscript:"Superscript",Underline:"Underline"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var t={415:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(609),s=i.n(n)()((function(t){return t[1]}));s.push([t.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}",""]);const r=s},609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var s={};if(n)for(var r=0;r{"use strict";var n,s=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),o=[];function a(t){for(var e=-1,i=0;i{t.exports=i(79)("./src/core.js")},181:(t,e,i)=>{t.exports=i(79)("./src/typing.js")},273:(t,e,i)=>{t.exports=i(79)("./src/ui.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={id:n,exports:{}};return t[n](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{Bold:()=>l,BoldEditing:()=>r,BoldUI:()=>c,Code:()=>f,CodeEditing:()=>g,CodeUI:()=>w,Italic:()=>T,ItalicEditing:()=>y,ItalicUI:()=>E,Strikethrough:()=>N,StrikethroughEditing:()=>A,StrikethroughUI:()=>I,Subscript:()=>F,SubscriptEditing:()=>B,SubscriptUI:()=>U,Superscript:()=>j,SuperscriptEditing:()=>M,SuperscriptUI:()=>V,Underline:()=>H,UnderlineEditing:()=>z,UnderlineUI:()=>q});var t=i(704);class e extends t.Command{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=void 0===t.forceValue?!this.value:t.forceValue;e.change((t=>{if(i.isCollapsed)n?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const s=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of s)n?t.setAttribute(this.attributeKey,n,e):t.removeAttribute(this.attributeKey,e)}}))}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const s="bold";class r extends t.Plugin{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:s}),t.model.schema.setAttributeProperties(s,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:s,view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e?"bold"==e||Number(e)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),t.commands.add(s,new e(t,s)),t.keystrokes.set("CTRL+B",s)}}var o=i(273);const a="bold";class c extends t.Plugin{static get pluginName(){return"BoldUI"}init(){const e=this.editor,i=e.t;e.ui.componentFactory.add(a,(n=>{const s=e.commands.get(a),r=new o.ButtonView(n);return r.set({label:i("Bold"),icon:t.icons.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),this.listenTo(r,"execute",(()=>{e.execute(a),e.editing.view.focus()})),r}))}}class l extends t.Plugin{static get requires(){return[r,c]}static get pluginName(){return"Bold"}}var u=i(181);const d="code";class g extends t.Plugin{static get pluginName(){return"CodeEditing"}static get requires(){return[u.TwoStepCaretMovement]}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:d}),t.model.schema.setAttributeProperties(d,{isFormatting:!0,copyOnEnter:!1}),t.conversion.attributeToElement({model:d,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),t.commands.add(d,new e(t,d)),t.plugins.get(u.TwoStepCaretMovement).registerAttribute(d),(0,u.inlineHighlight)(t,d,"code","ck-code_selected")}}var m=i(62),p=i.n(m),h=i(415),b={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(h.Z,b);h.Z.locals;const v="code";class w extends t.Plugin{static get pluginName(){return"CodeUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(v,(i=>{const n=t.commands.get(v),s=new o.ButtonView(i);return s.set({label:e("Code"),icon:'',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(v),t.editing.view.focus()})),s}))}}class f extends t.Plugin{static get requires(){return[g,w]}static get pluginName(){return"Code"}}const x="italic";class y extends t.Plugin{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:x}),t.model.schema.setAttributeProperties(x,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:x,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(x,new e(t,x)),t.keystrokes.set("CTRL+I",x)}}const S="italic";class E extends t.Plugin{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(S,(i=>{const n=t.commands.get(S),s=new o.ButtonView(i);return s.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(S),t.editing.view.focus()})),s}))}}class T extends t.Plugin{static get requires(){return[y,E]}static get pluginName(){return"Italic"}}const k="strikethrough";class A extends t.Plugin{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:k}),t.model.schema.setAttributeProperties(k,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:k,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(k,new e(t,k)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}const C="strikethrough";class I extends t.Plugin{static get pluginName(){return"StrikethroughUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(C,(i=>{const n=t.commands.get(C),s=new o.ButtonView(i);return s.set({label:e("Strikethrough"),icon:'',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(C),t.editing.view.focus()})),s}))}}class N extends t.Plugin{static get requires(){return[A,I]}static get pluginName(){return"Strikethrough"}}const P="subscript";class B extends t.Plugin{static get pluginName(){return"SubscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:P}),t.model.schema.setAttributeProperties(P,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:P,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),t.commands.add(P,new e(t,P))}}const O="subscript";class U extends t.Plugin{static get pluginName(){return"SubscriptUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(O,(i=>{const n=t.commands.get(O),s=new o.ButtonView(i);return s.set({label:e("Subscript"),icon:'',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(O),t.editing.view.focus()})),s}))}}class F extends t.Plugin{static get requires(){return[B,U]}static get pluginName(){return"Subscript"}}const L="superscript";class M extends t.Plugin{static get pluginName(){return"SuperscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:L}),t.model.schema.setAttributeProperties(L,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:L,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),t.commands.add(L,new e(t,L))}}const R="superscript";class V extends t.Plugin{static get pluginName(){return"SuperscriptUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(R,(i=>{const n=t.commands.get(R),s=new o.ButtonView(i);return s.set({label:e("Superscript"),icon:'',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(R),t.editing.view.focus()})),s}))}}class j extends t.Plugin{static get requires(){return[M,V]}static get pluginName(){return"Superscript"}}const K="underline";class z extends t.Plugin{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:K}),t.model.schema.setAttributeProperties(K,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:K,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add(K,new e(t,K)),t.keystrokes.set("CTRL+U","underline")}}const _="underline";class q extends t.Plugin{static get pluginName(){return"UnderlineUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(_,(i=>{const n=t.commands.get(_),s=new o.ButtonView(i);return s.set({label:e("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(_),t.editing.view.focus()})),s}))}}class H extends t.Plugin{static get requires(){return[z,q]}static get pluginName(){return"Underline"}}})(),(window.CKEditor5=window.CKEditor5||{}).basicStyles=n})(); \ No newline at end of file + */(()=>{var t={415:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(609),s=i.n(n)()((function(t){return t[1]}));s.push([t.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}",""]);const r=s},609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var s={};if(n)for(var r=0;r{"use strict";var n,s=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),o=[];function a(t){for(var e=-1,i=0;i{t.exports=i(79)("./src/core.js")},181:(t,e,i)=>{t.exports=i(79)("./src/typing.js")},273:(t,e,i)=>{t.exports=i(79)("./src/ui.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={id:n,exports:{}};return t[n](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{Bold:()=>l,BoldEditing:()=>r,BoldUI:()=>c,Code:()=>f,CodeEditing:()=>g,CodeUI:()=>w,Italic:()=>T,ItalicEditing:()=>y,ItalicUI:()=>E,Strikethrough:()=>N,StrikethroughEditing:()=>A,StrikethroughUI:()=>I,Subscript:()=>F,SubscriptEditing:()=>B,SubscriptUI:()=>U,Superscript:()=>j,SuperscriptEditing:()=>M,SuperscriptUI:()=>V,Underline:()=>H,UnderlineEditing:()=>z,UnderlineUI:()=>q});var t=i(704);class e extends t.Command{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=void 0===t.forceValue?!this.value:t.forceValue;e.change((t=>{if(i.isCollapsed)n?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const s=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of s)n?t.setAttribute(this.attributeKey,n,e):t.removeAttribute(this.attributeKey,e)}}))}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const s="bold";class r extends t.Plugin{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:s}),t.model.schema.setAttributeProperties(s,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:s,view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e&&("bold"==e||Number(e)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(s,new e(t,s)),t.keystrokes.set("CTRL+B",s)}}var o=i(273);const a="bold";class c extends t.Plugin{static get pluginName(){return"BoldUI"}init(){const e=this.editor,i=e.t;e.ui.componentFactory.add(a,(n=>{const s=e.commands.get(a),r=new o.ButtonView(n);return r.set({label:i("Bold"),icon:t.icons.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),this.listenTo(r,"execute",(()=>{e.execute(a),e.editing.view.focus()})),r}))}}class l extends t.Plugin{static get requires(){return[r,c]}static get pluginName(){return"Bold"}}var u=i(181);const d="code";class g extends t.Plugin{static get pluginName(){return"CodeEditing"}static get requires(){return[u.TwoStepCaretMovement]}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:d}),t.model.schema.setAttributeProperties(d,{isFormatting:!0,copyOnEnter:!1}),t.conversion.attributeToElement({model:d,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),t.commands.add(d,new e(t,d)),t.plugins.get(u.TwoStepCaretMovement).registerAttribute(d),(0,u.inlineHighlight)(t,d,"code","ck-code_selected")}}var m=i(62),p=i.n(m),h=i(415),b={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(h.Z,b);h.Z.locals;const v="code";class w extends t.Plugin{static get pluginName(){return"CodeUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(v,(i=>{const n=t.commands.get(v),s=new o.ButtonView(i);return s.set({label:e("Code"),icon:'',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(v),t.editing.view.focus()})),s}))}}class f extends t.Plugin{static get requires(){return[g,w]}static get pluginName(){return"Code"}}const x="italic";class y extends t.Plugin{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:x}),t.model.schema.setAttributeProperties(x,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:x,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(x,new e(t,x)),t.keystrokes.set("CTRL+I",x)}}const S="italic";class E extends t.Plugin{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(S,(i=>{const n=t.commands.get(S),s=new o.ButtonView(i);return s.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(S),t.editing.view.focus()})),s}))}}class T extends t.Plugin{static get requires(){return[y,E]}static get pluginName(){return"Italic"}}const k="strikethrough";class A extends t.Plugin{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:k}),t.model.schema.setAttributeProperties(k,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:k,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(k,new e(t,k)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}const C="strikethrough";class I extends t.Plugin{static get pluginName(){return"StrikethroughUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(C,(i=>{const n=t.commands.get(C),s=new o.ButtonView(i);return s.set({label:e("Strikethrough"),icon:'',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(C),t.editing.view.focus()})),s}))}}class N extends t.Plugin{static get requires(){return[A,I]}static get pluginName(){return"Strikethrough"}}const P="subscript";class B extends t.Plugin{static get pluginName(){return"SubscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:P}),t.model.schema.setAttributeProperties(P,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:P,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),t.commands.add(P,new e(t,P))}}const O="subscript";class U extends t.Plugin{static get pluginName(){return"SubscriptUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(O,(i=>{const n=t.commands.get(O),s=new o.ButtonView(i);return s.set({label:e("Subscript"),icon:'',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(O),t.editing.view.focus()})),s}))}}class F extends t.Plugin{static get requires(){return[B,U]}static get pluginName(){return"Subscript"}}const L="superscript";class M extends t.Plugin{static get pluginName(){return"SuperscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:L}),t.model.schema.setAttributeProperties(L,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:L,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),t.commands.add(L,new e(t,L))}}const R="superscript";class V extends t.Plugin{static get pluginName(){return"SuperscriptUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(R,(i=>{const n=t.commands.get(R),s=new o.ButtonView(i);return s.set({label:e("Superscript"),icon:'',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(R),t.editing.view.focus()})),s}))}}class j extends t.Plugin{static get requires(){return[M,V]}static get pluginName(){return"Superscript"}}const K="underline";class z extends t.Plugin{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:K}),t.model.schema.setAttributeProperties(K,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:K,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add(K,new e(t,K)),t.keystrokes.set("CTRL+U","underline")}}const _="underline";class q extends t.Plugin{static get pluginName(){return"UnderlineUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(_,(i=>{const n=t.commands.get(_),s=new o.ButtonView(i);return s.set({label:e("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{t.execute(_),t.editing.view.focus()})),s}))}}class H extends t.Plugin{static get requires(){return[z,q]}static get pluginName(){return"Underline"}}})(),(window.CKEditor5=window.CKEditor5||{}).basicStyles=n})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/block-quote/block-quote.js b/core/assets/vendor/ckeditor5/block-quote/block-quote.js index dce8e14d74c..cf7f8bf4cef 100644 --- a/core/assets/vendor/ckeditor5/block-quote/block-quote.js +++ b/core/assets/vendor/ckeditor5/block-quote/block-quote.js @@ -1,5 +1,5 @@ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Block quote":"Block quote"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */(()=>{var e={446:(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var n=o(609),r=o.n(n)()((function(e){return e[1]}));r.push([e.id,".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}",""]);const i=r},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=e(t);return t[2]?"@media ".concat(t[2]," {").concat(o,"}"):o})).join("")},t.i=function(e,o,n){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(n)for(var i=0;i{"use strict";var n,r=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}e[t]=o}return e[t]}}(),c=[];function s(e){for(var t=-1,o=0;o{e.exports=o(79)("./src/core.js")},331:(e,t,o)=>{e.exports=o(79)("./src/enter.js")},181:(e,t,o)=>{e.exports=o(79)("./src/typing.js")},273:(e,t,o)=>{e.exports=o(79)("./src/ui.js")},209:(e,t,o)=>{e.exports=o(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={id:n,exports:{}};return e[n](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var n={};(()=>{"use strict";o.r(n),o.d(n,{BlockQuote:()=>g,BlockQuoteEditing:()=>u,BlockQuoteUI:()=>v});var e=o(704),t=o(331),r=o(181),i=o(209);class c extends e.Command{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,o=t.schema,n=t.document.selection,r=Array.from(n.getSelectedBlocks()),i=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(i){const t=r.filter((e=>s(e)||a(o,e)));this._applyQuote(e,t)}else this._removeQuote(e,r.filter(s))}))}_getValue(){const e=this.editor.model.document.selection,t=(0,i.first)(e.getSelectedBlocks());return!(!t||!s(t))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,o=(0,i.first)(e.getSelectedBlocks());return!!o&&a(t,o)}_removeQuote(e,t){l(e,t).reverse().forEach((t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const o=e.createPositionBefore(t.start.parent);return void e.move(t,o)}t.end.isAtEnd||e.split(t.end);const o=e.createPositionAfter(t.end.parent);e.move(t,o)}))}_applyQuote(e,t){const o=[];l(e,t).reverse().forEach((t=>{let n=s(t.start);n||(n=e.createElement("blockQuote"),e.wrap(t,n)),o.push(n)})),o.reverse().reduce(((t,o)=>t.nextSibling==o?(e.merge(e.createPositionAfter(t)),t):o))}}function s(e){return"blockQuote"==e.parent.name?e.parent:null}function l(e,t){let o,n=0;const r=[];for(;n{const n=e.model.document.differ.getChanges();for(const e of n)if("insert"==e.type){const n=e.position.nodeAfter;if(!n)continue;if(n.is("element","blockQuote")&&n.isEmpty)return o.remove(n),!0;if(n.is("element","blockQuote")&&!t.checkChild(e.position,n))return o.unwrap(n),!0;if(n.is("element")){const e=o.createRangeIn(n);for(const n of e.getItems())if(n.is("element","blockQuote")&&!t.checkChild(o.createPositionBefore(n),n))return o.unwrap(n),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return o.remove(t),!0}return!1}));const o=this.editor.editing.view.document,n=e.model.document.selection,r=e.commands.get("blockQuote");this.listenTo(o,"enter",((t,o)=>{if(!n.isCollapsed||!r.value)return;n.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),o.preventDefault(),t.stop())}),{context:"blockquote"}),this.listenTo(o,"delete",((t,o)=>{if("backward"!=o.direction||!n.isCollapsed||!r.value)return;const i=n.getLastPosition().parent;i.isEmpty&&!i.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),o.preventDefault(),t.stop())}),{context:"blockquote"})}}var d=o(273),f=o(62),p=o.n(f),m=o(446),h={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(m.Z,h);m.Z.locals;class v extends e.Plugin{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,o=t.t;t.ui.componentFactory.add("blockQuote",(n=>{const r=t.commands.get("blockQuote"),i=new d.ButtonView(n);return i.set({label:o("Block quote"),icon:e.icons.quote,tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(i,"execute",(()=>{t.execute("blockQuote"),t.editing.view.focus()})),i}))}}class g extends e.Plugin{static get requires(){return[u,v]}static get pluginName(){return"BlockQuote"}}})(),(window.CKEditor5=window.CKEditor5||{}).blockQuote=n})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js b/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js index 5618a5fd7d3..59bba71f68a 100644 --- a/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js +++ b/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js @@ -1,5 +1,5 @@ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1",Aquamarine:"Aquamarine",Black:"Black",Blue:"Blue",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Dim grey":"Dim grey","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Editor block content toolbar":"Editor block content toolbar","Editor contextual toolbar":"Editor contextual toolbar","Editor editing area: %0":"Editor editing area: %0","Editor toolbar":"Editor toolbar",Green:"Green",Grey:"Grey","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Next:"Next",Orange:"Orange","Press Enter to type after or press Shift + Enter to type before the widget":"Press Enter to type after or press Shift + Enter to type before the widget",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Restore default":"Restore default","Rich Text Editor":"Rich Text Editor","Rich Text Editor. Editing area: %0":"Rich Text Editor. Editing area: %0",Save:"Save","Select all":"Select all","Show more items":"Show more items",Turquoise:"Turquoise",Undo:"Undo","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar",Yellow:"Yellow"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var e={"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-clipboard/theme/clipboard.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,'.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}',""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-engine/theme/placeholder.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text);cursor:text}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-engine/theme/renderer.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/button/button.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;justify-content:left;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.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,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)}.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{-webkit-appearance:none;border:1px solid transparent;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.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{color:inherit;cursor:inherit;font-size:inherit;font-weight: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,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,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(var(--ck-spacing-small)*-1);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-left:var(--ck-spacing-small);margin-right:calc(var(--ck-spacing-small)*-1)}.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)}.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-on,a.ck.ck-button.ck-on{color:var(--ck-color-button-on-color)}.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)}.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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/button/switchbutton.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".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:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.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{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.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(var(--ck-border-radius)*.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.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:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.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(var( --ck-switch-button-translation )*-1))}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-color-grid-tile-size)}.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{color:var(--ck-color-color-grid-check-icon);display:none}.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)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/dropdown.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-dropdown-max-width:75vw}.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-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-modal)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.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}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.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{margin-left:var(--ck-spacing-standard);right: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{overflow:hidden;text-overflow:ellipsis;width:7em}.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 .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.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{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/listdropdown.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".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-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/splitbutton.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,'.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.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)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:"";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.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}',""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/editorui/editorui.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable.ck-rounded-corners:not(.ck-editor__nested-editable){border-radius:var(--ck-border-radius)}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-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)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/formheader/formheader.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-form__header .ck-form__header__label{font-weight:700}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/icon/icon.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{font-size:.8333350694em;height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/input/input.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{border-radius:0}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/label/label.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.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.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/list/list.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.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{background:var(--ck-color-list-background);list-style-type:none}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{border-radius:0;min-height:unset;padding:calc(var(--ck-line-height-base)*.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*.4*var(--ck-font-size-base));text-align:left;width:100%}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*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-switchbutton):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{background:var(--ck-color-base-border);height:1px;width:100%}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/balloonpanel.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,':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-border-width:1px;--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.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{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);box-shadow:var(--ck-drop-shadow),0 0;min-height:15px}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.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(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.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(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}',""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/balloonrotator.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;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-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/fakepanel.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".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{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width: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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/stickypanel.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-modal)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/toolbar/toolbar.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;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__line-break{flex-basis:100%}.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);border:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;background:var(--ck-color-toolbar-border);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){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>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.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.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.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.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{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.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/tooltip/tooltip.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-balloon-panel.ck-tooltip{--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);padding:0 var(--ck-spacing-medium);pointer-events:none;z-index:calc(var(--ck-z-modal) + 100)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip{box-shadow:none}.ck.ck-balloon-panel.ck-tooltip:before{display:none}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/globals/globals.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck-hidden{display:none!important}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{box-sizing:border-box;height:auto;position:static;width:auto}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{word-wrap:break-word;background:transparent;border:0;margin:0;padding:0;text-decoration:none;transition:none;vertical-align:middle}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widget.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.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);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.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{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top: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)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}: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-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);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{background-color:var(--ck-color-widget-editable-focus-background);border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);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)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.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{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.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:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.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{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widgetresize.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widgettypearound.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,'.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);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;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 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{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;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);width:var(--ck-widget-type-around-button-size)}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}.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{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.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{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.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_selected.ck-widget_with-resizer>.ck-widget__resizer,.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_selected.ck-widget_with-resizer>.ck-widget__resizer,.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[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.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}}',""]);const n=i},"./node_modules/css-loader/dist/runtime/api.js":e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=e(t);return t[2]?"@media ".concat(t[2]," {").concat(o,"}"):o})).join("")},t.i=function(e,o,s){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(s)for(var n=0;n{"use strict";var s,i=function(){return void 0===s&&(s=Boolean(window&&document&&document.all&&!window.atob)),s},n=function(){var e={};return function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}e[t]=o}return e[t]}}(),r=[];function a(e){for(var t=-1,o=0;o{"use strict";o.d(t,{mY:()=>r,_y:()=>d,eO:()=>h,W9:()=>y,ML:()=>g,S8:()=>_,xK:()=>x,AJ:()=>c,lR:()=>T,Sy:()=>i,P$:()=>v,ci:()=>C,Nu:()=>P});var s=o("./packages/ckeditor5-utils/src/index.ts");class i extends((0,s.Re)()){constructor(e){super(),this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",n,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",n),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function n(e){e.return=!1,e.stop()}class r extends((0,s.Re)()){constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()})),this.on("execute",(e=>{this.isEnabled||e.stop()}),{priority:"high"}),this.listenTo(e,"change:isReadOnly",((e,t,o)=>{o&&this.affectsData?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}))}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",a,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",a),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function a(e){e.return=!1,e.stop()}class c extends r{constructor(e){super(e),this._childCommandsDefinitions=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){(0,s.VG)(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",(()=>this._checkEnabled())),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find((({command:e})=>e.isEnabled));return e&&e.command}}class l extends((0,s.ln)()){constructor(e,t=[],o=[]){super(),this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of o)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new s.Bb("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[],o=[]){const i=this,n=this._context;!function e(t,o=new Set){t.forEach((t=>{c(t)&&(o.has(t)||(o.add(t),t.pluginName&&!i._availablePlugins.has(t.pluginName)&&i._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,o)))}))}(e),u(e);const r=[...function e(t,o=new Set){return t.map((e=>c(e)?e:i._availablePlugins.get(e))).reduce(((t,s)=>o.has(s)?t:(o.add(s),s.requires&&(u(s.requires,s),e(s.requires,o).forEach((e=>t.add(e)))),t.add(s))),new Set)}(e.filter((e=>!d(e,t))))];!function(e,t){for(const o of t){if("function"!=typeof o)throw new s.Bb("plugincollection-replace-plugin-invalid-type",null,{pluginItem:o});const t=o.pluginName;if(!t)throw new s.Bb("plugincollection-replace-plugin-missing-name",null,{pluginItem:o});if(o.requires&&o.requires.length)throw new s.Bb("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const n=i._availablePlugins.get(t);if(!n)throw new s.Bb("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const r=e.indexOf(n);if(-1===r){if(i._contextPlugins.has(n))return;throw new s.Bb("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(n.requires&&n.requires.length)throw new s.Bb("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(r,1,o),i._availablePlugins.set(t,o)}}(r,o);const a=function(e){return e.map((e=>{let t=i._contextPlugins.get(e);return t=t||new e(n),i._add(e,t),t}))}(r);return p(a,"init").then((()=>p(a,"afterInit"))).then((()=>a));function c(e){return"function"==typeof e}function l(e){return c(e)&&e.isContextPlugin}function d(e,t){return t.some((t=>t===e||(h(e)===t||h(t)===e)))}function h(e){return c(e)?e.pluginName||e.name:e}function u(e,o=null){e.map((e=>c(e)?e:i._availablePlugins.get(e)||e)).forEach((e=>{!function(e,t){if(c(e))return;if(t)throw new s.Bb("plugincollection-soft-required",n,{missingPlugin:e,requiredBy:h(t)});throw new s.Bb("plugincollection-plugin-not-found",n,{plugin:e})}(e,o),function(e,t){if(!l(t))return;if(l(e))return;throw new s.Bb("plugincollection-context-required",n,{plugin:h(e),requiredBy:h(t)})}(e,o),function(e,o){if(!o)return;if(!d(e,t))return;throw new s.Bb("plugincollection-required",n,{plugin:h(e),requiredBy:h(o)})}(e,o)}))}function p(e,t){return e.reduce(((e,o)=>o[t]?i._contextPlugins.has(o)?e:e.then(o[t].bind(o)):e),Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const o=e.pluginName;if(o){if(this._plugins.has(o))throw new s.Bb("plugincollection-plugin-name-conflict",null,{pluginName:o,plugin1:this._plugins.get(o).constructor,plugin2:e});this._plugins.set(o,t)}}}class d{constructor(e){this.config=new s.De(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new l(this,t);const o=this.config.get("language")||{};this.locale=new s.go({uiLanguage:"string"==typeof o?o:o.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new s.FE,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const o of e.concat(t)){if("function"!=typeof o)throw new s.Bb("context-initplugins-constructor-only",null,{Plugin:o});if(!0!==o.isContextPlugin)throw new s.Bb("context-initplugins-invalid-plugin",null,{Plugin:o})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,(e=>e.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(e,t){if(this._contextOwner)throw new s.Bb("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise((t=>{const o=new this(e);t(o.initPlugins().then((()=>o)))}))}}class h extends((0,s.Re)()){constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}var u=o("./packages/ckeditor5-engine/src/index.ts");class p{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const o=this.get(e);if(!o)throw new s.Bb("commandcollection-command-not-found",this,{commandName:e});return o.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 f extends s.VD{constructor(e){super(),this.editor=e}set(e,t,o={}){if("string"==typeof t){const e=t;t=(t,o)=>{this.editor.execute(e),o()}}super.set(e,t,o)}}class g extends((0,s.Re)()){constructor(e={}){super();const t=this.constructor,o=e.language||t.defaultConfig&&t.defaultConfig.language;this._context=e.context||new d({language:o}),this._context._addEditor(this,!e.context);const i=Array.from(t.builtinPlugins||[]);this.config=new s.De(e,t.defaultConfig),this.config.define("plugins",i),this.config.define(this._context._getEditorConfig()),this.plugins=new l(this,i,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new p,this.set("state","initializing"),this.once("ready",(()=>this.state="ready"),{priority:"high"}),this.once("destroy",(()=>this.state="destroyed"),{priority:"high"}),this.model=new u.Hn;const n=new u.A_;this.data=new u.Yc(this.model,n),this.editing=new u.jH(this.model,n),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new u.uz([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 f(this),this.keystrokes.listenTo(this.editing.view.document)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new s.Bb("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new s.Bb("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new s.Bb("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}initPlugins(){const e=this.config,t=e.get("plugins"),o=e.get("removePlugins")||[],s=e.get("extraPlugins")||[],i=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(s),o,i)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise((e=>this.once("ready",e)))),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,...t){try{return this.commands.execute(e,...t)}catch(e){s.Bb.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}}var m=o("./packages/ckeditor5-ui/src/componentfactory.ts"),b=o("./packages/ckeditor5-ui/src/tooltipmanager.ts");class _ extends((0,s.Re)()){constructor(e){super(),this.editor=e,this.componentFactory=new m.Z(e),this.focusTracker=new s.Rh,this.tooltipManager=new b.Z(e),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.isReady=!1,this.once("ready",(()=>{this.isReady=!0})),this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this.listenTo(e.editing.view.document,"layoutChanged",(()=>this.update())),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor);for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const o=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?o():this.once("ready",o)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)):e.once("render",(()=>{this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)})),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const o=e.config.get("toolbar.viewportTopOffset");return o?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:o}):{top:0}}_initFocusTracking(){const e=this.editor,t=e.editing.view;let o,s;e.keystrokes.set("Alt+F10",((e,i)=>{const n=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(n)&&!Array.from(t.domRoots.values()).includes(n)&&(o=n);const r=this._getCurrentFocusedToolbarDefinition();r&&s||(s=this._getFocusableCandidateToolbarDefinitions());for(let e=0;e{const i=this._getCurrentFocusedToolbarDefinition();i&&(o?(o.focus(),o=null):e.editing.view.focus(),i.options.afterBlur&&i.options.afterBlur(),s())}))}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:o,options:i}=t;((0,s.pn)(o.element)||i.beforeFocus)&&e.push(t)}return e.sort(((e,t)=>w(e)-w(t))),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:o}}=e;return o&&o(),!!(0,s.pn)(t.element)&&(t.focus(),!0)}}function w(e){const{toolbarView:t,options:o}=e;let i=10;return(0,s.pn)(t.element)&&i--,o.isContextual&&i--,i}var k=o("./node_modules/lodash-es/isFunction.js");function v(e){if(!(0,k.Z)(e.updateSourceElement))throw new s.Bb("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(function(e){return!!e&&"textarea"===e.tagName.toLowerCase()}(t)&&t.form){let o;const s=t.form,i=()=>e.updateSourceElement();(0,k.Z)(s.submit)&&(o=s.submit,s.submit=()=>{i(),o.apply(s)}),s.addEventListener("submit",i),e.on("destroy",(()=>{s.removeEventListener("submit",i),o&&(s.submit=o)}))}}function y(e){return class extends e{setData(e){this.data.set(e)}getData(e){return this.data.get(e)}}}{const e=y(Object);y.setData=e.prototype.setData,y.getData=e.prototype.getData}function x(e){return class extends e{updateSourceElement(e=this.data.get()){if(!this.sourceElement)throw new s.Bb("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),o=this.sourceElement instanceof HTMLTextAreaElement;t||o?(0,s.jS)(this.sourceElement,e):(0,s.jS)(this.sourceElement,"")}}}function P(e){const t=e.sourceElement;if(t){if(t.ckeditorInstance)throw new s.Bb("editor-source-element-already-used",e);t.ckeditorInstance=e,e.once("destroy",(()=>{delete t.ckeditorInstance}))}}x.updateSourceElement=x(Object).prototype.updateSourceElement;class T extends h{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new s.FE({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new s.Bb("pendingactions-add-invalid-message",this);const t=new((0,s.Re)());return t.set("message",e),this._actions.add(t),this.hasAny=!0,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]()}}const C={bold:'',cancel:'',caption:'',check:'',cog:'',eraser:'',image:'',lowVision:'',importExport:'',paragraph:'',plus:'',text:'',alignBottom:'',alignMiddle:'',alignTop:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',objectLeft:'',objectCenter:'',objectRight:'',objectFullWidth:'',objectInline:'',objectBlockLeft:'',objectBlockRight:'',objectSizeFull:'',objectSizeLarge:'',objectSizeSmall:'',objectSizeMedium:'',pencil:'',pilcrow:'',quote:'',threeVerticalDots:''}},"./packages/ckeditor5-engine/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{r7:()=>ze,KU:()=>Tn,uz:()=>oi,Yc:()=>ti,tn:()=>Po,f4:()=>Xi,uj:()=>ns,pG:()=>Vt,dK:()=>Zt,qZ:()=>Wt,qD:()=>it,jH:()=>js,W_:()=>Bo,Ay:()=>Hi,X5:()=>ei,IZ:()=>fi,jP:()=>Vi,iE:()=>ts,zj:()=>gi,xO:()=>P,Hn:()=>Pn,dM:()=>Cn,Qj:()=>Ft,Bz:()=>Pi,Ly:()=>Io,e6:()=>Wo,Th:()=>Tt,A_:()=>xe,xv:()=>Mo,Po:()=>No,yj:()=>An,G7:()=>Eo,m1:()=>Ue,By:()=>Ee,Ux:()=>qe,y_:()=>st,W2:()=>Re,y9:()=>Ce,pc:()=>Je,wx:()=>tt,Xj:()=>v,dq:()=>Xe,QR:()=>er,sI:()=>tr,vt:()=>hr,J8:()=>ur,DA:()=>l,ID:()=>c,KT:()=>_n,I8:()=>Yn,mq:()=>Jn,oz:()=>Gn,YG:()=>Se,m0:()=>Xn,uT:()=>Qn,$_:()=>h,SB:()=>qn,D5:()=>Bn,G9:()=>Dn,IT:()=>Vn,zz:()=>Fn,WK:()=>Hn,Zb:()=>Zn,PX:()=>Kn,Q7:()=>u,NJ:()=>d,Rf:()=>Si});var s=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),i=o.n(s),n=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-engine/theme/placeholder.css"),r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i()(n.Z,r);n.Z.locals;const a=new WeakMap;function c(e){const{view:t,element:o,text:s,isDirectHost:i=!0,keepOnFocus:n=!1}=e,r=t.document;a.has(r)||(a.set(r,new Map),r.registerPostFixer((e=>p(r,e))),r.on("change:isComposing",(()=>{t.change((e=>p(r,e)))}),{priority:"high"})),a.get(r).set(o,{text:s,isDirectHost:i,keepOnFocus:n,hostElement:i?o:null}),t.change((e=>p(r,e)))}function l(e,t){const o=t.document;e.change((e=>{if(!a.has(o))return;const s=a.get(o),i=s.get(t);e.removeAttribute("data-placeholder",i.hostElement),h(e,i.hostElement),s.delete(t)}))}function d(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}function h(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}function u(e,t){if(!e.isAttached())return!1;const o=Array.from(e.getChildren()).some((e=>!e.is("uiElement")));if(o)return!1;const s=e.document,i=s.selection.anchor;return(!s.isComposing||!i||i.parent!==e)&&(!!t||(!s.isFocused||!!i&&i.parent!==e))}function p(e,t){const o=a.get(e),s=[];let i=!1;for(const[e,n]of o)n.isDirectHost&&(s.push(e),f(t,e,n)&&(i=!0));for(const[e,n]of o){if(n.isDirectHost)continue;const o=g(e);o&&(s.includes(o)||(n.hostElement=o,f(t,e,n)&&(i=!0)))}return i}function f(e,t,o){const{text:s,isDirectHost:i,hostElement:n}=o;let r=!1;n.getAttribute("data-placeholder")!==s&&(e.setAttribute("data-placeholder",s,n),r=!0);return(i||1==t.childCount)&&u(n,o.keepOnFocus)?d(e,n)&&(r=!0):h(e,n)&&(r=!0),r}function g(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}var m=o("./packages/ckeditor5-utils/src/index.ts");class b{is(){throw new Error("is() method is abstract")}}var _=o("./node_modules/lodash-es/_baseClone.js");const w=function(e){return(0,_.Z)(e,4)};o("./packages/ckeditor5-utils/src/version.ts");class k extends((0,m.ln)(b)){constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new m.Bb("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let o=e.includeSelf?this:this.parent;for(;o;)t[e.parentFirst?"push":"unshift"](o),o=o.parent;return t}getCommonAncestor(e,t={}){const o=this.getAncestors(t),s=e.getAncestors(t);let i=0;for(;o[i]==s[i]&&o[i];)i++;return 0===i?null:o[i-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),o=e.getPath(),s=(0,m.Rt)(t,o);switch(s){case"prefix":return!0;case"extension":return!1;default:return t[s]e.data.length)throw new m.Bb("view-textproxy-wrong-offsetintext",this);if(o<0||t+o>e.data.length)throw new m.Bb("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+o),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}getAncestors(e={}){const t=[];let o=e.includeSelf?this.textNode:this.parent;for(;null!==o;)t[e.parentFirst?"push":"unshift"](o),o=o.parent;return t}}y.prototype.is=function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e};var x=o("./node_modules/lodash-es/isPlainObject.js");class P{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const o=T(t,e);if(o)return{element:t,pattern:e,match:o}}return null}matchAll(...e){const t=[];for(const o of e)for(const e of this._patterns){const s=T(o,e);s&&t.push({element:o,pattern:e,match:s})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function T(e,t){if("function"==typeof t)return t(e);const o={};return t.name&&(o.name=function(e,t){if(e instanceof RegExp)return!!t.match(e);return e===t}(t.name,e.name),!o.name)||t.attributes&&(o.attributes=function(e,t){const o=new Set(t.getAttributeKeys());(0,x.Z)(e)?(void 0!==e.style&&(0,m.KE)("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&(0,m.KE)("matcher-pattern-deprecated-attributes-class-key",e)):(o.delete("style"),o.delete("class"));return C(e,o,(e=>t.getAttribute(e)))}(t.attributes,e),!o.attributes)||t.classes&&(o.classes=function(e,t){return C(e,t.getClassNames(),(()=>{}))}(t.classes,e),!o.classes)||t.styles&&(o.styles=function(e,t){return C(e,t.getStyleNames(!0),(e=>t.getStyle(e)))}(t.styles,e),!o.styles)?null:o}function C(e,t,o){const s=function(e){if(Array.isArray(e))return e.map((e=>(0,x.Z)(e)?(void 0!==e.key&&void 0!==e.value||(0,m.KE)("matcher-pattern-missing-key-or-value",e),[e.key,e.value]):[e,!0]));if((0,x.Z)(e))return Object.entries(e);return[[e,!0]]}(e),i=Array.from(t),n=[];if(s.forEach((([e,t])=>{i.forEach((s=>{(function(e,t){return!0===e||e===t||e instanceof RegExp&&t.match(e)})(e,s)&&function(e,t,o){if(!0===e)return!0;const s=o(t);return e===s||e instanceof RegExp&&!!String(s).match(e)}(t,s,o)&&n.push(s)}))})),s.length&&!(n.lengthi?0:i+t),(o=o>i?i:o)<0&&(o+=i),i=t>o?0:o-t>>>0,t>>>=0;for(var n=Array(i);++st===e));return Array.isArray(t)}set(e,t){if((0,A.Z)(e))for(const[t,o]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,o,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=Pe(e);U(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map((e=>e.join(":"))).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!(0,A.Z)(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find((([t])=>t===e));return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){if(this.isEmpty)return[];if(e)return this._styleProcessor.getStyleNames(this._styles);return this._getStylesEntries().map((([e])=>e))}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const o of t)e.push(...this._styleProcessor.getReducedForm(o,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const o=t.splice(0,t.length-1).join("."),s=K(this._styles,o);if(!s)return;!Array.from(Object.keys(s)).length&&this.remove(o)}}class xe{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,o){if((0,A.Z)(t))Te(o,Pe(e),t);else if(this._normalizers.has(e)){const s=this._normalizers.get(e),{path:i,value:n}=s(t);Te(o,i,n)}else Te(o,e,t)}getNormalized(e,t){if(!e)return be({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const o=this._extractors.get(e);if("string"==typeof o)return K(t,o);const s=o(e,t);if(s)return s}return K(t,Pe(e))}getReducedForm(e,t){const o=this.getNormalized(e,t);if(void 0===o)return[];if(this._reducers.has(e)){return this._reducers.get(e)(o)}return[[e,o]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter((t=>{const o=this.getNormalized(t,e);return o&&"object"==typeof o?Object.keys(o).length:o})),o=new Set([...t,...Object.keys(e)]);return Array.from(o.values())}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 o of t)this._mapStyleNames(o,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function Pe(e){return e.replace("-",".")}function Te(e,t,o){let s=o;(0,A.Z)(o)&&(s=be({},K(e,t),o)),ve(e,t,s)}class Ce extends k{constructor(e,t,o,s){if(super(e),this.name=t,this._attrs=function(e){const t=(0,m.qL)(e);for(const[e,o]of t)null===o?t.delete(e):"string"!=typeof o&&t.set(e,String(o));return t}(o),this._children=[],s&&this._insertChild(0,s),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");Ae(this._classes,e),this._attrs.delete("class")}this._styles=new ye(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._unsafeAttributesToRender=[]}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof Ce))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,o]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==o)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new P(...e);let o=this.parent;for(;o&&!o.is("documentFragment");){if(t.match(o))return o;o=o.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),o=Array.from(this._attrs).map((e=>`${e[0]}="${e[1]}"`)).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==o?"":` ${o}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const o of this.getChildren())t.push(o._clone(e));const o=new this.constructor(this.document,this.name,this._attrs,t);return o._classes=new Set(this._classes),o._styles.set(this._styles.getNormalized()),o._customProperties=new Map(this._customProperties),o.getFillerOffset=this.getFillerOffset,o._unsafeAttributesToRender=this._unsafeAttributesToRender,o}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let o=0;const s=function(e,t){if("string"==typeof t)return[new v(e,t)];(0,m.TW)(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new v(e,t):t instanceof y?new v(e,t.data):t))}(this.document,t);for(const t of s)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,o++;return o}_removeChildren(e,t=1){this._fireChange("children",this);for(let o=e;o0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of(0,m.qo)(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of(0,m.qo)(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),(0,x.Z)(e)?this._styles.set(e):this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of(0,m.qo)(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Ae(e,t){const o=t.split(/\s+/);e.clear(),o.forEach((t=>e.add(t)))}Ce.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Ee extends Ce{constructor(...e){super(...e),this.getFillerOffset=Se}}function Se(){const e=[...this.getChildren()],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}Ee.prototype.is=function(e,t){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Re extends((0,m.Re)(Ee)){constructor(...e){super(...e);const t=e[0];this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",(e=>e&&t.selection.editableElement==this)),this.listenTo(t.selection,"change",(()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this}))}destroy(){this.stopListening()}}Re.prototype.is=function(e,t){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};const Oe=Symbol("rootName");class Me extends Re{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(Oe)}set rootName(e){this._setCustomProperty(Oe,e)}set _name(e){this.name=e}}Me.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===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"===e};class je{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new m.Bb("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new m.Bb("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=Be._createAt(e.startPosition):this.position=Be._createAt(e.boundaries["backward"==e.direction?"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,o,s;do{s=this.position,({done:t,value:o}=this.next())}while(!t&&e(o));t||(this.position=s)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,o=e.parent;if(null===o.parent&&e.offset===o.childCount)return{done:!0,value:void 0};if(o===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let s;if(o instanceof v){if(e.isAtEnd)return this.position=Be._createAfter(o),this._next();s=o.data[e.offset]}else s=o.getChild(e.offset);if(s instanceof Ce)return this.shallow?e.offset++:e=new Be(s,0),this.position=e,this._formatReturnValue("elementStart",s,t,e,1);if(s instanceof v){if(this.singleCharacters)return e=new Be(s,0),this.position=e,this._next();{let o,i=s.data.length;return s==this._boundaryEndParent?(i=this.boundaries.end.offset,o=new y(s,0,i),e=Be._createAfter(o)):(o=new y(s,0,s.data.length),e.offset++),this.position=e,this._formatReturnValue("text",o,t,e,i)}}if("string"==typeof s){let s;if(this.singleCharacters)s=1;else{s=(o===this._boundaryEndParent?this.boundaries.end.offset:o.data.length)-e.offset}const i=new y(o,e.offset,s);return e.offset+=s,this.position=e,this._formatReturnValue("text",i,t,e,s)}return e=Be._createAfter(o),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",o,t,e)}_previous(){let e=this.position.clone();const t=this.position,o=e.parent;if(null===o.parent&&0===e.offset)return{done:!0,value:void 0};if(o==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let s;if(o instanceof v){if(e.isAtStart)return this.position=Be._createBefore(o),this._previous();s=o.data[e.offset-1]}else s=o.getChild(e.offset-1);if(s instanceof Ce)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",s,t,e,1)):(e=new Be(s,s.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",s,t,e));if(s instanceof v){if(this.singleCharacters)return e=new Be(s,s.data.length),this.position=e,this._previous();{let o,i=s.data.length;if(s==this._boundaryStartParent){const t=this.boundaries.start.offset;o=new y(s,t,s.data.length-t),i=o.data.length,e=Be._createBefore(o)}else o=new y(s,0,s.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",o,t,e,i)}}if("string"==typeof s){let s;if(this.singleCharacters)s=1;else{const t=o===this._boundaryStartParent?this.boundaries.start.offset:0;s=e.offset-t}e.offset-=s;const i=new y(o,e.offset,s);return this.position=e,this._formatReturnValue("text",i,t,e,s)}return e=Be._createBefore(o),this.position=e,this._formatReturnValue("elementStart",o,t,e,1)}_formatReturnValue(e,t,o,s,i){return t instanceof y&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?o=Be._createAfter(t.textNode):(s=Be._createAfter(t.textNode),this.position=s)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?o=Be._createBefore(t.textNode):(s=Be._createBefore(t.textNode),this.position=s))),{done:!1,value:{type:e,item:t,previousPosition:o,nextPosition:s,length:i}}}}class Be extends b{constructor(e,t){super(),this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const 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;for(;!(e instanceof Re);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=Be._createAt(this),o=t.offset+e;return t.offset=o<0?0:o,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const o=new je(t);return o.skip(e),o.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),o=e.getAncestors();let s=0;for(;t[s]==o[s]&&t[s];)s++;return 0===s?null:t[s-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],o=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),o.push(e.offset);const s=(0,m.Rt)(t,o);switch(s){case"prefix":return"before";case"extension":return"after";default:return t[s]0?new this(o,s):new this(s,o)}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(Be._createBefore(e),t)}}function Ve(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}Ne.prototype.is=function(e){return"range"===e||"view:range"===e};class Ie extends((0,m.ln)(b)){constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}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];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)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!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let o=!1;for(const s of e._ranges)if(t.isEqual(s)){o=!0;break}if(!o)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=(0,m.QX)(this.getRanges());if(t!=(0,m.QX)(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let o=!1;for(let s of e.getRanges())if(s=s.getTrimmed(),t.start.isEqual(s.start)&&t.end.isEqual(s.end)){o=!0;break}if(!o)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,o,s]=e;if("object"==typeof o&&(s=o,o=void 0),null===t)this._setRanges([]),this._setFakeOptions(s);else if(t instanceof Ie||t instanceof De)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Ne)this._setRanges([t],s&&s.backward),this._setFakeOptions(s);else if(t instanceof Be)this._setRanges([new Ne(t)]),this._setFakeOptions(s);else if(t instanceof k){const e=!!s&&!!s.backward;let i;if(void 0===o)throw new m.Bb("view-selection-setto-required-second-parameter",this);i="in"==o?Ne._createIn(t):"on"==o?Ne._createOn(t):new Ne(Be._createAt(t,o)),this._setRanges([i],e),this._setFakeOptions(s)}else{if(!(0,m.TW)(t))throw new m.Bb("view-selection-setto-not-selectable",this);this._setRanges(t,s&&s.backward),this._setFakeOptions(s)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new m.Bb("view-selection-setfocus-no-ranges",this);const o=Be._createAt(e,t);if("same"==o.compareWith(this.focus))return;const s=this.anchor;this._ranges.pop(),"before"==o.compareWith(s)?this._addRange(new Ne(o,s),!0):this._addRange(new Ne(s,o)),this.fire("change")}_setRanges(e,t=!1){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=!1){if(!(e instanceof Ne))throw new m.Bb("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new m.Bb("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Ne(e.start,e.end))}}Ie.prototype.is=function(e){return"selection"===e||"view:selection"===e};class De extends((0,m.ln)(b)){constructor(...e){super(),this._selection=new Ie,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}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)}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}}De.prototype.is=function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e};class ze extends m.M3{constructor(e,t,o){super(e,t),this.startRange=o,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const Fe=Symbol("bubbling contexts");function Le(e){return class extends e{fire(e,...t){try{const o=e instanceof m.M3?e:new m.M3(this,e),s=$e(this);if(!s.size)return;if(Ze(o,"capturing",this),We(s,"$capture",o,...t))return o.return;const i=o.startRange||this.selection.getFirstRange(),n=i?i.getContainedElement():null,r=!!n&&Boolean(He(s,n));let a=n||function(e){if(!e)return null;const t=e.start.parent,o=e.end.parent,s=t.getPath(),i=o.getPath();return s.length>i.length?t:o}(i);if(Ze(o,"atTarget",a),!r){if(We(s,"$text",o,...t))return o.return;Ze(o,"bubbling",a)}for(;a;){if(a.is("rootElement")){if(We(s,"$root",o,...t))return o.return}else if(a.is("element")&&We(s,a.name,o,...t))return o.return;if(We(s,a,o,...t))return o.return;a=a.parent,Ze(o,"bubbling",a)}return Ze(o,"bubbling",this),We(s,"$document",o,...t),o.return}catch(e){m.Bb.rethrowUnexpectedError(e,this)}}_addEventListener(e,t,o){const s=(0,m.qo)(o.context||"$document"),i=$e(this);for(const n of s){let s=i.get(n);s||(s=new((0,m.ln)()),i.set(n,s)),this.listenTo(s,e,t,o)}}_removeEventListener(e,t){const o=$e(this);for(const s of o.values())this.stopListening(s,e,t)}}}{const e=Le(Object);["fire","_addEventListener","_removeEventListener"].forEach((t=>{Le[t]=e.prototype[t]}))}function Ze(e,t,o){e instanceof ze&&(e._eventPhase=t,e._currentTarget=o)}function We(e,t,o,...s){const i="string"==typeof t?e.get(t):He(e,t);return!!i&&(i.fire(o,...s),o.stop.called)}function He(e,t){for(const[o,s]of e)if("function"==typeof o&&o(t))return s;return null}function $e(e){return e[Fe]||(e[Fe]=new Map),e[Fe]}class qe extends(Le((0,m.Re)())){constructor(e){super(),this.selection=new De,this.roots=new m.FE({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("_isFocusChanging",!1),this.set("isSelecting",!1),this.set("isComposing",!1),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=!1;do{for(const o of this._postFixers)if(t=o(e),t)break}while(t)}}class Ue extends Ce{constructor(...e){super(...e),this.getFillerOffset=Ke,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new m.Bb("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function Ke(){if(Ge(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Ge(e)>1)return null;e=e.parent}return!e||Ge(e)>1?null:this.childCount}function Ge(e){return Array.from(e.getChildren()).filter((e=>!e.is("uiElement"))).length}Ue.DEFAULT_PRIORITY=10,Ue.prototype.is=function(e,t){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Je extends Ce{constructor(e,t,o,s){super(e,t,o,s),this.getFillerOffset=Ye}_insertChild(e,t){if(t&&(t instanceof k||Array.from(t).length>0))throw new m.Bb("view-emptyelement-cannot-add",[this,t]);return 0}}function Ye(){return null}Je.prototype.is=function(e,t){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Xe extends Ce{constructor(...e){super(...e),this.getFillerOffset=et}_insertChild(e,t){if(t&&(t instanceof k||Array.from(t).length>0))throw new m.Bb("view-uielement-cannot-add",[this,t]);return 0}render(e,t){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 Qe(e){e.document.on("arrowKey",((t,o)=>function(e,t,o){if(t.keyCode==m.Do.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),s=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(s||t.shiftKey){const t=e.focusNode,i=e.focusOffset,n=o.domPositionToView(t,i);if(null===n)return;let r=!1;const a=n.getLastMatchingPosition((e=>(e.item.is("uiElement")&&(r=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement")))));if(r){const t=o.viewPositionToDom(a);s?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,o,e.domConverter)),{priority:"low"})}function et(){return null}Xe.prototype.is=function(e,t){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class tt extends Ce{constructor(...e){super(...e),this.getFillerOffset=ot}_insertChild(e,t){if(t&&(t instanceof k||Array.from(t).length>0))throw new m.Bb("view-rawelement-cannot-add",[this,t]);return 0}render(){}}function ot(){return null}tt.prototype.is=function(e,t){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class st extends((0,m.ln)(b)){constructor(e,t){super(),this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}_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 o=0;const s=function(e,t){if("string"==typeof t)return[new v(e,t)];(0,m.TW)(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new v(e,t):t instanceof y?new v(e,t.data):t))}(this.document,t);for(const t of s)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,o++;return o}_removeChildren(e,t=1){this._fireChange("children",this);for(let o=e;o{const o=e[e.length-1],s=!t.is("uiElement");return o&&o.breakAttributes==s?o.nodes.push(t):e.push({breakAttributes:s,nodes:[t]}),e}),[]);let s=null,i=e;for(const{nodes:e,breakAttributes:t}of o){const o=this._insertNodes(i,e,t);s||(s=o.start),i=o.end}return s?new Ne(s,i):new Ne(e)}remove(e){const t=e instanceof Ne?e:Ne._createOn(e);if(pt(t,this.document),t.isCollapsed)return new st(this.document);const{start:o,end:s}=this._breakAttributesRange(t,!0),i=o.parent,n=s.offset-o.offset,r=i._removeChildren(o.offset,n);for(const e of r)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(o);return t.start=a,t.end=a.clone(),new st(this.document,r)}clear(e,t){pt(e,this.document);const o=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const s of o){const o=s.item;let i;if(o.is("element")&&t.isSimilar(o))i=Ne._createOn(o);else if(!s.nextPosition.isAfter(e.start)&&o.is("$textProxy")){const e=o.getAncestors().find((e=>e.is("element")&&t.isSimilar(e)));e&&(i=Ne._createIn(e))}i&&(i.end.isAfter(e.end)&&(i.end=e.end),i.start.isBefore(e.start)&&(i.start=e.start),this.remove(i))}}move(e,t){let o;if(t.isAfter(e.end)){const s=(t=this._breakAttributes(t,!0)).parent,i=s.childCount;e=this._breakAttributesRange(e,!0),o=this.remove(e),t.offset+=s.childCount-i}else o=this.remove(e);return this.insert(t,o)}wrap(e,t){if(!(t instanceof Ue))throw new m.Bb("view-writer-wrap-invalid-attribute",this.document);if(pt(e,this.document),e.isCollapsed){let s=e.start;s.parent.is("element")&&(o=s.parent,!Array.from(o.getChildren()).some((e=>!e.is("uiElement"))))&&(s=s.getLastMatchingPosition((e=>e.item.is("uiElement")))),s=this._wrapPosition(s,t);const i=this.document.selection;return i.isCollapsed&&i.getFirstPosition().isEqual(e.start)&&this.setSelection(s),new Ne(s)}return this._wrapRange(e,t);var o}unwrap(e,t){if(!(t instanceof Ue))throw new m.Bb("view-writer-unwrap-invalid-attribute",this.document);if(pt(e,this.document),e.isCollapsed)return e;const{start:o,end:s}=this._breakAttributesRange(e,!0),i=o.parent,n=this._unwrapChildren(i,o.offset,s.offset,t),r=this.mergeAttributes(n.start);r.isEqual(n.start)||n.end.offset--;const a=this.mergeAttributes(n.end);return new Ne(r,a)}rename(e,t){const o=new Ee(this.document,e,t.getAttributes());return this.insert(Be._createAfter(t),o),this.move(Ne._createIn(t),Be._createAt(o,0)),this.remove(Ne._createOn(t)),o}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return Be._createAt(e,t)}createPositionAfter(e){return Be._createAfter(e)}createPositionBefore(e){return Be._createBefore(e)}createRange(...e){return new Ne(...e)}createRangeOn(e){return Ne._createOn(e)}createRangeIn(e){return Ne._createIn(e)}createSelection(...e){return new Ie(...e)}createSlot(e){if(!this._slotFactory)throw new m.Bb("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,o){let s,i;if(s=o?nt(e):e.parent.is("$text")?e.parent.parent:e.parent,!s)throw new m.Bb("view-writer-invalid-position-container",this.document);i=o?this._breakAttributes(e,!0):e.parent.is("$text")?ct(e):e;const n=s._insertChild(i.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const r=i.getShiftedBy(n),a=this.mergeAttributes(i);a.isEqual(i)||r.offset--;const c=this.mergeAttributes(r);return new Ne(a,c)}_wrapChildren(e,t,o,s){let i=t;const n=[];for(;i!1,e.parent._insertChild(e.offset,o);const s=new Ne(e,e.getShiftedBy(1));this.wrap(s,t);const i=new Be(o.parent,o.index);o._remove();const n=i.nodeBefore,r=i.nodeAfter;return n instanceof v&&r instanceof v?lt(n,r):at(i)}_wrapAttributeElement(e,t){if(!ft(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const o of e.getAttributeKeys())if("class"!==o&&"style"!==o&&t.hasAttribute(o)&&t.getAttribute(o)!==e.getAttribute(o))return!1;for(const o of e.getStyleNames())if(t.hasStyle(o)&&t.getStyle(o)!==e.getStyle(o))return!1;for(const o of e.getAttributeKeys())"class"!==o&&"style"!==o&&(t.hasAttribute(o)||this.setAttribute(o,e.getAttribute(o),t));for(const o of e.getStyleNames())t.hasStyle(o)||this.setStyle(o,e.getStyle(o),t);for(const o of e.getClassNames())t.hasClass(o)||this.addClass(o,t);return!0}_unwrapAttributeElement(e,t){if(!ft(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const o of e.getAttributeKeys())if("class"!==o&&"style"!==o&&(!t.hasAttribute(o)||t.getAttribute(o)!==e.getAttribute(o)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const o of e.getStyleNames())if(!t.hasStyle(o)||t.getStyle(o)!==e.getStyle(o))return!1;for(const o of e.getAttributeKeys())"class"!==o&&"style"!==o&&this.removeAttribute(o,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const o=e.start,s=e.end;if(pt(e,this.document),e.isCollapsed){const o=this._breakAttributes(e.start,t);return new Ne(o,o)}const i=this._breakAttributes(s,t),n=i.parent.childCount,r=this._breakAttributes(o,t);return i.offset+=i.parent.childCount-n,new Ne(r,i)}_breakAttributes(e,t=!1){const o=e.offset,s=e.parent;if(e.parent.is("emptyElement"))throw new m.Bb("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new m.Bb("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new m.Bb("view-writer-cannot-break-raw-element",this.document);if(!t&&s.is("$text")&&ut(s.parent))return e.clone();if(ut(s))return e.clone();if(s.is("$text"))return this._breakAttributes(ct(e),t);if(o==s.childCount){const e=new Be(s.parent,s.index+1);return this._breakAttributes(e,t)}if(0===o){const e=new Be(s.parent,s.index);return this._breakAttributes(e,t)}{const e=s.index+1,i=s._clone();s.parent._insertChild(e,i),this._addToClonedElementsGroup(i);const n=s.childCount-o,r=s._removeChildren(o,n);i._appendChild(r);const a=new Be(s.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 o=this._cloneGroups.get(t);o||(o=new Set,this._cloneGroups.set(t,o)),o.add(e),e._clonesGroup=o}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const o=this._cloneGroups.get(t);o&&o.delete(e)}}function nt(e){let t=e.parent;for(;!ut(t);){if(!t)return;t=t.parent}return t}function rt(e,t){return e.priorityt.priority)&&e.getIdentity()o instanceof e)))throw new m.Bb("view-writer-insert-invalid-node-type",t);o.is("$text")||ht(o.getChildren(),t)}}function ut(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function pt(e,t){const o=nt(e.start),s=nt(e.end);if(!o||!s||o!==s)throw new m.Bb("view-writer-invalid-range-container",t)}function ft(e,t){return null===e.id&&null===t.id}const gt=e=>e.createTextNode(" "),mt=e=>{const t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},bt=e=>{const t=e.createElement("br");return t.dataset.ckeFiller="true",t},_t="⁠".repeat(7);function wt(e){return(0,m.Gs)(e)&&e.data.substr(0,7)===_t}function kt(e){return 7==e.data.length&&wt(e)}function vt(e){return wt(e)?e.data.slice(7):e.data}function yt(e,t){if(t.keyCode==m.Do.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,o=e.getRangeAt(0).startOffset;wt(t)&&o<=7&&e.collapse(t,0)}}}var xt=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-engine/theme/renderer.css"),Pt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i()(xt.Z,Pt);xt.Z.locals;class Tt extends((0,m.Re)()){constructor(e,t){super(),this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.set("isFocused",!1),this.set("_isFocusChanging",!1),this.set("isSelecting",!1),m.OB.isBlink&&!m.OB.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()})),this.set("isComposing",!1),this.on("change:isComposing",(()=>{this.isComposing||this.render()})),this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new m.Bb("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!m.OB.isAndroid)return;let e=null;const t=!(m.OB.isBlink&&!m.OB.isAndroid)||!this.isSelecting;for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=Be._createBefore(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)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),o=t.parent.ownerDocument;wt(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=Ct(o,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){if(!this.domConverter.mapViewToDom(e))return;const t=Array.from(this.domConverter.mapViewToDom(e).childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),s=this._diffNodeLists(t,o),i=this._findReplaceActions(s,t,o);if(-1!==i.indexOf("replace")){const s={equal:0,insert:0,delete:0};for(const n of i)if("replace"===n){const i=s.equal+s.insert,n=s.equal+s.delete,r=e.getChild(i);!r||r.is("uiElement")||r.is("rawElement")||this._updateElementMappings(r,t[n]),(0,m.Od)(o[i]),s.equal++}else s[n]++}}_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();return e.parent.is("$text")?Be._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&(0,m.Gs)(t.parent)&&wt(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!wt(e))throw new m.Bb("view-renderer-filler-was-lost",this);kt(e)?e.remove():e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,o=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor((e=>e.hasAttribute("contenteditable")));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;if(o===t.getFillerOffset())return!1;const s=e.nodeBefore,i=e.nodeAfter;return!(s instanceof v||i instanceof v)&&(!m.OB.isAndroid||!s&&!i)}_updateText(e,t){const o=this.domConverter.findCorrespondingDomText(e);let s=this.domConverter.viewToDom(e).data;const i=t.inlineFillerPosition;i&&i.parent==e.parent&&i.offset==e.index&&(s=_t+s),Rt(o,s)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const o=Array.from(t.attributes).map((e=>e.name)),s=e.getAttributeKeys();for(const o of s)this.domConverter.setDomElementAttribute(t,o,e.getAttribute(o),e);for(const s of o)e.hasAttribute(s)||this.domConverter.removeDomElementAttribute(t,s)}_updateChildren(e,t){const o=this.domConverter.mapViewToDom(e);if(!o)return;if(m.OB.isAndroid){let e=null;for(const t of Array.from(o.childNodes)){if(e&&(0,m.Gs)(e)&&(0,m.Gs)(t)){o.normalize();break}e=t}}const s=t.inlineFillerPosition,i=o.childNodes,n=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));s&&s.parent===e&&Ct(o.ownerDocument,n,s.offset);const r=this._diffNodeLists(i,n),a=m.OB.isAndroid?this._findReplaceActions(r,i,n,{replaceText:!0}):r;let c=0;const l=new Set;for(const e of a)"delete"===e?(l.add(i[c]),(0,m.Od)(i[c])):"equal"!==e&&"replace"!==e||c++;c=0;for(const e of a)"insert"===e?((0,m.ZQ)(o,c,n[c]),c++):"replace"===e?(Rt(i[c],n[c].data),c++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(n[c])),c++);for(const e of l)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return e=function(e,t){const o=Array.from(e);if(0==o.length||!t)return o;const s=o[o.length-1];s==t&&o.pop();return o}(e,this._fakeSelectionContainer),(0,m.Hg)(e,t,St.bind(null,this.domConverter))}_findReplaceActions(e,t,o,s={}){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let i=[],n=[],r=[];const a={equal:0,insert:0,delete:0};for(const c of e)"insert"===c?r.push(o[a.equal+a.insert]):"delete"===c?n.push(t[a.equal+a.delete]):(i=i.concat((0,m.Hg)(n,r,s.replaceText?Et:At).map((e=>"equal"===e?"replace":e))),i.push("equal"),n=[],r=[]),a[c]++;return i.concat((0,m.Hg)(n,r,s.replaceText?Et:At).map((e=>"equal"===e?"replace":e)))}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(m.OB.isBlink&&!m.OB.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this._isFocusChanging)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&m.OB.isAndroid||this._updateDomSelection(e))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const o=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(o,this.selection),!this._fakeSelectionNeedsUpdate(e))return;o.parentElement&&o.parentElement==e||e.appendChild(o),o.textContent=this.selection.fakeSelectionLabel||" ";const s=t.getSelection(),i=t.createRange();s.removeAllRanges(),i.selectNodeContents(o),s.addRange(i)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const o=this.domConverter.viewPositionToDom(this.selection.anchor),s=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(o.parent,o.offset),t.extend(s.parent,s.offset),m.OB.isGecko&&function(e,t){const o=e.parent;if(o.nodeType!=Node.ELEMENT_NODE||e.offset!=o.childNodes.length-1)return;const s=o.childNodes[e.offset];s&&"BR"==s.tagName&&t.addRange(t.getRangeAt(0))}(s,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,o=e.ownerDocument.getSelection();return!t||t.parentElement!==e||(o.anchorNode!==t&&!t.contains(o.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const o=e.activeElement,s=this.domConverter.mapDomToView(o);o&&s&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function Ct(e,t,o){const s=t instanceof Array?t:t.childNodes,i=s[o];if((0,m.Gs)(i))return i.data=_t+i.data,i;{const i=e.createTextNode(_t);return Array.isArray(t)?s.splice(o,0,i):(0,m.ZQ)(t,o,i),i}}function At(e,t){return(0,m.UG)(e)&&(0,m.UG)(t)&&!(0,m.Gs)(e)&&!(0,m.Gs)(t)&&!(0,m.C3)(e)&&!(0,m.C3)(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Et(e,t){return(0,m.UG)(e)&&(0,m.UG)(t)&&(0,m.Gs)(e)&&(0,m.Gs)(t)}function St(e,t,o){return t===o||((0,m.Gs)(t)&&(0,m.Gs)(o)?t.data===o.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(o)))}function Rt(e,t){const o=e.data;if(o==t)return;const s=(0,m.HZ)(o,t);for(const t of s)"insert"===t.type?e.insertData(t.index,t.values.join("")):e.deleteData(t.index,t.howMany)}const Ot=bt(m.CO.document),Mt=gt(m.CO.document),jt=mt(m.CO.document),Bt="data-ck-unsafe-attribute-",Nt="data-ck-unsafe-element";class Vt{constructor(e,t={}){this.document=e,this.renderingMode=t.renderingMode||"editing",this.blockFillerMode=t.blockFillerMode||("editing"===this.renderingMode?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument="editing"===this.renderingMode?m.CO.document:m.CO.document.implementation.createHTMLDocument(""),this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new P,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Ie(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 Array.from(e.children))this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,o){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&(("srcdoc"!==e||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===o&&("src"===e||"srcset"===e)||("source"===o&&"srcset"===e||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const o=(new DOMParser).parseFromString(t,"text/html"),s=o.createDocumentFragment(),i=o.body.childNodes;for(;i.length>0;)s.appendChild(i[0]);const n=o.createTreeWalker(s,NodeFilter.SHOW_ELEMENT),r=[];let a;for(;a=n.nextNode();)r.push(a);for(const e of r){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(zt(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(s)}viewToDom(e,t={}){if(e.is("$text")){const t=this._processDataFromViewText(e);return this._domDocument.createTextNode(t)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let o;if(e.is("documentFragment"))o=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(o,e);else{if(e.is("uiElement"))return o="$comment"===e.name?this._domDocument.createComment(e.getCustomProperty("$rawContent")):e.render(this._domDocument,this),t.bind&&this.bindElements(o,e),o;this._shouldRenameElement(e.name)?(zt(e.name),o=this._createReplacementDomElement(e.name)):o=e.hasAttribute("xmlns")?this._domDocument.createElementNS(e.getAttribute("xmlns"),e.name):this._domDocument.createElement(e.name),e.is("rawElement")&&e.render(o,this),t.bind&&this.bindElements(o,e);for(const t of e.getAttributeKeys())this.setDomElementAttribute(o,t,e.getAttribute(t),e)}if(!1!==t.withChildren)for(const s of this.viewChildrenToDom(e,t))o.appendChild(s);return o}}setDomElementAttribute(e,t,o,s){const i=this.shouldRenderAttribute(t,o,e.tagName.toLowerCase())||s&&s.shouldRenderUnsafeAttribute(t);i||(0,m.KE)("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:o}),e.hasAttribute(t)&&!i?e.removeAttribute(t):e.hasAttribute(Bt+t)&&i&&e.removeAttribute(Bt+t),e.setAttribute(i?t:Bt+t,o)}removeDomElementAttribute(e,t){t!=Nt&&(e.removeAttribute(t),e.removeAttribute(Bt+t))}*viewChildrenToDom(e,t={}){const o=e.getFillerOffset&&e.getFillerOffset();let s=0;for(const i of e.getChildren()){o===s&&(yield this._getBlockFiller());const e=i.is("element")&&i.getCustomProperty("dataPipeline:transparentRendering");e&&"data"==this.renderingMode?yield*this.viewChildrenToDom(i,t):(e&&(0,m.KE)("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:i}),yield this.viewToDom(i,t)),s++}o===s&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),o=this.viewPositionToDom(e.end),s=this._domDocument.createRange();return s.setStart(t.parent,t.offset),s.setEnd(o.parent,o.offset),s}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const o=this.findCorrespondingDomText(t);if(!o)return null;let s=e.offset;return wt(o)&&(s+=7),{parent:o,offset:s}}{let o,s,i;if(0===e.offset){if(o=this.mapViewToDom(t),!o)return null;i=o.childNodes[0]}else{const t=e.nodeBefore;if(s=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(t),!s)return null;o=s.parentNode,i=s.nextSibling}if((0,m.Gs)(i)&&wt(i))return{parent:i,offset:7};return{parent:o,offset:s?(0,m.cq)(s)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const o=this.getHostViewElement(e);if(o)return o;if((0,m.C3)(e)&&t.skipComments)return null;if((0,m.Gs)(e)){if(kt(e))return null;{const t=this._processDataFromDomText(e);return""===t?null:new v(this.document,t)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let o;if(this.isDocumentFragment(e))o=new st(this.document),t.bind&&this.bindDocumentFragments(e,o);else{o=this._createViewElement(e,t),t.bind&&this.bindElements(e,o);const s=e.attributes;if(s)for(let e=s.length,t=0;t{const{scrollLeft:t,scrollTop:o}=e;s.push([t,o])})),t.focus(),It(t,(e=>{const[t,o]=s.shift();e.scrollLeft=t,e.scrollTop=o})),m.CO.window.scrollTo(e,o)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(Ot):!("BR"!==e.tagName||!Dt(e,this.blockElements)||1!==e.parentNode.childNodes.length)||(e.isEqualNode(jt)||function(e,t){const o=e.isEqualNode(Mt);return o&&Dt(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements))}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch(e){return!1}const o=t.collapsed;return t.detach(),o}getHostViewElement(e){const t=(0,m.dk)(e);for(t.pop();t.length;){const e=t.pop(),o=this._domToViewMapping.get(e);if(o&&(o.is("uiElement")||o.is("rawElement")))return o}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return gt(this._domDocument);case"markedNbsp":return mt(this._domDocument);case"br":return bt(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if((0,m.Gs)(e)&&wt(e)&&t<7)return!1;if(this.isElement(e)&&wt(e.childNodes[t]))return!1;const o=this.mapDomToView(e);return!o||!o.is("uiElement")&&!o.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some((e=>this.preElements.includes(e.name))))return t;if(" "==t.charAt(0)){const o=this._getTouchingInlineViewNode(e,!1);!(o&&o.is("$textProxy")&&this._nodeEndsWithSpace(o))&&o||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const o=this._getTouchingInlineViewNode(e,!0),s=o&&o.is("$textProxy")&&" "==o.data.charAt(0);" "!=t.charAt(t.length-2)&&o&&!s||(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!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(function(e,t){const o=(0,m.dk)(e);return o.some((e=>e.tagName&&t.includes(e.tagName.toLowerCase())))}(e,this.preElements))return vt(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const o=this._getTouchingInlineDomNode(e,!1),s=this._getTouchingInlineDomNode(e,!0),i=this._checkShouldLeftTrimDomText(e,o),n=this._checkShouldRightTrimDomText(e,s);i&&(t=t.replace(/^ /,"")),n&&(t=t.replace(/ $/,"")),t=vt(new Text(t)),t=t.replace(/ \u00A0/g," ");const r=s&&this.isElement(s)&&"BR"!=s.tagName,a=s&&(0,m.Gs)(s)&&" "==s.data.charAt(0);return(/( |\u00A0)\u00A0$/.test(t)||!s||r||a)&&(t=t.replace(/\u00A0$/," ")),(i||o&&this.isElement(o)&&"BR"!=o.tagName)&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?"BR"===t.tagName:!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!wt(e)}_getTouchingInlineViewNode(e,t){const o=new je({startPosition:t?Be._createAfter(e):Be._createBefore(e),direction:t?"forward":"backward"});for(const e of o){if(e.item.is("element")&&this.inlineObjectElements.includes(e.item.name))return e.item;if(e.item.is("containerElement"))return null;if(e.item.is("element","br"))return null;if(e.item.is("$textProxy"))return e.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const o=t?"firstChild":"lastChild",s=t?"nextSibling":"previousSibling";let i=!0,n=e;do{if(!i&&n[o]?n=n[o]:n[s]?(n=n[s],i=!1):(n=n.parentNode,i=!0),!n||this._isBlockElement(n))return null}while(!(0,m.Gs)(n)&&"BR"!=n.tagName&&!this._isInlineObjectElement(n));return n}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if((0,m.C3)(e))return new Xe(this.document,"$comment");const o=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new Ce(this.document,o)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const o=this._domDocument.createElement("span");if(o.setAttribute(Nt,e),t){for(;t.firstChild;)o.appendChild(t.firstChild);for(const e of t.getAttributeNames())o.setAttribute(e,t.getAttribute(e))}return o}}function It(e,t){let o=e;for(;o;)t(o),o=o.parentElement}function Dt(e,t){const o=e.parentNode;return!!o&&!!o.tagName&&t.includes(o.tagName.toLowerCase())}function zt(e){"script"===e&&(0,m.KE)("domconverter-unsafe-script-element-detected"),"style"===e&&(0,m.KE)("domconverter-unsafe-style-element-detected")}class Ft extends((0,m.Xu)()){constructor(e){super(),this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}var Lt=o("./node_modules/lodash-es/assignIn.js");class Zt{constructor(e,t,o){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,(0,Lt.Z)(this,o)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Wt extends Ft{constructor(e){super(e),this.useCapture=!1}observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach((t=>{this.listenTo(e,t,((e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)}),{useCapture:this.useCapture})}))}fire(e,t,o){this.isEnabled&&this.document.fire(e,new Zt(this.view,t,o))}}class Ht extends Wt{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return(0,m.Cq)(this)}};this.fire(e.type,e,t)}}var $t=o("./node_modules/lodash-es/debounce.js");class qt extends Ft{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=(0,$t.Z)((e=>{this.document.fire("selectionChangeDone",e)}),200)}observe(){const e=this.document;e.on("arrowKey",((t,o)=>{e.selection.isFake&&this.isEnabled&&o.preventDefault()}),{context:"$capture"}),e.on("arrowKey",((t,o)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(o.keyCode)}),{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,o=new Ie(t.getRanges(),{backward:t.isBackward,fake:!1});e!=m.Do.arrowleft&&e!=m.Do.arrowup||o.setTo(o.getFirstPosition()),e!=m.Do.arrowright&&e!=m.Do.arrowdown||o.setTo(o.getLastPosition());const s={oldSelection:t,newSelection:o,domSelection:null};this.document.fire("selectionChange",s),this._fireSelectionChangeDoneDebounced(s)}}const Ut=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Kt=function(e){return this.__data__.has(e)};function Gt(e){var t=-1,o=null==e?0:e.length;for(this.__data__=new j.Z;++ta))return!1;var l=n.get(e),d=n.get(t);if(l&&d)return l==t&&d==e;var h=-1,u=!0,p=2&o?new Jt:void 0;for(n.set(e,t),n.set(t,e);++h{this.document.fire("selectionChangeDone",e)}),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=(0,$t.Z)((()=>this.document.isSelecting=!1),5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,o=()=>{this.document.isSelecting&&(this._handleSelectionChange(null,t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(e,"keydown",o,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",o,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",o,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",((e,o)=>{this.document.isComposing&&!m.OB.isAndroid||(this._handleSelectionChange(o,t),this._documentIsSelectingInactivityTimeoutDebounced())})),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_handleSelectionChange(e,t){if(!this.isEnabled)return;const o=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(o.anchorNode))return;this.mutationObserver.flush();const s=this.domConverter.domSelectionToView(o);if(0!=s.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(s)&&this.domConverter.isDomSelectionCorrect(o)||++this._loopbackCounter>60))if(this.selection.isSimilar(s))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:s,domSelection:o};this.document._isFocusChanging=!1,this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class yo extends Wt{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",(()=>{t.isFocused=!0,t._isFocusChanging=!0,this._renderTimeoutId=setTimeout((()=>{t._isFocusChanging=!1,e.change((()=>{}))}),50)})),t.on("blur",((o,s)=>{const i=t.selection.editableElement;null!==i&&i!==s.target||(t.isFocused=!1,e.change((()=>{})))}))}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class xo extends Wt{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",(()=>{t.isComposing=!0}),{priority:"low"}),t.on("compositionend",(()=>{t.isComposing=!1}),{priority:"low"})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class Po{constructor(e){this.files=function(e){const t=Array.from(e.files||[]),o=Array.from(e.items||[]);if(t.length)return t;return o.filter((e=>"file"===e.kind)).map((e=>e.getAsFile()))}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}class To extends Wt{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){const t=e.getTargetRanges(),o=this.view,s=o.document;let i=null,n=null,r=[];if(e.dataTransfer&&(i=new Po(e.dataTransfer)),null!==e.data?n=e.data:i&&(n=i.getData("text/plain")),s.selection.isFake)r=Array.from(s.selection.getRanges());else if(t.length)r=t.map((e=>o.domConverter.domRangeToView(e)));else if(m.OB.isAndroid){const t=e.target.ownerDocument.defaultView.getSelection();r=Array.from(o.domConverter.domSelectionToView(t).getRanges())}if(m.OB.isAndroid&&"insertCompositionText"==e.inputType&&n&&n.endsWith("\n"))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[o.createRange(r[0].end)]});else if("insertText"==e.inputType&&n&&n.includes("\n")){const t=n.split(/\n{1,2}/g);let o=r;for(let n=0;n{if(this.isEnabled&&(0,m.dj)(t.keyCode)){const o=new ze(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(o,t),o.stop.called&&e.stop()}}))}observe(){}}class Ao extends Ft{constructor(e){super(e);const t=this.document;t.on("keydown",((e,o)=>{if(!this.isEnabled||o.keyCode!=m.Do.tab||o.ctrlKey)return;const s=new ze(t,"tab",t.selection.getFirstRange());t.fire(s,o),s.stop.called&&e.stop()}))}observe(){}}class Eo extends((0,m.Re)()){constructor(e){super(),this.document=new qe(e),this.domConverter=new Vt(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Tt(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing","_isFocusChanging").to(this.document,"isFocused","isSelecting","isComposing","_isFocusChanging"),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new it(this.document),this.addObserver(wo),this.addObserver(vo),this.addObserver(yo),this.addObserver(Ht),this.addObserver(qt),this.addObserver(xo),this.addObserver(Co),this.addObserver(To),this.addObserver(Ao),this.document.on("arrowKey",yt,{priority:"low"}),Qe(this),this.on("render",(()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=!0})),this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=!0}))}attachDomRoot(e,t="main"){const o=this.document.getRoot(t);o._name=e.tagName.toLowerCase();const s={};for(const{name:t,value:i}of Array.from(e.attributes))s[t]=i,"class"===t?this._writer.addClass(i.split(" "),o):this._writer.setAttribute(t,i,o);this._initialDomRootAttributes.set(e,s);const i=()=>{this._writer.setAttribute("contenteditable",(!o.isReadOnly).toString(),o),o.isReadOnly?this._writer.addClass("ck-read-only",o):this._writer.removeClass("ck-read-only",o)};i(),this.domRoots.set(t,e),this.domConverter.bindElements(e,o),this._renderer.markToSync("children",o),this._renderer.markToSync("attributes",o),this._renderer.domDocuments.add(e.ownerDocument),o.on("change:children",((e,t)=>this._renderer.markToSync("children",t))),o.on("change:attributes",((e,t)=>this._renderer.markToSync("attributes",t))),o.on("change:text",((e,t)=>this._renderer.markToSync("text",t))),o.on("change:isReadOnly",(()=>this.change(i))),o.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const o of this._observers.values())o.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach((({name:e})=>t.removeAttribute(e)));const o=this._initialDomRootAttributes.get(t);for(const e in o)t.setAttribute(e,o[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,o]of this.domRoots)t.observe(o,e);return t.enable(),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();e&&(0,m.mR)({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new m.Bb("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){m.Bb.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.document._isFocusChanging=!1,this.change((()=>{}))}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return Be._createAt(e,t)}createPositionAfter(e){return Be._createAfter(e)}createPositionBefore(e){return Be._createBefore(e)}createRange(...e){return new Ne(...e)}createRangeOn(e){return Ne._createOn(e)}createRangeIn(e){return Ne._createIn(e)}createSelection(...e){return new Ie(...e)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change((()=>{}))}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class So{is(){throw new Error("is() method is abstract")}}class Ro extends So{constructor(e){super(),this.parent=null,this._attrs=(0,m.qL)(e)}get document(){return null}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new m.Bb("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new m.Bb("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let o=e.includeSelf?this:this.parent;for(;o;)t[e.parentFirst?"push":"unshift"](o),o=o.parent;return t}getCommonAncestor(e,t={}){const o=this.getAncestors(t),s=e.getAncestors(t);let i=0;for(;o[i]==s[i]&&o[i];)i++;return 0===i?null:o[i-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),o=e.getPath(),s=(0,m.Rt)(t,o);switch(s){case"prefix":return!0;case"extension":return!1;default:return t[s](e[t[0]]=t[1],e)),{})),e}_clone(e){return new Ro(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=(0,m.qL)(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}Ro.prototype.is=function(e){return"node"===e||"model:node"===e};class Oo{constructor(e){this._nodes=[],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-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?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 m.Bb("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const o of this._nodes){if(e>=t&&ee.toJSON()))}}class Mo extends Ro{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Mo(this.data,this.getAttributes())}static fromJSON(e){return new Mo(e.data,e.attributes)}}Mo.prototype.is=function(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e};class jo extends So{constructor(e,t,o){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new m.Bb("model-textproxy-wrong-offsetintext",this);if(o<0||t+o>e.offsetSize)throw new m.Bb("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+o),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let o=e.includeSelf?this:this.parent;for(;o;)t[e.parentFirst?"push":"unshift"](o),o=o.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()}}jo.prototype.is=function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e};class Bo extends Ro{constructor(e,t,o){super(t),this.name=e,this._children=new Oo,o&&this._insertChild(0,o)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}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 o of e)t=t.getChild(t.offsetToIndex(o));return t}findAncestor(e,t={}){let o=t.includeSelf?this:this.parent;for(;o;){if(o.name===e)return o;o=o.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map((e=>e._clone(!0))):void 0;return new Bo(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const o=function(e){if("string"==typeof e)return[new Mo(e)];(0,m.TW)(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new Mo(e):e instanceof jo?new Mo(e.data,e.getAttributes()):e))}(t);for(const e of o)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,o)}_removeChildren(e,t=1){const o=this._children._removeNodes(e,t);for(const e of o)e.parent=null;return o}static fromJSON(e){let t;if(e.children){t=[];for(const o of e.children)o.name?t.push(Bo.fromJSON(o)):t.push(Mo.fromJSON(o))}return new Bo(e.name,e.attributes,t)}}Bo.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e};class No{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new m.Bb("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new m.Bb("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=Io._createAt(this.boundaries["backward"==this.direction?"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,o,s,i;do{s=this.position,i=this._visitedParent,({done:t,value:o}=this.next())}while(!t&&e(o));t||(this.position=s,this._visitedParent=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),o=this._visitedParent;if(null===o.parent&&t.offset===o.maxOffset)return{done:!0,value:void 0};if(o===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const s=Do(t,o),i=s||zo(t,o,s);if(i instanceof Bo)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=i),this.position=t,Vo("elementStart",i,e,t,1);if(i instanceof Mo){let s;if(this.singleCharacters)s=1;else{let e=i.endOffset;this._boundaryEndParent==o&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),s=t.offset-e}const i=t.offset-n.startOffset,r=new jo(n,i-s,s);return t.offset-=s,this.position=t,Vo("text",r,e,t,s)}return t.path.pop(),this.position=t,this._visitedParent=o.parent,Vo("elementStart",o,e,t,1)}}function Vo(e,t,o,s,i){return{done:!1,value:{type:e,item:t,previousPosition:o,nextPosition:s,length:i}}}class Io extends So{constructor(e,t,o="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new m.Bb("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new m.Bb("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=o}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;t1)return!1;if(1===t)return Lo(e,this,o);if(-1===t)return Lo(this,e,o)}return this.path.length===e.path.length||(this.path.length>e.path.length?Zo(this.path,t):Zo(e.path,t))}hasSameParentAs(e){if(this.root!==e.root)return!1;const t=this.getParentPath(),o=e.getParentPath();return"same"==(0,m.Rt)(t,o)}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=Io._createAt(this)}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;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let o;return t.containsPosition(this)||t.start.isEqual(this)?(o=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(o=o._getTransformedByDeletion(e.deletionPosition,1))):o=this.isEqual(e.deletionPosition)?Io._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),o}_getTransformedByDeletion(e,t){const o=Io._createAt(this);if(this.root!=e.root)return o;if("same"==(0,m.Rt)(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;o.offset-=t}}else if("prefix"==(0,m.Rt)(e.getParentPath(),this.getParentPath())){const s=e.path.length-1;if(e.offset<=this.path[s]){if(e.offset+t>this.path[s])return null;o.path[s]-=t}}return o}_getTransformedByInsertion(e,t){const o=Io._createAt(this);if(this.root!=e.root)return o;if("same"==(0,m.Rt)(e.getParentPath(),this.getParentPath()))(e.offset=t;){if(e.path[s]+i!==o.maxOffset)return!1;i=1,s--,o=o.parent}return!0}(e,o+1))}function Zo(e,t){for(;tt+1;){const t=s.maxOffset-o.offset;0!==t&&e.push(new Wo(o,o.getShiftedBy(t))),o.path=o.path.slice(0,-1),o.offset++,s=s.parent}for(;o.path.length<=this.end.path.length;){const t=this.end.path[o.path.length-1],s=t-o.offset;0!==s&&e.push(new Wo(o,o.getShiftedBy(s))),o.offset=t,o.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new No(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new No(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new No(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 Wo(this.start,this.end)]}getTransformedByOperations(e){const t=[new Wo(this.start,this.end)];for(const o of e)for(let e=0;e0?new this(o,s):new this(s,o)}static _createIn(e){return new this(Io._createAt(e,0),Io._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Io._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new m.Bb("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort(((e,t)=>e.start.isAfter(t.start)?1:-1));const o=e.indexOf(t),s=new this(t.start,t.end);if(o>0)for(let t=o-1;e[t].end.isEqual(s.start);t++)s.start=Io._createAt(e[t].start);for(let t=o+1;t{if(t.viewPosition)return;const o=this._modelToViewMapping.get(t.modelPosition.parent);if(!o)throw new m.Bb("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(o,t.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((e,t)=>{if(t.modelPosition)return;const o=this.findMappedViewAncestor(t.viewPosition),s=this._viewToModelMapping.get(o),i=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,o);t.modelPosition=Io._createAt(s,i)}),{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const o=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e),this._modelToViewMapping.get(o)==e&&this._modelToViewMapping.delete(o))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const o=this._markerNameToElements.get(t)||new Set;o.add(e);const s=this._elementToMarkerNames.get(e)||new Set;s.add(t),this._markerNameToElements.set(t,o),this._elementToMarkerNames.set(e,s)}unbindElementFromMarkerName(e,t){const o=this._markerNameToElements.get(t);o&&(o.delete(e),0==o.size&&this._markerNameToElements.delete(t));const s=this._elementToMarkerNames.get(e);s&&(s.delete(t),0==s.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Wo(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Ne(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const o={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",o),o.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const o=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())o.add(t);else o.add(e);return o}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,o){if(o!=e){return this._toModelOffset(e.parent,e.index,o)+this._toModelOffset(e,t,e)}if(e.is("$text"))return t;let s=0;for(let o=0;o1?t[0]+":"+t[1]:t[0]}class Uo extends((0,m.ln)()){constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,o){const s=this._createConversionApi(o,e.getRefreshedItems());for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,s);const i=this._reduceChanges(e.getChanges());for(const e of i)"insert"===e.type?this._convertInsert(Wo._createFromPositionAndShift(e.position,e.length),s):"reinsert"===e.type?this._convertReinsert(Wo._createFromPositionAndShift(e.position,e.length),s):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,s):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,s);for(const e of s.mapper.flushUnboundMarkerNames()){const o=t.get(e).getRange();this._convertMarkerRemove(e,o,s),this._convertMarkerAdd(e,o,s)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,s);s.mapper.flushDeferredBindings(),s.consumable.verifyAllConsumed("insert")}convert(e,t,o,s={}){const i=this._createConversionApi(o,void 0,s);this._convertInsert(e,i);for(const[e,o]of t)this._convertMarkerAdd(e,o,i);i.consumable.verifyAllConsumed("insert")}convertSelection(e,t,o){const s=Array.from(t.getMarkersAtPosition(e.getFirstPosition())),i=this._createConversionApi(o);if(this._addConsumablesForSelection(i.consumable,e,s),this.fire("selection",{selection:e},i),e.isCollapsed){for(const t of s){const o=t.getRange();if(!Ko(e.getFirstPosition(),t,i.mapper))continue;const s={item:e,markerName:t.name,markerRange:o};i.consumable.test(e,"addMarker:"+t.name)&&this.fire(`addMarker:${t.name}`,s,i)}for(const t of e.getAttributeKeys()){const o={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};i.consumable.test(e,"attribute:"+o.attributeKey)&&this.fire(`attribute:${o.attributeKey}:$text`,o,i)}}}_convertInsert(e,t,o={}){o.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,Array.from(e));for(const o of Array.from(e.getWalker({shallow:!0})).map(Go))this._testAndFire("insert",o,t)}_convertRemove(e,t,o,s){this.fire(`remove:${o}`,{position:e,length:t},s)}_convertAttribute(e,t,o,s,i){this._addConsumablesForRange(i.consumable,e,`attribute:${t}`);for(const n of e){const e={item:n.item,range:Wo._createFromPositionAndShift(n.previousPosition,n.length),attributeKey:t,attributeOldValue:o,attributeNewValue:s};this._testAndFire(`attribute:${t}`,e,i)}}_convertReinsert(e,t){const o=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,o);for(const e of o.map(Go))this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,o){if("$graveyard"==t.root.rootName)return;const s=`addMarker:${e}`;if(o.consumable.add(t,s),this.fire(s,{markerName:e,markerRange:t},o),o.consumable.consume(t,s)){this._addConsumablesForRange(o.consumable,t,s);for(const i of t.getItems()){if(!o.consumable.test(i,s))continue;const n={item:i,range:Wo._createOn(i),markerName:e,markerRange:t};this.fire(s,n,o)}}}_convertMarkerRemove(e,t,o){"$graveyard"!=t.root.rootName&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},o)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const o of t){const t=o.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const o of t.getAttributeKeys())e.add(t,"attribute:"+o)}}return e}_addConsumablesForRange(e,t,o){for(const s of t.getItems())e.add(s,o);return e}_addConsumablesForSelection(e,t,o){e.add(t,"selection");for(const s of o)e.add(t,"addMarker:"+s.name);for(const o of t.getAttributeKeys())e.add(t,"attribute:"+o);return e}_testAndFire(e,t,o){const s=function(e,t){const o=t.item.is("element")?t.item.name:"$text";return`${e}:${o}`}(e,t),i=t.item.is("$textProxy")?o.consumable._getSymbolForTextProxy(t.item):t.item,n=this._firedEventsMap.get(o),r=n.get(i);if(r){if(r.has(s))return;r.add(s)}else n.set(i,new Set([s]));this.fire(s,t,o)}_testAndFireAddAttributes(e,t){const o={item:e,range:Wo._createOn(e)};for(const e of o.item.getAttributeKeys())o.attributeKey=e,o.attributeOldValue=null,o.attributeNewValue=o.item.getAttribute(e),this._testAndFire(`attribute:${e}`,o,t)}_createConversionApi(e,t=new Set,o={}){const s={...this._conversionApi,consumable:new $o,writer:e,options:o,convertItem:e=>this._convertInsert(Wo._createOn(e),s),convertChildren:e=>this._convertInsert(Wo._createIn(e),s,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,s),canReuseView:e=>!t.has(s.mapper.toModelElement(e))};return this._firedEventsMap.set(s,new Map),s}}function Ko(e,t,o){const s=t.getRange(),i=Array.from(e.getAncestors());i.shift(),i.reverse();return!i.some((e=>{if(s.containsItem(e)){return!!o.toViewElement(e).getCustomProperty("addHighlight")}}))}function Go(e){return{item:e.item,range:Wo._createFromPositionAndShift(e.previousPosition,e.length)}}class Jo extends((0,m.ln)(So)){constructor(...e){super(),this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e.length&&this.setTo(...e)}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(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let o=!1;for(const s of e._ranges)if(t.isEqual(s)){o=!0;break}if(!o)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new Wo(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new Wo(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new Wo(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){let[t,o,s]=e;if("object"==typeof o&&(s=o,o=void 0),null===t)this._setRanges([]);else if(t instanceof Jo)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof Wo)this._setRanges([t],!!s&&!!s.backward);else if(t instanceof Io)this._setRanges([new Wo(t)]);else if(t instanceof Ro){const e=!!s&&!!s.backward;let i;if("in"==o)i=Wo._createIn(t);else if("on"==o)i=Wo._createOn(t);else{if(void 0===o)throw new m.Bb("model-selection-setto-required-second-parameter",[this,t]);i=new Wo(Io._createAt(t,o))}this._setRanges([i],e)}else{if(!(0,m.TW)(t))throw new m.Bb("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,s&&!!s.backward)}}_setRanges(e,t=!1){const o=Array.from(e),s=o.some((t=>{if(!(t instanceof Wo))throw new m.Bb("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every((e=>!e.isEqual(t)))}));(o.length!==this._ranges.length||s)&&(this._replaceAllRanges(o),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(null===this.anchor)throw new m.Bb("model-selection-setfocus-no-ranges",[this,e]);const o=Io._createAt(e,t);if("same"==o.compareWith(this.focus))return;const s=this.anchor;this._ranges.length&&this._popRange(),"before"==o.compareWith(s)?(this._pushRange(new Wo(o,s)),this._lastRangeBackward=!0):(this._pushRange(new Wo(s,o)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}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){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const o=Qo(t.start,e);o&&es(o,t)&&(yield o);for(const o of t.getWalker()){const s=o.item;"elementEnd"==o.type&&Xo(s,e,t)&&(yield s)}const s=Qo(t.end,e);s&&!t.end.isTouching(Io._createAt(s,0))&&es(s,t)&&(yield s)}}containsEntireContent(e=this.anchor.root){const t=Io._createAt(e,0),o=Io._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&o.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new Wo(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function Yo(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function Xo(e,t,o){return Yo(e,t)&&es(e,o)}function Qo(e,t){const o=e.parent.root.document.model.schema,s=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const n=s.find((e=>!i&&(i=o.isLimit(e),!i&&Yo(e,t))));return s.forEach((e=>t.add(e))),n}function es(e,t){const o=function(e){const t=e.root.document.model.schema;let o=e.parent;for(;o;){if(t.isBlock(o))return o;o=o.parent}}(e);if(!o)return!0;return!t.containsRange(Wo._createOn(o),!0)}Jo.prototype.is=function(e){return"selection"===e||"model:selection"===e};class ts extends((0,m.ln)(Wo)){constructor(e,t){super(e,t),os.call(this)}detach(){this.stopListening()}toRange(){return new Wo(this.start,this.end)}static fromRange(e){return new ts(e.start,e.end)}}function os(){this.listenTo(this.root.document.model,"applyOperation",((e,t)=>{const o=t[0];o.isDocumentOperation&&ss.call(this,o)}),{priority:"low"})}function ss(e){const t=this.getTransformedByOperation(e),o=Wo._createFromRanges(t),s=!o.isEqual(this),i=function(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!1}(this,e);let n=null;if(s){"$graveyard"==o.root.rootName&&(n="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=o.start,this.end=o.end,this.fire("change:range",t,{deletionPosition:n})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:n})}ts.prototype.is=function(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e};const is="selection:";class ns extends((0,m.ln)(So)){constructor(e){super(),this._selection=new rs(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(!1)}observeMarkers(e){this._selection.observeMarkers(e)}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_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 is+e}static _isStoreAttributeKey(e){return e.startsWith(is)}}ns.prototype.is=function(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e};class rs extends Jo{constructor(e){super(),this.markers=new m.FE({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",((e,t)=>{const o=t[0];o.isDocumentOperation&&"marker"!=o.type&&"rename"!=o.type&&"noop"!=o.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))}),{priority:"lowest"}),this.on("change:range",(()=>{this._validateSelectionRanges(this.getRanges())})),this.listenTo(this._model.markers,"update",((e,t,o,s)=>{this._updateMarker(t,s)})),this.listenTo(this._document,"change",((e,t)=>{!function(e,t){const o=e.document.differ;for(const s of o.getChanges()){if("insert"!=s.type)continue;const o=s.position.parent;s.length===o.maxOffset&&e.enqueueChange(t,(e=>{const t=Array.from(o.getAttributeKeys()).filter((e=>e.startsWith(is)));for(const s of t)e.removeAttribute(s,o)}))}}(this._model,t)}))}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=s.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}})),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const o=t.name.split(":",1)[0];if(!this._observedMarkers.has(o))continue;const s=t.getRange();for(const o of this.getRanges())s.containsRange(o,!o.isCollapsed)&&e.push(t)}const o=Array.from(this.markers);for(const o of e)this.markers.has(o)||(this.markers.add(o),t=!0);for(const o of Array.from(this.markers))e.includes(o)||(this.markers.remove(o),t=!0);t&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateMarker(e,t){const o=e.name.split(":",1)[0];if(!this._observedMarkers.has(o))return;let s=!1;const i=Array.from(this.markers),n=this.markers.has(e);if(t){let o=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){o=!0;break}o&&!n?(this.markers.add(e),s=!0):!o&&n&&(this.markers.remove(e),s=!0)}else n&&(this.markers.remove(e),s=!0);s&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateAttributes(e){const t=(0,m.qL)(this._getSurroundingAttributes()),o=(0,m.qL)(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const s=[];for(const[e,t]of this.getAttributes())o.has(e)&&o.get(e)===t||s.push(e);for(const[e]of o)this.hasAttribute(e)||s.push(e);s.length>0&&this.fire("change:attribute",{attributeKeys:s,directChange:!1})}_setAttribute(e,t,o=!0){const s=o?"normal":"low";if("low"==s&&"normal"==this._attributePriority.get(e))return!1;return super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,s),!0)}_removeAttribute(e,t=!0){const o=t?"normal":"low";return("low"!=o||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,o),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[t,o]of this.getAttributes())e.get(t)!==o&&this._removeAttribute(t,!1);for(const[o,s]of e){this._setAttribute(o,s,!1)&&t.add(o)}return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(is)){const o=t.substr(is.length);yield[o,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let o=null;if(this.isCollapsed){const s=e.textNode?e.textNode:e.nodeBefore,i=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(o=as(s)),o||(o=as(i)),!this.isGravityOverridden&&!o){let e=s;for(;e&&!t.isInline(e)&&!o;)e=e.previousSibling,o=as(e)}if(!o){let e=i;for(;e&&!t.isInline(e)&&!o;)e=e.nextSibling,o=as(e)}o||(o=this.getStoredAttributes())}else{const e=this.getFirstRange();for(const s of e){if(s.item.is("element")&&t.isObject(s.item))break;if("text"==s.type){o=s.item.getAttributes();break}}}return o}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function as(e){return e instanceof jo||e instanceof Mo?e.getAttributes():null}class cs{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}const ls=function(e){return(0,_.Z)(e,5)};class ds extends cs{elementToElement(e){return this.add(function(e){const t=ps(e.model),o=fs(e.view,"container");t.attributes.length&&(t.children=!0);return s=>{s.on(`insert:${t.name}`,function(e,t=ys){return(o,s,i)=>{if(!t(s.item,i.consumable,{preflight:!0}))return;const n=e(s.item,i,s);if(!n)return;t(s.item,i.consumable);const r=i.mapper.toViewPosition(s.range.start);i.mapper.bindElements(s.item,n),i.writer.insert(r,n),i.convertAttributes(s.item),ks(n,s.item.getChildren(),i,{reconversion:s.reconversion})}}(o,ws(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&s.on("reduceChanges",_s(t),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){const t=ps(e.model),o=fs(e.view,"container");return t.children=!0,s=>{if(s._conversionApi.schema.checkChild(t.name,"$text"))throw new m.Bb("conversion-element-to-structure-disallowed-text",s,{elementName:t.name});var i,n;s.on(`insert:${t.name}`,(i=o,n=ws(t),(e,t,o)=>{if(!n(t.item,o.consumable,{preflight:!0}))return;const s=new Map;o.writer._registerSlotFactory(function(e,t,o){return(s,i="children")=>{const n=s.createContainerElement("$slot");let r=null;if("children"===i)r=Array.from(e.getChildren());else{if("function"!=typeof i)throw new m.Bb("conversion-slot-mode-unknown",o.dispatcher,{modeOrFilter:i});r=Array.from(e.getChildren()).filter((e=>i(e)))}return t.set(n,r),n}}(t.item,s,o));const r=i(t.item,o,t);if(o.writer._clearSlotFactory(),!r)return;!function(e,t,o){const s=Array.from(t.values()).flat(),i=new Set(s);if(i.size!=s.length)throw new m.Bb("conversion-slot-filter-overlap",o.dispatcher,{element:e});if(i.size!=e.childCount)throw new m.Bb("conversion-slot-filter-incomplete",o.dispatcher,{element:e})}(t.item,s,o),n(t.item,o.consumable);const a=o.mapper.toViewPosition(t.range.start);o.mapper.bindElements(t.item,r),o.writer.insert(a,r),o.convertAttributes(t.item),function(e,t,o,s){o.mapper.on("modelToViewPosition",r,{priority:"highest"});let i=null,n=null;for([i,n]of t)ks(e,n,o,s),o.writer.move(o.writer.createRangeIn(i),o.writer.createPositionBefore(i)),o.writer.remove(i);function r(e,t){const o=t.modelPosition.nodeAfter,s=n.indexOf(o);s<0||(t.viewPosition=t.mapper.findPositionIn(i,s))}o.mapper.off("modelToViewPosition",r)}(r,s,o,{reconversion:t.reconversion})}),{priority:e.converterPriority||"normal"}),s.on("reduceChanges",_s(t),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){e=ls(e);let t=e.model;"string"==typeof t&&(t={key:t});let o=`attribute:${t.key}`;t.name&&(o+=":"+t.name);if(t.values)for(const o of t.values)e.view[o]=fs(e.view[o],"attribute");else e.view=fs(e.view,"attribute");const s=gs(e);return t=>{t.on(o,function(e){return(t,o,s)=>{if(!s.consumable.test(o.item,t.name))return;const i=e(o.attributeOldValue,s,o),n=e(o.attributeNewValue,s,o);if(!i&&!n)return;s.consumable.consume(o.item,t.name);const r=s.writer,a=r.document.selection;if(o.item instanceof Jo||o.item instanceof ns)r.wrap(a.getFirstRange(),n);else{let e=s.mapper.toViewRange(o.range);null!==o.attributeOldValue&&i&&(e=r.unwrap(e,i)),null!==o.attributeNewValue&&n&&r.wrap(e,n)}}}(s),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=ls(e);let t=e.model;"string"==typeof t&&(t={key:t});let o=`attribute:${t.key}`;t.name&&(o+=":"+t.name);if(t.values)for(const o of t.values)e.view[o]=ms(e.view[o]);else e.view=ms(e.view);const s=gs(e);return t=>{var i;t.on(o,(i=s,(e,t,o)=>{if(!o.consumable.test(t.item,e.name))return;const s=i(t.attributeOldValue,o,t),n=i(t.attributeNewValue,o,t);if(!s&&!n)return;o.consumable.consume(t.item,e.name);const r=o.mapper.toViewElement(t.item),a=o.writer;if(!r)throw new m.Bb("conversion-attribute-to-attribute-on-text",o.dispatcher,t);if(null!==t.attributeOldValue&&s)if("class"==s.key){const e=(0,m.qo)(s.value);for(const t of e)a.removeClass(t,r)}else if("style"==s.key){const e=Object.keys(s.value);for(const t of e)a.removeStyle(t,r)}else a.removeAttribute(s.key,r);if(null!==t.attributeNewValue&&n)if("class"==n.key){const e=(0,m.qo)(n.value);for(const t of e)a.addClass(t,r)}else if("style"==n.key){const e=Object.keys(n.value);for(const t of e)a.setStyle(t,n.value[t],r)}else a.setAttribute(n.key,n.value,r)}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){const t=fs(e.view,"ui");return o=>{var s;o.on(`addMarker:${e.model}`,(s=t,(e,t,o)=>{t.isOpening=!0;const i=s(t,o);t.isOpening=!1;const n=s(t,o);if(!i||!n)return;const r=t.markerRange;if(r.isCollapsed&&!o.consumable.consume(r,e.name))return;for(const t of r)if(!o.consumable.consume(t.item,e.name))return;const a=o.mapper,c=o.writer;c.insert(a.toViewPosition(r.start),i),o.mapper.bindElementToMarker(i,t.markerName),r.isCollapsed||(c.insert(a.toViewPosition(r.end),n),o.mapper.bindElementToMarker(n,t.markerName)),e.stop()}),{priority:e.converterPriority||"normal"}),o.on(`removeMarker:${e.model}`,((e,t,o)=>{const s=o.mapper.markerNameToElements(t.markerName);if(s){for(const e of s)o.mapper.unbindElementFromMarkerName(e,t.markerName),o.writer.clear(o.writer.createRangeOn(e),e);o.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var o;t.on(`addMarker:${e.model}`,(o=e.view,(e,t,s)=>{if(!t.item)return;if(!(t.item instanceof Jo||t.item instanceof ns||t.item.is("$textProxy")))return;const i=bs(o,t,s);if(!i)return;if(!s.consumable.consume(t.item,e.name))return;const n=s.writer,r=hs(n,i),a=n.document.selection;if(t.item instanceof Jo||t.item instanceof ns)n.wrap(a.getFirstRange(),r);else{const e=s.mapper.toViewRange(t.range),o=n.wrap(e,r);for(const e of o.getItems())if(e.is("attributeElement")&&e.isSimilar(r)){s.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,function(e){return(t,o,s)=>{if(!o.item)return;if(!(o.item instanceof Bo))return;const i=bs(e,o,s);if(!i)return;if(!s.consumable.test(o.item,t.name))return;const n=s.mapper.toViewElement(o.item);if(n&&n.getCustomProperty("addHighlight")){s.consumable.consume(o.item,t.name);for(const e of Wo._createIn(o.item))s.consumable.consume(e.item,t.name);n.getCustomProperty("addHighlight")(n,i,s.writer),s.mapper.bindElementToMarker(n,o.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,function(e){return(t,o,s)=>{if(o.markerRange.isCollapsed)return;const i=bs(e,o,s);if(!i)return;const n=hs(s.writer,i),r=s.mapper.markerNameToElements(o.markerName);if(r){for(const e of r)if(s.mapper.unbindElementFromMarkerName(e,o.markerName),e.is("attributeElement"))s.writer.unwrap(s.writer.createRangeOn(e),n);else{e.getCustomProperty("removeHighlight")(e,i.id,s.writer)}s.writer.clearClonedElementsGroup(o.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){e=ls(e);const t=e.model;let o=e.view;o||(o=o=>({group:t,name:o.substr(e.model.length+1)}));return s=>{var i;s.on(`addMarker:${t}`,(i=o,(e,t,o)=>{const s=i(t.markerName,o);if(!s)return;const n=t.markerRange;o.consumable.consume(n,e.name)&&(us(n,!1,o,t,s),us(n,!0,o,t,s),e.stop())}),{priority:e.converterPriority||"normal"}),s.on(`removeMarker:${t}`,function(e){return(t,o,s)=>{const i=e(o.markerName,s);if(!i)return;const n=s.mapper.markerNameToElements(o.markerName);if(n){for(const e of n)s.mapper.unbindElementFromMarkerName(e,o.markerName),e.is("containerElement")?(r(`data-${i.group}-start-before`,e),r(`data-${i.group}-start-after`,e),r(`data-${i.group}-end-before`,e),r(`data-${i.group}-end-after`,e)):s.writer.clear(s.writer.createRangeOn(e),e);s.writer.clearClonedElementsGroup(o.markerName),t.stop()}function r(e,t){if(t.hasAttribute(e)){const o=new Set(t.getAttribute(e).split(","));o.delete(i.name),0==o.size?s.writer.removeAttribute(e,t):s.writer.setAttribute(e,Array.from(o).join(","),t)}}}}(o),{priority:e.converterPriority||"normal"})}}(e))}}function hs(e,t){const o=e.createAttributeElement("span",t.attributes);return t.classes&&o._addClass(t.classes),"number"==typeof t.priority&&(o._priority=t.priority),o._id=t.id,o}function us(e,t,o,s,i){const n=t?e.start:e.end,r=n.nodeAfter&&n.nodeAfter.is("element")?n.nodeAfter:null,a=n.nodeBefore&&n.nodeBefore.is("element")?n.nodeBefore:null;if(r||a){let e,n;t&&r||!t&&!a?(e=r,n=!0):(e=a,n=!1);const c=o.mapper.toViewElement(e);if(c)return void function(e,t,o,s,i,n){const r=`data-${n.group}-${t?"start":"end"}-${o?"before":"after"}`,a=e.hasAttribute(r)?e.getAttribute(r).split(","):[];a.unshift(n.name),s.writer.setAttribute(r,a.join(","),e),s.mapper.bindElementToMarker(e,i.markerName)}(c,t,n,o,s,i)}!function(e,t,o,s,i){const n=`${i.group}-${t?"start":"end"}`,r=i.name?{name:i.name}:null,a=o.writer.createUIElement(n,r);o.writer.insert(e,a),o.mapper.bindElementToMarker(a,s.markerName)}(o.mapper.toViewPosition(n),t,o,s,i)}function ps(e){return"string"==typeof e&&(e={name:e}),e.attributes?Array.isArray(e.attributes)||(e.attributes=[e.attributes]):e.attributes=[],e.children=!!e.children,e}function fs(e,t){return"function"==typeof e?e:(o,s)=>function(e,t,o){"string"==typeof e&&(e={name:e});let s;const i=t.writer,n=Object.assign({},e.attributes);if("container"==o)s=i.createContainerElement(e.name,n);else if("attribute"==o){const t={priority:e.priority||Ue.DEFAULT_PRIORITY};s=i.createAttributeElement(e.name,n,t)}else s=i.createUIElement(e.name,n);if(e.styles){const t=Object.keys(e.styles);for(const o of t)i.setStyle(o,e.styles[o],s)}if(e.classes){const t=e.classes;if("string"==typeof t)i.addClass(t,s);else for(const e of t)i.addClass(e,s)}return s}(e,s,t)}function gs(e){return e.model.values?(t,o,s)=>{const i=e.view[t];return i?i(t,o,s):null}:e.view}function ms(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function bs(e,t,o){const s="function"==typeof e?e(t,o):e;return s?(s.priority||(s.priority=10),s.id||(s.id=t.markerName),s):null}function _s(e){const t=function(e){return(t,o)=>{if(!t.is("element",e.name))return!1;if("attribute"==o.type){if(e.attributes.includes(o.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,o)=>{const s=[];o.reconvertedElements||(o.reconvertedElements=new Set);for(const e of o.changes){const i="attribute"==e.type?e.range.start.nodeAfter:e.position.parent;if(i&&t(i,e)){if(!o.reconvertedElements.has(i)){o.reconvertedElements.add(i);const e=Io._createBefore(i);s.push({type:"remove",name:i.name,position:e,length:1},{type:"reinsert",name:i.name,position:e,length:1})}}else s.push(e)}o.changes=s}}function ws(e){return(t,o,s={})=>{const i=["insert"];for(const o of e.attributes)t.hasAttribute(o)&&i.push(`attribute:${o}`);return!!i.every((e=>o.test(t,e)))&&(s.preflight||i.forEach((e=>o.consume(t,e))),!0)}}function ks(e,t,o,s){for(const i of t)vs(e.root,i,o,s)||o.convertItem(i)}function vs(e,t,o,s){const{writer:i,mapper:n}=o;if(!s.reconversion)return!1;const r=n.toViewElement(t);return!(!r||r.root==e)&&(!!o.canReuseView(r)&&(i.move(i.createRangeOn(r),n.toViewPosition(Io._createBefore(t))),!0))}function ys(e,t,{preflight:o}={}){return o?t.test(e,"insert"):t.consume(e,"insert")}function xs(e){const{schema:t,document:o}=e.model;for(const s of o.getRootNames()){const i=o.getRoot(s);if(i.isEmpty&&!t.checkChild(i,"$text")&&t.checkChild(i,"paragraph"))return e.insertElement("paragraph",i),!0}return!1}function Ps(e,t,o){const s=o.createContext(e);return!!o.checkChild(s,"paragraph")&&!!o.checkChild(s.push("paragraph"),t)}function Ts(e,t){const o=t.createElement("paragraph");return t.insert(o,e),t.createPositionAt(o,0)}class Cs extends cs{elementToElement(e){return this.add(As(e))}elementToAttribute(e){return this.add(function(e){e=ls(e),Rs(e);const t=Os(e,!1),o=Es(e.view),s=o?`element:${o}`:"element";return o=>{o.on(s,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=ls(e);let t=null;("string"==typeof e.view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key;let o;if("class"==t||"style"==t){o={["class"==t?"classes":"styles"]:e.view.value}}else{o={attributes:{[t]:void 0===e.view.value?/[\s\S]*/:e.view.value}}}e.view.name&&(o.name=e.view.name);return e.view=o,t}(e));Rs(e,t);const o=Os(e,!0);return t=>{t.on("element",o,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){const t=function(e){return(t,o)=>{const s="string"==typeof e?e:e(t,o);return o.writer.createElement("$marker",{"data-name":s})}}(e.model);return As({...e,model:t})}(e))}dataToMarker(e){return this.add(function(e){e=ls(e),e.model||(e.model=t=>t?e.view+":"+t:e.view);const t={view:e.view,model:e.model},o=Ss(Ms(t,"start")),s=Ss(Ms(t,"end"));return i=>{i.on(`element:${e.view}-start`,o,{priority:e.converterPriority||"normal"}),i.on(`element:${e.view}-end`,s,{priority:e.converterPriority||"normal"});const n=m.tA.get("low"),r=m.tA.get("highest"),a=m.tA.get(e.converterPriority)/r;i.on("element",function(e){return(t,o,s)=>{const i=`data-${e.view}`;function n(t,i){for(const n of i){const i=e.model(n,s),r=s.writer.createElement("$marker",{"data-name":i});s.writer.insert(r,t),o.modelCursor.isEqual(t)?o.modelCursor=o.modelCursor.getShiftedBy(1):o.modelCursor=o.modelCursor._getTransformedByInsertion(t,1),o.modelRange=o.modelRange._getTransformedByInsertion(t,1)[0]}}(s.consumable.test(o.viewItem,{attributes:i+"-end-after"})||s.consumable.test(o.viewItem,{attributes:i+"-start-after"})||s.consumable.test(o.viewItem,{attributes:i+"-end-before"})||s.consumable.test(o.viewItem,{attributes:i+"-start-before"}))&&(o.modelRange||Object.assign(o,s.convertChildren(o.viewItem,o.modelCursor)),s.consumable.consume(o.viewItem,{attributes:i+"-end-after"})&&n(o.modelRange.end,o.viewItem.getAttribute(i+"-end-after").split(",")),s.consumable.consume(o.viewItem,{attributes:i+"-start-after"})&&n(o.modelRange.end,o.viewItem.getAttribute(i+"-start-after").split(",")),s.consumable.consume(o.viewItem,{attributes:i+"-end-before"})&&n(o.modelRange.start,o.viewItem.getAttribute(i+"-end-before").split(",")),s.consumable.consume(o.viewItem,{attributes:i+"-start-before"})&&n(o.modelRange.start,o.viewItem.getAttribute(i+"-start-before").split(",")))}}(t),{priority:n+a})}}(e))}}function As(e){const t=Ss(e=ls(e)),o=Es(e.view),s=o?`element:${o}`:"element";return o=>{o.on(s,t,{priority:e.converterPriority||"normal"})}}function Es(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function Ss(e){const t=new P(e.view);return(o,s,i)=>{const n=t.match(s.viewItem);if(!n)return;const r=n.match;if(r.name=!0,!i.consumable.test(s.viewItem,r))return;const a=function(e,t,o){return e instanceof Function?e(t,o):o.writer.createElement(e)}(e.model,s.viewItem,i);a&&i.safeInsert(a,s.modelCursor)&&(i.consumable.consume(s.viewItem,r),i.convertChildren(s.viewItem,a),i.updateConversionResult(a,s))}}function Rs(e,t=null){const o=null===t||(e=>e.getAttribute(t)),s="object"!=typeof e.model?e.model:e.model.key,i="object"!=typeof e.model||void 0===e.model.value?o:e.model.value;e.model={key:s,value:i}}function Os(e,t){const o=new P(e.view);return(s,i,n)=>{if(!i.modelRange&&t)return;const r=o.match(i.viewItem);if(!r)return;if(!function(e,t){const o="function"==typeof e?e(t):e;if("object"==typeof o&&!Es(o))return!1;return!o.classes&&!o.attributes&&!o.styles}(e.view,i.viewItem)?delete r.match.name:r.match.name=!0,!n.consumable.test(i.viewItem,r.match))return;const a=e.model.key,c="function"==typeof e.model.value?e.model.value(i.viewItem,n):e.model.value;if(null===c)return;i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor));const l=function(e,t,o,s){let i=!1;for(const n of Array.from(e.getItems({shallow:o})))s.schema.checkAttribute(n,t.key)&&(i=!0,n.hasAttribute(t.key)||s.writer.setAttribute(t.key,t.value,n));return i}(i.modelRange,{key:a,value:c},t,n);l&&(n.consumable.test(i.viewItem,{name:!0})&&(r.match.name=!0),n.consumable.consume(i.viewItem,r.match))}}function Ms(e,t){return{view:`${e.view}-${t}`,model:(t,o)=>{const s=t.getAttribute("name"),i=e.model(s,o);return o.writer.createElement("$marker",{"data-name":i})}}}class js extends((0,m.Re)()){constructor(e,t){super(),this.model=e,this.view=new Eo(t),this.mapper=new Ho,this.downcastDispatcher=new Uo({mapper:this.mapper,schema:e.schema});const o=this.model.document,s=o.selection,i=this.model.markers;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(o,"change",(()=>{this.view.change((e=>{this.downcastDispatcher.convertChanges(o.differ,i,e),this.downcastDispatcher.convertSelection(s,i,e)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(o,s)=>{const i=s.newSelection,n=[];for(const e of i.getRanges())n.push(t.toModelRange(e));const r=e.createSelection(n,{backward:i.isBackward});r.isEqual(e.document.selection)||e.change((e=>{e.setSelection(r)}))}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",((e,t,o)=>{if(!o.consumable.consume(t.item,e.name))return;const s=o.writer,i=o.mapper.toViewPosition(t.range.start),n=s.createText(t.item.data);s.insert(i,n)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,o)=>{o.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||o.convertChildren(t.item)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((e,t,o)=>{const s=o.mapper.toViewPosition(t.position),i=t.position.getShiftedBy(t.length),n=o.mapper.toViewPosition(i,{isPhantom:!0}),r=o.writer.createRange(s,n),a=o.writer.remove(r.getTrimmed());for(const e of o.writer.createRangeIn(a).getItems())o.mapper.unbindViewElement(e,{defer:!0})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,o)=>{const s=o.writer,i=s.document.selection;for(const e of i.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&o.writer.mergeAttributes(e.start);s.setSelection(null)}),{priority:"high"}),this.downcastDispatcher.on("selection",((e,t,o)=>{const s=t.selection;if(s.isCollapsed)return;if(!o.consumable.consume(s,"selection"))return;const i=[];for(const e of s.getRanges())i.push(o.mapper.toViewRange(e));o.writer.setSelection(i,{backward:s.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,o)=>{const s=t.selection;if(!s.isCollapsed)return;if(!o.consumable.consume(s,"selection"))return;const i=o.writer,n=s.getFirstPosition(),r=o.mapper.toViewPosition(n),a=i.breakAttributes(r);i.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((e=>{if("$graveyard"==e.rootName)return null;const t=new Me(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t}))}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,o=this.model.markers.get(t);if(!o)throw new m.Bb("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change((()=>{this.model.markers._refresh(o)}))}reconvertItem(e){this.model.change((()=>{this.model.document.differ._refreshItem(e)}))}}class Bs{constructor(){this._consumables=new Map}add(e,t){let o;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?o=this._consumables.get(e):(o=new Vs(e),this._consumables.set(e,o)),o.add(t))}test(e,t){const o=this._consumables.get(e);return void 0===o?null:e.is("$text")||e.is("documentFragment")?o:o.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const o=this._consumables.get(e);void 0!==o&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):o.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},o=e.getAttributeKeys();for(const e of o)"style"!=e&&"class"!=e&&t.attributes.push(e);const s=e.getClassNames();for(const e of s)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 Bs),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,Bs.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const o of e.getChildren())t=Bs.createFrom(o,t);return t}}const Ns=["attributes","classes","styles"];class Vs{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t of Ns)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t of Ns)if(t in e){const o=this._test(t,e[t]);if(!0!==o)return o}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t of Ns)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t of Ns)t in e&&this._revert(t,e[t])}_add(e,t){const o=(0,E.Z)(t)?t:[t],s=this._consumables[e];for(const t of o){if("attributes"===e&&("class"===t||"style"===t))throw new m.Bb("viewconsumable-invalid-attribute",this);if(s.set(t,!0),"styles"===e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))s.set(e,!0)}}_test(e,t){const o=(0,E.Z)(t)?t:[t],s=this._consumables[e];for(const t of o)if("attributes"!==e||"class"!==t&&"style"!==t){const e=s.get(t);if(void 0===e)return null;if(!e)return!1}else{const e="class"==t?"classes":"styles",o=this._test(e,[...this._consumables[e].keys()]);if(!0!==o)return o}return!0}_consume(e,t){const o=(0,E.Z)(t)?t:[t],s=this._consumables[e];for(const t of o)if("attributes"!==e||"class"!==t&&"style"!==t){if(s.set(t,!1),"styles"==e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))s.set(e,!1)}else{const e="class"==t?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const o=(0,E.Z)(t)?t:[t],s=this._consumables[e];for(const t of o)if("attributes"!==e||"class"!==t&&"style"!==t){!1===s.get(t)&&s.set(t,!0)}else{const e="class"==t?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class Is extends((0,m.Re)()){constructor(){super(),this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((e,t)=>{t[0]=new Ds(t[0])}),{priority:"highest"}),this.on("checkChild",((e,t)=>{t[0]=new Ds(t[0]),t[1]=this.getDefinition(t[1])}),{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new m.Bb("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new m.Bb("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,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);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const o=this.getDefinition(e.last);return!!o&&o.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof Io){const t=e.nodeBefore,o=e.nodeAfter;if(!(t instanceof Bo))throw new m.Bb("schema-check-merge-no-element-before",this);if(!(o instanceof Bo))throw new m.Bb("schema-check-merge-no-element-after",this);return this.checkMerge(t,o)}for(const o of t.getChildren())if(!this.checkChild(e,o))return!1;return!0}addChildCheck(e){this.on("checkChild",((t,[o,s])=>{if(!s)return;const i=e(o,s);"boolean"==typeof i&&(t.stop(),t.return=i)}),{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",((t,[o,s])=>{const i=e(o,s);"boolean"==typeof i&&(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 Io)t=e.parent;else{t=(e instanceof Wo?[e]:Array.from(e.getRanges())).reduce(((e,t)=>{const o=t.getCommonAncestor();return e?e.getCommonAncestor(o,{includeSelf:!0}):o}),null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const o=[...e.getFirstPosition().getAncestors(),new Mo("",e.getAttributes())];return this.checkAttribute(o,t)}{const o=e.getRanges();for(const e of o)for(const o of e)if(this.checkAttribute(o.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const o of e)yield*this._getValidRangesForRange(o,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new Wo(e);let o,s;const i=e.getAncestors().reverse().find((e=>this.isLimit(e)))||e.root;"both"!=t&&"backward"!=t||(o=new No({boundaries:Wo._createIn(i),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(s=new No({boundaries:Wo._createIn(i),startPosition:e}));for(const e of function*(e,t){let o=!1;for(;!o;){if(o=!0,e){const t=e.next();t.done||(o=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(o=!1,yield{walker:t,value:e.value})}}}(o,s)){const t=e.walker==o?"elementEnd":"elementStart",s=e.value;if(s.type==t&&this.isObject(s.item))return Wo._createOn(s.item);if(this.checkChild(s.nextPosition,"$text"))return new Wo(s.nextPosition)}return null}findAllowedParent(e,t){let o=e.parent;for(;o;){if(this.checkChild(o,t))return o;if(this.isLimit(o))return null;o=o.parent}return null}setAllowedAttributes(e,t,o){const s=o.model;for(const[i,n]of Object.entries(t))s.schema.checkAttribute(e,i)&&o.setAttribute(i,n,e)}removeDisallowedAttributes(e,t){for(const o of e)if(o.is("$text"))Ys(this,o,t);else{const e=Wo._createIn(o).getPositions();for(const o of e){Ys(this,o.nodeBefore||o.parent,t)}}}getAttributesWithProperty(e,t,o){const s={};for(const[i,n]of e.getAttributes()){const e=this.getAttributeProperties(i);void 0!==e[t]&&(void 0!==o&&o!==e[t]||(s[i]=n))}return s}createContext(e){return new Ds(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,o=Object.keys(t);for(const s of o)e[s]=zs(t[s],s);for(const t of o)Fs(e,t);for(const t of o)Ls(e,t);for(const t of o)Zs(e,t);for(const t of o)Ws(e,t),Hs(e,t);for(const t of o)$s(e,t),qs(e,t),Us(e,t);this._compiledDefinitions=e}_checkContextMatch(e,t,o=t.length-1){const s=t.getItem(o);if(e.allowIn.includes(s.name)){if(0==o)return!0;{const e=this.getDefinition(s);return this._checkContextMatch(e,t,o-1)}}return!1}*_getValidRangesForRange(e,t){let o=e.start,s=e.start;for(const i of e.getItems({shallow:!0}))i.is("element")&&(yield*this._getValidRangesForRange(Wo._createIn(i),t)),this.checkAttribute(i,t)||(o.isEqual(s)||(yield new Wo(o,s)),o=Io._createAfter(i)),s=Io._createAfter(i);o.isEqual(s)||(yield new Wo(o,s))}}class Ds{constructor(e){if(e instanceof Ds)return e;let t;t="string"==typeof e?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(Js)}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 Ds([e]);return t._items=[...this._items,...t._items],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 zs(e,t){const o={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(e,t){for(const o of e){const e=Object.keys(o).filter((e=>e.startsWith("is")));for(const s of e)t[s]=!!o[s]}}(e,o),Ks(e,o,"allowIn"),Ks(e,o,"allowContentOf"),Ks(e,o,"allowWhere"),Ks(e,o,"allowAttributes"),Ks(e,o,"allowAttributesOf"),Ks(e,o,"allowChildren"),Ks(e,o,"inheritTypesFrom"),function(e,t){for(const o of e){const e=o.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}(e,o),o}function Fs(e,t){const o=e[t];for(const s of o.allowChildren){const o=e[s];o&&o.allowIn.push(t)}o.allowChildren.length=0}function Ls(e,t){for(const o of e[t].allowContentOf)if(e[o]){Gs(e,o).forEach((e=>{e.allowIn.push(t)}))}delete e[t].allowContentOf}function Zs(e,t){for(const o of e[t].allowWhere){const s=e[o];if(s){const o=s.allowIn;e[t].allowIn.push(...o)}}delete e[t].allowWhere}function Ws(e,t){for(const o of e[t].allowAttributesOf){const s=e[o];if(s){const o=s.allowAttributes;e[t].allowAttributes.push(...o)}}delete e[t].allowAttributesOf}function Hs(e,t){const o=e[t];for(const t of o.inheritTypesFrom){const s=e[t];if(s){const e=Object.keys(s).filter((e=>e.startsWith("is")));for(const t of e)t in o||(o[t]=s[t])}}delete o.inheritTypesFrom}function $s(e,t){const o=e[t],s=o.allowIn.filter((t=>e[t]));o.allowIn=Array.from(new Set(s))}function qs(e,t){const o=e[t];for(const s of o.allowIn){e[s].allowChildren.push(t)}}function Us(e,t){const o=e[t];o.allowAttributes=Array.from(new Set(o.allowAttributes))}function Ks(e,t,o){for(const s of e){const e=s[o];"string"==typeof e?t[o].push(e):Array.isArray(e)&&t[o].push(...e)}}function Gs(e,t){const o=e[t];return(s=e,Object.keys(s).map((e=>s[e]))).filter((e=>e.allowIn.includes(o.name)));var s}function Js(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function Ys(e,t,o){for(const s of t.getAttributeKeys())e.checkAttribute(t,s)||o.removeAttribute(s,t)}class Xs extends((0,m.ln)()){constructor(e){super(),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(e,t)=>this._convertItem(e,t),convertChildren:(e,t)=>this._convertChildren(e,t),safeInsert:(e,t)=>this._safeInsert(e,t),updateConversionResult:(e,t)=>this._updateConversionResult(e,t),splitToAllowedParent:(e,t)=>this._splitToAllowedParent(e,t),getSplitParts:e=>this._getSplitParts(e),keepEmptyElement:e=>this._keepEmptyElement(e)}}convert(e,t,o=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let o;for(const s of new Ds(e)){const e={};for(const t of s.getAttributeKeys())e[t]=s.getAttribute(t);const i=t.createElement(s.name,e);o&&t.insert(i,o),o=Io._createAt(i,0)}return o}(o,t),this.conversionApi.writer=t,this.conversionApi.consumable=Bs.createFrom(e),this.conversionApi.store={};const{modelRange:s}=this._convertItem(e,this._modelCursor),i=t.createDocumentFragment();if(s){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,i);i.markers=function(e,t){const o=new Set,s=new Map,i=Wo._createIn(e).getItems();for(const e of i)e.is("element","$marker")&&o.add(e);for(const e of o){const o=e.getAttribute("data-name"),i=t.createPositionBefore(e);s.has(o)?s.get(o).end=i.clone():s.set(o,new Wo(i.clone())),t.remove(e)}return s}(i,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,i}_convertItem(e,t){const o={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,o,this.conversionApi):e.is("$text")?this.fire("text",o,this.conversionApi):this.fire("documentFragment",o,this.conversionApi),o.modelRange&&!(o.modelRange instanceof Wo))throw new m.Bb("view-conversion-dispatcher-incorrect-result",this);return{modelRange:o.modelRange,modelCursor:o.modelCursor}}_convertChildren(e,t){let o=t.is("position")?t:Io._createAt(t,0);const s=new Wo(o);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,o);e.modelRange instanceof Wo&&(s.end=e.modelRange.end,o=e.modelCursor)}return{modelRange:s,modelCursor:o}}_safeInsert(e,t){const o=this._splitToAllowedParent(e,t);return!!o&&(this.conversionApi.writer.insert(e,o.position),!0)}_updateConversionResult(e,t){const o=this._getSplitParts(e),s=this.conversionApi.writer;t.modelRange||(t.modelRange=s.createRange(s.createPositionBefore(e),s.createPositionAfter(o[o.length-1])));const i=this._cursorParents.get(e);t.modelCursor=i?s.createPositionAt(i,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:o,writer:s}=this.conversionApi;let i=o.findAllowedParent(t,e);if(i){if(i===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(i)&&(i=null)}if(!i)return Ps(t,e,o)?{position:Ts(t,s)}:null;const n=this.conversionApi.writer.split(t,i),r=[];for(const e of n.range.getWalker())if("elementEnd"==e.type)r.push(e.item);else{const t=r.pop(),o=e.item;this._registerSplitPair(t,o)}const a=n.range.end.parent;return this._cursorParents.set(e,a),{position:n.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const o=this._splitParts.get(e);this._splitParts.set(t,o),o.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&!this._emptyElementsToKeep.has(t)&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}class Qs{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class ei{constructor(e){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new Vt(e,{renderingMode:"data"}),this.htmlWriter=new Qs}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){e.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),o=t.createDocumentFragment(),s=t.body.childNodes;for(;s.length>0;)o.appendChild(s[0]);return o}}class ti extends((0,m.ln)()){constructor(e,t){super(),this.model=e,this.mapper=new Ho,this.downcastDispatcher=new Uo({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",((e,t,o)=>{if(!o.consumable.consume(t.item,e.name))return;const s=o.writer,i=o.mapper.toViewPosition(t.range.start),n=s.createText(t.item.data);s.insert(i,n)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,o)=>{o.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||o.convertChildren(t.item)}),{priority:"lowest"}),this.upcastDispatcher=new Xs({schema:e.schema}),this.viewDocument=new qe(t),this.stylesProcessor=t,this.htmlProcessor=new ei(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new it(this.viewDocument),this.upcastDispatcher.on("text",((e,t,{schema:o,consumable:s,writer:i})=>{let n=t.modelCursor;if(!s.test(t.viewItem))return;if(!o.checkChild(n,"$text")){if(!Ps(n,"$text",o))return;if(0==t.viewItem.data.trim().length)return;n=Ts(n,i)}s.consume(t.viewItem);const r=i.createText(t.viewItem.data);i.insert(r,n),t.modelRange=i.createRange(n,n.getShiftedBy(r.offsetSize)),t.modelCursor=t.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((e,t,o)=>{if(!t.modelRange&&o.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:s}=o.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=s}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((e,t,o)=>{if(!t.modelRange&&o.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:s}=o.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=s}}),{priority:"lowest"}),(0,m.Re)().prototype.decorate.call(this,"init"),(0,m.Re)().prototype.decorate.call(this,"set"),(0,m.Re)().prototype.decorate.call(this,"get"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange({isUndoable:!1},xs)}),{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:o="empty"}=e;if(!this._checkIfRootsExists([t]))throw new m.Bb("datacontroller-get-non-existent-root",this);const s=this.model.document.getRoot(t);return"empty"!==o||this.model.hasContent(s,{ignoreWhitespaces:!0})?this.stringify(s,e):""}stringify(e,t={}){const o=this.toView(e,t);return this.processor.toData(o)}toView(e,t={}){const o=this.viewDocument,s=this._viewWriter;this.mapper.clearBindings();const i=Wo._createIn(e),n=new st(o);this.mapper.bindElements(e,n);const r=e.is("documentFragment")?e.markers:function(e){const t=[],o=e.root.document;if(!o)return new Map;const s=Wo._createIn(e);for(const e of o.model.markers){const o=e.getRange(),i=o.isCollapsed,n=o.start.isEqual(s.start)||o.end.isEqual(s.end);if(i&&n)t.push([e.name,o]);else{const i=s.getIntersection(o);i&&t.push([e.name,i])}}return t.sort((([e,t],[o,s])=>{if("after"!==t.end.compareWith(s.start))return 1;if("before"!==t.start.compareWith(s.end))return-1;switch(t.start.compareWith(s.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(s.end)){case"before":return 1;case"after":return-1;default:return o.localeCompare(e)}}})),new Map(t)}(e);return this.downcastDispatcher.convert(i,r,s,t),n}init(e){if(this.model.document.version)throw new m.Bb("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new m.Bb("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},(e=>{for(const o of Object.keys(t)){const s=this.model.document.getRoot(o);e.insert(this.parse(t[o],s),s,0)}})),Promise.resolve()}set(e,t={}){let o={};if("string"==typeof e?o.main=e:o=e,!this._checkIfRootsExists(Object.keys(o)))throw new m.Bb("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},(e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(o)){const s=this.model.document.getRoot(t);e.remove(e.createRangeIn(s)),e.insert(this.parse(o[t],s),s,0)}}))}parse(e,t="$root"){const o=this.processor.toView(e);return this.toModel(o,t)}toModel(e,t="$root"){return this.model.change((o=>this.upcastDispatcher.convert(e,o,t)))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}class oi{constructor(e,t){this._helpers=new Map,this._downcast=(0,m.qo)(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=(0,m.qo)(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const o=this._downcast.includes(t);if(!this._upcast.includes(t)&&!o)throw new m.Bb("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:o})}for(e){if(!this._helpers.has(e))throw new m.Bb("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:o}of si(e))this.for("upcast").elementToElement({model:t,view:o,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:o}of si(e))this.for("upcast").elementToAttribute({view:o,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:o}of si(e))this.for("upcast").attributeToAttribute({view:o,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:o}){if(this._helpers.has(e))throw new m.Bb("conversion-group-exists",this);const s=o?new ds(t):new Cs(t);this._helpers.set(e,s)}}function*si(e){if(e.model.values)for(const t of e.model.values){const o={key:e.model.key,value:t},s=e.view[t],i=e.upcastAlso?e.upcastAlso[t]:void 0;yield*ii(o,s,i)}else yield*ii(e.model,e.view,e.upcastAlso)}function*ii(e,t,o){if(yield{model:e,view:t},o)for(const t of(0,m.qo)(o))yield{model:e,view:t}}class ni{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function ri(e,t){const o=li(t),s=o.reduce(((e,t)=>e+t.offsetSize),0),i=e.parent;hi(e);const n=e.index;return i._insertChild(n,o),di(i,n+o.length),di(i,n),new Wo(e,e.getShiftedBy(s))}function ai(e){if(!e.isFlat)throw new m.Bb("operation-utils-remove-range-not-flat",this);const t=e.start.parent;hi(e.start),hi(e.end);const o=t._removeChildren(e.start.index,e.end.index-e.start.index);return di(t,e.start.index),o}function ci(e,t){if(!e.isFlat)throw new m.Bb("operation-utils-move-range-not-flat",this);const o=ai(e);return ri(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),o)}function li(e){const t=[];!function e(o){if("string"==typeof o)t.push(new Mo(o));else if(o instanceof jo)t.push(new Mo(o.data,o.getAttributes()));else if(o instanceof Ro)t.push(o);else if((0,m.TW)(o))for(const t of o)e(t)}(e);for(let e=1;ee.maxOffset)throw new m.Bb("move-operation-nodes-do-not-exist",this);if(e===t&&o=o&&this.targetPosition.path[e]e._clone(!0)))),t=new fi(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new Io(e,[0]);return new pi(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0)))),ri(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const o=[];for(const t of e.nodes)t.name?o.push(Bo.fromJSON(t)):o.push(Mo.fromJSON(t));const s=new fi(Io.fromJSON(e.position,t),o,e.baseVersion);return s.shouldReceiveAttributes=e.shouldReceiveAttributes,s}}class gi extends ni{constructor(e,t,o,s,i,n){super(n),this.name=e,this.oldRange=t?t.clone():null,this.newRange=o?o.clone():null,this.affectsData=i,this._markers=s}get type(){return"marker"}clone(){return new gi(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new gi(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){this.newRange?this._markers._set(this.name,this.newRange,!0,this.affectsData):this._markers._remove(this.name)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new gi(e.name,e.oldRange?Wo.fromJSON(e.oldRange,t):null,e.newRange?Wo.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}const mi=function(e,t){return bo(e,t)};class bi extends ni{constructor(e,t,o,s,i){super(i),this.range=e.clone(),this.key=t,this.oldValue=void 0===o?null:o,this.newValue=void 0===s?null:s}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new bi(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new bi(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new m.Bb("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!mi(e.getAttribute(this.key),this.oldValue))throw new m.Bb("attribute-operation-wrong-old-value",this,{item:e,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&e.hasAttribute(this.key))throw new m.Bb("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){mi(this.oldValue,this.newValue)||function(e,t,o){hi(e.start),hi(e.end);for(const s of e.getItems({shallow:!0})){const e=s.is("$textProxy")?s.textNode:s;null!==o?e._setAttribute(t,o):e._removeAttribute(t),di(e.parent,e.index)}di(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new bi(Wo.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class _i extends ni{get type(){return"noop"}clone(){return new _i(this.baseVersion)}getReversed(){return new _i(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}class wi extends ni{constructor(e,t,o,s){super(s),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=o}get type(){return"rename"}clone(){return new wi(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new wi(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Bo))throw new m.Bb("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new m.Bb("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new wi(Io.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class ki extends ni{constructor(e,t,o,s,i){super(i),this.root=e,this.key=t,this.oldValue=o,this.newValue=s}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new ki(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new ki(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new m.Bb("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new m.Bb("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new m.Bb("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new m.Bb("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new ki(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class vi extends ni{constructor(e,t,o,s,i){super(i),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=o.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=s.clone()}get type(){return"merge"}get deletionPosition(){return new Io(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Wo(this.sourcePosition,e)}clone(){return new vi(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),o=new Io(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new yi(e,this.howMany,o,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new m.Bb("merge-operation-source-position-invalid",this);if(!t.parent)throw new m.Bb("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new m.Bb("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;ci(Wo._createIn(e),this.targetPosition),ci(Wo._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const o=Io.fromJSON(e.sourcePosition,t),s=Io.fromJSON(e.targetPosition,t),i=Io.fromJSON(e.graveyardPosition,t);return new this(o,e.howMany,s,i,e.baseVersion)}}class yi extends ni{constructor(e,t,o,s,i){super(i),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=o,this.graveyardPosition=s?s.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new Io(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Wo(this.splitPosition,e)}clone(){return new yi(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new Io(e,[0]);return new vi(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const s=e.range.getDifference(t.range).map((t=>new bi(t,e.key,e.oldValue,e.newValue,0))),i=e.range.getIntersection(t.range);return i&&o.aIsStrong&&s.push(new bi(i,t.key,t.newValue,e.newValue,0)),0==s.length?[new _i(0)]:s}return[e]})),Ci(bi,fi,((e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const o=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map((t=>new bi(t,e.key,e.oldValue,e.newValue,e.baseVersion)));if(t.shouldReceiveAttributes){const s=ji(t,e.key,e.oldValue);s&&o.unshift(s)}return o}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]})),Ci(bi,vi,((e,t)=>{const o=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&o.push(Wo._createFromPositionAndShift(t.graveyardPosition,1));const s=e.range._getTransformedByMergeOperation(t);return s.isCollapsed||o.push(s),o.map((t=>new bi(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),Ci(bi,pi,((e,t)=>function(e,t){const o=Wo._createFromPositionAndShift(t.sourcePosition,t.howMany);let s=null,i=[];o.containsRange(e,!0)?s=e:e.start.hasSameParentAs(o.start)?(i=e.getDifference(o),s=e.getIntersection(o)):i=[e];const n=[];for(let e of i){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const o=t.getMovedRangeStart(),s=e.start.hasSameParentAs(o),i=e._getTransformedByInsertion(o,t.howMany,s);n.push(...i)}s&&n.push(s._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return n}(e.range,t).map((t=>new bi(t,e.key,e.oldValue,e.newValue,e.baseVersion))))),Ci(bi,yi,((e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const o=e.clone();return o.range=new Wo(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,o]}return e.range=e.range._getTransformedBySplitOperation(t),[e]})),Ci(fi,bi,((e,t)=>{const o=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const s=ji(e,t.key,t.newValue);s&&o.push(s)}return o})),Ci(fi,fi,((e,t,o)=>(e.position.isEqual(t.position)&&o.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e]))),Ci(fi,pi,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),Ci(fi,yi,((e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]))),Ci(fi,vi,((e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]))),Ci(gi,fi,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]))),Ci(gi,gi,((e,t,o)=>{if(e.name==t.name){if(!o.aIsStrong)return[new _i(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]})),Ci(gi,vi,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]))),Ci(gi,pi,((e,t,o)=>{if(e.oldRange&&(e.oldRange=Wo._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(o.abRelation){const s=Wo._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==o.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.end=s.end,e.newRange.start.path=o.abRelation.path,[e];if("right"==o.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=s.start,e.newRange.end.path=o.abRelation.path,[e]}e.newRange=Wo._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]})),Ci(gi,yi,((e,t,o)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(o.abRelation){const s=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&o.abRelation.wasStartBeforeMergedElement?e.newRange.start=Io._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!o.abRelation.wasInLeftElement&&(e.newRange.start=Io._createAt(t.moveTargetPosition)),e.newRange.end.isEqual(t.splitPosition)&&o.abRelation.wasInRightElement?e.newRange.end=Io._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&o.abRelation.wasEndBeforeMergedElement?e.newRange.end=Io._createAt(t.insertionPosition):e.newRange.end=s.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]})),Ci(vi,fi,((e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]))),Ci(vi,vi,((e,t,o)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(o.bWasUndone){const o=t.graveyardPosition.path.slice();return o.push(0),e.sourcePosition=new Io(t.graveyardPosition.root,o),e.howMany=0,[e]}return[new _i(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!o.bWasUndone&&"splitAtSource"!=o.abRelation){const s="$graveyard"==e.targetPosition.root.rootName,i="$graveyard"==t.targetPosition.root.rootName;if(i&&!s||!(s&&!i)&&o.aIsStrong){const o=t.targetPosition._getTransformedByMergeOperation(t),s=e.targetPosition._getTransformedByMergeOperation(t);return[new pi(o,e.howMany,s,0)]}return[new _i(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&o.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),Ci(vi,pi,((e,t,o)=>{const s=Wo._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!o.bWasUndone&&!o.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&s.containsPosition(e.sourcePosition)?[new _i(0)]:(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])})),Ci(vi,yi,((e,t,o)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){const s=0!=t.howMany,i=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(s||i||"mergeTargetNotMoved"==o.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==o.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==o.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),Ci(pi,fi,((e,t)=>{const o=Wo._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=o.start,e.howMany=o.end.offset-o.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),Ci(pi,pi,((e,t,o)=>{const s=Wo._createFromPositionAndShift(e.sourcePosition,e.howMany),i=Wo._createFromPositionAndShift(t.sourcePosition,t.howMany);let n,r=o.aIsStrong,a=!o.aIsStrong;if("insertBefore"==o.abRelation||"insertAfter"==o.baRelation?a=!0:"insertAfter"!=o.abRelation&&"insertBefore"!=o.baRelation||(a=!1),n=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Bi(e,t)&&Bi(t,e))return[t.getReversed()];if(s.containsPosition(t.targetPosition)&&s.containsRange(i,!0))return s.start=s.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),s.end=s.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Ni([s],n);if(i.containsPosition(e.targetPosition)&&i.containsRange(s,!0))return s.start=s.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),s.end=s.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Ni([s],n);const c=(0,m.Rt)(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return s.start=s.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),s.end=s.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Ni([s],n);"remove"!=e.type||"remove"==t.type||o.aWasUndone||o.forceWeakRemove?"remove"==e.type||"remove"!=t.type||o.bWasUndone||o.forceWeakRemove||(r=!1):r=!0;const l=[],d=s.getDifference(i);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const o="same"==(0,m.Rt)(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),s=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,o);l.push(...s)}const h=s.getIntersection(i);return null!==h&&r&&(h.start=h.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),h.end=h.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===l.length?l.push(h):1==l.length?i.start.isBefore(s.start)||i.start.isEqual(s.start)?l.unshift(h):l.push(h):l.splice(1,0,h)),0===l.length?[new _i(e.baseVersion)]:Ni(l,n)})),Ci(pi,yi,((e,t,o)=>{let s=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=o.abRelation||(s=e.targetPosition._getTransformedBySplitOperation(t));const i=Wo._createFromPositionAndShift(e.sourcePosition,e.howMany);if(i.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=s,[e];if(i.start.hasSameParentAs(t.splitPosition)&&i.containsPosition(t.splitPosition)){let e=new Wo(t.splitPosition,i.end);e=e._getTransformedBySplitOperation(t);return Ni([new Wo(i.start,t.splitPosition),e],s)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==o.abRelation&&(s=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==o.abRelation&&(s=e.targetPosition);const n=[i._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const s=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);e.howMany>1&&s&&!o.aWasUndone&&n.push(Wo._createFromPositionAndShift(t.insertionPosition,1))}return Ni(n,s)})),Ci(pi,vi,((e,t,o)=>{const s=Wo._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&s.containsPosition(t.sourcePosition))if("remove"!=e.type||o.forceWeakRemove){if(1==e.howMany)return o.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new _i(0)]}else if(!o.aWasUndone){const o=[];let s=t.graveyardPosition.clone(),i=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(o.push(new pi(e.sourcePosition,e.howMany-1,e.targetPosition,0)),s=s._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));const n=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),r=new pi(s,1,n,0),a=r.getMovedRangeStart().path.slice();a.push(0);const c=new Io(r.targetPosition.root,a);i=i._getTransformedByMove(s,n,1);const l=new pi(i,t.howMany,c,0);return o.push(r),o.push(l),o}const i=Wo._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),Ci(wi,fi,((e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]))),Ci(wi,vi,((e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]))),Ci(wi,pi,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),Ci(wi,wi,((e,t,o)=>{if(e.position.isEqual(t.position)){if(!o.aIsStrong)return[new _i(0)];e.oldName=t.newName}return[e]})),Ci(wi,yi,((e,t)=>{const o=e.position.path,s=t.splitPosition.getParentPath();if("same"==(0,m.Rt)(o,s)&&!t.graveyardPosition){const t=new wi(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),Ci(ki,ki,((e,t,o)=>{if(e.root===t.root&&e.key===t.key){if(!o.aIsStrong||e.newValue===t.newValue)return[new _i(0)];e.oldValue=t.newValue}return[e]})),Ci(yi,fi,((e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!o.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const o=t.graveyardPosition.path.slice();o.push(0);const s=new Io(t.graveyardPosition.root,o),i=yi.getInsertionPosition(new Io(t.graveyardPosition.root,o)),n=new yi(s,0,i,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=yi.getInsertionPosition(e.splitPosition),e.graveyardPosition=n.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[n,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=yi.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),Ci(yi,pi,((e,t,o)=>{const s=Wo._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const i=s.start.isEqual(e.graveyardPosition)||s.containsPosition(e.graveyardPosition);if(!o.bWasUndone&&i){const o=e.splitPosition._getTransformedByMoveOperation(t),s=e.graveyardPosition._getTransformedByMoveOperation(t),i=s.path.slice();i.push(0);const n=new Io(s.root,i);return[new pi(o,e.howMany,n,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const i=e.splitPosition.isEqual(t.targetPosition);if(i&&("insertAtSource"==o.baRelation||"splitBefore"==o.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=yi.getInsertionPosition(e.splitPosition),[e];if(i&&o.abRelation&&o.abRelation.howMany){const{howMany:t,offset:s}=o.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(s),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&s.containsPosition(e.splitPosition)){const o=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=o,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new _i(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new _i(0)];if("splitBefore"==o.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const s="$graveyard"==e.splitPosition.root.rootName,i="$graveyard"==t.splitPosition.root.rootName;if(i&&!s||!(s&&!i)&&o.aIsStrong){const o=[];return t.howMany&&o.push(new pi(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&o.push(new pi(e.splitPosition,e.howMany,e.moveTargetPosition,0)),o}return[new _i(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==o.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==o.baRelation){const o=t.insertionPosition.path.slice();o.push(0);const s=new Io(t.insertionPosition.root,o);return[e,new pi(e.insertionPosition,1,s,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset{const o=t[0];o.isDocumentOperation&&Di.call(this,o)}),{priority:"low"})}function Di(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)}}Vi.prototype.is=function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e};class zi{constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},(0,m.KE)("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:o=!0,isUndo:s=!1,isTyping:i=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=o,this.isUndo=s,this.isTyping=i}get type(){return(0,m.KE)("batch-type-deprecated"),"default"}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class Fi{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,this._refreshedItems=new Set}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}bufferOperation(e){const t=e;switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),o=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),o||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=Wo._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const o=t.graveyardPosition.parent;this._markInsert(o,t.graveyardPosition.offset,1);const s=t.targetPosition.parent;this._isInInsertedElement(s)||this._markInsert(s,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,o){const s=this._changedMarkers.get(e);s?(s.newMarkerData=o,null==s.oldMarkerData.range&&null==o.range&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{newMarkerData:o,oldMarkerData:t})}getMarkersToRemove(){const e=[];for(const[t,o]of this._changedMarkers)null!=o.oldMarkerData.range&&e.push({name:t,range:o.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,o]of this._changedMarkers)null!=o.newMarkerData.range&&e.push({name:t,range:o.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map((([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}})))}hasDataChanges(){if(this._changesInElement.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const o=e.range&&!t.range,s=!e.range&&t.range,i=e.range&&t.range&&!e.range.isEqual(t.range);if(o||s||i)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const o=this._changesInElement.get(e).sort(((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamee));for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(Wi),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e);const t=Wo._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_markInsert(e,t,o){const s={type:"insert",offset:t,howMany:o,count:this._changeCount++};this._markChange(e,s)}_markRemove(e,t,o){const s={type:"remove",offset:t,howMany:o,count:this._changeCount++};this._markChange(e,s),this._removeAllNestedChanges(e,t,o)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const o=this._getChangesForElement(e);this._handleChange(t,o),o.push(t);for(let e=0;eo.offset){if(s>i){const e={type:"attribute",offset:i,howMany:s-i,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=o.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=o.offset&&e.offseti?(e.nodesToHandle=s-i,e.offset=i):e.nodesToHandle=0);if("remove"==o.type&&e.offseto.offset){const i={type:"attribute",offset:o.offset,howMany:s-o.offset,count:this._changeCount++};this._handleChange(i,t),t.push(i),e.nodesToHandle=o.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==o.type&&(e.offset>=o.offset&&s<=i?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=o.offset&&s>=i&&(o.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,o){return{type:"insert",position:Io._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,o){return{type:"remove",position:Io._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,o){const s=[];o=new Map(o);for(const[i,n]of t){const t=o.has(i)?o.get(i):null;t!==n&&s.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:i,attributeOldValue:n,attributeNewValue:t,changeCount:this._changeCount++}),o.delete(i)}for(const[t,i]of o)s.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:i,changeCount:this._changeCount++});return s}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const o=this._changesInElement.get(t),s=e.startOffset;if(o)for(const e of o)if("insert"==e.type&&s>=e.offset&&ss){for(let t=0;tthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new m.Bb("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const o=this._operations[0];void 0===e&&(e=o.baseVersion);let s=t-1;for(const[t,o]of this._gaps)e>t&&et&&sthis.lastOperation.baseVersion)return[];let i=this._baseVersionToOperationIndex.get(e);void 0===i&&(i=0);let n=this._baseVersionToOperationIndex.get(s);return void 0===n&&(n=this._operations.length-1),this._operations.slice(i,n+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(void 0!==t)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class $i extends Bo{constructor(e,t,o="main"){super(t),this._document=e,this.rootName=o}get document(){return this._document}toJSON(){return this.rootName}}$i.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e};const qi="$graveyard";class Ui extends((0,m.ln)()){constructor(e){super(),this.model=e,this.history=new Hi,this.selection=new ns(this),this.roots=new m.FE({idProperty:"rootName"}),this.differ=new Fi(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",qi),this.listenTo(e,"applyOperation",((e,t)=>{const o=t[0];o.isDocumentOperation&&this.differ.bufferOperation(o)}),{priority:"high"}),this.listenTo(e,"applyOperation",((e,t)=>{const o=t[0];o.isDocumentOperation&&this.history.addOperation(o)}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(e.markers,"update",((e,t,o,s,i)=>{const n={...t.getData(),range:s};this.differ.bufferMarkerChange(t.name,i,n),null===o&&t.on("change",((e,o)=>{const s=t.getData();this.differ.bufferMarkerChange(t.name,{...s,range:o},s)}))}))}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(qi)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new m.Bb("model-document-createroot-name-exists",this,{name:t});const o=new $i(this,e,t);return this.roots.add(o),o}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!=qi))}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=w(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_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(),t=this.model,o=t.schema,s=t.createPositionFromPath(e,[0]);return o.getNearestSelectionRange(s)||t.createRange(s)}_validateSelectionRange(e){return Ki(e.start)&&Ki(e.end)}_callPostFixers(e){let t=!1;do{for(const o of this._postFixers)if(this.selection.refresh(),t=o(e),t)break}while(t)}}function Ki(e){const t=e.textNode;if(t){const o=t.data,s=e.offset-t.startOffset;return!(0,m.to)(o,s)&&!(0,m.pp)(o,s)}return!0}class Gi extends((0,m.ln)()){constructor(){super(),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Ji?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,o=!1,s=!1){const i=e instanceof Ji?e.name:e;if(i.includes(","))throw new m.Bb("markercollection-incorrect-marker-name",this);const n=this._markers.get(i);if(n){const e=n.getData(),r=n.getRange();let a=!1;return r.isEqual(t)||(n._attachLiveRange(ts.fromRange(t)),a=!0),o!=n.managedUsingOperations&&(n._managedUsingOperations=o,a=!0),"boolean"==typeof s&&s!=n.affectsData&&(n._affectsData=s,a=!0),a&&this.fire(`update:${i}`,n,r,t,e),n}const r=ts.fromRange(t),a=new Ji(i,r,o,s);return this._markers.set(i,a),this.fire(`update:${i}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof Ji?e.name:e,o=this._markers.get(t);return!!o&&(this._markers.delete(t),this.fire(`update:${t}`,o,o.getRange(),null,o.getData()),this._destroyMarker(o),!0)}_refresh(e){const t=e instanceof Ji?e.name:e,o=this._markers.get(t);if(!o)throw new m.Bb("markercollection-refresh-marker-not-exists",this);const s=o.getRange();this.fire(`update:${t}`,o,s,s,o.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(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())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class Ji extends((0,m.ln)(So)){constructor(e,t,o,s){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=o,this._affectsData=s}get managedUsingOperations(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Ji.prototype.is=function(e){return"marker"===e||"model:marker"===e};class Yi extends ni{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new m.Bb("detach-operation-on-document-node",this)}_execute(){ai(Wo._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Xi extends So{constructor(e){super(),this.markers=new Map,this._children=new Oo,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 0===this.childCount}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}getAncestors(){return[]}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 o of e)t=t.getChild(t.offsetToIndex(o));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 o of e)o.name?t.push(Bo.fromJSON(o)):t.push(Mo.fromJSON(o));return new Xi(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const o=function(e){if("string"==typeof e)return[new Mo(e)];(0,m.TW)(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new Mo(e):e instanceof jo?new Mo(e.data,e.getAttributes()):e))}(t);for(const e of o)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,o)}_removeChildren(e,t=1){const o=this._children._removeNodes(e,t);for(const e of o)e.parent=null;return o}}Xi.prototype.is=function(e){return"documentFragment"===e||"model:documentFragment"===e};class Qi{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Mo(e,t)}createElement(e,t){return new Bo(e,t)}createDocumentFragment(){return new Xi}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,o=0){if(this._assertWriterUsedCorrectly(),e instanceof Mo&&""==e.data)return;const s=Io._createAt(t,o);if(e.parent){if(nn(e.root,s.root))return void this.move(Wo._createOn(e),s);if(e.root.document)throw new m.Bb("model-writer-insert-forbidden-move",this);this.remove(e)}const i=s.root.document?s.root.document.version:null,n=new fi(s,e,i);if(e instanceof Mo&&(n.shouldReceiveAttributes=!0),this.batch.addOperation(n),this.model.applyOperation(n),e instanceof Xi)for(const[t,o]of e.markers){const e=Io._createAt(o.root,0),i={range:new Wo(o.start._getCombined(e,s),o.end._getCombined(e,s)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,i):this.addMarker(t,i)}}insertText(e,t,o,s){t instanceof Xi||t instanceof Bo||t instanceof Io?this.insert(this.createText(e),t,o):this.insert(this.createText(e,t),o,s)}insertElement(e,t,o,s){t instanceof Xi||t instanceof Bo||t instanceof Io?this.insert(this.createElement(e),t,o):this.insert(this.createElement(e,t),o,s)}append(e,t){this.insert(e,t,"end")}appendText(e,t,o){t instanceof Xi||t instanceof Bo?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),o,"end")}appendElement(e,t,o){t instanceof Xi||t instanceof Bo?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),o,"end")}setAttribute(e,t,o){if(this._assertWriterUsedCorrectly(),o instanceof Wo){const s=o.getMinimalFlatRanges();for(const o of s)en(this,e,t,o)}else tn(this,e,t,o)}setAttributes(e,t){for(const[o,s]of(0,m.qL)(e))this.setAttribute(o,s,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof Wo){const o=t.getMinimalFlatRanges();for(const t of o)en(this,e,null,t)}else tn(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof Wo)for(const o of e.getItems())t(o);else t(e)}move(e,t,o){if(this._assertWriterUsedCorrectly(),!(e instanceof Wo))throw new m.Bb("writer-move-invalid-range",this);if(!e.isFlat)throw new m.Bb("writer-move-range-not-flat",this);const s=Io._createAt(t,o);if(s.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!nn(e.root,s.root))throw new m.Bb("writer-move-different-document",this);const i=e.root.document?e.root.document.version:null,n=new pi(e.start,e.end.offset-e.start.offset,s,i);this.batch.addOperation(n),this.model.applyOperation(n)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof Wo?e:Wo._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),sn(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,o=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Bo))throw new m.Bb("writer-merge-no-element-before",this);if(!(o instanceof Bo))throw new m.Bb("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,o){return this.model.createPositionFromPath(e,t,o)}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){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,o=e.nodeAfter;this.move(Wo._createIn(o),Io._createAt(t,"end")),this.remove(o)}_merge(e){const t=Io._createAt(e.nodeBefore,"end"),o=Io._createAt(e.nodeAfter,0),s=e.root.document.graveyard,i=new Io(s,[0]),n=e.root.document.version,r=new vi(o,e.nodeAfter.maxOffset,t,i,n);this.batch.addOperation(r),this.model.applyOperation(r)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Bo))throw new m.Bb("writer-rename-not-element-instance",this);const o=e.root.document?e.root.document.version:null,s=new wi(Io._createBefore(e),e.name,t,o);this.batch.addOperation(s),this.model.applyOperation(s)}split(e,t){this._assertWriterUsedCorrectly();let o,s,i=e.parent;if(!i.parent)throw new m.Bb("writer-split-element-no-parent",this);if(t||(t=i.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new m.Bb("writer-split-invalid-limit-element",this);do{const t=i.root.document?i.root.document.version:null,n=i.maxOffset-e.offset,r=yi.getInsertionPosition(e),a=new yi(e,n,r,null,t);this.batch.addOperation(a),this.model.applyOperation(a),o||s||(o=i,s=e.parent.nextSibling),i=(e=this.createPositionAfter(e.parent)).parent}while(i!==t);return{position:e,range:new Wo(Io._createAt(o,"end"),Io._createAt(s,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new m.Bb("writer-wrap-range-not-flat",this);const o=t instanceof Bo?t:new Bo(t);if(o.childCount>0)throw new m.Bb("writer-wrap-element-not-empty",this);if(null!==o.parent)throw new m.Bb("writer-wrap-element-attached",this);this.insert(o,e.start);const s=new Wo(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(s,Io._createAt(o,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new m.Bb("writer-unwrap-element-no-parent",this);this.move(Wo._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new m.Bb("writer-addmarker-no-usingoperation",this);const o=t.usingOperation,s=t.range,i=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new m.Bb("writer-addmarker-marker-exists",this);if(!s)throw new m.Bb("writer-addmarker-no-range",this);return o?(on(this,e,null,s,i),this.model.markers.get(e)):this.model.markers._set(e,s,o,i)}updateMarker(e,t){this._assertWriterUsedCorrectly();const o="string"==typeof e?e:e.name,s=this.model.markers.get(o);if(!s)throw new m.Bb("writer-updatemarker-marker-not-exists",this);if(!t)return(0,m.KE)("writer-updatemarker-reconvert-using-editingcontroller",{markerName:o}),void this.model.markers._refresh(s);const i="boolean"==typeof t.usingOperation,n="boolean"==typeof t.affectsData,r=n?t.affectsData:s.affectsData;if(!i&&!t.range&&!n)throw new m.Bb("writer-updatemarker-wrong-options",this);const a=s.getRange(),c=t.range?t.range:a;i&&t.usingOperation!==s.managedUsingOperations?t.usingOperation?on(this,o,null,c,r):(on(this,o,a,null,r),this.model.markers._set(o,c,void 0,r)):s.managedUsingOperations?on(this,o,a,c,r):this.model.markers._set(o,c,void 0,r)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new m.Bb("writer-removemarker-no-marker",this);const o=this.model.markers.get(t);if(!o.managedUsingOperations)return void this.model.markers._remove(t);on(this,t,o.getRange(),null,o.affectsData)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,o]of(0,m.qL)(e))this._setSelectionAttribute(t,o)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)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 o=this.model.document.selection;if(o.isCollapsed&&o.anchor.parent.isEmpty){const s=ns._getStoreAttributeKey(e);this.setAttribute(s,t,o.anchor.parent)}o._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const o=ns._getStoreAttributeKey(e);this.removeAttribute(o,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new m.Bb("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const o of this.model.markers){if(!o.managedUsingOperations)continue;const s=o.getRange();let i=!1;if("move"===e){const e=t;i=e.containsPosition(s.start)||e.start.isEqual(s.start)||e.containsPosition(s.end)||e.end.isEqual(s.end)}else{const e=t,o=e.nodeBefore,n=e.nodeAfter,r=s.start.parent==o&&s.start.isAtEnd,a=s.end.parent==n&&0==s.end.offset,c=s.end.nodeAfter==n,l=s.start.nodeAfter==n;i=r||a||c||l}i&&this.updateMarker(o.name,{range:s})}}}function en(e,t,o,s){const i=e.model,n=i.document;let r,a,c,l=s.start;for(const e of s.getWalker({shallow:!0}))c=e.item.getAttribute(t),r&&a!=c&&(a!=o&&d(),l=r),r=e.nextPosition,a=c;function d(){const s=new Wo(l,r),c=s.root.document?n.version:null,d=new bi(s,t,a,o,c);e.batch.addOperation(d),i.applyOperation(d)}r instanceof Io&&r!=l&&a!=o&&d()}function tn(e,t,o,s){const i=e.model,n=i.document,r=s.getAttribute(t);let a,c;if(r!=o){if(s.root===s){const e=s.document?n.version:null;c=new ki(s,t,r,o,e)}else{a=new Wo(Io._createBefore(s),e.createPositionAfter(s));const i=a.root.document?n.version:null;c=new bi(a,t,r,o,i)}e.batch.addOperation(c),i.applyOperation(c)}}function on(e,t,o,s,i){const n=e.model,r=n.document,a=new gi(t,o,s,n.markers,!!i,r.version);e.batch.addOperation(a),n.applyOperation(a)}function sn(e,t,o,s){let i;if(e.root.document){const o=s.document,n=new Io(o.graveyard,[0]);i=new pi(e,t,n,o.version)}else i=new Yi(e,t);o.addOperation(i),s.applyOperation(i)}function nn(e,t){return e===t||e instanceof $i&&t instanceof $i}function rn(e){e.document.registerPostFixer((t=>function(e,t){const o=t.document.selection,s=t.schema,i=[];let n=!1;for(const e of o.getRanges()){const t=an(e,s);t&&!t.isEqual(e)?(i.push(t),n=!0):i.push(e)}n&&e.setSelection(function(e){const t=[...e],o=new Set;let s=1;for(;s!o.has(t)))}(i),{backward:o.isBackward});return!1}(t,e)))}function an(e,t){return e.isCollapsed?function(e,t){const o=e.start,s=t.getNearestSelectionRange(o);if(!s){const e=o.getAncestors().reverse().find((e=>t.isObject(e)));return e?Wo._createOn(e):null}if(!s.isCollapsed)return s;const i=s.start;if(o.isEqual(i))return null;return new Wo(i)}(e,t):function(e,t){const{start:o,end:s}=e,i=t.checkChild(o,"$text"),n=t.checkChild(s,"$text"),r=t.getLimitElement(o),a=t.getLimitElement(s);if(r===a){if(i&&n)return null;if(function(e,t,o){const s=e.nodeAfter&&!o.isLimit(e.nodeAfter)||o.checkChild(e,"$text"),i=t.nodeBefore&&!o.isLimit(t.nodeBefore)||o.checkChild(t,"$text");return s||i}(o,s,t)){const e=o.nodeAfter&&t.isSelectable(o.nodeAfter)?null:t.getNearestSelectionRange(o,"forward"),i=s.nodeBefore&&t.isSelectable(s.nodeBefore)?null:t.getNearestSelectionRange(s,"backward"),n=e?e.start:o,r=i?i.end:s;return new Wo(n,r)}}const c=r&&!r.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const e=o.nodeAfter&&s.nodeBefore&&o.nodeAfter.parent===s.nodeBefore.parent,i=c&&(!e||!ln(o.nodeAfter,t)),n=l&&(!e||!ln(s.nodeBefore,t));let d=o,h=s;return i&&(d=Io._createBefore(cn(r,t))),n&&(h=Io._createAfter(cn(a,t))),new Wo(d,h)}return null}(e,t)}function cn(e,t){let o=e,s=o;for(;t.isLimit(s)&&s.parent;)o=s,s=s.parent;return o}function ln(e,t){return e&&t.isSelectable(e)}function dn(e,t,o={}){if(t.isCollapsed)return;const s=t.getFirstRange();if("$graveyard"==s.root.rootName)return;const i=e.schema;e.change((e=>{if(!o.doNotResetEntireContent&&function(e,t){const o=e.getLimitElement(t);if(!t.containsEntireContent(o))return!1;const s=t.getFirstRange();if(s.start.parent==s.end.parent)return!1;return e.checkChild(o,"paragraph")}(i,t))return void function(e,t){const o=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(o)),fn(e,e.createPositionAt(o,0),t)}(e,t);const n={};if(!o.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(n,i.getAttributesWithProperty(e,"copyOnReplace",!0))}const[r,a]=function(e){const t=e.root.document.model,o=e.start;let s=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const o=function(e){const t=e.parent,o=t.root.document.model.schema,s=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of s){if(o.isLimit(e))return null;if(o.isBlock(e))return e}}(s);if(o&&s.isTouching(t.createPositionAt(o,0))){const o=t.createSelection(e);t.modifySelection(o,{direction:"backward"});const i=o.getLastPosition(),n=t.createRange(i,s);t.hasContent(n,{ignoreMarkers:!0})||(s=i)}}return[Vi.fromPosition(o,"toPrevious"),Vi.fromPosition(s,"toNext")]}(s);r.isTouching(a)||e.remove(e.createRange(r,a)),o.leaveUnmerged||(!function(e,t,o){const s=e.model;if(!pn(e.model.schema,t,o))return;const[i,n]=function(e,t){const o=e.getAncestors(),s=t.getAncestors();let i=0;for(;o[i]&&o[i]==s[i];)i++;return[o[i],s[i]]}(t,o);if(!i||!n)return;!s.hasContent(i,{ignoreMarkers:!0})&&s.hasContent(n,{ignoreMarkers:!0})?un(e,t,o,i.parent):hn(e,t,o,i.parent)}(e,r,a),i.removeDisallowedAttributes(r.parent.getChildren(),e)),gn(e,t,r),!o.doNotAutoparagraph&&function(e,t){const o=e.checkChild(t,"$text"),s=e.checkChild(t,"paragraph");return!o&&s}(i,r)&&fn(e,r,t,n),r.detach(),a.detach()}))}function hn(e,t,o,s){const i=t.parent,n=o.parent;if(i!=s&&n!=s){for(t=e.createPositionAfter(i),(o=e.createPositionBefore(n)).isEqual(t)||e.insert(n,t),e.merge(t);o.parent.isEmpty;){const t=o.parent;o=e.createPositionBefore(t),e.remove(t)}pn(e.model.schema,t,o)&&hn(e,t,o,s)}}function un(e,t,o,s){const i=t.parent,n=o.parent;if(i!=s&&n!=s){for(t=e.createPositionAfter(i),(o=e.createPositionBefore(n)).isEqual(t)||e.insert(i,o);t.parent.isEmpty;){const o=t.parent;t=e.createPositionBefore(o),e.remove(o)}o=e.createPositionBefore(n),function(e,t){const o=t.nodeBefore,s=t.nodeAfter;o.name!=s.name&&e.rename(o,s.name);e.clearAttributes(o),e.setAttributes(Object.fromEntries(s.getAttributes()),o),e.merge(t)}(e,o),pn(e.model.schema,t,o)&&un(e,t,o,s)}}function pn(e,t,o){const s=t.parent,i=o.parent;return s!=i&&(!e.isLimit(s)&&!e.isLimit(i)&&function(e,t,o){const s=new Wo(e,t);for(const e of s.getWalker())if(o.isLimit(e.item))return!1;return!0}(t,o,e))}function fn(e,t,o,s={}){const i=e.createElement("paragraph");e.model.schema.setAllowedAttributes(i,s,e),e.insert(i,t),gn(e,o,e.createPositionAt(i,0))}function gn(e,t,o){t instanceof ns?e.setSelection(o):t.setTo(o)}function mn(e,t){const o=[];Array.from(e.getItems({direction:"backward"})).map((e=>t.createRangeOn(e))).filter((t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end)))).forEach((e=>{o.push(e.start.parent),t.remove(e)})),o.forEach((e=>{let o=e;for(;o.parent&&o.isEmpty;){const e=t.createRangeOn(o);o=o.parent,t.remove(e)}}))}class bn{constructor(e,t,o){this.model=e,this.writer=t,this.position=o,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),o=this.writer.createPositionAfter(e);if(o.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new m.Bb("insertcontent-invalid-insertion-position",this);this.position=o,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?Wo._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Wo(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Vi.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new m.Bb("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Vi.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Vi.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Bo))return;if(!this._canMergeLeft(e))return;const t=Vi._createBefore(e);t.stickiness="toNext";const o=Vi.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=Vi._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Vi._createAt(t.nodeBefore,"end","toNext")),this.position=o.toPosition(),o.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof Bo))return;if(!this._canMergeRight(e))return;const t=Vi._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new m.Bb("insertcontent-invalid-insertion-position",this);this.position=Io._createAt(t.nodeBefore,"end");const o=Vi.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=Vi._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Vi._createAt(t.nodeBefore,0,"toPrevious")),this.position=o.toPosition(),o.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof Bo&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Bo&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function _n(e,t,o="auto"){const s=e.getSelectedElement();if(s&&t.schema.isObject(s)&&!t.schema.isInline(s))return"before"==o||"after"==o?t.createRange(t.createPositionAt(s,o)):t.createRangeOn(s);const i=(0,m.Ps)(e.getSelectedBlocks());if(!i)return t.createRange(e.focus);if(i.isEmpty)return t.createRange(t.createPositionAt(i,0));const n=t.createPositionAfter(i);return e.focus.isTouching(n)?t.createRange(n):t.createRange(t.createPositionBefore(i))}function wn(e,t,o,s,i={}){if(!e.schema.isObject(t))throw new m.Bb("insertobject-element-not-an-object",e,{object:t});let n;n=o?o instanceof Jo||o instanceof ns?o:e.createSelection(o,s):e.document.selection;let r=n;i.findOptimalPosition&&e.schema.isBlock(t)&&(r=e.createSelection(_n(n,e,i.findOptimalPosition)));const a=(0,m.Ps)(n.getSelectedBlocks()),c={};return a&&Object.assign(c,e.schema.getAttributesWithProperty(a,"copyOnReplace",!0)),e.change((o=>{r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});let s=t;const n=r.anchor.parent;!e.schema.checkChild(n,t)&&e.schema.checkChild(n,"paragraph")&&e.schema.checkChild("paragraph",t)&&(s=o.createElement("paragraph"),o.insert(t,s)),e.schema.setAllowedAttributes(s,c,o);const a=e.insertContent(s,r);return a.isCollapsed||i.setSelection&&function(e,t,o,s){const i=e.model;if("on"==o)return void e.setSelection(t,"on");if("after"!=o)throw new m.Bb("insertobject-invalid-place-parameter-value",i);let n=t.nextSibling;if(i.schema.isInline(t))return void e.setSelection(t,"after");const r=n&&i.schema.checkChild(n,"$text");!r&&i.schema.checkChild(t.parent,"paragraph")&&(n=e.createElement("paragraph"),i.schema.setAllowedAttributes(n,s,e),i.insertContent(n,e.createPositionAfter(t)));n&&e.setSelection(n,0)}(o,t,i.setSelection,c),a}))}function kn(e,t){const{isForward:o,walker:s,unit:i,schema:n,treatEmojiAsSingleUnit:r}=e,{type:a,item:c,nextPosition:l}=t;if("text"==a)return"word"===e.unit?function(e,t){let o=e.position.textNode;o||(o=t?e.position.nodeAfter:e.position.nodeBefore);for(;o&&o.is("$text");){const s=e.position.offset-o.startOffset;if(xn(o,s,t))o=t?e.position.nodeAfter:e.position.nodeBefore;else{if(yn(o.data,s,t))break;e.next()}}return e.position}(s,o):function(e,t,o){const s=e.position.textNode;if(s){const i=s.data;let n=e.position.offset-s.startOffset;for(;(0,m.to)(i,n)||"character"==t&&(0,m.pp)(i,n)||o&&(0,m.YK)(i,n);)e.next(),n=e.position.offset-s.startOffset}return e.position}(s,i,r);if(a==(o?"elementStart":"elementEnd")){if(n.isSelectable(c))return Io._createAt(c,o?"after":"before");if(n.checkChild(l,"$text"))return l}else{if(n.isLimit(c))return void s.skip((()=>!0));if(n.checkChild(l,"$text"))return l}}function vn(e,t){const o=e.root,s=Io._createAt(o,t?"end":0);return t?new Wo(e,s):new Wo(s,e)}function yn(e,t,o){const s=t+(o?0:-1);return' ,.?!:;"-()'.includes(e.charAt(s))}function xn(e,t,o){return t===(o?e.offsetSize:0)}class Pn extends((0,m.Re)()){constructor(){super(),this.markers=new Gi,this.document=new Ui(this),this.schema=new Is,this._pendingChanges=[],this._currentWriter=null,["insertContent","insertObject","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach((e=>this.decorate(e))),this.on("applyOperation",((e,t)=>{t[0]._validate()}),{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(((e,t)=>{if("$marker"===t.name)return!0})),rn(this),this.document.registerPostFixer(xs)}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new zi,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){m.Bb.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new zi):e instanceof zi||(e=new zi(e)):e=new zi,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){m.Bb.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,o){return function(e,t,o,s){return e.change((i=>{let n;n=o?o instanceof Jo||o instanceof ns?o:i.createSelection(o,s):e.document.selection,n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0});const r=new bn(e,i,n.anchor),a=[];let c;if(t.is("documentFragment")){if(t.markers.size){const e=[];for(const[o,s]of t.markers){const{start:t,end:i}=s,n=t.isEqual(i);e.push({position:t,name:o,isCollapsed:n},{position:i,name:o,isCollapsed:n})}e.sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:o,name:s,isCollapsed:n}of e){let e=null,r=null;const c=o.parent===t&&o.isAtStart,l=o.parent===t&&o.isAtEnd;c||l?n&&(r=c?"start":"end"):(e=i.createElement("$marker"),i.insert(e,o)),a.push({name:s,element:e,collapsed:r})}}c=t.getChildren()}else c=[t];r.handleNodes(c);let l=r.getSelectionRange();if(t.is("documentFragment")&&a.length){const e=l?ts.fromRange(l):null,t={};for(let e=a.length-1;e>=0;e--){const{name:o,element:s,collapsed:n}=a[e],c=!t[o];if(c&&(t[o]=[]),s){const e=i.createPositionAt(s,"before");t[o].push(e),i.remove(s)}else{const e=r.getAffectedRange();if(!e){n&&t[o].push(r.position);continue}n?t[o].push(e[n]):t[o].push(c?e.start:e.end)}}for(const[e,[o,s]]of Object.entries(t))o&&s&&o.root===s.root&&i.addMarker(e,{usingOperation:!0,affectsData:!0,range:new Wo(o,s)});e&&(l=e.toRange(),e.detach())}l&&(n instanceof ns?i.setSelection(l):n.setTo(l));const d=r.getAffectedRange()||e.createRange(n.anchor);return r.destroy(),d}))}(this,e,t,o)}insertObject(e,t,o,s){return wn(this,e,t,o,s)}deleteContent(e,t){dn(this,e,t)}modifySelection(e,t){!function(e,t,o={}){const s=e.schema,i="backward"!=o.direction,n=o.unit?o.unit:"character",r=!!o.treatEmojiAsSingleUnit,a=t.focus,c=new No({boundaries:vn(a,i),singleCharacters:!0,direction:i?"forward":"backward"}),l={walker:c,schema:s,isForward:i,unit:n,treatEmojiAsSingleUnit:r};let d;for(;d=c.next();){if(d.done)return;const o=kn(l,d.value);if(o)return void(t instanceof ns?e.change((e=>{e.setSelectionFocus(o)})):t.setFocus(o))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change((e=>{const o=e.createDocumentFragment(),s=t.getFirstRange();if(!s||s.isCollapsed)return o;const i=s.start.root,n=s.start.getCommonPath(s.end),r=i.getNodeByPath(n);let a;a=s.start.parent==s.end.parent?s:e.createRange(e.createPositionAt(r,s.start.path[n.length]),e.createPositionAt(r,s.end.path[n.length]+1));const c=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),o):e.append(e.cloneElement(t,!0),o);if(a!=s){const t=s._getTransformedByMove(a.start,e.createPositionAt(o,0),c)[0],i=e.createRange(e.createPositionAt(o,0),t.start);mn(e.createRange(t.end,e.createPositionAt(o,"end")),e),mn(i,e)}return o}))}(this,e)}hasContent(e,t={}){const o=e instanceof Wo?e:Wo._createIn(e);if(o.isCollapsed)return!1;const{ignoreWhitespaces:s=!1,ignoreMarkers:i=!1}=t;if(!i)for(const e of this.markers.getMarkersIntersectingRange(o))if(e.affectsData)return!0;for(const e of o.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!s)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}createPositionFromPath(e,t,o){return new Io(e,t,o)}createPositionAt(e,t){return Io._createAt(e,t)}createPositionAfter(e){return Io._createAfter(e)}createPositionBefore(e){return Io._createBefore(e)}createRange(e,t){return new Wo(e,t)}createRangeIn(e){return Wo._createIn(e)}createRangeOn(e){return Wo._createOn(e)}createSelection(...e){return new Jo(...e)}createBatch(e){return new zi(e)}createOperationFromJSON(e){return Pi.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new Qi(this,t);const o=this._pendingChanges[0].callback(this._currentWriter);e.push(o),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}class Tn extends Wt{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Cn extends Wt{constructor(e){super(e),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class An{constructor(e){this.document=e}createDocumentFragment(e){return new st(this.document,e)}createElement(e,t,o){return new Ce(this.document,e,t,o)}createText(e){return new v(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,o){return o._insertChild(e,t)}removeChildren(e,t,o){return o._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const o=e.parent;if(o){const s=o.getChildIndex(e);return this.removeChildren(s,1,o),this.insertChild(s,t,o),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const o=t.getChildIndex(e);this.remove(e),this.insertChild(o,e.getChildren(),t)}}rename(e,t){const o=new Ce(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,o)?o:null}setAttribute(e,t,o){o._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,o){(0,x.Z)(e)&&void 0===o?t._setStyle(e):o._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,o){o._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return Be._createAt(e,t)}createPositionAfter(e){return Be._createAfter(e)}createPositionBefore(e){return Be._createBefore(e)}createRange(e,t){return new Ne(e,t)}createRangeOn(e){return Ne._createOn(e)}createRangeIn(e){return Ne._createIn(e)}createSelection(...e){return new Ie(...e)}}const En=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Sn=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,Rn=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,On=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,Mn=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,jn=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","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function Bn(e){return e.startsWith("#")?En.test(e):e.startsWith("rgb")?Sn.test(e)||Rn.test(e):e.startsWith("hsl")?On.test(e)||Mn.test(e):jn.has(e.toLowerCase())}const Nn=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function Vn(e){return Nn.includes(e)}const In=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function Dn(e){return In.test(e)}const zn=/^[+-]?[0-9]*([.][0-9]+)?%$/;function Fn(e){return zn.test(e)}const Ln=["repeat-x","repeat-y","repeat","space","round","no-repeat"];function Zn(e){return Ln.includes(e)}const Wn=["center","top","bottom","left","right"];function Hn(e){return Wn.includes(e)}const $n=["fixed","scroll","local"];function qn(e){return $n.includes(e)}const Un=/^url\(/;function Kn(e){return Un.test(e)}function Gn(e=""){if(""===e)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const t=Qn(e),o=t[0],s=t[2]||o,i=t[1]||o;return{top:o,bottom:s,right:i,left:t[3]||i}}function Jn(e){return t=>{const{top:o,right:s,bottom:i,left:n}=t,r=[];return[o,s,n,i].every((e=>!!e))?r.push([e,Yn(t)]):(o&&r.push([e+"-top",o]),s&&r.push([e+"-right",s]),i&&r.push([e+"-bottom",i]),n&&r.push([e+"-left",n])),r}}function Yn({top:e,right:t,bottom:o,left:s}){const i=[];return s!==t?i.push(e,t,o,s):o!==e?i.push(e,t,o):t!==e?i.push(e,t):i.push(e),i.join(" ")}function Xn(e){return t=>({path:e,value:Gn(t)})}function Qn(e){return e.replace(/, /g,",").split(" ").map((e=>e.replace(/,/g,", ")))}function er(e){e.setNormalizer("background",(e=>{const t={},o=Qn(e);for(const e of o)Zn(e)?(t.repeat=t.repeat||[],t.repeat.push(e)):Hn(e)?(t.position=t.position||[],t.position.push(e)):qn(e)?t.attachment=e:Bn(e)?t.color=e:Kn(e)&&(t.image=e);return{path:"background",value:t}})),e.setNormalizer("background-color",(e=>({path:"background.color",value:e}))),e.setReducer("background",(e=>{const t=[];return t.push(["background-color",e.color]),t})),e.setStyleRelation("background",["background-color"])}function tr(e){e.setNormalizer("border",(e=>{const{color:t,style:o,width:s}=cr(e);return{path:"border",value:{color:Gn(t),style:Gn(o),width:Gn(s)}}})),e.setNormalizer("border-top",or("top")),e.setNormalizer("border-right",or("right")),e.setNormalizer("border-bottom",or("bottom")),e.setNormalizer("border-left",or("left")),e.setNormalizer("border-color",sr("color")),e.setNormalizer("border-width",sr("width")),e.setNormalizer("border-style",sr("style")),e.setNormalizer("border-top-color",nr("color","top")),e.setNormalizer("border-top-style",nr("style","top")),e.setNormalizer("border-top-width",nr("width","top")),e.setNormalizer("border-right-color",nr("color","right")),e.setNormalizer("border-right-style",nr("style","right")),e.setNormalizer("border-right-width",nr("width","right")),e.setNormalizer("border-bottom-color",nr("color","bottom")),e.setNormalizer("border-bottom-style",nr("style","bottom")),e.setNormalizer("border-bottom-width",nr("width","bottom")),e.setNormalizer("border-left-color",nr("color","left")),e.setNormalizer("border-left-style",nr("style","left")),e.setNormalizer("border-left-width",nr("width","left")),e.setExtractor("border-top",rr("top")),e.setExtractor("border-right",rr("right")),e.setExtractor("border-bottom",rr("bottom")),e.setExtractor("border-left",rr("left")),e.setExtractor("border-top-color","border.color.top"),e.setExtractor("border-right-color","border.color.right"),e.setExtractor("border-bottom-color","border.color.bottom"),e.setExtractor("border-left-color","border.color.left"),e.setExtractor("border-top-width","border.width.top"),e.setExtractor("border-right-width","border.width.right"),e.setExtractor("border-bottom-width","border.width.bottom"),e.setExtractor("border-left-width","border.width.left"),e.setExtractor("border-top-style","border.style.top"),e.setExtractor("border-right-style","border.style.right"),e.setExtractor("border-bottom-style","border.style.bottom"),e.setExtractor("border-left-style","border.style.left"),e.setReducer("border-color",Jn("border-color")),e.setReducer("border-style",Jn("border-style")),e.setReducer("border-width",Jn("border-width")),e.setReducer("border-top",lr("top")),e.setReducer("border-right",lr("right")),e.setReducer("border-bottom",lr("bottom")),e.setReducer("border-left",lr("left")),e.setReducer("border",function(){return t=>{const o=ar(t,"top"),s=ar(t,"right"),i=ar(t,"bottom"),n=ar(t,"left"),r=[o,s,i,n],a={width:e(r,"width"),style:e(r,"style"),color:e(r,"color")},c=dr(a,"all");if(c.length)return c;const l=Object.entries(a).reduce(((e,[t,o])=>(o&&(e.push([`border-${t}`,o]),r.forEach((e=>delete e[t]))),e)),[]);return[...l,...dr(o,"top"),...dr(s,"right"),...dr(i,"bottom"),...dr(n,"left")]};function e(e,t){return e.map((e=>e[t])).reduce(((e,t)=>e==t?e:null))}}()),e.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]),e.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]),e.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]),e.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]),e.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]),e.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function or(e){return t=>{const{color:o,style:s,width:i}=cr(t),n={};return void 0!==o&&(n.color={[e]:o}),void 0!==s&&(n.style={[e]:s}),void 0!==i&&(n.width={[e]:i}),{path:"border",value:n}}}function sr(e){return t=>({path:"border",value:ir(t,e)})}function ir(e,t){return{[t]:Gn(e)}}function nr(e,t){return o=>({path:"border",value:{[e]:{[t]:o}}})}function rr(e){return(t,o)=>{if(o.border)return ar(o.border,e)}}function ar(e,t){const o={};return e.width&&e.width[t]&&(o.width=e.width[t]),e.style&&e.style[t]&&(o.style=e.style[t]),e.color&&e.color[t]&&(o.color=e.color[t]),o}function cr(e){const t={},o=Qn(e);for(const e of o)Dn(e)||/thin|medium|thick/.test(e)?t.width=e:Vn(e)?t.style=e:t.color=e;return t}function lr(e){return t=>dr(t,e)}function dr(e,t){const o=[];if(e&&e.width&&o.push("width"),e&&e.style&&o.push("style"),e&&e.color&&o.push("color"),3==o.length){const s=o.map((t=>e[t])).join(" ");return["all"==t?["border",s]:[`border-${t}`,s]]}return"all"==t?[]:o.map((o=>[`border-${t}-${o}`,e[o]]))}function hr(e){e.setNormalizer("margin",Xn("margin")),e.setNormalizer("margin-top",(e=>({path:"margin.top",value:e}))),e.setNormalizer("margin-right",(e=>({path:"margin.right",value:e}))),e.setNormalizer("margin-bottom",(e=>({path:"margin.bottom",value:e}))),e.setNormalizer("margin-left",(e=>({path:"margin.left",value:e}))),e.setReducer("margin",Jn("margin")),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function ur(e){e.setNormalizer("padding",Xn("padding")),e.setNormalizer("padding-top",(e=>({path:"padding.top",value:e}))),e.setNormalizer("padding-right",(e=>({path:"padding.right",value:e}))),e.setNormalizer("padding-bottom",(e=>({path:"padding.bottom",value:e}))),e.setNormalizer("padding-left",(e=>({path:"padding.left",value:e}))),e.setReducer("padding",Jn("padding")),e.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}},"./packages/ckeditor5-enter/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{C:()=>d,G:()=>f});var s=o("./packages/ckeditor5-core/src/index.ts");function*i(e,t){for(const o of t)o&&e.getAttributeProperties(o[0]).copyOnEnter&&(yield o)}class n extends s.mY{execute(){this.editor.model.change((e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})}))}enterBlock(e){const t=this.editor.model,o=t.document.selection,s=t.schema,n=o.isCollapsed,a=o.getFirstRange(),c=a.start.parent,l=a.end.parent;if(s.isLimit(c)||s.isLimit(l))return n||c!=l||t.deleteContent(o),!1;if(n){const t=i(e.model.schema,o.getAttributes());return r(e,a.start),e.setSelectionAttribute(t),!0}{const s=!(a.start.isAtStart&&a.end.isAtEnd),i=c==l;if(t.deleteContent(o,{leaveUnmerged:s}),s){if(i)return r(e,o.focus),!0;e.setSelection(l,0)}}return!1}}function r(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}var a=o("./packages/ckeditor5-engine/src/index.ts");const c={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class l extends a.Qj{constructor(e){super(e);const t=this.document;t.on("beforeinput",((o,s)=>{if(!this.isEnabled)return;const i=s.domEvent,n=c[s.inputType];if(!n)return;const r=new a.r7(t,"enter",s.targetRanges[0]);t.fire(r,new a.dK(e,i,{isSoft:n.isSoft})),r.stop.called&&o.stop()}))}observe(){}}class d extends s.Sy{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,o=t.document;t.addObserver(l),e.commands.add("enter",new n(e)),this.listenTo(o,"enter",((s,i)=>{o.isComposing||i.preventDefault(),i.isSoft||(e.execute("enter"),t.scrollToTheSelection())}),{priority:"low"})}}class h extends s.mY{execute(){const e=this.editor.model,t=e.document;e.change((o=>{!function(e,t,o){const s=o.isCollapsed,n=o.getFirstRange(),r=n.start.parent,a=n.end.parent,c=r==a;if(s){const s=i(e.schema,o.getAttributes());u(e,t,n.end),t.removeSelectionAttribute(o.getAttributeKeys()),t.setSelectionAttribute(s)}else{const s=!(n.start.isAtStart&&n.end.isAtEnd);e.deleteContent(o,{leaveUnmerged:s}),c?u(e,t,o.focus):s&&t.setSelection(a,0)}}(e,o,t.selection),this.fire("afterExecute",{writer:o})}))}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const o=t.anchor;if(!o||!e.checkChild(o,"softBreak"))return!1;const s=t.getFirstRange(),i=s.start.parent,n=s.end.parent;if((p(i,e)||p(n,e))&&i!==n)return!1;return!0}(e.schema,t.selection)}}function u(e,t,o){const s=t.createElement("softBreak");e.insertContent(s,o),t.setSelection(s,"after")}function p(e,t){return!e.is("rootElement")&&(t.isLimit(e)||p(e.parent,t))}class f extends s.Sy{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,o=e.conversion,s=e.editing.view,i=s.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),o.for("upcast").elementToElement({model:"softBreak",view:"br"}),o.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),s.addObserver(l),e.commands.add("shiftEnter",new h(e)),this.listenTo(i,"enter",((t,o)=>{i.isComposing||o.preventDefault(),o.isSoft&&(e.execute("shiftEnter"),s.scrollToTheSelection())}),{priority:"low"})}}},"./packages/ckeditor5-typing/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{HG:()=>w,II:()=>d,cL:()=>N,uL:()=>y,mh:()=>x,Mq:()=>k,VD:()=>F,Up:()=>v,Im:()=>Z});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts");class n{constructor(e,t=20){this._batch=null,this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class r extends s.mY{constructor(e,t){super(e),this._buffer=new n(e.model,t)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,o=t.document,s=e.text||"",i=s.length;let n=o.selection;e.selection?n=e.selection:e.range&&(n=t.createSelection(e.range));const r=e.resultRange;t.enqueueChange(this._buffer.batch,(e=>{this._buffer.lock(),t.deleteContent(n),s&&t.insertContent(e.createText(s,o.selection.getAttributes()),n),r?e.setSelection(r):n.is("documentSelection")||e.setSelection(n),this._buffer.unlock(),this._buffer.input(i)}))}}var a=o("./packages/ckeditor5-engine/src/index.ts");const c=["insertText","insertReplacementText"];class l extends a.Qj{constructor(e){super(e),i.OB.isAndroid&&c.push("insertCompositionText");const t=e.document;t.on("beforeinput",((o,s)=>{if(!this.isEnabled)return;const{data:n,targetRanges:r,inputType:l,domEvent:d}=s;if(!c.includes(l))return;const h=new i.M3(t,"insertText");t.fire(h,new a.dK(e,d,{text:n,selection:e.createSelection(r)})),h.stop.called&&o.stop()})),t.on("compositionend",((o,{data:s,domEvent:n})=>{this.isEnabled&&!i.OB.isAndroid&&s&&t.fire("insertText",new a.dK(e,n,{text:s,selection:t.selection}))}),{priority:"lowest"})}observe(){}}class d extends s.Sy{static get pluginName(){return"Input"}init(){const e=this.editor,t=e.model,o=e.editing.view,s=t.document.selection;o.addObserver(l);const n=new r(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",n),e.commands.add("input",n),this.listenTo(o.document,"insertText",((s,n)=>{o.document.isComposing||n.preventDefault();const{text:r,selection:a,resultRange:c}=n,l=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t)));let d=r;if(i.OB.isAndroid){const e=Array.from(l[0].getItems()).reduce(((e,t)=>e+(t.is("$textProxy")?t.data:"")),"");e&&(e.length<=d.length?d.startsWith(e)&&(d=d.substring(e.length),l[0].start=l[0].start.getShiftedBy(e.length)):e.startsWith(d)&&(l[0].start=l[0].start.getShiftedBy(d.length),d=""))}const h={text:d,selection:t.createSelection(l)};c&&(h.resultRange=e.editing.mapper.toModelRange(c)),e.execute("insertText",h)})),i.OB.isAndroid?this.listenTo(o.document,"keydown",((e,i)=>{!s.isCollapsed&&229==i.keyCode&&o.document.isComposing&&h(t,n)})):this.listenTo(o.document,"compositionstart",(()=>{s.isCollapsed||h(t,n)}))}}function h(e,t){if(!t.isEnabled)return;const o=t.buffer;o.lock(),e.enqueueChange(o.batch,(()=>{e.deleteContent(e.document.selection)})),o.unlock()}class u extends s.mY{constructor(e,t){super(e),this.direction=t,this._buffer=new n(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,o=t.document;t.enqueueChange(this._buffer.batch,(s=>{this._buffer.lock();const n=s.createSelection(e.selection||o.selection),r=e.sequence||1,a=n.isCollapsed;if(n.isCollapsed&&t.modifySelection(n,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(r))return void this._replaceEntireContentWithParagraph(s);if(this._shouldReplaceFirstBlockWithParagraph(n,r))return void this.editor.execute("paragraph",{selection:n});if(n.isCollapsed)return;let c=0;n.getFirstRange().getMinimalFlatRanges().forEach((e=>{c+=(0,i.QX)(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),t.deleteContent(n,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(c),s.setSelection(n),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,o=t.document.selection,s=t.schema.getLimitElement(o);if(!(o.isCollapsed&&o.containsEntireContent(s)))return!1;if(!t.schema.checkChild(s,"paragraph"))return!1;const i=s.getChild(0);return!i||!i.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,o=t.document.selection,s=t.schema.getLimitElement(o),i=e.createElement("paragraph");e.remove(e.createRangeIn(s)),e.insert(i,s),e.setSelection(i,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const o=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const s=e.getFirstPosition(),i=o.schema.getLimitElement(s),n=i.getChild(0);return s.parent==n&&(!!e.containsEntireContent(n)&&(!!o.schema.checkChild(i,"paragraph")&&"paragraph"!=n.name))}}const p="word",f="selection",g="backward",m="forward",b={deleteContent:{unit:f,direction:g},deleteContentBackward:{unit:"codePoint",direction:g},deleteWordBackward:{unit:p,direction:g},deleteHardLineBackward:{unit:f,direction:g},deleteSoftLineBackward:{unit:f,direction:g},deleteContentForward:{unit:"character",direction:m},deleteWordForward:{unit:p,direction:m},deleteHardLineForward:{unit:f,direction:m},deleteSoftLineForward:{unit:f,direction:m}};class _ extends a.Qj{constructor(e){super(e);const t=e.document;let o=0;t.on("keydown",(()=>{o++})),t.on("keyup",(()=>{o=0})),t.on("beforeinput",((s,n)=>{if(!this.isEnabled)return;const{targetRanges:r,domEvent:c,inputType:l}=n,d=b[l];if(!d)return;const h={direction:d.direction,unit:d.unit,sequence:o};h.unit==f&&(h.selectionToRemove=e.createSelection(r[0])),i.OB.isAndroid&&"deleteContentBackward"===l&&(h.sequence=1,1!=r.length||r[0].start.parent==r[0].end.parent&&r[0].start.offset+1==r[0].end.offset||(h.unit=f,h.selectionToRemove=e.createSelection(r)));const u=new a.r7(t,"delete",r[0]);t.fire(u,new a.dK(e,c,h)),u.stop.called&&s.stop()})),i.OB.isBlink&&function(e){const t=e.view,o=t.document;let s=null,n=!1;function r(e){return e==i.Do.backspace||e==i.Do.delete}function c(e){return e==i.Do.backspace?g:m}o.on("keydown",((e,{keyCode:t})=>{s=t,n=!1})),o.on("keyup",((i,{keyCode:l,domEvent:d})=>{const h=o.selection,u=e.isEnabled&&l==s&&r(l)&&!h.isCollapsed&&!n;if(s=null,u){const e=h.getFirstRange(),s=new a.r7(o,"delete",e),i={unit:f,direction:c(l),selectionToRemove:h};o.fire(s,new a.dK(t,d,i))}})),o.on("beforeinput",((e,{inputType:t})=>{const o=b[t];r(s)&&o&&o.direction==c(s)&&(n=!0)}),{priority:"high"}),o.on("beforeinput",((e,{inputType:t,data:o})=>{s==i.Do.delete&&"insertText"==t&&""==o&&e.stop()}),{priority:"high"})}(this)}observe(){}}class w extends s.Sy{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,o=t.document,s=e.model.document;t.addObserver(_),this._undoOnBackspace=!1;const i=new u(e,"forward");e.commands.add("deleteForward",i),e.commands.add("forwardDelete",i),e.commands.add("delete",new u(e,"backward")),this.listenTo(o,"delete",((s,i)=>{o.isComposing||i.preventDefault();const{direction:n,sequence:r,selectionToRemove:a,unit:c}=i,l="forward"===n?"deleteForward":"delete",d={sequence:r};if("selection"==c){const t=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t)));d.selection=e.model.createSelection(t)}else d.unit=c;e.execute(l,d),t.scrollToTheSelection()}),{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(o,"delete",((t,o)=>{this._undoOnBackspace&&"backward"==o.direction&&1==o.sequence&&"codePoint"==o.unit&&(this._undoOnBackspace=!1,e.execute("undo"),o.preventDefault(),t.stop())}),{context:"$capture"}),this.listenTo(s,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class k extends s.Sy{static get requires(){return[d,w]}static get pluginName(){return"Typing"}}function v(e,t){let o=e.start;return{text:Array.from(e.getItems()).reduce(((e,s)=>s.is("$text")||s.is("$textProxy")?e+s.data:(o=t.createPositionAfter(s),"")),""),range:t.createRange(o,e.end)}}class y extends((0,i.Re)()){constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",(()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))})),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",((t,{directChange:o})=>{o&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))})),this.listenTo(e,"change:data",((e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})}))}_evaluateTextBeforeSelection(e,t={}){const o=this.model,s=o.document.selection,i=o.createRange(o.createPositionAt(s.focus.parent,0),s.focus),{text:n,range:r}=v(i,o),a=this.testCallback(n);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const o=Object.assign(t,{text:n,range:r});"object"==typeof a&&Object.assign(o,a),this.fire(`matched:${e}`,o)}}}class x extends s.Sy{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,o=e.editing.view,s=e.locale,n=t.document.selection;this.listenTo(o.document,"arrowKey",((e,t)=>{if(!n.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const o=t.keyCode==i.Do.arrowright,r=t.keyCode==i.Do.arrowleft;if(!o&&!r)return;const a=s.contentLanguageDirection;let c=!1;c="ltr"===a&&o||"rtl"===a&&r?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===c&&e.stop()}),{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(n,"change:range",((e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&A(n.getFirstPosition(),this.attributes)||this._restoreGravity())}))}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,o=this.editor.model.document.selection,s=o.getFirstPosition();return!this._isGravityOverridden&&((!s.isAtStart||!P(o,t))&&(!!A(s,t)&&(C(e),this._overrideGravity(),!0)))}_handleBackwardMovement(e){const t=this.attributes,o=this.editor.model,s=o.document.selection,i=s.getFirstPosition();return this._isGravityOverridden?(C(e),this._restoreGravity(),T(o,t,i),!0):i.isAtStart?!!P(s,t)&&(C(e),T(o,t,i),!0):!!function(e,t){const o=e.getShiftedBy(-1);return A(o,t)}(i,t)&&(i.isAtEnd&&!P(s,t)&&A(i,t)?(C(e),T(o,t,i),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}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 P(e,t){for(const o of t)if(e.hasAttribute(o))return!0;return!1}function T(e,t,o){const s=o.nodeBefore;e.change((e=>{s?e.setSelectionAttribute(s.getAttributes()):e.removeSelectionAttribute(t)}))}function C(e){e.preventDefault()}function A(e,t){const{nodeBefore:o,nodeAfter:s}=e;for(const e of t){const t=o?o.getAttribute(e):void 0;if((s?s.getAttribute(e):void 0)!==t)return!0}return!1}var E=o("./node_modules/lodash-es/toString.js"),S=/[\\^$.*+?()[\]{}|]/g,R=RegExp(S.source);const O=function(e){return(e=(0,E.Z)(e))&&R.test(e)?e.replace(S,"\\$&"):e},M={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:z('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:z("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:z("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:z('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:z('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:z("'"),to:[null,"‚",null,"’"]}},j={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},B=["symbols","mathematical","typography","quotes"];class N extends s.Sy{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}constructor(e){super(e),e.config.define("typing",{transformations:{include:B}})}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTransformationWatchers()}_enableTransformationWatchers(){const e=this.editor,t=e.model,o=e.plugins.get("Delete"),s=function(e){const t=e.extra||[],o=e.remove||[],s=e=>!o.includes(e);return function(e){const t=new Set;for(const o of e)if("string"==typeof o&&j[o])for(const e of j[o])t.add(e);else t.add(o);return Array.from(t)}(e.include.concat(t).filter(s)).filter(s).map((e=>"string"==typeof e&&M[e]?M[e]:e)).filter((e=>"object"==typeof e)).map((e=>({from:V(e.from),to:I(e.to)})))}(e.config.get("typing.transformations")),i=new y(e.model,(e=>{for(const t of s){if(t.from.test(e))return{normalizedTransformation:t}}}));i.on("matched:data",((e,s)=>{if(!s.batch.isTyping)return;const{from:i,to:n}=s.normalizedTransformation,r=i.exec(s.text),a=n(r.slice(1)),c=s.range;let l=r.index;t.enqueueChange((e=>{for(let o=1;o{o.requestUndoOnBackspace()}))}))})),i.bind("isEnabled").to(this)}}function V(e){return"string"==typeof e?new RegExp(`(${O(e)})$`):e}function I(e){return"string"==typeof e?()=>[e]:e instanceof Array?()=>e:e}function D(e){return(e.textNode?e.textNode:e.nodeAfter).getAttributes()}function z(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function F(e,t,o,s){return s.createRange(L(e,t,o,!0,s),L(e,t,o,!1,s))}function L(e,t,o,s,i){let n=e.textNode||(s?e.nodeBefore:e.nodeAfter),r=null;for(;n&&n.getAttribute(t)==o;)r=n,n=s?n.previousSibling:n.nextSibling;return r?i.createPositionAt(r,s?"before":"after"):e}function Z(e,t,o,s){const i=e.editing.view,n=new Set;i.document.registerPostFixer((i=>{const r=e.model.document.selection;let a=!1;if(r.hasAttribute(t)){const c=F(r.getFirstPosition(),t,r.getAttribute(t),e.model),l=e.editing.mapper.toViewRange(c);for(const e of l.getItems())e.is("element",o)&&!e.hasClass(s)&&(i.addClass(s,e),n.add(e),a=!0)}return a})),e.conversion.for("editingDowncast").add((e=>{function t(){i.change((e=>{for(const t of n.values())e.removeClass(s,t),n.delete(t)}))}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})}))}},"./packages/ckeditor5-ui/src/componentfactory.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./packages/ckeditor5-utils/src/index.ts");class i{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(n(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new s.Bb("componentfactory-item-missing",this,{name:e});return this._components.get(n(e)).callback(this.editor.locale)}has(e){return this._components.has(n(e))}}function n(e){return String(e).toLowerCase()}},"./packages/ckeditor5-ui/src/index.ts":(e,t,o)=>{"use strict";function s({emitter:e,activator:t,callback:o,contextElements:s}){e.listenTo(document,"mousedown",((e,i)=>{if(!t())return;const n="function"==typeof i.composedPath?i.composedPath():[];for(const e of s)if(e.contains(i.target)||n.includes(e))return;o()}))}function i(e){const t=e;t.set("_isCssTransitionsDisabled",!1),t.disableCssTransitions=()=>{t._isCssTransitionsDisabled=!0},t.enableCssTransitions=()=>{t._isCssTransitionsDisabled=!1},t.extendTemplate({attributes:{class:[t.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function n({view:e}){e.listenTo(e.element,"submit",((t,o)=>{o.preventDefault(),e.fire("submit")}),{useCapture:!0})}function r({keystrokeHandler:e,focusTracker:t,gridItems:o,numberOfColumns:s,uiLanguageDirection:i}){const n="number"==typeof s?()=>s:s;function r(e){return s=>{const i=o.find((e=>e.element===t.focusedElement)),n=o.getIndex(i),r=e(n,o);o.get(r).focus(),s.stopPropagation(),s.preventDefault()}}function a(e,t){return e===t-1?0:e+1}function c(e,t){return 0===e?t-1:e-1}e.set("arrowright",r(((e,t)=>"rtl"===i?c(e,t.length):a(e,t.length)))),e.set("arrowleft",r(((e,t)=>"rtl"===i?a(e,t.length):c(e,t.length)))),e.set("arrowup",r(((e,t)=>{let o=e-n();return o<0&&(o=e+n()*Math.floor(t.length/n()),o>t.length-1&&(o-=n())),o}))),e.set("arrowdown",r(((e,t)=>{let o=e+n();return o>t.length-1&&(o=e%n()),o})))}o.d(t,{no:()=>Ze.Z,Jf:()=>it,ee:()=>ht,BK:()=>d,py:()=>ve,r5:()=>w,J6:()=>R,_9:()=>C,_Y:()=>O.Z,WB:()=>Ke,J0:()=>j,fF:()=>be,I0:()=>L,Gp:()=>Ce,mO:()=>m,VY:()=>Me,r1:()=>xe,Xs:()=>Oe,pq:()=>Re,Em:()=>Se,Dn:()=>ke,KP:()=>Ne,dn:()=>ne,Bv:()=>ie,Hn:()=>Le,P_:()=>ze,Rm:()=>V,lp:()=>et,BM:()=>y,YS:()=>a.ZP,$y:()=>W,jB:()=>X,gE:()=>tt.Z,G7:()=>h.Z,vX:()=>c.Z,IJ:()=>r,Pm:()=>pe,up:()=>ue,eC:()=>s,t9:()=>he,FH:()=>De,sh:()=>Ie,R:()=>Ve,Mh:()=>fe,k6:()=>x,fe:()=>i,S1:()=>P,jY:()=>T,iw:()=>$,GI:()=>n});var a=o("./packages/ckeditor5-ui/src/template.ts"),c=o("./packages/ckeditor5-ui/src/viewcollection.ts"),l=o("./packages/ckeditor5-utils/src/index.ts");class d extends c.Z{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new a.ZP({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");e||(e=(0,l.az)(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}var h=o("./packages/ckeditor5-ui/src/view.ts"),u=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),p=o.n(u),f=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/icon/icon.css"),g={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(f.Z,g);f.Z.locals;class m extends h.Z{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon","ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],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").querySelector("svg"),t=e.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:t,value:o}of Array.from(e.attributes))m.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,o);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((e=>{e.style.fill=this.fillColor}))}}m.presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];var b=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/button/button.css"),_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(b.Z,_);b.Z.locals;class w extends h.Z{constructor(e){super(e);const t=this.bindTemplate,o=(0,l.hQ)();this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._createLabelView(o),this.iconView=new m,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));const s={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||"button")),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${o}`,"aria-disabled":t.if("isEnabled",!0,(e=>!e)),"aria-pressed":t.to("isOn",(e=>!!this.isToggleable&&String(!!e))),"data-cke-tooltip-text":t.to("_tooltipString"),"data-cke-tooltip-position":t.to("tooltipPosition")},children:this.children,on:{click:t.to((e=>{this.isEnabled?this.fire("execute"):e.preventDefault()}))}};l.OB.isSafari&&(s.on.mousedown=t.to((e=>{this.focus(),e.preventDefault()}))),this.setTemplate(s)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createLabelView(e){const t=new h.Z,o=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:o.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new h.Z;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(e=>(0,l.XU)(e)))}]}),e}_getTooltipString(e,t,o){return e?"string"==typeof e?e:(o&&(o=(0,l.XU)(o)),e instanceof Function?e(t,o):`${t}${o?` (${o})`:""}`):""}}var k=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/button/switchbutton.css"),v={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(k.Z,v);k.Z.locals;class y extends w{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new h.Z;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}function x(e,t){const o=e.t,s={Black:o("Black"),"Dim grey":o("Dim grey"),Grey:o("Grey"),"Light grey":o("Light grey"),White:o("White"),Red:o("Red"),Orange:o("Orange"),Yellow:o("Yellow"),"Light green":o("Light green"),Green:o("Green"),Aquamarine:o("Aquamarine"),Turquoise:o("Turquoise"),"Light blue":o("Light blue"),Blue:o("Blue"),Purple:o("Purple")};return t.map((e=>{const t=s[e.label];return t&&t!=e.label&&(e.label=t),e}))}function P(e){return e.map(T).filter((e=>!!e))}function T(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class C extends w{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon='',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 A=o("./packages/ckeditor5-utils/src/keystrokehandler.ts"),E=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/colorgrid/colorgrid.css"),S={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(E.Z,S);E.Z.locals;class R extends h.Z{constructor(e,t){super(e);const o=t&&t.colorDefinitions||[];this.columns=t&&t.columns?t.columns:5;const s={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new l.Rh,this.keystrokes=new A.Z,this.items.on("add",((e,t)=>{t.isOn=t.color===this.selectedColor})),o.forEach((e=>{const t=new C;t.set({color:e.color,label:e.label,tooltip:!0,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:s}}),this.on("change:selectedColor",((e,t,o)=>{for(const e of this.items)e.isOn=e.color===o}))}focus(){this.items.length&&this.items.first.focus()}focusLast(){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),r({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}var O=o("./packages/ckeditor5-ui/src/componentfactory.ts");const M='';class j extends w{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e)))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new m;return e.content=M,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}var B=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/splitbutton.css"),N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(B.Z,N);B.Z.locals;class V extends h.Z{constructor(e){super(e);const t=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new l.VD,this.focusTracker=new l.Rh,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",t.to("class"),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)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())})),this.keystrokes.set("arrowleft",((e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(){const e=new w;return 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),e}_createArrowView(){const e=new w,t=e.bindTemplate;return e.icon=M,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}class I extends h.Z{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",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){const e=this.children.first;"function"==typeof e.focus?e.focus():(0,l.KE)("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}var D=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/dropdown.css"),z={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(D.Z,z);D.Z.locals;class F extends h.Z{constructor(e,t,o){super(e);const s=this.bindTemplate;this.buttonView=t,this.panelView=o,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.keystrokes=new l.VD,this.focusTracker=new l.Rh,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",s.to("class"),s.if("isEnabled","ck-disabled",(e=>!e))],id:s.to("id"),"aria-describedby":s.to("ariaDescribedById")},children:[t,o]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":s.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",(()=>{this.isOpen=!this.isOpen})),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",((e,t,o)=>{o&&("auto"===this.panelPosition?this.panelView.position=F._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)})),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",((e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())})),this.keystrokes.set("arrowright",((e,t)=>{this.isOpen&&t()})),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:o,southWest:s,northEast:i,northWest:n,southMiddleEast:r,southMiddleWest:a,northMiddleEast:c,northMiddleWest:l}=F.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[o,s,r,a,e,i,n,c,l,t]:[s,o,a,r,e,n,i,l,c,t]}}F.defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),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"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})},F._getOptimalPosition=l.xZ;class L{constructor(e){if(this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let o=e.actions[t];"string"==typeof o&&(o=[o]);for(const s of o)e.keystrokeHandler.set(s,((e,o)=>{this[t](),o()}))}}get first(){return this.focusables.find(Z)||null}get last(){return this.focusables.filter(Z).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find(((t,o)=>{const s=t.element===this.focusTracker.focusedElement;return s&&(e=o),s})),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,o=this.focusables.length;if(!o)return null;if(null===t)return this[1===e?"first":"last"];let s=(t+o+e)%o;do{const t=this.focusables.get(s);if(Z(t))return t;s=(s+o+e)%o}while(s!==t);return null}}function Z(e){return!(!e.focus||!(0,l.pn)(e.element))}class W extends h.Z{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class H extends h.Z{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function $(e){return Array.isArray(e)?{items:e,removeItems:[]}:e?Object.assign({items:[],removeItems:[]},e):{items:[],removeItems:[]}}var q=o("./packages/ckeditor5-core/src/index.ts"),U=o("./node_modules/lodash-es/isObject.js"),K=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/toolbar/toolbar.css"),G={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(K.Z,G);K.Z.locals;const{threeVerticalDots:J}=q.ci,Y={alignLeft:q.ci.alignLeft,bold:q.ci.bold,importExport:q.ci.importExport,paragraph:q.ci.paragraph,plus:q.ci.plus,text:q.ci.text,threeVerticalDots:q.ci.threeVerticalDots};class X extends h.Z{constructor(e,t){super(e);const o=this.bindTemplate,s=this.t;this.options=t||{},this.set("ariaLabel",s("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new l.Rh,this.keystrokes=new l.VD,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new Q(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const i="rtl"===e.uiLanguageDirection;this._focusCycler=new L({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[i?"arrowright":"arrowleft","arrowup"],focusNext:[i?"arrowleft":"arrowright","arrowdown"]}});const n=["ck","ck-toolbar",o.to("class"),o.if("isCompact","ck-toolbar_compact")];var r;this.options.shouldGroupWhenFull&&this.options.isFloating&&n.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:n,role:"toolbar","aria-label":o.to("ariaLabel"),style:{maxWidth:o.to("maxWidth")}},children:this.children,on:{mousedown:(r=this,r.bindTemplate.to((e=>{e.target===r.element&&e.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new te(this):new ee(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(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,o){const s=$(e),i=o||s.removeItems,n=this._cleanItemsConfiguration(s.items,t,i).map((e=>(0,U.Z)(e)?this._createNestedToolbarDropdown(e,t,i):"|"===e?new W:"-"===e?new H:t.create(e))).filter((e=>!!e));this.items.addMany(n)}_cleanItemsConfiguration(e,t,o){const s=e.filter(((e,s,i)=>"|"===e||-1===o.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||((0,l.KE)("toolbarview-line-break-ignored-when-grouping-items",i),!1):!(!(0,U.Z)(e)&&!t.has(e))||((0,l.KE)("toolbarview-item-unavailable",{item:e}),!1))));return this._cleanSeparatorsAndLineBreaks(s)}_cleanSeparatorsAndLineBreaks(e){const t=e=>"-"!==e&&"|"!==e,o=e.length,s=e.findIndex(t);if(-1===s)return[];const i=o-e.slice().reverse().findIndex(t);return e.slice(s,i).filter(((e,o,s)=>{if(t(e))return!0;return!(o>0&&s[o-1]===e)}))}_createNestedToolbarDropdown(e,t,o){let{label:s,icon:i,items:n,tooltip:r=!0,withText:a=!1}=e;if(n=this._cleanItemsConfiguration(n,t,o),!n.length)return null;const c=he(this.locale);return s||(0,l.KE)("toolbarview-nested-toolbar-dropdown-missing-label",e),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:s,tooltip:r,withText:!!a}),!1!==i?c.buttonView.icon=Y[i]||i||J:c.buttonView.withText=!0,ue(c,[]),c.toolbarView.fillFromConfig(n,t,o),c}}class Q extends h.Z{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class ee{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),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 te{constructor(e){this.view=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=!1,e.itemsView.children.bindTo(this.ungroupedItems).using((e=>e)),this.ungroupedItems.on("change",this._updateFocusCycleableItems.bind(this)),e.children.on("change",this._updateFocusCycleableItems.bind(this)),e.items.on("change",((e,t)=>{const o=t.index,s=Array.from(t.added);for(const e of t.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=o;ethis.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,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(!(0,l.pn)(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,o=new l.UL(e.lastChild),s=new l.UL(e);if(!this.cachedPadding){const o=l.CO.window.getComputedStyle(e),s="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(o[s])}return"ltr"===t?o.right>s.right-this.cachedPadding:o.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)})),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new W),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)),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,t=e.t,o=he(e);return o.class="ck-toolbar__grouped-dropdown",o.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",ue(o,[]),o.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:J}),o.toolbarView.items.bindTo(this.groupedItems).using((e=>e)),o}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((e=>{this.viewFocusables.add(e)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var oe=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/list/list.css"),se={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(oe.Z,se);oe.Z.locals;class ie extends h.Z{constructor(e){super(e),this.items=this.createCollection(),this.focusTracker=new l.Rh,this.keystrokes=new l.VD,this._focusCycler=new L({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)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class ne extends h.Z{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",(e=>!e))]},children:this.children})}focus(){this.children.first.focus()}}class re extends h.Z{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var ae=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css"),ce={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(ae.Z,ce);ae.Z.locals;var le=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/listdropdown.css"),de={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(le.Z,de);le.Z.locals;function he(e,t=j){const o=new t(e),i=new I(e),n=new F(e,o,i);return o.bind("isEnabled").to(n),o instanceof V?o.arrowView.bind("isOn").to(n,"isOpen"):o.bind("isOn").to(n,"isOpen"),function(e){(function(e){e.on("render",(()=>{s({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})}))})(e),function(e){e.on("execute",(t=>{t.source instanceof y||(e.isOpen=!1)}))}(e),function(e){e.focusTracker.on("change:isFocused",((t,o,s)=>{e.isOpen&&!s&&(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",((t,o)=>{e.isOpen&&(e.panelView.focus(),o())})),e.keystrokes.set("arrowup",((t,o)=>{e.isOpen&&(e.panelView.focusLast(),o())}))}(e),function(e){e.on("change:isOpen",((t,o,s)=>{s||e.panelView.element.contains(l.CO.document.activeElement)&&e.buttonView.focus()}))}(e),function(e){e.on("change:isOpen",((t,o,s)=>{s&&e.panelView.focus()}),{priority:"low"})}(e)}(n),n}function ue(e,t,o={}){const s=e.locale,i=s.t,n=e.toolbarView=new X(s);n.set("ariaLabel",i("Dropdown toolbar")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map((e=>n.items.add(e))),o.enableActiveItemFocusOnDropdownOpen&&fe(e,(()=>n.items.find((e=>e.isOn)))),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function pe(e,t){const o=e.locale,s=e.listView=new ie(o);s.items.bindTo(t).using((e=>{if("separator"===e.type)return new re(o);if("button"===e.type||"switchbutton"===e.type){const t=new ne(o);let s;return s="button"===e.type?new w(o):new y(o),s.bind(...Object.keys(e.model)).to(e.model),s.delegate("execute").to(t),t.children.add(s),t}return null})),e.panelView.children.add(s),s.items.delegate("execute").to(e),fe(e,(()=>s.items.find((e=>e instanceof ne&&e.children.first.isOn))))}function fe(e,t){e.on("change:isOpen",(()=>{if(!e.isOpen)return;const o=t();o&&("function"==typeof o.focus?o.focus():(0,l.KE)("ui-dropdown-focus-child-on-open-child-missing-focus",{view:o}))}),{priority:l.tA.low-10})}var ge=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/editorui/editorui.css"),me={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(ge.Z,me);ge.Z.locals;class be extends h.Z{constructor(e){super(e),this.body=new d(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}var _e=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/label/label.css"),we={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(_e.Z,we);_e.Z.locals;class ke extends h.Z{constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${(0,l.hQ)()}`;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 ve extends be{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,t=new ke;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class ye extends h.Z{constructor(e,t,o){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",!1),this._editableElement=o,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",(()=>this._updateIsFocusedClasses())),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change((o=>{const s=e.document.getRoot(t.name);o.addClass(t.isFocused?"ck-focused":"ck-blurred",s),o.removeClass(t.isFocused?"ck-blurred":"ck-focused",s)}))}e.isRenderingInProgress?function o(s){e.once("change:isRenderingInProgress",((e,i,n)=>{n?o(s):t(s)}))}(this):t(this)}}class xe extends ye{constructor(e,t,o,s={}){super(e,t,o);const i=e.t;this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}}),this._generateLabel=s.label||(()=>i("Editor editing area: %0",this.name))}render(){super.render();const e=this._editingView;e.change((t=>{const o=e.document.getRoot(this.name);t.setAttribute("aria-label",this._generateLabel(this),o)}))}}var Pe=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/formheader/formheader.css"),Te={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(Pe.Z,Te);Pe.Z.locals;class Ce extends h.Z{constructor(e,t={}){super(e);const o=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",o.to("class")]},children:this.children});const s=new h.Z(e);s.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"]},children:[{text:o.to("label")}]}),this.children.add(s)}}var Ae=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/input/input.css"),Ee={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(Ae.Z,Ee);Ae.Z.locals;class Se extends h.Z{constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.focusTracker=new l.Rh,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0),this.set("inputMode","text");const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),inputmode:t.to("inputMode"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to(((...e)=>{this.fire("input",...e),this._updateIsEmpty()})),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",((e,t,o)=>{this._setDomElementValue(o),this._updateIsEmpty()}))}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class Re extends Se{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class Oe extends Se{constructor(e,{min:t,max:o,step:s}={}){super(e);const i=this.bindTemplate;this.set("min",t),this.set("max",o),this.set("step",s),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:i.to("min"),max:i.to("max"),step:i.to("step")}})}}class Me extends h.Z{constructor(e){super(e);const t=this.bindTemplate;this.setTemplate({tag:"iframe",attributes:{class:["ck","ck-reset_all"],sandbox:"allow-same-origin allow-scripts"},on:{load:t.to("loaded")}})}render(){return new Promise((e=>(this.on("loaded",e),super.render())))}}var je=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css"),Be={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(je.Z,Be);je.Z.locals;class Ne extends h.Z{constructor(e,t){super(e);const o=`ck-labeled-field-view-${(0,l.hQ)()}`,s=`ck-labeled-field-view-status-${(0,l.hQ)()}`;this.fieldView=t(this,o,s),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(o),this.statusView=this._createStatusView(s),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),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)),i.if("isEmpty","ck-labeled-field-view_empty"),i.if("isFocused","ck-labeled-field-view_focused"),i.if("placeholder","ck-labeled-field-view_placeholder"),i.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new ke(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new h.Z(this.locale),o=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",o.if("errorText","ck-labeled-field-view__status_error"),o.if("_statusText","ck-hidden",(e=>!e))],id:e,role:o.if("errorText","alert")},children:[{text:o.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function Ve(e,t,o){const s=new Re(e.locale);return s.set({id:t,ariaDescribedById:o}),s.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),s.bind("hasError").to(e,"errorText",(e=>!!e)),s.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(s),s}function Ie(e,t,o){const s=new Oe(e.locale);return s.set({id:t,ariaDescribedById:o,inputMode:"numeric"}),s.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),s.bind("hasError").to(e,"errorText",(e=>!!e)),s.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(s),s}function De(e,t,o){const s=he(e.locale);return s.set({id:t,ariaDescribedById:o}),s.bind("isEnabled").to(e),s}class ze extends q.eO{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=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}var Fe=o("./node_modules/lodash-es/assignIn.js");class Le extends((0,l.Re)()){constructor(e,t){super(),t&&(0,Fe.Z)(this,t),e&&this.set(e)}}var Ze=o("./packages/ckeditor5-ui/src/panel/balloon/balloonpanelview.ts");var We=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/balloonrotator.css"),He={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(We.Z,He);We.Z.locals;var $e=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/fakepanel.css"),qe={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()($e.Z,qe);$e.Z.locals;const Ue=(0,l.nn)("px");class Ke extends q.Sy{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.set("visibleView",null),this.view=new Ze.Z(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",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}destroy(){super.destroy(),this.view.destroy(),this._rotatorView.destroy(),this._fakePanelsView.destroy()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view))throw new l.Bb("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const o=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),o.set(e.view,e),this._viewToStack.set(e.view,o),o===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new l.Bb("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){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 l.Bb("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find((t=>t[1]===e))[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;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;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Ge(this.editor.locale),t=this.editor.locale.t;return 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,o)=>{if(o<2)return"";const s=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[s,o])})),e.buttonNextView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()})),e.buttonPrevView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()})),e}_createFakePanelsView(){const e=new Je(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>=2?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),e}_showView({view:e,balloonClassName:t="",withArrow:o=!0,singleViewMode:s=!1}){this.view.class=t,this.view.withArrow=o,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),s&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}}class Ge extends h.Z{constructor(e){super(e);const t=e.t,o=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new l.Rh,this.buttonPrevView=this._createButtonView(t("Previous"),''),this.buttonNextView=this._createButtonView(t("Next"),''),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",o.to("isNavigationVisible",(e=>e?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:o.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const o=new w(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o}}class Je extends h.Z{constructor(e,t){super(e);const o=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",o.to("numberOfPanels",(e=>e?"":"ck-hidden"))],style:{top:o.to("top",Ue),left:o.to("left",Ue),width:o.to("width",Ue),height:o.to("height",Ue)}},children:this.content}),this.on("change:numberOfPanels",((e,t,o,s)=>{o>s?this._addPanels(o-s):this._removePanels(s-o),this.updatePosition()}))}_addPanels(e){for(;e--;){const e=new h.Z;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;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,{width:o,height:s}=new l.UL(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:o,height:s})}}}var Ye=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/stickypanel.css"),Xe={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(Ye.Z,Xe);Ye.Z.locals;const Qe=(0,l.nn)("px");class et extends h.Z{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new a.ZP({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",(e=>e?"block":"none")),height:t.to("isSticky",(e=>e?Qe(this._panelRect.height):null))}}}).render(),this._contentPanel=new a.ZP({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?Qe(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:t.to("_hasViewportTopOffset",(e=>e?Qe(this.viewportTopOffset):null)),bottom:t.to("_isStickyToTheLimiter",(e=>e?Qe(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(l.CO.window,"scroll",(()=>{this._checkIfShouldBeSticky()})),this.listenTo(this,"change:isActive",(()=>{this._checkIfShouldBeSticky()}))}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top{this.focusTracker.add(e.ui.getEditableElement()),this.focusTracker.add(this.toolbarView.element)})),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this.show(!0),afterBlur:()=>this.hide(),isContextual:!0}),this._resizeObserver=null,this._balloon=e.plugins.get(Ke),this._fireSelectionChangeDebounced=(0,ot.Z)((()=>this.fire("_selectionChangeDebounced")),200),this.decorate("show")}init(){const e=this.editor,t=e.model.document.selection;this.listenTo(this.focusTracker,"change:isFocused",((e,t,o)=>{const s=this._balloon.visibleView===this.toolbarView;!o&&s?this.hide():o&&this.show()})),this.listenTo(t,"change:range",((e,o)=>{(o.directChange||t.isCollapsed)&&this.hide(),this._fireSelectionChangeDebounced()})),this.listenTo(this,"_selectionChangeDebounced",(()=>{this.editor.editing.view.document.isFocused&&this.show()})),this._balloonConfig.shouldNotGroupWhenFull||this.listenTo(e,"ready",(()=>{const t=e.ui.view.editable.element;this._resizeObserver=new l.do(t,(()=>{this.toolbarView.maxWidth=st(.9*new l.UL(t).width)}))})),this.listenTo(this.toolbarView,"groupedItemsUpdate",(()=>{this._updatePosition()}))}afterInit(){const e=this.editor.ui.componentFactory;this.toolbarView.fillFromConfig(this._balloonConfig,e)}_createToolbarView(){const e=this.editor.locale.t,t=!this._balloonConfig.shouldNotGroupWhenFull,o=new X(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return o.ariaLabel=e("Editor contextual toolbar"),o.render(),o}show(e=!1){const t=this.editor,o=t.model.document.selection,s=t.model.schema;this._balloon.hasView(this.toolbarView)||o.isCollapsed&&!e||function(e,t){if(1===e.rangeCount)return!1;return[...e.getRanges()].every((e=>{const o=e.getContainedElement();return o&&t.isSelectable(o)}))}(o,s)||Array.from(this.toolbarView.items).every((e=>void 0!==e.isEnabled&&!e.isEnabled))||(this.listenTo(this.editor.ui,"update",(()=>{this._updatePosition()})),this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"}))}hide(){this._balloon.hasView(this.toolbarView)&&(this.stopListening(this.editor.ui,"update"),this._balloon.remove(this.toolbarView))}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document,o=t.selection,s=t.selection.isBackward;return{target:()=>{const t=s?o.getFirstRange():o.getLastRange(),i=l.UL.getDomRangeRects(e.domConverter.viewRangeToDom(t));return s?i[0]:(i.length>1&&0===i[i.length-1].width&&i.pop(),i[i.length-1])},positions:this._getBalloonPositions(s)}}_updatePosition(){this._balloon.updatePosition(this._getBalloonPositionData())}destroy(){super.destroy(),this.stopListening(),this._fireSelectionChangeDebounced.cancel(),this.toolbarView.destroy(),this.focusTracker.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getBalloonPositions(e){const t=l.OB.isSafari&&l.OB.isiOS?(0,Ze.M)({heightOffset:Math.max(Ze.Z.arrowHeightOffset,Math.round(20/l.CO.window.visualViewport.scale))}):Ze.Z.defaultPositions;return e?[t.northWestArrowSouth,t.northWestArrowSouthWest,t.northWestArrowSouthEast,t.northWestArrowSouthMiddleEast,t.northWestArrowSouthMiddleWest,t.southWestArrowNorth,t.southWestArrowNorthWest,t.southWestArrowNorthEast,t.southWestArrowNorthMiddleWest,t.southWestArrowNorthMiddleEast]:[t.southEastArrowNorth,t.southEastArrowNorthEast,t.southEastArrowNorthWest,t.southEastArrowNorthMiddleEast,t.southEastArrowNorthMiddleWest,t.northEastArrowSouth,t.northEastArrowSouthEast,t.northEastArrowSouthWest,t.northEastArrowSouthMiddleEast,t.northEastArrowSouthMiddleWest]}}var nt=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css"),rt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(nt.Z,rt);nt.Z.locals;const at=(0,l.nn)("px");class ct extends w{constructor(e){super(e);const t=this.bindTemplate;this.isVisible=!1,this.isToggleable=!0,this.set("top",0),this.set("left",0),this.extendTemplate({attributes:{class:"ck-block-toolbar-button",style:{top:t.to("top",(e=>at(e))),left:t.to("left",(e=>at(e)))}}})}}const lt=(0,l.nn)("px"),{pilcrow:dt}=q.ci;class ht extends q.Sy{static get pluginName(){return"BlockToolbar"}constructor(e){super(e),this._blockToolbarConfig=$(this.editor.config.get("blockToolbar")),this.toolbarView=this._createToolbarView(),this.panelView=this._createPanelView(),this.buttonView=this._createButtonView(),this._resizeObserver=null,s({emitter:this.panelView,contextElements:[this.panelView.element,this.buttonView.element],activator:()=>this.panelView.isVisible,callback:()=>this._hidePanel()})}init(){const e=this.editor;this.listenTo(e.model.document.selection,"change:range",((e,t)=>{t.directChange&&this._hidePanel()})),this.listenTo(e.ui,"update",(()=>this._updateButton())),this.listenTo(e,"change:isReadOnly",(()=>this._updateButton()),{priority:"low"}),this.listenTo(e.ui.focusTracker,"change:isFocused",(()=>this._updateButton())),this.listenTo(this.buttonView,"change:isVisible",((e,t,o)=>{o?this.buttonView.listenTo(window,"resize",(()=>this._updateButton())):(this.buttonView.stopListening(window,"resize"),this._hidePanel())})),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this._showPanel(),afterBlur:()=>this._hidePanel()})}afterInit(){const e=this.editor.ui.componentFactory,t=this._blockToolbarConfig;this.toolbarView.fillFromConfig(t,e);for(const e of this.toolbarView.items)e.on("execute",(()=>this._hidePanel(!0)),{priority:"high"});t.shouldNotGroupWhenFull||this.listenTo(this.editor,"ready",(()=>{const e=this.editor.ui.view.editable.element;this._resizeObserver=new l.do(e,(()=>{this.toolbarView.maxWidth=this._getToolbarMaxWidth()}))}))}destroy(){super.destroy(),this.panelView.destroy(),this.buttonView.destroy(),this.toolbarView.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_createToolbarView(){const e=this.editor.locale.t,t=!this._blockToolbarConfig.shouldNotGroupWhenFull,o=new X(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return o.ariaLabel=e("Editor block content toolbar"),o.focusTracker.on("change:isFocused",((e,t,o)=>{o||this._hidePanel()})),o}_createPanelView(){const e=this.editor,t=new Ze.Z(e.locale);return t.content.add(this.toolbarView),t.class="ck-toolbar-container",e.ui.view.body.add(t),e.ui.focusTracker.add(t.element),this.toolbarView.keystrokes.set("Esc",((e,t)=>{this._hidePanel(!0),t()})),t}_createButtonView(){const e=this.editor,t=e.t,o=new ct(e.locale),s=o.bindTemplate;return o.set({label:t("Edit block"),icon:dt,withText:!1}),o.extendTemplate({on:{mousedown:s.to((e=>{l.OB.isSafari&&this.panelView.isVisible&&this.toolbarView.focus(),e.preventDefault()}))}}),o.bind("isOn").to(this.panelView,"isVisible"),o.bind("tooltip").to(this.panelView,"isVisible",(e=>!e)),this.listenTo(o,"execute",(()=>{this.panelView.isVisible?this._hidePanel(!0):this._showPanel()})),e.ui.view.body.add(o),e.ui.focusTracker.add(o.element),o}_updateButton(){const e=this.editor,t=e.model,o=e.editing.view;if(!e.ui.focusTracker.isFocused)return void this._hideButton();if(e.isReadOnly)return void this._hideButton();const s=Array.from(t.document.selection.getSelectedBlocks())[0];if(!s||Array.from(this.toolbarView.items).every((e=>!e.isEnabled)))return void this._hideButton();const i=o.domConverter.mapViewToDom(e.editing.mapper.toViewElement(s));this.buttonView.isVisible=!0,this._attachButtonToElement(i),this.panelView.isVisible&&this._showPanel()}_hideButton(){this.buttonView.isVisible=!1}_showPanel(){if(!this.buttonView.isVisible)return;const e=this.panelView.isVisible;this.panelView.show(),this.toolbarView.maxWidth=this._getToolbarMaxWidth(),this.panelView.pin({target:this.buttonView.element,limiter:this.editor.ui.getEditableElement()}),e||this.toolbarView.items.get(0).focus()}_hidePanel(e){this.panelView.isVisible=!1,e&&this.editor.editing.view.focus()}_attachButtonToElement(e){const t=window.getComputedStyle(e),o=new l.UL(this.editor.ui.getEditableElement()),s=parseInt(t.paddingTop,10),i=parseInt(t.lineHeight,10)||1.2*parseInt(t.fontSize,10),n=(0,l.xZ)({element:this.buttonView.element,target:e,positions:[(e,t)=>{let n;return n="ltr"===this.editor.locale.uiLanguageDirection?o.left-t.width:o.right,{top:e.top+s+(i-t.height)/2,left:n}}]});this.buttonView.top=n.top,this.buttonView.left=n.left}_getToolbarMaxWidth(){const e=this.editor.ui.view.editable.element,t=new l.UL(e),o=new l.UL(this.buttonView.element),s="rtl"===this.editor.locale.uiLanguageDirection?o.left-t.right+o.width:t.left-o.left;return lt(t.width+s)}}},"./packages/ckeditor5-ui/src/panel/balloon/balloonpanelview.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>u,M:()=>f});var s=o("./packages/ckeditor5-ui/src/view.ts"),i=o("./packages/ckeditor5-utils/src/index.ts"),n=o("./node_modules/lodash-es/isElement.js"),r=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),a=o.n(r),c=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/balloonpanel.css"),l={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(c.Z,l);c.Z.locals;const d=(0,i.nn)("px"),h=i.CO.document.body;class u extends s.Z{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,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",d),left:t.to("left",d)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=u.defaultPositions,o=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,t.viewportStickyNorth],limiter:h,fitInViewport:!0},e),s=u._getOptimalPosition(o),i=parseInt(s.left),n=parseInt(s.top),r=s.name,a=s.config||{},{withArrow:c=!0}=a;this.top=n,this.left=i,this.position=r,this.withArrow=c}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=p(e.target),o=e.limiter?p(e.limiter):h;this.listenTo(i.CO.document,"scroll",((s,i)=>{const n=i.target,r=t&&n.contains(t),a=o&&n.contains(o);!r&&!a&&t&&o||this.attachTo(e)}),{useCapture:!0}),this.listenTo(i.CO.window,"resize",(()=>{this.attachTo(e)}))}_stopPinning(){this.stopListening(i.CO.document,"scroll"),this.stopListening(i.CO.window,"resize")}}function p(e){return(0,n.Z)(e)?e:(0,i.bR)(e)?e.commonAncestorContainer:"function"==typeof e?p(e()):null}function f(e={}){const{sideOffset:t=u.arrowSideOffset,heightOffset:o=u.arrowHeightOffset,stickyVerticalOffset:s=u.stickyVerticalOffset,config:i}=e;return{northWestArrowSouthWest:(e,o)=>({top:n(e,o),left:e.left-t,name:"arrow_sw",...i&&{config:i}}),northWestArrowSouthMiddleWest:(e,o)=>({top:n(e,o),left:e.left-.25*o.width-t,name:"arrow_smw",...i&&{config:i}}),northWestArrowSouth:(e,t)=>({top:n(e,t),left:e.left-t.width/2,name:"arrow_s",...i&&{config:i}}),northWestArrowSouthMiddleEast:(e,o)=>({top:n(e,o),left:e.left-.75*o.width+t,name:"arrow_sme",...i&&{config:i}}),northWestArrowSouthEast:(e,o)=>({top:n(e,o),left:e.left-o.width+t,name:"arrow_se",...i&&{config:i}}),northArrowSouthWest:(e,o)=>({top:n(e,o),left:e.left+e.width/2-t,name:"arrow_sw",...i&&{config:i}}),northArrowSouthMiddleWest:(e,o)=>({top:n(e,o),left:e.left+e.width/2-.25*o.width-t,name:"arrow_smw",...i&&{config:i}}),northArrowSouth:(e,t)=>({top:n(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...i&&{config:i}}),northArrowSouthMiddleEast:(e,o)=>({top:n(e,o),left:e.left+e.width/2-.75*o.width+t,name:"arrow_sme",...i&&{config:i}}),northArrowSouthEast:(e,o)=>({top:n(e,o),left:e.left+e.width/2-o.width+t,name:"arrow_se",...i&&{config:i}}),northEastArrowSouthWest:(e,o)=>({top:n(e,o),left:e.right-t,name:"arrow_sw",...i&&{config:i}}),northEastArrowSouthMiddleWest:(e,o)=>({top:n(e,o),left:e.right-.25*o.width-t,name:"arrow_smw",...i&&{config:i}}),northEastArrowSouth:(e,t)=>({top:n(e,t),left:e.right-t.width/2,name:"arrow_s",...i&&{config:i}}),northEastArrowSouthMiddleEast:(e,o)=>({top:n(e,o),left:e.right-.75*o.width+t,name:"arrow_sme",...i&&{config:i}}),northEastArrowSouthEast:(e,o)=>({top:n(e,o),left:e.right-o.width+t,name:"arrow_se",...i&&{config:i}}),southWestArrowNorthWest:e=>({top:r(e),left:e.left-t,name:"arrow_nw",...i&&{config:i}}),southWestArrowNorthMiddleWest:(e,o)=>({top:r(e),left:e.left-.25*o.width-t,name:"arrow_nmw",...i&&{config:i}}),southWestArrowNorth:(e,t)=>({top:r(e),left:e.left-t.width/2,name:"arrow_n",...i&&{config:i}}),southWestArrowNorthMiddleEast:(e,o)=>({top:r(e),left:e.left-.75*o.width+t,name:"arrow_nme",...i&&{config:i}}),southWestArrowNorthEast:(e,o)=>({top:r(e),left:e.left-o.width+t,name:"arrow_ne",...i&&{config:i}}),southArrowNorthWest:e=>({top:r(e),left:e.left+e.width/2-t,name:"arrow_nw",...i&&{config:i}}),southArrowNorthMiddleWest:(e,o)=>({top:r(e),left:e.left+e.width/2-.25*o.width-t,name:"arrow_nmw",...i&&{config:i}}),southArrowNorth:(e,t)=>({top:r(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...i&&{config:i}}),southArrowNorthMiddleEast:(e,o)=>({top:r(e),left:e.left+e.width/2-.75*o.width+t,name:"arrow_nme",...i&&{config:i}}),southArrowNorthEast:(e,o)=>({top:r(e),left:e.left+e.width/2-o.width+t,name:"arrow_ne",...i&&{config:i}}),southEastArrowNorthWest:e=>({top:r(e),left:e.right-t,name:"arrow_nw",...i&&{config:i}}),southEastArrowNorthMiddleWest:(e,o)=>({top:r(e),left:e.right-.25*o.width-t,name:"arrow_nmw",...i&&{config:i}}),southEastArrowNorth:(e,t)=>({top:r(e),left:e.right-t.width/2,name:"arrow_n",...i&&{config:i}}),southEastArrowNorthMiddleEast:(e,o)=>({top:r(e),left:e.right-.75*o.width+t,name:"arrow_nme",...i&&{config:i}}),southEastArrowNorthEast:(e,o)=>({top:r(e),left:e.right-o.width+t,name:"arrow_ne",...i&&{config:i}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-o,name:"arrow_e",...i&&{config:i}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+o,name:"arrow_w",...i&&{config:i}}),viewportStickyNorth:(e,t,o)=>e.getIntersection(o)?{top:o.top+s,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...i}}:null};function n(e,t){return e.top-t.height-o}function r(e){return e.bottom+o}}u.arrowSideOffset=25,u.arrowHeightOffset=10,u.stickyVerticalOffset=20,u._getOptimalPosition=i.xZ,u.defaultPositions=f()},"./packages/ckeditor5-ui/src/template.ts":(e,t,o)=>{"use strict";o.d(t,{ZP:()=>c});var s=o("./packages/ckeditor5-ui/src/view.ts"),i=o("./packages/ckeditor5-ui/src/viewcollection.ts"),n=o("./packages/ckeditor5-utils/src/index.ts"),r=o("./node_modules/lodash-es/cloneDeepWith.js"),a=o("./node_modules/lodash-es/isObject.js");class c extends((0,n.ln)()){constructor(e){super(),Object.assign(this,_(b(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new n.Bb("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const o of t.children)P(o)?yield o:T(o)&&(yield*e(o))}(this)}static bind(e,t){return{to:(o,s)=>new d({eventNameOrFunction:o,attribute:o,observable:e,emitter:t,callback:s}),if:(o,s,i)=>new h({observable:e,emitter:t,attribute:o,valueIfTrue:s,callback:i})}}static extend(e,t){if(e._isRendered)throw new n.Bb("template-extend-render",[this,e]);y(e,_(b(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new n.Bb("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),u(this.text)?this._bindToObservable({schema:this.text,updater:f(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,o=e.revertData;for(const s in this.attributes){const i=t.getAttribute(s),n=this.attributes[s];o&&(o.attributes[s]=i);const r=A(n)?n[0].ns:null;if(u(n)){const a=A(n)?n[0].value:n;o&&E(s)&&a.unshift(i),this._bindToObservable({schema:a,updater:g(t,s,r),data:e})}else if("style"==s&&"string"!=typeof n[0])this._renderStyleAttribute(n[0],e);else{o&&i&&E(s)&&n.unshift(i);const e=n.map((e=>e&&e.value||e)).reduce(((e,t)=>e.concat(t)),[]).reduce(k,"");x(e)||t.setAttributeNS(r,s,e)}}}_renderStyleAttribute(e,t){const o=t.node;for(const s in e){const i=e[s];u(i)?this._bindToObservable({schema:[i],updater:m(o,s),data:t}):o.style[s]=i}}_renderElementChildren(e){const t=e.node,o=e.intoFragment?document.createDocumentFragment():t,s=e.isApplying;let i=0;for(const r of this.children)if(C(r)){if(!s){r.setParent(t);for(const e of r)o.appendChild(e.element)}}else if(P(r))s||(r.isRendered||r.render(),o.appendChild(r.element));else if((0,n.UG)(r))o.appendChild(r);else if(s){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),r._renderNode({intoFragment:!1,node:o.childNodes[i++],isApplying:!0,revertData:t})}else o.appendChild(r.render());e.intoFragment&&t.appendChild(o)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const o=this.eventListeners[t].map((o=>{const[s,i]=t.split("@");return o.activateDomEventListener(s,i,e)}));e.revertData&&e.revertData.bindings.push(o)}}_bindToObservable({schema:e,updater:t,data:o}){const s=o.revertData;p(e,t,o);const i=e.filter((e=>!x(e))).filter((e=>e.observable)).map((s=>s.activateAttributeListener(e,t,o)));s&&s.bindings.push(i)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)return void(e.textContent=t.text);const o=e;for(const e in t.attributes){const s=t.attributes[e];null===s?o.removeAttribute(e):o.setAttribute(e,s)}for(let e=0;ep(e,t,o);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,s),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,s)}}}class d extends l{constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,o){const s=(e,o)=>{t&&!o.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(o):this.observable.fire(this.eventNameOrFunction,o))};return this.emitter.listenTo(o.node,e,s),()=>{this.emitter.stopListening(o.node,e,s)}}}class h extends l{constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!x(super.getValue(e))&&(this.valueIfTrue||!0)}}function u(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(u):e instanceof l)}function p(e,t,{node:o}){const s=function(e,t){return e.map((e=>e instanceof l?e.getValue(t):e))}(e,o);let i;i=1==e.length&&e[0]instanceof h?s[0]:s.reduce(k,""),x(i)?t.remove():t.set(i)}function f(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function g(e,t,o){return{set(s){e.setAttributeNS(o,t,s)},remove(){e.removeAttributeNS(o,t)}}}function m(e,t){return{set(o){e.style[t]=o},remove(){e.style[t]=null}}}function b(e){return(0,r.Z)(e,(e=>{if(e&&(e instanceof l||T(e)||P(e)||C(e)))return e}))}function _(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=(0,n.qo)(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)w(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=(0,n.qo)(e[t].value)),w(e,t)}(e.attributes);const t=[];if(e.children)if(C(e.children))t.push(e.children);else for(const o of e.children)T(o)||P(o)||(0,n.UG)(o)?t.push(o):t.push(new c(o));e.children=t}return e}function w(e,t){e[t]=(0,n.qo)(e[t])}function k(e,t){return x(t)?e:x(e)?t:`${e} ${t}`}function v(e,t){for(const o in t)e[o]?e[o].push(...t[o]):e[o]=t[o]}function y(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),v(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),v(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new n.Bb("ui-template-extend-children-mismatch",e);let o=0;for(const s of t.children)y(e.children[o++],s)}}function x(e){return!e&&0!==e}function P(e){return e instanceof s.Z}function T(e){return e instanceof c}function C(e){return e instanceof i.Z}function A(e){return(0,a.Z)(e[0])&&e[0].ns}function E(e){return"class"==e||"style"==e}},"./packages/ckeditor5-ui/src/tooltipmanager.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>p});var s=o("./packages/ckeditor5-ui/src/view.ts"),i=o("./packages/ckeditor5-ui/src/panel/balloon/balloonpanelview.ts"),n=o("./packages/ckeditor5-utils/src/index.ts"),r=o("./node_modules/lodash-es/debounce.js"),a=o("./node_modules/lodash-es/isElement.js"),c=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),l=o.n(c),d=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/tooltip/tooltip.css"),h={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};l()(d.Z,h);d.Z.locals;const u="ck-tooltip";class p extends((0,n.Xu)()){constructor(e){if(super(),p._editors.add(e),p._instance)return p._instance;p._instance=this,this.tooltipTextView=new s.Z(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new i.Z(e.locale),this.balloonPanelView.class=u,this.balloonPanelView.content.add(this.tooltipTextView),this._resizeObserver=null,this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._pinTooltipDebounced=(0,r.Z)(this._pinTooltip,600),this.listenTo(n.CO.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(n.CO.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(n.CO.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(n.CO.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(n.CO.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;p._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),p._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),p._instance=null)}static getPositioningFunctions(e){const t=p.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onEnterOrFocus(e,{target:t}){const o=f(t);var s;o&&(o!==this._currentElementWithTooltip&&(this._unpinTooltip(),this._pinTooltipDebounced(o,{text:(s=o).dataset.ckeTooltipText,position:s.dataset.ckeTooltipPosition||"s",cssClass:s.dataset.ckeTooltipClass||""})))}_onLeaveOrBlur(e,{target:t,relatedTarget:o}){if("mouseleave"===e.name){if(!(0,a.Z)(t))return;if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const e=f(t),s=f(o);e&&e!==s&&this._unpinTooltip()}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._unpinTooltip()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:o,cssClass:s}){const i=(0,n.Ps)(p._editors.values()).ui.view.body;i.has(this.balloonPanelView)||i.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.pin({target:e,positions:p.getPositioningFunctions(o)}),this._resizeObserver=new n.do(e,(()=>{(0,n.pn)(e)||this._unpinTooltip()})),this.balloonPanelView.class=[u,s].filter((e=>e)).join(" ");for(const e of p._editors)this.listenTo(e.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=o}_unpinTooltip(){this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of p._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver&&this._resizeObserver.destroy()}_updateTooltipPosition(){(0,n.pn)(this._currentElementWithTooltip)?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:p.getPositioningFunctions(this._currentTooltipPosition)}):this._unpinTooltip()}}function f(e){return(0,a.Z)(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}p.defaultBalloonPositions=(0,i.M)({heightOffset:5,sideOffset:13}),p._editors=new Set,p._instance=null},"./packages/ckeditor5-ui/src/view.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>d});var s=o("./packages/ckeditor5-ui/src/viewcollection.ts"),i=o("./packages/ckeditor5-ui/src/template.ts"),n=o("./packages/ckeditor5-utils/src/index.ts"),r=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),a=o.n(r),c=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/globals/globals.css"),l={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(c.Z,l);c.Z.locals;class d extends((0,n.Xu)((0,n.Re)())){constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new n.FE,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((t,o)=>{o.locale=e,o.t=e&&e.t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=i.ZP.bind(this,this)}createCollection(e){const t=new s.Z(e);return this._viewCollections.add(t),t}registerChild(e){(0,n.TW)(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){(0,n.TW)(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new i.ZP(e)}extendTemplate(e){i.ZP.extend(this.template,e)}render(){if(this.isRendered)throw new n.Bb("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((e=>e.destroy())),this.template&&this.template._revertData&&this.template.revert(this.element)}}},"./packages/ckeditor5-ui/src/viewcollection.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./packages/ckeditor5-utils/src/index.ts");class i extends s.FE{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",((e,t,o)=>{this._renderViewIntoCollectionParent(t,o)})),this.on("remove",((e,t)=>{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||!e.every((e=>"string"==typeof e)))throw new s.Bb("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const o of this)for(const s of e)o.delegate(s).to(t);this.on("add",((o,s)=>{for(const o of e)s.delegate(o).to(t)})),this.on("remove",((o,s)=>{for(const o of e)s.stopDelegating(o,t)}))}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}},"./packages/ckeditor5-utils/src/ckeditorerror.ts":(e,t,o)=>{"use strict";o.d(t,{H:()=>n,KE:()=>i,ZP:()=>s});class s extends Error{constructor(e,t,o){super(function(e,t){const o=new WeakSet,s=(e,t)=>{if("object"==typeof t&&null!==t){if(o.has(t))return`[object ${t.constructor.name}]`;o.add(t)}return t},i=t?` ${JSON.stringify(t,s)}`:"",n=r(e);return e+i+n}(e,o)),this.name="CKEditorError",this.context=t,this.data=o}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const o=new s(e.message,t);throw o.stack=e.stack,o}}function i(e,t){console.warn(...a(e,t))}function n(e,t){console.error(...a(e,t))}function r(e){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-${e}`}function a(e,t){const o=r(e);return t?[e,t,o]:[e,o]}},"./packages/ckeditor5-utils/src/dom/emittermixin.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>c});var s=o("./packages/ckeditor5-utils/src/emittermixin.ts"),i=o("./packages/ckeditor5-utils/src/uid.ts"),n=o("./packages/ckeditor5-utils/src/dom/isnode.ts"),r=o("./packages/ckeditor5-utils/src/dom/iswindow.ts");const a=c((0,s.ZP)());function c(e){if(!e)return a;return class extends e{listenTo(e,t,o,s={}){if((0,n.Z)(e)||(0,r.Z)(e)){const i={capture:!!s.useCapture,passive:!!s.usePassive},n=this._getProxyEmitter(e,i)||new l(e,i);this.listenTo(n,t,o,s)}else super.listenTo(e,t,o,s)}stopListening(e,t,o){if((0,n.Z)(e)||(0,r.Z)(e)){const s=this._getAllProxyEmitters(e);for(const e of s)this.stopListening(e,t,o)}else super.stopListening(e,t,o)}_getProxyEmitter(e,t){return(0,s.Rl)(this,d(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map((t=>this._getProxyEmitter(e,t))).filter((e=>!!e))}}}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{c[e]=a.prototype[e]}));class l extends((0,s.ZP)()){constructor(e,t){super(),(0,s.Hv)(this,d(e,t)),this._domNode=e,this._options=t}attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,o){this.attach(e),(0,s.ZP)().prototype._addEventListener.call(this,e,t,o)}_removeEventListener(e,t){(0,s.ZP)().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function d(e,t){let o=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=(0,i.Z)())}(e);for(const e of Object.keys(t).sort())t[e]&&(o+="-"+e);return o}},"./packages/ckeditor5-utils/src/dom/isnode.ts":(e,t,o)=>{"use strict";function s(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}o.d(t,{Z:()=>s})},"./packages/ckeditor5-utils/src/dom/iswindow.ts":(e,t,o)=>{"use strict";function s(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}o.d(t,{Z:()=>s})},"./packages/ckeditor5-utils/src/emittermixin.ts":(e,t,o)=>{"use strict";o.d(t,{Hv:()=>f,Rl:()=>p,ZP:()=>u});var s=o("./packages/ckeditor5-utils/src/eventinfo.ts"),i=o("./packages/ckeditor5-utils/src/uid.ts"),n=o("./packages/ckeditor5-utils/src/priorities.ts"),r=o("./packages/ckeditor5-utils/src/inserttopriorityarray.ts"),a=(o("./packages/ckeditor5-utils/src/version.ts"),o("./packages/ckeditor5-utils/src/ckeditorerror.ts"));const c=Symbol("listeningTo"),l=Symbol("emitterId"),d=Symbol("delegations"),h=u(Object);function u(e){if(!e)return h;return class extends e{on(e,t,o){this.listenTo(this,e,t,o)}once(e,t,o){let s=!1;this.listenTo(this,e,((e,...o)=>{s||(s=!0,e.off(),t.call(this,e,...o))}),o)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,o,s={}){let i,n;this[c]||(this[c]={});const r=this[c];g(e)||f(e);const a=g(e);(i=r[a])||(i=r[a]={emitter:e,callbacks:{}}),(n=i.callbacks[t])||(n=i.callbacks[t]=[]),n.push(o),function(e,t,o,s,i){t._addEventListener?t._addEventListener(o,s,i):e._addEventListener.call(t,o,s,i)}(this,e,t,o,s)}stopListening(e,t,o){const s=this[c];let i=e&&g(e);const n=s&&i?s[i]:void 0,r=n&&t?n.callbacks[t]:void 0;if(!(!s||e&&!n||t&&!r))if(o){k(this,e,t,o);-1!==r.indexOf(o)&&(1===r.length?delete n.callbacks[t]:k(this,e,t,o))}else if(r){for(;o=r.pop();)k(this,e,t,o);delete n.callbacks[t]}else if(n){for(t in n.callbacks)this.stopListening(e,t);delete s[i]}else{for(i in s)this.stopListening(s[i].emitter);delete this[c]}}fire(e,...t){try{const o=e instanceof s.Z?e:new s.Z(this,e),i=o.name;let n=_(this,i);if(o.path.push(this),n){const e=[o,...t];n=Array.from(n);for(let t=0;t{this[d]||(this[d]=new Map),e.forEach((e=>{const s=this[d].get(e);s?s.set(t,o):this[d].set(e,new Map([[t,o]]))}))}}}stopDelegating(e,t){if(this[d])if(e)if(t){const o=this[d].get(e);o&&o.delete(t)}else this[d].delete(e);else this[d].clear()}_addEventListener(e,t,o){!function(e,t){const o=m(e);if(o[t])return;let s=t,i=null;const n=[];for(;""!==s&&!o[s];)o[s]={callbacks:[],childEvents:[]},n.push(o[s]),i&&o[s].childEvents.push(i),i=s,s=s.substr(0,s.lastIndexOf(":"));if(""!==s){for(const e of n)e.callbacks=o[s].callbacks.slice();o[s].childEvents.push(i)}}(this,e);const s=b(this,e),i={callback:t,priority:n.Z.get(o.priority)};for(const e of s)(0,r.Z)(e,i)}_removeEventListener(e,t){const o=b(this,e);for(const e of o)for(let o=0;o-1?_(e,t.substr(0,t.lastIndexOf(":"))):null}function w(e,t,o){for(let[i,n]of e){n?"function"==typeof n&&(n=n(t.name)):n=t.name;const e=new s.Z(t.source,n);e.path=[...t.path],i.fire(e,...o)}}function k(e,t,o,s){t._removeEventListener?t._removeEventListener(o,s):e._removeEventListener.call(t,o,s)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{u[e]=h.prototype[e]}))},"./packages/ckeditor5-utils/src/env.ts":(e,t,o)=>{"use strict";o.d(t,{ZP:()=>n});const s=function(){try{return navigator.userAgent.toLowerCase()}catch(e){return""}}(),i={isMac:r(s),isWindows:function(e){return e.indexOf("windows")>-1}(s),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(s),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(s),isiOS:function(e){return!!e.match(/iphone|ipad/i)||r(e)&&navigator.maxTouchPoints>0}(s),isAndroid:function(e){return e.indexOf("android")>-1}(s),isBlink:function(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}(s),features:{isRegExpUnicodePropertySupported:function(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}()}},n=i;function r(e){return e.indexOf("macintosh")>-1}},"./packages/ckeditor5-utils/src/eventinfo.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});const s=function(){return function e(){e.called=!0}};class i{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=s(),this.off=s()}}},"./packages/ckeditor5-utils/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{Bb:()=>h.ZP,FE:()=>Oe,De:()=>I,Xu:()=>F.Z,a6:()=>T,ln:()=>l.ZP,M3:()=>d.Z,Rh:()=>je,VD:()=>Be.Z,go:()=>Se,Re:()=>w,UL:()=>J,do:()=>ee,Rt:()=>A,QX:()=>C,az:()=>j,Hg:()=>a,OB:()=>s.ZP,HZ:()=>i,Ps:()=>Me,dk:()=>W,Cq:()=>Pe.Cq,yy:()=>H,XU:()=>Pe.XU,j9:()=>Ce,mA:()=>Pe.mA,xZ:()=>le,CO:()=>Z,cq:()=>se,ZQ:()=>ie,VG:()=>Ie.Z,dj:()=>Pe.dj,tO:()=>ze,C3:()=>ne,Zt:()=>Pe.Zt,Cb:()=>Fe,pp:()=>We,YK:()=>$e,to:()=>Ze,TW:()=>E,nA:()=>Le,UG:()=>re.Z,bR:()=>q,Gs:()=>$,pn:()=>ae,Do:()=>Pe.Do,H:()=>h.H,KE:()=>h.KE,CD:()=>c,Zz:()=>Pe.Zz,tA:()=>Ve.Z,Od:()=>ue,F0:()=>fe,mR:()=>pe,jS:()=>te,x:()=>De,qo:()=>Ae,qL:()=>Ne,nn:()=>oe,hQ:()=>Re.Z,i8:()=>qe.Z});var s=o("./packages/ckeditor5-utils/src/env.ts");function i(e,t,o,s){o=o||function(e,t){return e===t};const i=Array.isArray(e)?e:Array.prototype.slice.call(e),a=Array.isArray(t)?t:Array.prototype.slice.call(t),c=function(e,t,o){const s=n(e,t,o);if(-1===s)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const i=r(e,s),a=r(t,s),c=n(i,a,o),l=e.length-c,d=t.length-c;return{firstIndex:s,lastIndexOld:l,lastIndexNew:d}}(i,a,o),l=s?function(e,t){const{firstIndex:o,lastIndexOld:s,lastIndexNew:i}=e;if(-1===o)return Array(t).fill("equal");let n=[];o>0&&(n=n.concat(Array(o).fill("equal")));i-o>0&&(n=n.concat(Array(i-o).fill("insert")));s-o>0&&(n=n.concat(Array(s-o).fill("delete")));i0&&o.push({index:s,type:"insert",values:e.slice(s,n)});i-s>0&&o.push({index:s+(n-s),type:"delete",howMany:i-s});return o}(a,c);return l}function n(e,t,o){for(let s=0;s200||i>200||s+i>300)return a.fastDiff(e,t,o,!0);let n,r;if(ia?-1:1;h[s+d]&&(h[s]=h[s+d].slice(0)),h[s]||(h[s]=[]),h[s].push(i>a?n:r);let p=Math.max(i,a),f=p-s;for(;fd;f--)u[f]=p(f);u[d]=p(d),g++}while(u[d]!==l);return h[d].slice(1)}function c(e,...t){t.forEach((t=>{const o=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);o.concat(s).forEach((o=>{if(o in e.prototype)return;if("function"==typeof t&&("length"==o||"name"==o||"prototype"==o))return;const s=Object.getOwnPropertyDescriptor(t,o);s.enumerable=!1,Object.defineProperty(e.prototype,o,s)}))}))}a.fastDiff=i;var l=o("./packages/ckeditor5-utils/src/emittermixin.ts"),d=o("./packages/ckeditor5-utils/src/eventinfo.ts"),h=o("./packages/ckeditor5-utils/src/ckeditorerror.ts"),u=o("./node_modules/lodash-es/isObject.js");const p=Symbol("observableProperties"),f=Symbol("boundObservables"),g=Symbol("boundProperties"),m=Symbol("decoratedMethods"),b=Symbol("decoratedOriginal"),_=w((0,l.ZP)());function w(e){if(!e)return _;return class extends e{set(e,t){if((0,u.Z)(e))return void Object.keys(e).forEach((t=>{this.set(t,e[t])}),this);k(this);const o=this[p];if(e in this&&!o.has(e))throw new h.ZP("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>o.get(e),set(t){const s=o.get(e);let i=this.fire(`set:${e}`,e,t,s);void 0===i&&(i=t),s===i&&o.has(e)||(o.set(e,i),this.fire(`change:${e}`,e,i,s))}}),this[e]=t}bind(...e){if(!e.length||!x(e))throw new h.ZP("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new h.ZP("observable-bind-duplicate-properties",this);k(this);const t=this[g];e.forEach((e=>{if(t.has(e))throw new h.ZP("observable-bind-rebind",this)}));const o=new Map;return e.forEach((e=>{const s={property:e,to:[]};t.set(e,s),o.set(e,s)})),{to:v,toMany:y,_observable:this,_bindProperties:e,_to:[],_bindings:o}}unbind(...e){if(!this[p])return;const t=this[g],o=this[f];if(e.length){if(!x(e))throw new h.ZP("observable-unbind-wrong-properties",this);e.forEach((e=>{const s=t.get(e);s&&(s.to.forEach((([e,t])=>{const i=o.get(e),n=i[t];n.delete(s),n.size||delete i[t],Object.keys(i).length||(o.delete(e),this.stopListening(e,"change"))})),t.delete(e))}))}else o.forEach(((e,t)=>{this.stopListening(t,"change")})),o.clear(),t.clear()}decorate(e){k(this);const t=this[e];if(!t)throw new h.ZP("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,((e,o)=>{e.return=t.apply(this,o)})),this[e]=function(...t){return this.fire(e,t)},this[e][b]=t,this[m]||(this[m]=[]),this[m].push(e)}stopListening(e,t,o){if(!e&&this[m]){for(const e of this[m])this[e]=this[e][b];delete this[m]}super.stopListening(e,t,o)}}}function k(e){e[p]||(Object.defineProperty(e,p,{value:new Map}),Object.defineProperty(e,f,{value:new Map}),Object.defineProperty(e,g,{value:new Map}))}function v(...e){const t=function(...e){if(!e.length)throw new h.ZP("observable-bind-to-parse-error",null);const t={to:[]};let o;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach((e=>{if("string"==typeof e)o.properties.push(e);else{if("object"!=typeof e)throw new h.ZP("observable-bind-to-parse-error",null);o={observable:e,properties:[]},t.to.push(o)}})),t}(...e),o=Array.from(this._bindings.keys()),s=o.length;if(!t.callback&&t.to.length>1)throw new h.ZP("observable-bind-to-no-callback",this);if(s>1&&t.callback)throw new h.ZP("observable-bind-to-extra-callback",this);var i;t.to.forEach((e=>{if(e.properties.length&&e.properties.length!==s)throw new h.ZP("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(o[0]).callback=t.callback),i=this._observable,this._to.forEach((e=>{const t=i[f];let o;t.get(e.observable)||i.listenTo(e.observable,"change",((s,n)=>{o=t.get(e.observable)[n],o&&o.forEach((e=>{P(i,e.property)}))}))})),function(e){let t;e._bindings.forEach(((o,s)=>{e._to.forEach((i=>{t=i.properties[o.callback?0:e._bindProperties.indexOf(s)],o.to.push([i.observable,t]),function(e,t,o,s){const i=e[f],n=i.get(o),r=n||{};r[s]||(r[s]=new Set);r[s].add(t),n||i.set(o,r)}(e._observable,o,i.observable,t)}))}))}(this),this._bindProperties.forEach((e=>{P(this._observable,e)}))}function y(e,t,o){if(this._bindings.size>1)throw new h.ZP("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const o=e.map((e=>[e,t]));return Array.prototype.concat.apply([],o)}(e,t),o)}function x(e){return e.every((e=>"string"==typeof e))}function P(e,t){const o=e[g].get(t);let s;o.callback?s=o.callback.apply(e,o.to.map((e=>e[0][e[1]]))):(s=o.to[0],s=s[0][s[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=s:e.set(t,s)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{w[e]=_.prototype[e]}));class T{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach((({element:e,newElement:t})=>{e.style.display="",t&&t.remove()})),this._replacedElements=[]}}function C(e){let t=0;for(const o of e)t++;return t}function A(e,t){const o=Math.min(e.length,t.length);for(let s=0;s{this._setToTarget(e,s,t[s],o)}))}}function D(e){return(0,N.Z)(e,z)}function z(e){return(0,V.Z)(e)?e:void 0}var F=o("./packages/ckeditor5-utils/src/dom/emittermixin.ts");let L;try{L={window,document}}catch(e){L={window:{},document:{}}}const Z=L;function W(e){const t=[];let o=e;for(;o&&o.nodeType!=Node.DOCUMENT_NODE;)t.unshift(o),o=o.parentNode;return t}function H(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}function $(e){return"[object Text]"==Object.prototype.toString.call(e)}function q(e){return"[object Range]"==Object.prototype.toString.apply(e)}var U=o("./packages/ckeditor5-utils/src/dom/iswindow.ts");function K(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 G=["top","right","bottom","left","width","height"];class J{constructor(e){const t=q(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),Q(e)||t)if(t){const t=J.getDomRangeRects(e);Y(this,J.getBoundingRect(t))}else Y(this,e.getBoundingClientRect());else if((0,U.Z)(e)){const{innerWidth:t,innerHeight:o}=e;Y(this,{top:0,right:t,bottom:o,left:0,width:t,height:o})}else Y(this,e)}clone(){return new J(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,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),width:0,height:0};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new J(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!X(e)){let o=e.parentNode||e.commonAncestorContainer;for(;o&&!X(o);){const e=new J(o),s=t.getIntersection(e);if(!s)return null;s.getArea(){for(const t of e){const e=ee._getElementCallbacks(t.target);if(e)for(const o of e)o(t)}}))}}function te(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function oe(e){return t=>t+e}function se(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function ie(e,t,o){e.insertBefore(o,e.childNodes[t]||null)}function ne(e){return e&&e.nodeType===Node.COMMENT_NODE}ee._observerInstance=null,ee._elementCallbacks=null;var re=o("./packages/ckeditor5-utils/src/dom/isnode.ts");function ae(e){return!!(e&&e.getClientRects&&e.getClientRects().length)}var ce=o("./node_modules/lodash-es/isFunction.js");function le({element:e,target:t,positions:o,limiter:s,fitInViewport:i,viewportOffsetConfig:n}){(0,ce.Z)(t)&&(t=t()),(0,ce.Z)(s)&&(s=s());const r=function(e){return e&&e.parentNode?e.offsetParent===Z.document.body?null:e.offsetParent:null}(e),a=new J(e),c=new J(t);let l;const d=i&&function(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new J(Z.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t}(n)||null,h={targetRect:c,elementRect:a,positionedElementAncestor:r,viewportRect:d};if(s||i){const e=s&&new J(s).getVisible();Object.assign(h,{limiterRect:e,viewportRect:d}),l=function(e,t){const{elementRect:o}=t,s=o.getArea(),i=e.map((e=>new he(e,t))).filter((e=>!!e.name));let n=0,r=null;for(const e of i){const{limiterIntersectionArea:t,viewportIntersectionArea:o}=e;if(t===s)return e;const i=o**2+t**2;i>n&&(n=i,r=e)}return r}(o,h)||new he(o[0],h)}else l=new he(o[0],h);return l}function de(e){const{scrollX:t,scrollY:o}=Z.window;return e.clone().moveBy(t,o)}class he{constructor(e,t){const o=e(t.targetRect,t.elementRect,t.viewportRect);if(!o)return;const{left:s,top:i,name:n,config:r}=o;this.name=n,this.config=r,this._positioningFunctionCorrdinates={left:s,top:i},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;if(e){const t=this._options.viewportRect;if(!t)return e.getIntersectionArea(this._rect);{const o=e.getIntersection(t);if(o)return o.getIntersectionArea(this._rect)}}return 0}get viewportIntersectionArea(){const e=this._options.viewportRect;return e?e.getIntersectionArea(this._rect):0}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=de(this._rect),this._options.positionedElementAncestor&&function(e,t){const o=de(new J(t)),s=K(t);let i=0,n=0;i-=o.left,n-=o.top,i+=t.scrollLeft,n+=t.scrollTop,i-=s.left,n-=s.top,e.moveBy(i,n)}(this._cachedAbsoluteRect,this._options.positionedElementAncestor)),this._cachedAbsoluteRect}}function ue(e){const t=e.parentNode;t&&t.removeChild(e)}function pe({target:e,viewportOffset:t=0}){const o=ve(e);let s=o,i=null;for(;s;){let n;n=ye(s==o?e:i),me(n,(()=>xe(e,s)));const r=xe(e,s);if(ge(s,r,t),s.parent!=s){if(i=s.frameElement,s=s.parent,!i)return}else s=null}}function fe(e){me(ye(e),(()=>new J(e)))}function ge(e,t,o){const s=t.clone().moveBy(0,o),i=t.clone().moveBy(0,-o),n=new J(e).excludeScrollbarsAndBorders();if(![i,s].every((e=>n.contains(e)))){let{scrollX:r,scrollY:a}=e;_e(i,n)?a-=n.top-t.top+o:be(s,n)&&(a+=t.bottom-n.bottom+o),we(t,n)?r-=n.left-t.left+o:ke(t,n)&&(r+=t.right-n.right+o),e.scrollTo(r,a)}}function me(e,t){const o=ve(e);let s,i;for(;e!=o.document.body;)i=t(),s=new J(e).excludeScrollbarsAndBorders(),s.contains(i)||(_e(i,s)?e.scrollTop-=s.top-i.top:be(i,s)&&(e.scrollTop+=i.bottom-s.bottom),we(i,s)?e.scrollLeft-=s.left-i.left:ke(i,s)&&(e.scrollLeft+=i.right-s.right)),e=e.parentNode}function be(e,t){return e.bottom>t.bottom}function _e(e,t){return e.topt.right}function ve(e){return q(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function ye(e){if(q(e)){let t=e.commonAncestorContainer;return $(t)&&(t=t.parentNode),t}return e.parentNode}function xe(e,t){const o=ve(e),s=new J(e);if(o===t)return s;{let e=o;for(;e!=t;){const t=e.frameElement,o=new J(t).excludeScrollbarsAndBorders();s.moveBy(o.left,o.top),e=e.parent}}return s}var Pe=o("./packages/ckeditor5-utils/src/keyboard.ts");const Te=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Ce(e){return Te.includes(e)?"rtl":"ltr"}function Ae(e){return Array.isArray(e)?e:[e]}function Ee(e,t,o=1){if("number"!=typeof o)throw new h.ZP("translation-service-quantity-not-a-number",null,{quantity:o});const s=Object.keys(Z.window.CKEDITOR_TRANSLATIONS).length;1===s&&(e=Object.keys(Z.window.CKEDITOR_TRANSLATIONS)[0]);const i=t.id||t.string;if(0===s||!function(e,t){return!!Z.window.CKEDITOR_TRANSLATIONS[e]&&!!Z.window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}(e,i))return 1!==o?t.plural:t.string;const n=Z.window.CKEDITOR_TRANSLATIONS[e].dictionary,r=Z.window.CKEDITOR_TRANSLATIONS[e].getPluralForm||(e=>1===e?0:1),a=n[i];if("string"==typeof a)return a;return a[Number(r(o))]}Z.window.CKEDITOR_TRANSLATIONS||(Z.window.CKEDITOR_TRANSLATIONS={});class Se{constructor({uiLanguage:e="en",contentLanguage:t}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Ce(this.uiLanguage),this.contentLanguageDirection=Ce(this.contentLanguage),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Ae(t),"string"==typeof e&&(e={string:e});const o=!!e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,((e,o)=>othis._items.length||t<0)throw new h.ZP("collection-add-item-invalid-index",this);let o=0;for(const s of e){const e=this._getItemIdBeforeAdding(s),i=t+o;this._items.splice(i,0,s),this._itemMap.set(e,s),this.fire("add",s,i),o++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new h.ZP("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,o]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:o}),t}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new h.ZP("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding((t=>new e(t)))},using:e=>{"function"==typeof e?this._setUpBindToBinding(e):this._setUpBindToBinding((t=>t[e]))}}}_setUpBindToBinding(e){const t=this._bindToCollection,o=(o,s,i)=>{const n=t._bindToCollection==this,r=t._bindToInternalToExternalMap.get(s);if(n&&r)this._bindToExternalToInternalMap.set(s,r),this._bindToInternalToExternalMap.set(r,s);else{const o=e(s);if(!o)return void this._skippedIndexesFromExternal.push(i);let n=i;for(const e of this._skippedIndexesFromExternal)i>e&&n--;for(const e of t._skippedIndexesFromExternal)n>=e&&n++;this._bindToExternalToInternalMap.set(s,o),this._bindToInternalToExternalMap.set(o,s),this.add(o,n);for(let e=0;e{const s=this._bindToExternalToInternalMap.get(t);s&&this.remove(s),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((e,t)=>(ot&&e.push(t),e)),[])}))}_getItemIdBeforeAdding(e){const t=this._idProperty;let o;if(t in e){if(o=e[t],"string"!=typeof o)throw new h.ZP("collection-add-invalid-id",this);if(this.get(o))throw new h.ZP("collection-add-item-already-exists",this)}else e[t]=o=(0,Re.Z)();return o}_remove(e){let t,o,s,i=!1;const n=this._idProperty;if("string"==typeof e?(o=e,s=this._itemMap.get(o),i=!s,s&&(t=this._items.indexOf(s))):"number"==typeof e?(t=e,s=this._items[t],i=!s,s&&(o=s[n])):(s=e,o=s[n],t=this._items.indexOf(s),i=-1==t||!this._itemMap.get(o)),i)throw new h.ZP("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(o);const r=this._bindToInternalToExternalMap.get(s);return this._bindToInternalToExternalMap.delete(s),this._bindToExternalToInternalMap.delete(r),this.fire("remove",s,t),[s,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Me(e){const t=e.next();return t.done?null:t.value}class je extends((0,F.Z)(w())){constructor(){super(),this._elements=new Set,this._nextEventLoopTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}add(e){if(this._elements.has(e))throw new h.ZP("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",(()=>this._focus(e)),{useCapture:!0}),this.listenTo(e,"blur",(()=>this._blur()),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout((()=>{this.focusedElement=null,this.isFocused=!1}),0)}}var Be=o("./packages/ckeditor5-utils/src/keystrokehandler.ts");function Ne(e){return E(e)?new Map(e):function(e){const t=new Map;for(const o in e)t.set(o,e[o]);return t}(e)}var Ve=o("./packages/ckeditor5-utils/src/priorities.ts"),Ie=o("./packages/ckeditor5-utils/src/inserttopriorityarray.ts");function De(e,t,o,s){if(Math.max(t.length,e.length)>1e4)return e.slice(0,o).concat(t).concat(e.slice(o+s,e.length));{const i=Array.from(e);return i.splice(o,s,...t),i}}function ze(e){return!!e&&1==e.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e)}function Fe(e){return!!e&&1==e.length&&/[\ud800-\udbff]/.test(e)}function Le(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}function Ze(e,t){return Fe(e.charAt(t-1))&&Le(e.charAt(t))}function We(e,t){return ze(e.charAt(t))}const He=function(){const e=/\p{Regional_Indicator}{2}/u.source,t="(?:"+[/\p{Emoji}[\u{E0020}-\u{E007E}]+\u{E007F}/u,/\p{Emoji}\u{FE0F}?\u{20E3}/u,/\p{Emoji}\u{FE0F}/u,/(?=\p{General_Category=Other_Symbol})\p{Emoji}\p{Emoji_Modifier}*/u].map((e=>e.source)).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}();function $e(e,t){const o=String(e).matchAll(He);return Array.from(o).some((e=>e.index{"use strict";o.d(t,{Z:()=>i});var s=o("./packages/ckeditor5-utils/src/priorities.ts");function i(e,t){const o=s.Z.get(t.priority);for(let i=0;i{"use strict";o.d(t,{Cq:()=>l,Do:()=>a,XU:()=>h,Zt:()=>f,Zz:()=>d,dj:()=>u,mA:()=>p});var s=o("./packages/ckeditor5-utils/src/ckeditorerror.ts"),i=o("./packages/ckeditor5-utils/src/env.ts");const n={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},r={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},a=function(){const e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){e[String.fromCharCode(t).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;for(const t of"`-=[];',./\\")e[t]=t.charCodeAt(0);return e}(),c=Object.fromEntries(Object.entries(a).map((([e,t])=>[t,e.charAt(0).toUpperCase()+e.slice(1)])));function l(e){let t;if("string"==typeof e){if(t=a[e.toLowerCase()],!t)throw new s.ZP("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?a.alt:0)+(e.ctrlKey?a.ctrl:0)+(e.shiftKey?a.shift:0)+(e.metaKey?a.cmd:0);return t}function d(e){return"string"==typeof e&&(e=function(e){return e.split("+").map((e=>e.trim()))}(e)),e.map((e=>"string"==typeof e?function(e){if(e.endsWith("!"))return l(e.slice(0,-1));const t=l(e);return i.ZP.isMac&&t==a.ctrl?a.cmd:t}(e):e)).reduce(((e,t)=>t+e),0)}function h(e){let t=d(e);return Object.entries(i.ZP.isMac?n:r).reduce(((e,[o,s])=>(0!=(t&a[o])&&(t&=~a[o],e+=s),e)),"")+(t?c[t]:"")}function u(e){return e==a.arrowright||e==a.arrowleft||e==a.arrowup||e==a.arrowdown}function p(e,t){const o="ltr"===t;switch(e){case a.arrowleft:return o?"left":"right";case a.arrowright:return o?"right":"left";case a.arrowup:return"up";case a.arrowdown:return"down"}}function f(e,t){const o=p(e,t);return"down"===o||"right"===o}},"./packages/ckeditor5-utils/src/keystrokehandler.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./packages/ckeditor5-utils/src/dom/emittermixin.ts"),i=o("./packages/ckeditor5-utils/src/keyboard.ts");class n{constructor(){this._listener=new((0,s.Z)())}listenTo(e){this._listener.listenTo(e,"keydown",((e,t)=>{this._listener.fire("_keydown:"+(0,i.Cq)(t),t)}))}set(e,t,o={}){const s=(0,i.Zz)(e),n=o.priority;this._listener.listenTo(this._listener,"_keydown:"+s,((e,o)=>{t(o,(()=>{o.preventDefault(),o.stopPropagation(),e.stop()})),e.return=!0}),{priority:n})}press(e){return!!this._listener.fire("_keydown:"+(0,i.Cq)(e),e)}destroy(){this._listener.stopListening()}}},"./packages/ckeditor5-utils/src/priorities.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s={get(e="normal"){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5}},"./packages/ckeditor5-utils/src/uid.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});const s=new Array(256).fill("").map(((e,t)=>("0"+t.toString(16)).slice(-2)));function i(){const e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,o=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0;return"e"+s[e>>0&255]+s[e>>8&255]+s[e>>16&255]+s[e>>24&255]+s[t>>0&255]+s[t>>8&255]+s[t>>16&255]+s[t>>24&255]+s[o>>0&255]+s[o>>8&255]+s[o>>16&255]+s[o>>24&255]+s[i>>0&255]+s[i>>8&255]+s[i>>16&255]+s[i>>24&255]}},"./packages/ckeditor5-utils/src/version.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./packages/ckeditor5-utils/src/ckeditorerror.ts");const i="35.4.0",n=i,r="object"==typeof window?window:o.g;if(r.CKEDITOR_VERSION)throw new s.ZP("ckeditor-duplicated-modules",null);r.CKEDITOR_VERSION=i},"./packages/ckeditor5-widget/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{s4:()=>f,Uo:()=>g,$L:()=>W,WR:()=>te,e8:()=>$,Ww:()=>I,KT:()=>P,id:()=>y,Qd:()=>m,em:()=>k,l6:()=>v,XC:()=>b,sC:()=>x,$n:()=>T});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-engine/src/index.ts"),n=o("./packages/ckeditor5-typing/src/index.ts"),r=o("./packages/ckeditor5-utils/src/index.ts"),a=o("./packages/ckeditor5-ui/src/index.ts"),c=o("./packages/ckeditor5-enter/src/index.ts");class l extends((0,r.ln)()){constructor(){super(),this._stack=[]}add(e,t){const o=this._stack,s=o[0];this._insertDescriptor(e);const i=o[0];s===i||d(s,i)||this.fire("change:top",{oldDescriptor:s,newDescriptor:i,writer:t})}remove(e,t){const o=this._stack,s=o[0];this._removeDescriptor(e);const i=o[0];s===i||d(s,i)||this.fire("change:top",{oldDescriptor:s,newDescriptor:i,writer:t})}_insertDescriptor(e){const t=this._stack,o=t.findIndex((t=>t.id===e.id));if(d(e,t[o]))return;o>-1&&t.splice(o,1);let s=0;for(;t[s]&&h(t[s],e);)s++;t.splice(s,0,e)}_removeDescriptor(e){const t=this._stack,o=t.findIndex((t=>t.id===e));o>-1&&t.splice(o,1)}}function d(e,t){return e&&t&&e.priority==t.priority&&u(e.classes)==u(t.classes)}function h(e,t){return e.priority>t.priority||!(e.priorityu(t.classes)}function u(e){return Array.isArray(e)?e.sort().join(","):e}const p='',f="ck-widget",g="ck-widget_selected";function m(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function b(e,t,o={}){if(!e.is("containerElement"))throw new r.Bb("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass(f,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=C,t.setCustomProperty("widgetLabel",[],e),o.label&&v(e,o.label),o.hasSelectionHandle&&function(e,t){const o=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),o=new a.mO;return o.set("content",p),o.render(),t.appendChild(o.element),t}));t.insert(t.createPositionAt(e,0),o),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),k(e,t),e}function _(e,t,o){if(t.classes&&o.addClass((0,r.qo)(t.classes),e),t.attributes)for(const s in t.attributes)o.setAttribute(s,t.attributes[s],e)}function w(e,t,o){if(t.classes&&o.removeClass((0,r.qo)(t.classes),e),t.attributes)for(const s in t.attributes)o.removeAttribute(s,e)}function k(e,t,o=_,s=w){const i=new l;i.on("change:top",((t,i)=>{i.oldDescriptor&&s(e,i.oldDescriptor,i.writer),i.newDescriptor&&o(e,i.newDescriptor,i.writer)}));t.setCustomProperty("addHighlight",((e,t,o)=>i.add(t,o)),e),t.setCustomProperty("removeHighlight",((e,t,o)=>i.remove(t,o)),e)}function v(e,t){e.getCustomProperty("widgetLabel").push(t)}function y(e){return e.getCustomProperty("widgetLabel").reduce(((e,t)=>"function"==typeof t?e?e+". "+t():t():e?e+". "+t:t),"")}function x(e,t,o={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),t.setAttribute("role","textbox",e),o.label&&t.setAttribute("aria-label",o.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",((o,s,i)=>{t.setAttribute("contenteditable",i?"false":"true",e)})),e.on("change:isFocused",((o,s,i)=>{i?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)})),k(e,t),e}function P(e,t){const o=e.getSelectedElement();if(o){const s=S(e);if(s)return t.createRange(t.createPositionAt(o,s))}return(0,i.KT)(e,t)}function T(e,t){return(o,s)=>{const{mapper:i,viewPosition:n}=s,r=i.findMappedViewAncestor(n);if(!t(r))return;const a=i.toModelElement(r);s.modelPosition=e.createPositionAt(a,n.isAtStart?"before":"after")}}function C(){return null}const A="widget-type-around";function E(e,t,o){return!!e&&m(e)&&!o.isInline(t)}function S(e){return e.getAttribute(A)}var R=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),O=o.n(R),M=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widgettypearound.css"),j={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};O()(M.Z,j);M.Z.locals;const B=["before","after"],N=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,V="ck-widget__type-around_disabled";class I extends s.Sy{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[c.C,n.HG]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",((o,s,i)=>{t.change((e=>{for(const o of t.document.roots)i?e.removeClass(V,o):e.addClass(V,o)})),i||e.model.change((e=>{e.removeSelectionAttribute(A)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const o=this.editor,s=o.editing.view,i=o.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);o.execute("insertParagraph",{position:o.model.createPositionAt(e,t),attributes:i}),s.focus(),s.scrollToTheSelection()}_listenToIfEnabled(e,t,o,s){this.listenTo(e,t,((...e)=>{this.isEnabled&&o(...e)}),s)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=S(e);if(!t)return!1;const o=e.getSelectedElement();return this._insertParagraph(o,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,o=e.locale.t,s={before:o("Insert paragraph before block"),after:o("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",((e,i,n)=>{const r=n.mapper.toViewElement(i.item);if(r&&E(r,i.item,t)){!function(e,t,o){const s=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const o=this.toDomElement(e);return function(e,t){for(const o of B){const s=new a.YS({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${o}`],title:t[o],"aria-hidden":"true"},children:[e.ownerDocument.importNode(N,!0)]});e.appendChild(s.render())}}(o,t),function(e){const t=new a.YS({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(o),o}));e.insert(e.createPositionAt(o,"end"),s)}(n.writer,s,r);r.getCustomProperty("widgetLabel").push((()=>this.isEnabled?o("Press Enter to type after or press Shift + Enter to type before the widget"):""))}}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,o=t.document.selection,s=t.schema,i=e.editing.view;function n(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(i.document,"arrowKey",((e,t)=>{this._handleArrowKeyPress(e,t)}),{context:[m,"$text"],priority:"high"}),this._listenToIfEnabled(o,"change:range",((t,o)=>{o.directChange&&e.model.change((e=>{e.removeSelectionAttribute(A)}))})),this._listenToIfEnabled(t.document,"change:data",(()=>{const t=o.getSelectedElement();if(t){if(E(e.editing.mapper.toViewElement(t),t,s))return}e.model.change((e=>{e.removeSelectionAttribute(A)}))})),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",((e,t,o)=>{const i=o.writer;if(this._currentFakeCaretModelElement){const e=o.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(i.removeClass(B.map(n),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=o.mapper.toViewElement(r);if(!E(a,r,s))return;const c=S(t.selection);c&&(i.addClass(n(c),a),this._currentFakeCaretModelElement=r)})),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",((t,o,s)=>{s||e.model.change((e=>{e.removeSelectionAttribute(A)}))}))}_handleArrowKeyPress(e,t){const o=this.editor,s=o.model,i=s.document.selection,n=s.schema,a=o.editing.view,c=t.keyCode,l=(0,r.Zt)(c,o.locale.contentLanguageDirection),d=a.document.selection.getSelectedElement();let h;E(d,o.editing.mapper.toModelElement(d),n)?h=this._handleArrowKeyPressOnSelectedWidget(l):i.isCollapsed?h=this._handleArrowKeyPressWhenSelectionNextToAWidget(l):t.shiftKey||(h=this._handleArrowKeyPressWhenNonCollapsedSelection(l)),h&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,o=S(t.document.selection);return t.change((t=>{if(!o)return t.setSelectionAttribute(A,e?"after":"before"),!0;if(!(o===(e?"after":"before")))return t.removeSelectionAttribute(A),!0;return!1}))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,o=t.model,s=o.schema,i=t.plugins.get("Widget"),n=i._getObjectElementNextToSelection(e);return!!E(t.editing.mapper.toViewElement(n),n,s)&&(o.change((t=>{i._setSelectionOverElement(n),t.setSelectionAttribute(A,e?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,o=t.model,s=o.schema,i=t.editing.mapper,n=o.document.selection,r=e?n.getLastPosition().nodeBefore:n.getFirstPosition().nodeAfter;return!!E(i.toViewElement(r),r,s)&&(o.change((t=>{t.setSelection(r,"on"),t.setSelectionAttribute(A,e?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",((o,s)=>{const i=s.domTarget.closest(".ck-widget__type-around__button");if(!i)return;const n=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(i),r=function(e,t){const o=e.closest(".ck-widget");return t.mapDomToView(o)}(i,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,n),s.preventDefault(),o.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,o=e.editing.view;this._listenToIfEnabled(o.document,"enter",((o,s)=>{if("atTarget"!=o.eventPhase)return;const i=t.getSelectedElement(),n=e.editing.mapper.toViewElement(i),r=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:E(n,i,r)&&(this._insertParagraph(i,s.isSoft?"before":"after"),a=!0),a&&(s.preventDefault(),o.stop())}),{context:m})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,o)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(o.selection=e.selection)}),{priority:"high"}),r.OB.isAndroid?this._listenToIfEnabled(e,"keydown",((e,t)=>{229==t.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()})):this._listenToIfEnabled(e,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,o=e.model,s=o.schema;this._listenToIfEnabled(t.document,"delete",((t,i)=>{if("atTarget"!=t.eventPhase)return;const n=S(o.document.selection);if(!n)return;const r=i.direction,a=o.document.selection.getSelectedElement(),c="forward"==r;if("before"===n===c)e.execute("delete",{selection:o.createSelection(a,"on")});else{const t=s.getNearestSelectionRange(o.createPositionAt(a,n),r);if(t)if(t.isCollapsed){const i=o.createSelection(t.start);if(o.modifySelection(i,{direction:r}),i.focus.isEqual(t.start)){const e=function(e,t){let o=t;for(const s of t.getAncestors({parentFirst:!0})){if(s.childCount>1||e.isLimit(s))break;o=s}return o}(s,t.start.parent);o.deleteContent(o.createSelection(e,"on"),{doNotAutoparagraph:!0})}else o.change((o=>{o.setSelection(t),e.execute(c?"deleteForward":"delete")}))}else o.change((o=>{o.setSelection(t),e.execute(c?"deleteForward":"delete")}))}i.preventDefault(),t.stop()}),{context:m})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,o=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",((e,[s,i])=>{if(i&&!i.is("documentSelection"))return;const n=S(o);return n?(e.stop(),t.change((e=>{const i=o.getSelectedElement(),r=t.createPositionAt(i,n),a=e.createSelection(r),c=t.insertContent(s,a);return e.setSelection(a),c}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",((e,o)=>{const[,s,,i={}]=o;if(s&&!s.is("documentSelection"))return;const n=S(t);n&&(i.findOptimalPosition=n,o[3]=i)}),{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",((e,[o])=>{if(o&&!o.is("documentSelection"))return;S(t)&&e.stop()}),{priority:"high"})}}function D(e){const t=e.model;return(o,s)=>{const i=s.keyCode==r.Do.arrowup,n=s.keyCode==r.Do.arrowdown,a=s.shiftKey,c=t.document.selection;if(!i&&!n)return;const l=n;if(a&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(c,l))return;const d=function(e,t,o){const s=e.model;if(o){const e=t.isCollapsed?t.focus:t.getLastPosition(),o=z(s,e,"forward");if(!o)return null;const i=s.createRange(e,o),n=F(s.schema,i,"backward");return n?s.createRange(e,n):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),o=z(s,e,"backward");if(!o)return null;const i=s.createRange(o,e),n=F(s.schema,i,"forward");return n?s.createRange(n,e):null}}(e,c,l);if(d){if(d.isCollapsed){if(c.isCollapsed)return;if(a)return}(d.isCollapsed||function(e,t,o){const s=e.model,i=e.view.domConverter;if(o){const e=s.createSelection(t.start);s.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=s.createRange(e.focus,t.end))}const n=e.mapper.toViewRange(t),a=i.viewRangeToDom(n),c=r.UL.getDomRangeRects(a);let l;for(const e of c)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,d,l))&&(t.change((e=>{const o=l?d.end:d.start;if(a){const s=t.createSelection(c.anchor);s.setFocus(o),e.setSelection(s)}else e.setSelection(o)})),o.stop(),s.preventDefault(),s.stopPropagation())}}}function z(e,t,o){const s=e.schema,i=e.createRangeIn(t.root),n="forward"==o?"elementStart":"elementEnd";for(const{previousPosition:e,item:r,type:a}of i.getWalker({startPosition:t,direction:o})){if(s.isLimit(r)&&!s.isInline(r))return e;if(a==n&&s.isBlock(r))return null}return null}function F(e,t,o){const s="backward"==o?t.end:t.start;if(e.checkChild(s,"$text"))return s;for(const{nextPosition:s}of t.getWalker({direction:o}))if(e.checkChild(s,"$text"))return s;return null}var L=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widget.css"),Z={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};O()(L.Z,Z);L.Z.locals;class W extends s.Sy{static get pluginName(){return"Widget"}static get requires(){return[I,n.HG]}init(){const e=this.editor,t=e.editing.view,o=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",((t,o,s)=>{const i=s.writer,n=o.selection;if(n.isCollapsed)return;const r=n.getSelectedElement();if(!r)return;const a=e.editing.mapper.toViewElement(r);m(a)&&s.consumable.consume(n,"selection")&&i.setSelection(i.createRangeOn(a),{fake:!0,label:y(a)})})),this.editor.editing.downcastDispatcher.on("selection",((e,t,o)=>{this._clearPreviouslySelectedWidgets(o.writer);const s=o.writer,i=s.document.selection;let n=null;for(const e of i.getRanges())for(const t of e){const e=t.item;m(e)&&!H(e,n)&&(s.addClass(g,e),this._previouslySelected.add(e),n=e)}}),{priority:"low"}),t.addObserver(i.dM),this.listenTo(o,"mousedown",((...e)=>this._onMousedown(...e))),this.listenTo(o,"arrowKey",((...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)}),{context:[m,"$text"]}),this.listenTo(o,"arrowKey",((...e)=>{this._preventDefaultOnArrowKeyPress(...e)}),{context:"$root"}),this.listenTo(o,"arrowKey",D(this.editor.editing),{context:"$text"}),this.listenTo(o,"delete",((e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())}),{context:"$root"})}_onMousedown(e,t){const o=this.editor,s=o.editing.view,i=s.document;let n=t.target;if(function(e){let t=e;for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(m(t))return!1;t=t.parent}return!1}(n)){if((r.OB.isSafari||r.OB.isGecko)&&t.domEvent.detail>=3){const e=o.editing.mapper,s=n.is("attributeElement")?n.findAncestor((e=>!e.is("attributeElement"))):n,i=e.toModelElement(s);t.preventDefault(),this.editor.model.change((e=>{e.setSelection(i,"in")}))}return}if(!m(n)&&(n=n.findAncestor(m),!n))return;r.OB.isAndroid&&t.preventDefault(),i.isFocused||s.focus();const a=o.editing.mapper.toModelElement(n);this._setSelectionOverElement(a)}_handleSelectionChangeOnArrowKeyPress(e,t){const o=t.keyCode,s=this.editor.model,i=s.schema,n=s.document.selection,a=n.getSelectedElement(),c=(0,r.mA)(o,this.editor.locale.contentLanguageDirection),l="down"==c||"right"==c,d="up"==c||"down"==c;if(a&&i.isObject(a)){const o=l?n.getLastPosition():n.getFirstPosition(),r=i.getNearestSelectionRange(o,l?"forward":"backward");return void(r&&(s.change((e=>{e.setSelection(r)})),t.preventDefault(),e.stop()))}if(!n.isCollapsed&&!t.shiftKey){const o=n.getFirstPosition(),r=n.getLastPosition(),a=o.nodeAfter,c=r.nodeBefore;return void((a&&i.isObject(a)||c&&i.isObject(c))&&(s.change((e=>{e.setSelection(l?r:o)})),t.preventDefault(),e.stop()))}if(!n.isCollapsed)return;const h=this._getObjectElementNextToSelection(l);if(h&&i.isObject(h)){if(i.isInline(h)&&d)return;this._setSelectionOverElement(h),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const o=this.editor.model,s=o.schema,i=o.document.selection.getSelectedElement();i&&s.isObject(i)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const o=this._getObjectElementNextToSelection(e);return o?(this.editor.model.change((e=>{let s=t.anchor.parent;for(;s.isEmpty;){const t=s;s=t.parent,e.remove(t)}this._setSelectionOverElement(o)})),!0):void 0}_setSelectionOverElement(e){this.editor.model.change((t=>{t.setSelection(t.createRangeOn(e))}))}_getObjectElementNextToSelection(e){const t=this.editor.model,o=t.schema,s=t.document.selection,i=t.createSelection(s);if(t.modifySelection(i,{direction:e?"forward":"backward"}),i.isEqual(s))return null;const n=e?i.focus.nodeBefore:i.focus.nodeAfter;return n&&o.isObject(n)?n:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(g,t);this._previouslySelected.clear()}}function H(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}class $ extends s.Sy{static get requires(){return[a.WB]}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=>{(function(e){const t=e.getSelectedElement();return!(!t||!m(t))})(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:o,getRelatedElement:s,balloonClassName:i="ck-toolbar-container"}){if(!o.length)return void(0,r.KE)("widget-toolbar-no-items",{toolbarId:e});const n=this.editor,c=n.t,l=new a.jB(n.locale);if(l.ariaLabel=t||c("Widget toolbar"),this._toolbarDefinitions.has(e))throw new r.Bb("widget-toolbar-duplicated",this,{toolbarId:e});l.fillFromConfig(o,n.ui.componentFactory);const d={view:l,getRelatedElement:s,balloonClassName:i};n.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{const e=s(n.editing.view.document.selection);e&&this._showToolbar(d,e)},afterBlur:()=>{this._hideToolbar(d)}}),this._toolbarDefinitions.set(e,d)}_updateToolbarsVisibility(){let e=0,t=null,o=null;for(const s of this._toolbarDefinitions.values()){const i=s.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&i)if(this.editor.ui.focusTracker.isFocused){const n=i.getAncestors().length;n>e&&(e=n,t=i,o=s)}else this._isToolbarVisible(s)&&this._hideToolbar(s);else this._isToolbarInBalloon(s)&&this._hideToolbar(s)}o&&this._showToolbar(o,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?q(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:U(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);q(this.editor,t)}})))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function q(e,t){const o=e.plugins.get("ContextualBalloon"),s=U(e,t);o.updatePosition(s)}function U(e,t){const o=e.editing.view,s=a.no.defaultPositions;return{target:o.domConverter.mapViewToDom(t),positions:[s.northArrowSouth,s.northArrowSouthWest,s.northArrowSouthEast,s.southArrowNorth,s.southArrowNorthWest,s.southArrowNorthEast,s.viewportStickyNorth]}}class K extends((0,r.Re)()){constructor(e){super(),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}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,o){const s=new r.UL(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const o of t)if(e.classList.contains(G(o)))return o}(e),this._referenceCoordinates=function(e,t){const o=new r.UL(e),s=t.split("-"),i={x:"right"==s[1]?o.right:o.left,y:"bottom"==s[0]?o.bottom:o.top};return i.x+=e.ownerDocument.defaultView.scrollX,i.y+=e.ownerDocument.defaultView.scrollY,i}(t,function(e){const t=e.split("-"),o={top:"bottom",bottom:"top",left:"right",right:"left"};return`${o[t[0]]}-${o[t[1]]}`}(this.activeHandlePosition)),this._originalWidth=s.width,this._originalHeight=s.height,this._aspectRatio=s.width/s.height;const i=o.style.width;i&&i.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(i):this._originalWidthPercents=function(e,t){const o=e.parentElement,s=parseFloat(o.ownerDocument.defaultView.getComputedStyle(o).width);return t.width/s*100}(o,s)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function G(e){return`ck-widget__resizer__handle-${e}`}class J extends a.G7{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",(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)=>null!==e&&null!==t)),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",((t,o,s)=>"px"===e.unit?`${t}×${o}`:`${s}%`)),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",((e,t,o)=>t<50||o<50?"above-center":e))}_dismiss(){this.unbind(),this._isVisible=!1}}class Y extends((0,r.Re)()){constructor(e){super(),this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",((e,t)=>e&&t)),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",(e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())}),{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change((e=>{e.removeClass("ck-hidden",this._viewResizerWrapper)}))}hide(){this._options.editor.editing.view.change((e=>{e.addClass("ck-hidden",this._viewResizerWrapper)}))}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change((o=>{const s=o.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const o=this.toDomElement(t);return e._appendHandles(o),e._appendSizeUI(o),o}));o.insert(o.createPositionAt(t,"end"),s),o.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=s,this.isVisible||this.hide()})),this.on("change:isVisible",(()=>{this.isVisible?(this.show(),this.redraw()):this.hide()}))}begin(e){this._state=new K(this._options),this._sizeView._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);this._options.editor.editing.view.change((e=>{const o=this._options.unit||"%",s=("%"===o?t.widthPercents:t.width)+o;e.setStyle("width",s,this._options.viewElement)}));const o=this._getHandleHost(),s=new r.UL(o),i=Math.round(s.width),n=Math.round(s.height),a=new r.UL(o);t.width=Math.round(a.width),t.height=Math.round(a.height),this.redraw(s),this.state.update({...t,handleHostWidth:i,handleHostHeight:n})}commit(){const e=this._options.unit||"%",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(!((o=t)&&o.ownerDocument&&o.ownerDocument.contains(o)))return;var o;const s=t.parentElement,i=this._getHandleHost(),n=this._viewResizerWrapper,a=[n.getStyle("width"),n.getStyle("height"),n.getStyle("left"),n.getStyle("top")];let c;if(s.isSameNode(i)){const t=e||new r.UL(i);c=[t.width+"px",t.height+"px",void 0,void 0]}else c=[i.offsetWidth+"px",i.offsetHeight+"px",i.offsetLeft+"px",i.offsetTop+"px"];"same"!==(0,r.Rt)(a,c)&&this._options.editor.editing.view.change((e=>{e.setStyle({width:c[0],height:c[1],left:c[2],top:c[3]},n)}))}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();this._options.editor.editing.view.change((e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(e){const t=this.state,o={x:(s=e).pageX,y:s.pageY};var s;const i=!this._options.isCentered||this._options.isCentered(this),n={x:t._referenceCoordinates.x-(o.x+t.originalWidth),y:o.y-t.originalHeight-t._referenceCoordinates.y};i&&t.activeHandlePosition.endsWith("-right")&&(n.x=o.x-(t._referenceCoordinates.x+t.originalWidth)),i&&(n.x*=2);let r=Math.abs(t.originalWidth+n.x),a=Math.abs(t.originalHeight+n.y);return"width"==(r/t.aspectRatio>a?"width":"height")?a=r/t.aspectRatio:r=a*t.aspectRatio,{width:Math.round(r),height:Math.round(a),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r*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)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const s of t)e.appendChild(new a.YS({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(o=s,`ck-widget__resizer__handle-${o}`)}}).render());var o}_appendSizeUI(e){this._sizeView=new J,this._sizeView.render(),e.appendChild(this._sizeView.element)}}var X=o("./node_modules/lodash-es/throttle.js"),Q=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widgetresize.css"),ee={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};O()(Q.Z,ee);Q.Z.locals;class te extends s.Sy{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing,t=r.CO.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(i.dM),this._observer=new((0,r.Xu)()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=(0,X.Z)((()=>this.redrawSelectedResizer()),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",(()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())}),{priority:"lowest"}),this._observer.listenTo(r.CO.window,"resize",this._redrawSelectedResizerThrottled);const o=this.editor.editing.view.document.selection;o.on("change",(()=>{const e=o.getSelectedElement(),t=this.getResizerByViewElement(e)||null;t?this.select(t):this.deselect()}))}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const t=new Y(e),o=this.editor.plugins;if(t.attach(),o.has("WidgetToolbarRepository")){const e=o.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);const s=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(s)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const o=t.domTarget;Y.isResizeHandle(o)&&(this._activeResizer=this._getResizerByHandle(o)||null,this._activeResizer&&(this._activeResizer.begin(o),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}},"./src/clipboard.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Clipboard:()=>y,ClipboardPipeline:()=>l,DragDrop:()=>m,PastePlainText:()=>v});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts"),n=o("./packages/ckeditor5-engine/src/index.ts");class r extends n.qZ{constructor(e){super(e);const t=this.document;function o(e){return(o,s)=>{s.preventDefault();const n=s.dropRange?[s.dropRange]:null,r=new i.M3(t,e);t.fire(r,{dataTransfer:s.dataTransfer,method:o.name,targetRanges:n,target:s.target}),r.stop.called&&s.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(t,"paste",o("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",o("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",o("dragging"),{priority:"low"})}onDomEvent(e){const t={dataTransfer:new n.tn("clipboardData"in e?e.clipboardData:e.dataTransfer)};"drop"!=e.type&&"dragover"!=e.type||(t.dropRange=function(e,t){const o=t.target.ownerDocument,s=t.clientX,i=t.clientY;let n;o.caretRangeFromPoint&&o.caretRangeFromPoint(s,i)?n=o.caretRangeFromPoint(s,i):t.rangeParent&&(n=o.createRange(),n.setStart(t.rangeParent,t.rangeOffset),n.collapse(!0));if(n)return e.domConverter.domRangeToView(n);return null}(this.view,e)),this.fire(e.type,e,t)}}const a=["figcaption","li"];function c(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 if(e.is("element","br"))t="\n";else{let o=null;for(const s of e.getChildren()){const e=c(s);o&&(o.is("containerElement")||s.is("containerElement"))&&(a.includes(o.name)||a.includes(s.name)?t+="\n":t+="\n\n"),t+=e,o=s}}return t}class l extends s.Sy{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(r),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,o=e.editing.view,s=o.document;this.listenTo(s,"clipboardInput",(t=>{e.isReadOnly&&t.stop()}),{priority:"highest"}),this.listenTo(s,"clipboardInput",((e,t)=>{const s=t.dataTransfer;let n;if(t.content)n=t.content;else{let e="";s.getData("text/html")?e=function(e){return e.replace(/(\s+)<\/span>/g,((e,t)=>1==t.length?" ":t)).replace(//g,"")}(s.getData("text/html")):s.getData("text/plain")&&(((r=(r=s.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||r.includes("
"))&&(r=`

${r}

`),e=r),n=this.editor.data.htmlProcessor.toView(e)}var r;const a=new i.M3(this,"inputTransformation");this.fire(a,{content:n,dataTransfer:s,targetRanges:t.targetRanges,method:t.method}),a.stop.called&&e.stop(),o.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,o)=>{if(o.content.isEmpty)return;const s=this.editor.data.toModel(o.content,"$clipboardHolder");0!=s.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:s,method:o.method,dataTransfer:o.dataTransfer,targetRanges:o.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,o)=>{o.resultRange=t.insertContent(o.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,o=e.editing.view.document,s=(s,i)=>{const n=i.dataTransfer;i.preventDefault();const r=e.data.toView(e.model.getSelectedContent(t.selection));o.fire("clipboardOutput",{dataTransfer:n,content:r,method:s.name})};this.listenTo(o,"copy",s,{priority:"low"}),this.listenTo(o,"cut",((t,o)=>{e.isReadOnly?o.preventDefault():s(t,o)}),{priority:"low"}),this.listenTo(o,"clipboardOutput",((o,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",c(s.content))),"cut"==s.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}var d=o("./packages/ckeditor5-widget/src/index.ts"),h=o("./node_modules/lodash-es/throttle.js"),u=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),p=o.n(u),f=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-clipboard/theme/clipboard.css"),g={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(f.Z,g);f.Z.locals;class m extends s.Sy{static get pluginName(){return"DragDrop"}static get requires(){return[l,d.$L]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=(0,h.Z)((e=>this._updateDropMarker(e)),40),this._removeDropMarkerDelayed=w((()=>this._removeDropMarker()),40),this._clearDraggableAttributesDelayed=w((()=>this._clearDraggableAttributes()),40),t.addObserver(r),t.addObserver(n.dM),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((e,t,o)=>{o?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((e,t,o)=>{o||this._finalizeDragging(!1)})),i.OB.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,o=t.document,s=e.editing.view,r=s.document;this.listenTo(r,"dragstart",((s,a)=>{const c=o.selection;if(a.target&&a.target.is("editableElement"))return void a.preventDefault();const l=a.target?k(a.target):null;if(l){const o=e.editing.mapper.toModelElement(l);this._draggedRange=n.iE.fromRange(t.createRangeOn(o)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!r.selection.isCollapsed){const e=r.selection.getSelectedElement();e&&(0,d.Qd)(e)||(this._draggedRange=n.iE.fromRange(c.getFirstRange()))}if(!this._draggedRange)return void a.preventDefault();this._draggingUid=(0,i.hQ)(),a.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const h=t.createSelection(this._draggedRange.toRange()),u=e.data.toView(t.getSelectedContent(h));r.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:u,method:"dragstart"}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(r,"dragend",((e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)}),{priority:"low"}),this.listenTo(r,"dragenter",(()=>{this.isEnabled&&s.focus()})),this.listenTo(r,"dragleave",(()=>{this._removeDropMarkerDelayed()})),this.listenTo(r,"dragging",((t,o)=>{if(!this.isEnabled)return void(o.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const s=b(e,o.targetRanges,o.target);this._draggedRange||(o.dataTransfer.dropEffect="copy"),i.OB.isGecko||("copy"==o.dataTransfer.effectAllowed?o.dataTransfer.dropEffect="copy":["all","copyMove"].includes(o.dataTransfer.effectAllowed)&&(o.dataTransfer.dropEffect="move")),s&&this._updateDropMarkerThrottled(s)}),{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",((t,o)=>{if("drop"!=o.method)return;const s=b(e,o.targetRanges,o.target);if(this._removeDropMarker(),!s)return this._finalizeDragging(!1),void t.stop();this._draggedRange&&this._draggingUid!=o.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==_(o.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(s,!0))return this._finalizeDragging(!1),void t.stop();o.targetRanges=[e.editing.mapper.toViewRange(s)]}),{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(l);e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const o=t.targetRanges.map((e=>this.editor.editing.mapper.toModelRange(e)));this.editor.model.change((e=>e.setSelection(o)))}),{priority:"high"}),e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const o="move"==_(t.dataTransfer),s=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(s&&o)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,o=t.document;this.listenTo(o,"mousedown",((s,n)=>{if(i.OB.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let r=k(n.target);if(i.OB.isBlink&&!e.isReadOnly&&!r&&!o.selection.isCollapsed){const e=o.selection.getSelectedElement();e&&(0,d.Qd)(e)||(r=o.selection.editableElement)}r&&(t.change((e=>{e.setAttribute("draggable","true",r)})),this._draggableElement=e.editing.mapper.toModelElement(r))})),this.listenTo(o,"mouseup",(()=>{i.OB.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change((t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:o})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return o.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(e){const t=this.toDomElement(e);return t.append("⁠",e.createElement("span"),"⁠"),t}))}})}_updateDropMarker(e){const t=this.editor,o=t.model.markers;t.model.change((t=>{o.has("drop-target")?o.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})}))}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change((e=>{e.removeMarker("drop-target")}))}_finalizeDragging(e){const t=this.editor,o=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&o.deleteContent(o.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function b(e,t,o){const s=e.model,n=e.editing.mapper;let r=null;const a=t?t[0].start:null;if(o.is("uiElement")&&(o=o.parent),r=function(e,t){const o=e.model,s=e.editing.mapper;if((0,d.Qd)(t))return o.createRangeOn(s.toModelElement(t));if(!t.is("editableElement")){const e=t.findAncestor((e=>(0,d.Qd)(e)||e.is("editableElement")));if((0,d.Qd)(e))return o.createRangeOn(s.toModelElement(e))}return null}(e,o),r)return r;const c=function(e,t){const o=e.editing.mapper,s=e.editing.view,i=o.toModelElement(t);if(i)return i;const n=s.createPositionBefore(t),r=o.findMappedViewAncestor(n);return o.toModelElement(r)}(e,o),l=a?n.toModelPosition(a):null;return l?(r=function(e,t,o){const s=e.model;if(!s.schema.checkChild(o,"$block"))return null;const i=s.createPositionAt(o,0),n=t.path.slice(0,i.path.length),r=s.createPositionFromPath(t.root,n),a=r.nodeAfter;if(a&&s.schema.isObject(a))return s.createRangeOn(a);return null}(e,l,c),r||(r=s.schema.getNearestSelectionRange(l,i.OB.isGecko?"forward":"backward"),r||function(e,t){const o=e.model;let s=t;for(;s;){if(o.schema.isObject(s))return o.createRangeOn(s);s=s.parent}return null}(e,l.parent))):function(e,t){const o=e.model,s=o.schema,i=o.createPositionAt(t,0);return s.getNearestSelectionRange(i,"forward")}(e,c)}function _(e){return i.OB.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function w(e,t){let o;function s(...i){s.cancel(),o=setTimeout((()=>e(...i)),t)}return s.cancel=()=>{clearTimeout(o)},s}function k(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(d.Qd);if((0,d.Qd)(e))return e;const t=e.findAncestor((e=>(0,d.Qd)(e)||e.is("editableElement")));return(0,d.Qd)(t)?t:null}class v extends s.Sy{static get pluginName(){return"PastePlainText"}static get requires(){return[l]}init(){const e=this.editor,t=e.model,o=e.editing.view,s=o.document,i=t.document.selection;let n=!1;o.addObserver(r),this.listenTo(s,"keydown",((e,t)=>{n=t.shiftKey})),e.plugins.get(l).on("contentInsertion",((e,o)=>{(n||function(e,t){if(e.childCount>1)return!1;const o=e.getChild(0);if(t.isObject(o))return!1;return 0==Array.from(o.getAttributeKeys()).length}(o.content,t.schema))&&t.change((e=>{const s=Array.from(i.getAttributes()).filter((([e])=>t.schema.getAttributeProperties(e).isFormatting));i.isCollapsed||t.deleteContent(i,{doNotAutoparagraph:!0}),s.push(...i.getAttributes());const n=e.createRangeIn(o.content);for(const t of n.getItems())t.is("$textProxy")&&e.setAttributes(s,t)}))}))}}class y extends s.Sy{static get pluginName(){return"Clipboard"}static get requires(){return[l,m,v]}}},"./src/core.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Command:()=>s.mY,Context:()=>s._y,ContextPlugin:()=>s.eO,DataApiMixin:()=>s.W9,Editor:()=>s.ML,EditorUI:()=>s.S8,ElementApiMixin:()=>s.xK,MultiCommand:()=>s.AJ,PendingActions:()=>s.lR,Plugin:()=>s.Sy,attachToForm:()=>s.P$,icons:()=>s.ci,secureSourceElement:()=>s.Nu});var s=o("./packages/ckeditor5-core/src/index.ts")},"./src/engine.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{BubblingEventInfo:()=>s.r7,ClickObserver:()=>s.KU,Conversion:()=>s.uz,DataController:()=>s.Yc,DataTransfer:()=>s.tn,DocumentFragment:()=>s.f4,DocumentSelection:()=>s.uj,DomConverter:()=>s.pG,DomEventData:()=>s.dK,DomEventObserver:()=>s.qZ,DowncastWriter:()=>s.qD,EditingController:()=>s.jH,Element:()=>s.W_,History:()=>s.Ay,HtmlDataProcessor:()=>s.X5,InsertOperation:()=>s.IZ,LivePosition:()=>s.jP,LiveRange:()=>s.iE,MarkerOperation:()=>s.zj,Matcher:()=>s.xO,Model:()=>s.Hn,MouseObserver:()=>s.dM,Observer:()=>s.Qj,OperationFactory:()=>s.Bz,Position:()=>s.Ly,Range:()=>s.e6,Renderer:()=>s.Th,StylesProcessor:()=>s.A_,Text:()=>s.xv,TreeWalker:()=>s.Po,UpcastWriter:()=>s.yj,View:()=>s.G7,ViewAttributeElement:()=>s.m1,ViewContainerElement:()=>s.By,ViewDocument:()=>s.Ux,ViewDocumentFragment:()=>s.y_,ViewEditableElement:()=>s.W2,ViewElement:()=>s.y9,ViewEmptyElement:()=>s.pc,ViewRawElement:()=>s.wx,ViewText:()=>s.Xj,ViewUIElement:()=>s.dq,addBackgroundRules:()=>s.QR,addBorderRules:()=>s.sI,addMarginRules:()=>s.vt,addPaddingRules:()=>s.J8,disablePlaceholder:()=>s.DA,enablePlaceholder:()=>s.ID,findOptimalInsertionRange:()=>s.KT,getBoxSidesShorthandValue:()=>s.I8,getBoxSidesValueReducer:()=>s.mq,getBoxSidesValues:()=>s.oz,getFillerOffset:()=>s.YG,getPositionShorthandNormalizer:()=>s.m0,getShorthandValues:()=>s.uT,hidePlaceholder:()=>s.$_,isAttachment:()=>s.SB,isColor:()=>s.D5,isLength:()=>s.G9,isLineStyle:()=>s.IT,isPercentage:()=>s.zz,isPosition:()=>s.WK,isRepeat:()=>s.Zb,isURL:()=>s.PX,needsPlaceholder:()=>s.Q7,showPlaceholder:()=>s.NJ,transformSets:()=>s.Rf});var s=o("./packages/ckeditor5-engine/src/index.ts")},"./src/enter.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Enter:()=>s.C,ShiftEnter:()=>s.G});var s=o("./packages/ckeditor5-enter/src/index.ts")},"./src/paragraph.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Paragraph:()=>c,ParagraphButtonUI:()=>h});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts");class n extends s.mY{refresh(){const e=this.editor.model,t=e.document,o=(0,i.Ps)(t.selection.getSelectedBlocks());this.value=!!o&&o.is("element","paragraph"),this.isEnabled=!!o&&r(o,e.schema)}execute(e={}){const t=this.editor.model,o=t.document;t.change((s=>{const i=(e.selection||o.selection).getSelectedBlocks();for(const e of i)!e.is("element","paragraph")&&r(e,t.schema)&&s.rename(e,"paragraph")}))}}function r(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class a extends s.mY{execute(e){const t=this.editor.model,o=e.attributes;let s=e.position;t.change((e=>{const i=e.createElement("paragraph");if(o&&t.schema.setAllowedAttributes(i,o,e),!t.schema.checkChild(s.parent,i)){const o=t.schema.findAllowedParent(s,i);if(!o)return;s=e.split(s,o).position}t.insertContent(i,s),e.setSelection(i,"in")}))}}class c extends s.Sy{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new n(e)),e.commands.add("insertParagraph",new a(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>c.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}c.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);var l=o("./packages/ckeditor5-ui/src/index.ts");const d=s.ci.paragraph;class h extends s.Sy{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("paragraph",(o=>{const s=new l.r5(o),i=e.commands.get("paragraph");return s.label=t("Paragraph"),s.icon=d,s.tooltip=!0,s.isToggleable=!0,s.bind("isEnabled").to(i),s.bind("isOn").to(i,"value"),s.on("execute",(()=>{e.execute("paragraph")})),s}))}}},"./src/select-all.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{SelectAll:()=>h,SelectAllEditing:()=>c,SelectAllUI:()=>d});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts");class n extends s.mY{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let o=e.schema.getLimitElement(t);if(t.containsEntireContent(o)||!r(e.schema,o))do{if(o=o.parent,!o)return}while(!r(e.schema,o));e.change((e=>{e.setSelection(o,"in")}))}}function r(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const a=(0,i.Zz)("Ctrl+A");class c extends s.Sy{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new n(e)),this.listenTo(t,"keydown",((t,o)=>{(0,i.Cq)(o)===a&&(e.execute("selectAll"),o.preventDefault())}))}}var l=o("./packages/ckeditor5-ui/src/index.ts");class d extends s.Sy{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",(t=>{const o=e.commands.get("selectAll"),s=new l.r5(t),i=t.t;return s.set({label:i("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),s.bind("isEnabled").to(o,"isEnabled"),this.listenTo(s,"execute",(()=>{e.execute("selectAll"),e.editing.view.focus()})),s}))}}class h extends s.Sy{static get requires(){return[c,d]}static get pluginName(){return"SelectAll"}}},"./src/typing.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Delete:()=>s.HG,Input:()=>s.II,TextTransformation:()=>s.cL,TextWatcher:()=>s.uL,TwoStepCaretMovement:()=>s.mh,Typing:()=>s.Mq,findAttributeRange:()=>s.VD,getLastTextLine:()=>s.Up,inlineHighlight:()=>s.Im});var s=o("./packages/ckeditor5-typing/src/index.ts")},"./src/ui.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{BalloonPanelView:()=>s.no,BalloonToolbar:()=>s.Jf,BlockToolbar:()=>s.ee,BodyCollection:()=>s.BK,BoxedEditorUIView:()=>s.py,ButtonView:()=>s.r5,ColorGridView:()=>s.J6,ColorTileView:()=>s._9,ComponentFactory:()=>s._Y,ContextualBalloon:()=>s.WB,DropdownButtonView:()=>s.J0,EditorUIView:()=>s.fF,FocusCycler:()=>s.I0,FormHeaderView:()=>s.Gp,IconView:()=>s.mO,IframeView:()=>s.VY,InlineEditableUIView:()=>s.r1,InputNumberView:()=>s.Xs,InputTextView:()=>s.pq,InputView:()=>s.Em,LabelView:()=>s.Dn,LabeledFieldView:()=>s.KP,ListItemView:()=>s.dn,ListView:()=>s.Bv,Model:()=>s.Hn,Notification:()=>s.P_,SplitButtonView:()=>s.Rm,StickyPanelView:()=>s.lp,SwitchButtonView:()=>s.BM,Template:()=>s.YS,ToolbarSeparatorView:()=>s.$y,ToolbarView:()=>s.jB,TooltipManager:()=>s.gE,View:()=>s.G7,ViewCollection:()=>s.vX,addKeyboardHandlingForGrid:()=>s.IJ,addListToDropdown:()=>s.Pm,addToolbarToDropdown:()=>s.up,clickOutsideHandler:()=>s.eC,createDropdown:()=>s.t9,createLabeledDropdown:()=>s.FH,createLabeledInputNumber:()=>s.sh,createLabeledInputText:()=>s.R,focusChildOnDropdownOpen:()=>s.Mh,getLocalizedColorOptions:()=>s.k6,injectCssTransitionDisabler:()=>s.fe,normalizeColorOptions:()=>s.S1,normalizeSingleColorDefinition:()=>s.jY,normalizeToolbarConfig:()=>s.iw,submitHandler:()=>s.GI});var s=o("./packages/ckeditor5-ui/src/index.ts")},"./src/undo.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Undo:()=>g,UndoEditing:()=>d,UndoUi:()=>f});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-engine/src/index.ts");class n extends s.mY{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",((e,t)=>{t[1]={...t[1]};const o=t[1];o.batchType||(o.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(e.data,"set",((e,t)=>{t[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,o={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:o}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,o){const s=this.editor.model,i=s.document,n=[],c=e.map((e=>e.getTransformedByOperations(o))),l=c.flat();for(const e of c){const t=e.filter((e=>e.root!=i.graveyard)).filter((e=>!a(e,l)));t.length&&(r(t),n.push(t[0]))}n.length&&s.change((e=>{e.setSelection(n,{backward:t})}))}_undo(e,t){const o=this.editor.model,s=o.document;this._createdBatches.add(t);const n=e.operations.slice().filter((e=>e.isDocumentOperation));n.reverse();for(const e of n){const n=e.baseVersion+1,r=Array.from(s.history.getOperations(n)),a=(0,i.Rf)([e.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const i of a)t.addOperation(i),o.applyOperation(i),s.history.setOperationAsUndone(e,i)}}}function r(e){e.sort(((e,t)=>e.start.isBefore(t.start)?-1:1));for(let t=1;tt!==e&&t.containsRange(e,!0)))}class c extends n{execute(e=null){const t=e?this._stack.findIndex((t=>t.batch==e)):this._stack.length-1,o=this._stack.splice(t,1)[0],s=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(s,(()=>{this._undo(o.batch,s);const e=this.editor.model.document.history.getOperations(o.batch.baseVersion);this._restoreSelection(o.selection.ranges,o.selection.isBackward,e),this.fire("revert",o.batch,s)})),this.refresh()}}class l extends n{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,(()=>{const o=e.batch.operations[e.batch.operations.length-1].baseVersion+1,s=this.editor.model.document.history.getOperations(o);this._restoreSelection(e.selection.ranges,e.selection.isBackward,s),this._undo(e.batch,t)})),this.refresh()}}class d extends s.Sy{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new c(e),this._redoCommand=new l(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",((e,t)=>{const o=t[0];if(!o.isDocumentOperation)return;const s=o.batch,i=this._redoCommand._createdBatches.has(s),n=this._undoCommand._createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(i?this._undoCommand.addBatch(s):n||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((e,t,o)=>{this._redoCommand.addBatch(o)})),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var h=o("./packages/ckeditor5-ui/src/index.ts");const u='',p='';class f extends s.Sy{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,o=e.t,s="ltr"==t.uiLanguageDirection?u:p,i="ltr"==t.uiLanguageDirection?p:u;this._addButton("undo",o("Undo"),"CTRL+Z",s),this._addButton("redo",o("Redo"),"CTRL+Y",i)}_addButton(e,t,o,s){const i=this.editor;i.ui.componentFactory.add(e,(n=>{const r=i.commands.get(e),a=new h.r5(n);return a.set({label:t,icon:s,keystroke:o,tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",(()=>{i.execute(e),i.editing.view.focus()})),a}))}}class g extends s.Sy{static get requires(){return[d,f]}static get pluginName(){return"Undo"}}},"./src/upload.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Base64UploadAdapter:()=>h,FileDialogButtonView:()=>l,FileRepository:()=>r,SimpleUploadAdapter:()=>p});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts");class n extends((0,i.Re)()){constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,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;return this.total=e.size,new Promise(((o,s)=>{t.onload=()=>{const e=t.result;this._data=e,o(e)},t.onerror=()=>{s("error")},t.onabort=()=>{s("aborted")},this._reader.readAsDataURL(e)}))}abort(){this._reader.abort()}}class r extends s.Sy{static get pluginName(){return"FileRepository"}static get requires(){return[s.lR]}init(){this.loaders=new i.FE,this.loaders.on("change",(()=>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)return(0,i.KE)("filerepository-no-upload-adapter"),null;const t=new a(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),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)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e})),t}destroyLoader(e){const t=e instanceof a?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach(((e,o)=>{e===t&&this._loadersMap.delete(o)}))}_updatePendingAction(){const e=this.editor.plugins.get(s.lR);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,o=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(o(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",o)}}else e.remove(this._pendingAction),this._pendingAction=null}}class a extends((0,i.Re)()){constructor(e,t){super(),this.id=(0,i.hQ)(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new n,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(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then((e=>this._filePromiseWrapper?e:null)):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new i.Bb("filerepository-read-wrong-status",this);return this.status="reading",this.file.then((e=>this._reader.read(e))).then((e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e})).catch((e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e}))}upload(){if("idle"!=this.status)throw new i.Bb("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then((()=>this._adapter.upload())).then((e=>(this.uploadResponse=e,this.status="idle",e))).catch((e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e}))}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch((()=>{})),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise(((o,s)=>{t.rejecter=s,t.isFulfilled=!1,e.then((e=>{t.isFulfilled=!0,o(e)})).catch((e=>{t.isFulfilled=!0,s(e)}))})),t}}var c=o("./packages/ckeditor5-ui/src/index.ts");class l extends c.G7{constructor(e){super(e),this.buttonView=new c.r5(e),this._fileInputView=new d(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 d extends c.G7{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);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((()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""}))}})}open(){this.element.click()}}class h extends s.Sy{static get requires(){return[r]}static get pluginName(){return"Base64UploadAdapter"}init(){this.editor.plugins.get(r).createUploadAdapter=e=>new u(e)}}class u{constructor(e){this.loader=e}upload(){return new Promise(((e,t)=>{const o=this.reader=new window.FileReader;o.addEventListener("load",(()=>{e({default:o.result})})),o.addEventListener("error",(e=>{t(e)})),o.addEventListener("abort",(()=>{t()})),this.loader.file.then((e=>{o.readAsDataURL(e)}))}))}abort(){this.reader.abort()}}class p extends s.Sy{static get requires(){return[r]}static get pluginName(){return"SimpleUploadAdapter"}init(){const e=this.editor.config.get("simpleUpload");e&&(e.uploadUrl?this.editor.plugins.get(r).createUploadAdapter=t=>new f(t,e):(0,i.KE)("simple-upload-adapter-missing-uploadurl"))}}class f{constructor(e,t){this.loader=e,this.options=t}upload(){return this.loader.file.then((e=>new Promise(((t,o)=>{this._initRequest(),this._initListeners(t,o,e),this._sendRequest(e)}))))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,!0),e.responseType="json"}_initListeners(e,t,o){const s=this.xhr,i=this.loader,n=`Couldn't upload file: ${o.name}.`;s.addEventListener("error",(()=>t(n))),s.addEventListener("abort",(()=>t())),s.addEventListener("load",(()=>{const o=s.response;if(!o||o.error)return t(o&&o.error&&o.error.message?o.error.message:n);const i=o.url?{default:o.url}:o.urls;e({...o,urls:i})})),s.upload&&s.upload.addEventListener("progress",(e=>{e.lengthComputable&&(i.uploadTotal=e.total,i.uploaded=e.loaded)}))}_sendRequest(e){const t=this.options.headers||{},o=this.options.withCredentials||!1;for(const e of Object.keys(t))this.xhr.setRequestHeader(e,t[e]);this.xhr.withCredentials=o;const s=new FormData;s.append("upload",e),this.xhr.send(s)}}},"./src/utils.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{CKEditorError:()=>s.Bb,Collection:()=>s.FE,Config:()=>s.De,DomEmitterMixin:()=>s.Xu,ElementReplacer:()=>s.a6,EmitterMixin:()=>s.ln,EventInfo:()=>s.M3,FocusTracker:()=>s.Rh,KeystrokeHandler:()=>s.VD,Locale:()=>s.go,ObservableMixin:()=>s.Re,Rect:()=>s.UL,ResizeObserver:()=>s.do,compareArrays:()=>s.Rt,count:()=>s.QX,createElement:()=>s.az,diff:()=>s.Hg,env:()=>s.OB,fastDiff:()=>s.HZ,first:()=>s.Ps,getAncestors:()=>s.dk,getCode:()=>s.Cq,getDataFromElement:()=>s.yy,getEnvKeystrokeText:()=>s.XU,getLanguageDirection:()=>s.j9,getLocalizedArrowKeyCodeDirection:()=>s.mA,getOptimalPosition:()=>s.xZ,global:()=>s.CO,indexOf:()=>s.cq,insertAt:()=>s.ZQ,insertToPriorityArray:()=>s.VG,isArrowKeyCode:()=>s.dj,isCombiningMark:()=>s.tO,isComment:()=>s.C3,isForwardArrowKeyCode:()=>s.Zt,isHighSurrogateHalf:()=>s.Cb,isInsideCombinedSymbol:()=>s.pp,isInsideEmojiSequence:()=>s.YK,isInsideSurrogatePair:()=>s.to,isIterable:()=>s.TW,isLowSurrogateHalf:()=>s.nA,isNode:()=>s.UG,isRange:()=>s.bR,isText:()=>s.Gs,isVisible:()=>s.pn,keyCodes:()=>s.Do,logError:()=>s.H,logWarning:()=>s.KE,mix:()=>s.CD,parseKeystroke:()=>s.Zz,priorities:()=>s.tA,remove:()=>s.Od,scrollAncestorsToShowTarget:()=>s.F0,scrollViewportToShowTarget:()=>s.mR,setDataInElement:()=>s.jS,spliceArray:()=>s.x,toArray:()=>s.qo,toMap:()=>s.qL,toUnit:()=>s.nn,uid:()=>s.hQ,version:()=>s.i8});var s=o("./packages/ckeditor5-utils/src/index.ts")},"./src/widget.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{WIDGET_CLASS_NAME:()=>s.s4,WIDGET_SELECTED_CLASS_NAME:()=>s.Uo,Widget:()=>s.$L,WidgetResize:()=>s.WR,WidgetToolbarRepository:()=>s.e8,WidgetTypeAround:()=>s.Ww,findOptimalInsertionRange:()=>s.KT,getLabel:()=>s.id,isWidget:()=>s.Qd,setHighlightHandling:()=>s.em,setLabel:()=>s.l6,toWidget:()=>s.XC,toWidgetEditable:()=>s.sC,viewToModelPositionOutsideModelElement:()=>s.$n});var s=o("./packages/ckeditor5-widget/src/index.ts")},"?7cdd":(e,t,o)=>{e.exports=o},"./node_modules/lodash-es/_ListCache.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>u});const s=function(){this.__data__=[],this.size=0};var i=o("./node_modules/lodash-es/eq.js");const n=function(e,t){for(var o=e.length;o--;)if((0,i.Z)(e[o][0],t))return o;return-1};var r=Array.prototype.splice;const a=function(e){var t=this.__data__,o=n(t,e);return!(o<0)&&(o==t.length-1?t.pop():r.call(t,o,1),--this.size,!0)};const c=function(e){var t=this.__data__,o=n(t,e);return o<0?void 0:t[o][1]};const l=function(e){return n(this.__data__,e)>-1};const d=function(e,t){var o=this.__data__,s=n(o,e);return s<0?(++this.size,o.push([e,t])):o[s][1]=t,this};function h(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_getNative.js"),i=o("./node_modules/lodash-es/_root.js");const n=(0,s.Z)(i.Z,"Map")},"./node_modules/lodash-es/_MapCache.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>x});const s=(0,o("./node_modules/lodash-es/_getNative.js").Z)(Object,"create");const i=function(){this.__data__=s?s(null):{},this.size=0};const n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var r=Object.prototype.hasOwnProperty;const a=function(e){var t=this.__data__;if(s){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return r.call(t,e)?t[e]:void 0};var c=Object.prototype.hasOwnProperty;const l=function(e){var t=this.__data__;return s?void 0!==t[e]:c.call(t,e)};const d=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=s&&void 0===t?"__lodash_hash_undefined__":t,this};function h(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t{"use strict";o.d(t,{Z:()=>u});var s=o("./node_modules/lodash-es/_ListCache.js");const i=function(){this.__data__=new s.Z,this.size=0};const n=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o};const r=function(e){return this.__data__.get(e)};const a=function(e){return this.__data__.has(e)};var c=o("./node_modules/lodash-es/_Map.js"),l=o("./node_modules/lodash-es/_MapCache.js");const d=function(e,t){var o=this.__data__;if(o instanceof s.Z){var i=o.__data__;if(!c.Z||i.length<199)return i.push([e,t]),this.size=++o.size,this;o=this.__data__=new l.Z(i)}return o.set(e,t),this.size=o.size,this};function h(e){var t=this.__data__=new s.Z(e);this.size=t.size}h.prototype.clear=i,h.prototype.delete=n,h.prototype.get=r,h.prototype.has=a,h.prototype.set=d;const u=h},"./node_modules/lodash-es/_Symbol.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=o("./node_modules/lodash-es/_root.js").Z.Symbol},"./node_modules/lodash-es/_Uint8Array.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=o("./node_modules/lodash-es/_root.js").Z.Uint8Array},"./node_modules/lodash-es/_arrayLikeKeys.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>d});const s=function(e,t){for(var o=-1,s=Array(e);++o{"use strict";o.d(t,{Z:()=>s});const s=function(e,t){for(var o=-1,s=t.length,i=e.length;++o{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/_baseAssignValue.js"),i=o("./node_modules/lodash-es/eq.js"),n=Object.prototype.hasOwnProperty;const r=function(e,t,o){var r=e[t];n.call(e,t)&&(0,i.Z)(r,o)&&(void 0!==o||t in e)||(0,s.Z)(e,t,o)}},"./node_modules/lodash-es/_baseAssignValue.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_defineProperty.js");const i=function(e,t,o){"__proto__"==t&&s.Z?(0,s.Z)(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}},"./node_modules/lodash-es/_baseClone.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>Q});var s=o("./node_modules/lodash-es/_Stack.js");const i=function(e,t){for(var o=-1,s=null==e?0:e.length;++o{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_arrayPush.js"),i=o("./node_modules/lodash-es/isArray.js");const n=function(e,t,o){var n=t(e);return(0,i.Z)(e)?n:(0,s.Z)(n,o(e))}},"./node_modules/lodash-es/_baseGetTag.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>u});var s=o("./node_modules/lodash-es/_Symbol.js"),i=Object.prototype,n=i.hasOwnProperty,r=i.toString,a=s.Z?s.Z.toStringTag:void 0;const c=function(e){var t=n.call(e,a),o=e[a];try{e[a]=void 0;var s=!0}catch(e){}var i=r.call(e);return s&&(t?e[a]=o:delete e[a]),i};var l=Object.prototype.toString;const d=function(e){return l.call(e)};var h=s.Z?s.Z.toStringTag:void 0;const u=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":h&&h in Object(e)?c(e):d(e)}},"./node_modules/lodash-es/_baseUnary.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e){return function(t){return e(t)}}},"./node_modules/lodash-es/_cloneArrayBuffer.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_Uint8Array.js");const i=function(e){var t=new e.constructor(e.byteLength);return new s.Z(t).set(new s.Z(e)),t}},"./node_modules/lodash-es/_cloneBuffer.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>c});var s=o("./node_modules/lodash-es/_root.js"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,n=i&&"object"==typeof module&&module&&!module.nodeType&&module,r=n&&n.exports===i?s.Z.Buffer:void 0,a=r?r.allocUnsafe:void 0;const c=function(e,t){if(t)return e.slice();var o=e.length,s=a?a(o):new e.constructor(o);return e.copy(s),s}},"./node_modules/lodash-es/_cloneTypedArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_cloneArrayBuffer.js");const i=function(e,t){var o=t?(0,s.Z)(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}},"./node_modules/lodash-es/_copyArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e,t){var o=-1,s=e.length;for(t||(t=Array(s));++o{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_assignValue.js"),i=o("./node_modules/lodash-es/_baseAssignValue.js");const n=function(e,t,o,n){var r=!o;o||(o={});for(var a=-1,c=t.length;++a{"use strict";o.d(t,{Z:()=>_});const s=function(e){return e};const i=function(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)};var n=Math.max;const r=function(e,t,o){return t=n(void 0===t?e.length-1:t,0),function(){for(var s=arguments,r=-1,a=n(s.length-t,0),c=Array(a);++r0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(l);const u=function(e,t){return h(r(e,t,s),e+"")};var p=o("./node_modules/lodash-es/eq.js"),f=o("./node_modules/lodash-es/isArrayLike.js"),g=o("./node_modules/lodash-es/_isIndex.js"),m=o("./node_modules/lodash-es/isObject.js");const b=function(e,t,o){if(!(0,m.Z)(o))return!1;var s=typeof t;return!!("number"==s?(0,f.Z)(o)&&(0,g.Z)(t,o.length):"string"==s&&t in o)&&(0,p.Z)(o[t],e)};const _=function(e){return u((function(t,o){var s=-1,i=o.length,n=i>1?o[i-1]:void 0,r=i>2?o[2]:void 0;for(n=e.length>3&&"function"==typeof n?(i--,n):void 0,r&&b(o[0],o[1],r)&&(n=i<3?void 0:n,i=1),t=Object(t);++s{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_getNative.js");const i=function(){try{var e=(0,s.Z)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},"./node_modules/lodash-es/_freeGlobal.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s="object"==typeof global&&global&&global.Object===Object&&global},"./node_modules/lodash-es/_getAllKeys.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/_baseGetAllKeys.js"),i=o("./node_modules/lodash-es/_getSymbols.js"),n=o("./node_modules/lodash-es/keys.js");const r=function(e){return(0,s.Z)(e,n.Z,i.Z)}},"./node_modules/lodash-es/_getNative.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>_});var s=o("./node_modules/lodash-es/isFunction.js");const i=o("./node_modules/lodash-es/_root.js").Z["__core-js_shared__"];var n,r=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";const a=function(e){return!!r&&r in e};var c=o("./node_modules/lodash-es/isObject.js"),l=o("./node_modules/lodash-es/_toSource.js"),d=/^\[object .+?Constructor\]$/,h=Function.prototype,u=Object.prototype,p=h.toString,f=u.hasOwnProperty,g=RegExp("^"+p.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const m=function(e){return!(!(0,c.Z)(e)||a(e))&&((0,s.Z)(e)?g:d).test((0,l.Z)(e))};const b=function(e,t){return null==e?void 0:e[t]};const _=function(e,t){var o=b(e,t);return m(o)?o:void 0}},"./node_modules/lodash-es/_getPrototype.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=(0,o("./node_modules/lodash-es/_overArg.js").Z)(Object.getPrototypeOf,Object)},"./node_modules/lodash-es/_getSymbols.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>a});const s=function(e,t){for(var o=-1,s=null==e?0:e.length,i=0,n=[];++o{"use strict";o.d(t,{Z:()=>x});var s=o("./node_modules/lodash-es/_getNative.js"),i=o("./node_modules/lodash-es/_root.js");const n=(0,s.Z)(i.Z,"DataView");var r=o("./node_modules/lodash-es/_Map.js");const a=(0,s.Z)(i.Z,"Promise");const c=(0,s.Z)(i.Z,"Set");const l=(0,s.Z)(i.Z,"WeakMap");var d=o("./node_modules/lodash-es/_baseGetTag.js"),h=o("./node_modules/lodash-es/_toSource.js"),u="[object Map]",p="[object Promise]",f="[object Set]",g="[object WeakMap]",m="[object DataView]",b=(0,h.Z)(n),_=(0,h.Z)(r.Z),w=(0,h.Z)(a),k=(0,h.Z)(c),v=(0,h.Z)(l),y=d.Z;(n&&y(new n(new ArrayBuffer(1)))!=m||r.Z&&y(new r.Z)!=u||a&&y(a.resolve())!=p||c&&y(new c)!=f||l&&y(new l)!=g)&&(y=function(e){var t=(0,d.Z)(e),o="[object Object]"==t?e.constructor:void 0,s=o?(0,h.Z)(o):"";if(s)switch(s){case b:return m;case _:return u;case w:return p;case k:return f;case v:return g}return t});const x=y},"./node_modules/lodash-es/_initCloneObject.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>c});var s=o("./node_modules/lodash-es/isObject.js"),i=Object.create;const n=function(){function e(){}return function(t){if(!(0,s.Z)(t))return{};if(i)return i(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}}();var r=o("./node_modules/lodash-es/_getPrototype.js"),a=o("./node_modules/lodash-es/_isPrototype.js");const c=function(e){return"function"!=typeof e.constructor||(0,a.Z)(e)?{}:n((0,r.Z)(e))}},"./node_modules/lodash-es/_isIndex.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=/^(?:0|[1-9]\d*)$/;const i=function(e,t){var o=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==o||"symbol"!=o&&s.test(e))&&e>-1&&e%1==0&&e{"use strict";o.d(t,{Z:()=>i});var s=Object.prototype;const i=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||s)}},"./node_modules/lodash-es/_nodeUtil.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>a});var s=o("./node_modules/lodash-es/_freeGlobal.js"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,n=i&&"object"==typeof module&&module&&!module.nodeType&&module,r=n&&n.exports===i&&s.Z.process;const a=function(){try{var e=n&&n.require&&n.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(e){}}()},"./node_modules/lodash-es/_overArg.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e,t){return function(o){return e(t(o))}}},"./node_modules/lodash-es/_root.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_freeGlobal.js"),i="object"==typeof self&&self&&self.Object===Object&&self;const n=s.Z||i||Function("return this")()},"./node_modules/lodash-es/_toSource.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=Function.prototype.toString;const i=function(e){if(null!=e){try{return s.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},"./node_modules/lodash-es/assignIn.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/_copyObject.js"),i=o("./node_modules/lodash-es/_createAssigner.js"),n=o("./node_modules/lodash-es/keysIn.js");const r=(0,i.Z)((function(e,t){(0,s.Z)(t,(0,n.Z)(t),e)}))},"./node_modules/lodash-es/cloneDeepWith.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_baseClone.js");const i=function(e,t){return t="function"==typeof t?t:void 0,(0,s.Z)(e,5,t)}},"./node_modules/lodash-es/debounce.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>_});var s=o("./node_modules/lodash-es/isObject.js"),i=o("./node_modules/lodash-es/_root.js");const n=function(){return i.Z.Date.now()};var r=/\s/;const a=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t};var c=/^\s+/;const l=function(e){return e?e.slice(0,a(e)+1).replace(c,""):e};var d=o("./node_modules/lodash-es/isSymbol.js"),h=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,p=/^0o[0-7]+$/i,f=parseInt;const g=function(e){if("number"==typeof e)return e;if((0,d.Z)(e))return NaN;if((0,s.Z)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=(0,s.Z)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=l(e);var o=u.test(e);return o||p.test(e)?f(e.slice(2),o?2:8):h.test(e)?NaN:+e};var m=Math.max,b=Math.min;const _=function(e,t,o){var i,r,a,c,l,d,h=0,u=!1,p=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var o=i,s=r;return i=r=void 0,h=t,c=e.apply(s,o)}function w(e){return h=e,l=setTimeout(v,t),u?_(e):c}function k(e){var o=e-d;return void 0===d||o>=t||o<0||p&&e-h>=a}function v(){var e=n();if(k(e))return y(e);l=setTimeout(v,function(e){var o=t-(e-d);return p?b(o,a-(e-h)):o}(e))}function y(e){return l=void 0,f&&i?_(e):(i=r=void 0,c)}function x(){var e=n(),o=k(e);if(i=arguments,r=this,d=e,o){if(void 0===l)return w(d);if(p)return clearTimeout(l),l=setTimeout(v,t),_(d)}return void 0===l&&(l=setTimeout(v,t)),c}return t=g(t)||0,(0,s.Z)(o)&&(u=!!o.leading,a=(p="maxWait"in o)?m(g(o.maxWait)||0,t):a,f="trailing"in o?!!o.trailing:f),x.cancel=function(){void 0!==l&&clearTimeout(l),h=0,i=d=r=l=void 0},x.flush=function(){return void 0===l?c:y(n())},x}},"./node_modules/lodash-es/eq.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e,t){return e===t||e!=e&&t!=t}},"./node_modules/lodash-es/isArguments.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>l});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/isObjectLike.js");const n=function(e){return(0,i.Z)(e)&&"[object Arguments]"==(0,s.Z)(e)};var r=Object.prototype,a=r.hasOwnProperty,c=r.propertyIsEnumerable;const l=n(function(){return arguments}())?n:function(e){return(0,i.Z)(e)&&a.call(e,"callee")&&!c.call(e,"callee")}},"./node_modules/lodash-es/isArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=Array.isArray},"./node_modules/lodash-es/isArrayLike.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/isFunction.js"),i=o("./node_modules/lodash-es/isLength.js");const n=function(e){return null!=e&&(0,i.Z)(e.length)&&!(0,s.Z)(e)}},"./node_modules/lodash-es/isBuffer.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>c});var s=o("./node_modules/lodash-es/_root.js");const i=function(){return!1};var n="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=n&&"object"==typeof module&&module&&!module.nodeType&&module,a=r&&r.exports===n?s.Z.Buffer:void 0;const c=(a?a.isBuffer:void 0)||i},"./node_modules/lodash-es/isElement.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/isObjectLike.js"),i=o("./node_modules/lodash-es/isPlainObject.js");const n=function(e){return(0,s.Z)(e)&&1===e.nodeType&&!(0,i.Z)(e)}},"./node_modules/lodash-es/isFunction.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/isObject.js");const n=function(e){if(!(0,i.Z)(e))return!1;var t=(0,s.Z)(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},"./node_modules/lodash-es/isLength.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},"./node_modules/lodash-es/isObject.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},"./node_modules/lodash-es/isObjectLike.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e){return null!=e&&"object"==typeof e}},"./node_modules/lodash-es/isPlainObject.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>h});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/_getPrototype.js"),n=o("./node_modules/lodash-es/isObjectLike.js"),r=Function.prototype,a=Object.prototype,c=r.toString,l=a.hasOwnProperty,d=c.call(Object);const h=function(e){if(!(0,n.Z)(e)||"[object Object]"!=(0,s.Z)(e))return!1;var t=(0,i.Z)(e);if(null===t)return!0;var o=l.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&c.call(o)==d}},"./node_modules/lodash-es/isSymbol.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/isObjectLike.js");const n=function(e){return"symbol"==typeof e||(0,i.Z)(e)&&"[object Symbol]"==(0,s.Z)(e)}},"./node_modules/lodash-es/isTypedArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>h});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/isLength.js"),n=o("./node_modules/lodash-es/isObjectLike.js"),r={};r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1;const a=function(e){return(0,n.Z)(e)&&(0,i.Z)(e.length)&&!!r[(0,s.Z)(e)]};var c=o("./node_modules/lodash-es/_baseUnary.js"),l=o("./node_modules/lodash-es/_nodeUtil.js"),d=l.Z&&l.Z.isTypedArray;const h=d?(0,c.Z)(d):a},"./node_modules/lodash-es/keys.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>l});var s=o("./node_modules/lodash-es/_arrayLikeKeys.js"),i=o("./node_modules/lodash-es/_isPrototype.js");const n=(0,o("./node_modules/lodash-es/_overArg.js").Z)(Object.keys,Object);var r=Object.prototype.hasOwnProperty;const a=function(e){if(!(0,i.Z)(e))return n(e);var t=[];for(var o in Object(e))r.call(e,o)&&"constructor"!=o&&t.push(o);return t};var c=o("./node_modules/lodash-es/isArrayLike.js");const l=function(e){return(0,c.Z)(e)?(0,s.Z)(e):a(e)}},"./node_modules/lodash-es/keysIn.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>d});var s=o("./node_modules/lodash-es/_arrayLikeKeys.js"),i=o("./node_modules/lodash-es/isObject.js"),n=o("./node_modules/lodash-es/_isPrototype.js");const r=function(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t};var a=Object.prototype.hasOwnProperty;const c=function(e){if(!(0,i.Z)(e))return r(e);var t=(0,n.Z)(e),o=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&o.push(s);return o};var l=o("./node_modules/lodash-es/isArrayLike.js");const d=function(e){return(0,l.Z)(e)?(0,s.Z)(e,!0):c(e)}},"./node_modules/lodash-es/stubArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(){return[]}},"./node_modules/lodash-es/throttle.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/debounce.js"),i=o("./node_modules/lodash-es/isObject.js");const n=function(e,t,o){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return(0,i.Z)(o)&&(n="leading"in o?!!o.leading:n,r="trailing"in o?!!o.trailing:r),(0,s.Z)(e,t,{leading:n,maxWait:t,trailing:r})}},"./node_modules/lodash-es/toString.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>d});var s=o("./node_modules/lodash-es/_Symbol.js");const i=function(e,t){for(var o=-1,s=null==e?0:e.length,i=Array(s);++o{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var s=o("?7cdd");(window.CKEditor5=window.CKEditor5||{}).dll=s})(),function(e){e.CKEditor5=e.CKEditor5||{};const t=["utils","core","engine","ui","clipboard","enter","paragraph","select-all","typing","undo","upload","widget"];for(const o of t){const t=o.replace(/-([a-z])/g,((e,t)=>t.toUpperCase()));e.CKEditor5[t]=e.CKEditor5.dll(`./src/${o}.js`)}}(window); \ No newline at end of file + */(()=>{var e={"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-clipboard/theme/clipboard.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,'.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}',""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-engine/theme/placeholder.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text);cursor:text}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-engine/theme/renderer.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/button/button.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;justify-content:left;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.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,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)}.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{-webkit-appearance:none;border:1px solid transparent;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.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{color:inherit;cursor:inherit;font-size:inherit;font-weight: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,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,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(var(--ck-spacing-small)*-1);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-left:var(--ck-spacing-small);margin-right:calc(var(--ck-spacing-small)*-1)}.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)}.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-on,a.ck.ck-button.ck-on{color:var(--ck-color-button-on-color)}.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)}.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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/button/switchbutton.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".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:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.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{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.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(var(--ck-border-radius)*.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.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:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.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(var( --ck-switch-button-translation )*-1))}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-color-grid-tile-size)}.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{color:var(--ck-color-color-grid-check-icon);display:none}.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)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/dropdown.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-dropdown-max-width:75vw}.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-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-modal)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.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}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.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{margin-left:var(--ck-spacing-standard);right: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{overflow:hidden;text-overflow:ellipsis;width:7em}.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 .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.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{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/listdropdown.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".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-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/splitbutton.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,'.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.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)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:"";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.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}',""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/editorui/editorui.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable.ck-rounded-corners:not(.ck-editor__nested-editable){border-radius:var(--ck-border-radius)}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-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)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/formheader/formheader.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-form__header .ck-form__header__label{font-weight:700}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/icon/icon.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{font-size:.8333350694em;height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/input/input.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{border-radius:0}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/label/label.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.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.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/list/list.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.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{background:var(--ck-color-list-background);list-style-type:none}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{border-radius:0;min-height:unset;padding:calc(var(--ck-line-height-base)*.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*.4*var(--ck-font-size-base));text-align:left;width:100%}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*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-switchbutton):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{background:var(--ck-color-base-border);height:1px;width:100%}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/balloonpanel.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,':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-border-width:1px;--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.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{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);box-shadow:var(--ck-drop-shadow),0 0;min-height:15px}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.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(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.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(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}',""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/balloonrotator.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;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-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/fakepanel.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".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{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width: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}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/stickypanel.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-modal)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/toolbar/toolbar.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;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__line-break{flex-basis:100%}.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);border:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;background:var(--ck-color-toolbar-border);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){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>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.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.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.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.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{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.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/tooltip/tooltip.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck.ck-balloon-panel.ck-tooltip{--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);padding:0 var(--ck-spacing-medium);pointer-events:none;z-index:calc(var(--ck-z-modal) + 100)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip{box-shadow:none}.ck.ck-balloon-panel.ck-tooltip:before{display:none}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/globals/globals.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck-hidden{display:none!important}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{box-sizing:border-box;height:auto;position:static;width:auto}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{word-wrap:break-word;background:transparent;border:0;margin:0;padding:0;text-decoration:none;transition:none;vertical-align:middle}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widget.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.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);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.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{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top: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)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}: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-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);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{background-color:var(--ck-color-widget-editable-focus-background);border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);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)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.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{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.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:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.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{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widgetresize.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}",""]);const n=i},"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widgettypearound.css":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/css-loader/dist/runtime/api.js"),i=o.n(s)()((function(e){return e[1]}));i.push([e.id,'.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);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;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 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{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;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);width:var(--ck-widget-type-around-button-size)}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}.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{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.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{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.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_selected.ck-widget_with-resizer>.ck-widget__resizer,.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_selected.ck-widget_with-resizer>.ck-widget__resizer,.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[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.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}}',""]);const n=i},"./node_modules/css-loader/dist/runtime/api.js":e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=e(t);return t[2]?"@media ".concat(t[2]," {").concat(o,"}"):o})).join("")},t.i=function(e,o,s){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(s)for(var n=0;n{"use strict";var s,i=function(){return void 0===s&&(s=Boolean(window&&document&&document.all&&!window.atob)),s},n=function(){var e={};return function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}e[t]=o}return e[t]}}(),r=[];function a(e){for(var t=-1,o=0;o{"use strict";o.d(t,{mY:()=>r,_y:()=>d,eO:()=>h,W9:()=>_,ML:()=>g,xK:()=>w,AJ:()=>c,lR:()=>v,Sy:()=>i,P$:()=>b,ci:()=>y,Nu:()=>k});var s=o("./packages/ckeditor5-utils/src/index.ts");class i extends((0,s.Re)()){constructor(e){super(),this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",n,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",n),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function n(e){e.return=!1,e.stop()}class r extends((0,s.Re)()){constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()})),this.on("execute",(e=>{this.isEnabled||e.stop()}),{priority:"high"}),this.listenTo(e,"change:isReadOnly",((e,t,o)=>{o&&this.affectsData?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}))}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",a,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",a),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function a(e){e.return=!1,e.stop()}class c extends r{constructor(e){super(e),this._childCommandsDefinitions=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){(0,s.VG)(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",(()=>this._checkEnabled())),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find((({command:e})=>e.isEnabled));return e&&e.command}}class l extends((0,s.ln)()){constructor(e,t=[],o=[]){super(),this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of o)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new s.Bb("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[],o=[]){const i=this,n=this._context;!function e(t,o=new Set){t.forEach((t=>{c(t)&&(o.has(t)||(o.add(t),t.pluginName&&!i._availablePlugins.has(t.pluginName)&&i._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,o)))}))}(e),u(e);const r=[...function e(t,o=new Set){return t.map((e=>c(e)?e:i._availablePlugins.get(e))).reduce(((t,s)=>o.has(s)?t:(o.add(s),s.requires&&(u(s.requires,s),e(s.requires,o).forEach((e=>t.add(e)))),t.add(s))),new Set)}(e.filter((e=>!d(e,t))))];!function(e,t){for(const o of t){if("function"!=typeof o)throw new s.Bb("plugincollection-replace-plugin-invalid-type",null,{pluginItem:o});const t=o.pluginName;if(!t)throw new s.Bb("plugincollection-replace-plugin-missing-name",null,{pluginItem:o});if(o.requires&&o.requires.length)throw new s.Bb("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const n=i._availablePlugins.get(t);if(!n)throw new s.Bb("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const r=e.indexOf(n);if(-1===r){if(i._contextPlugins.has(n))return;throw new s.Bb("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(n.requires&&n.requires.length)throw new s.Bb("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(r,1,o),i._availablePlugins.set(t,o)}}(r,o);const a=function(e){return e.map((e=>{let t=i._contextPlugins.get(e);return t=t||new e(n),i._add(e,t),t}))}(r);return p(a,"init").then((()=>p(a,"afterInit"))).then((()=>a));function c(e){return"function"==typeof e}function l(e){return c(e)&&e.isContextPlugin}function d(e,t){return t.some((t=>t===e||(h(e)===t||h(t)===e)))}function h(e){return c(e)?e.pluginName||e.name:e}function u(e,o=null){e.map((e=>c(e)?e:i._availablePlugins.get(e)||e)).forEach((e=>{!function(e,t){if(c(e))return;if(t)throw new s.Bb("plugincollection-soft-required",n,{missingPlugin:e,requiredBy:h(t)});throw new s.Bb("plugincollection-plugin-not-found",n,{plugin:e})}(e,o),function(e,t){if(!l(t))return;if(l(e))return;throw new s.Bb("plugincollection-context-required",n,{plugin:h(e),requiredBy:h(t)})}(e,o),function(e,o){if(!o)return;if(!d(e,t))return;throw new s.Bb("plugincollection-required",n,{plugin:h(e),requiredBy:h(o)})}(e,o)}))}function p(e,t){return e.reduce(((e,o)=>o[t]?i._contextPlugins.has(o)?e:e.then(o[t].bind(o)):e),Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const o=e.pluginName;if(o){if(this._plugins.has(o))throw new s.Bb("plugincollection-plugin-name-conflict",null,{pluginName:o,plugin1:this._plugins.get(o).constructor,plugin2:e});this._plugins.set(o,t)}}}class d{constructor(e){this.config=new s.De(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new l(this,t);const o=this.config.get("language")||{};this.locale=new s.go({uiLanguage:"string"==typeof o?o:o.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new s.FE,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const o of e.concat(t)){if("function"!=typeof o)throw new s.Bb("context-initplugins-constructor-only",null,{Plugin:o});if(!0!==o.isContextPlugin)throw new s.Bb("context-initplugins-invalid-plugin",null,{Plugin:o})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,(e=>e.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(e,t){if(this._contextOwner)throw new s.Bb("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise((t=>{const o=new this(e);t(o.initPlugins().then((()=>o)))}))}}class h extends((0,s.Re)()){constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}var u=o("./packages/ckeditor5-engine/src/index.ts");class p{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const o=this.get(e);if(!o)throw new s.Bb("commandcollection-command-not-found",this,{commandName:e});return o.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 f extends s.VD{constructor(e){super(),this.editor=e}set(e,t,o={}){if("string"==typeof t){const e=t;t=(t,o)=>{this.editor.execute(e),o()}}super.set(e,t,o)}}class g extends((0,s.Re)()){constructor(e={}){super();const t=this.constructor,o=e.language||t.defaultConfig&&t.defaultConfig.language;this._context=e.context||new d({language:o}),this._context._addEditor(this,!e.context);const i=Array.from(t.builtinPlugins||[]);this.config=new s.De(e,t.defaultConfig),this.config.define("plugins",i),this.config.define(this._context._getEditorConfig()),this.plugins=new l(this,i,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new p,this.set("state","initializing"),this.once("ready",(()=>this.state="ready"),{priority:"high"}),this.once("destroy",(()=>this.state="destroyed"),{priority:"high"}),this.model=new u.Hn;const n=new u.A_;this.data=new u.Yc(this.model,n),this.editing=new u.jH(this.model,n),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new u.uz([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 f(this),this.keystrokes.listenTo(this.editing.view.document)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new s.Bb("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new s.Bb("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new s.Bb("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}initPlugins(){const e=this.config,t=e.get("plugins"),o=e.get("removePlugins")||[],s=e.get("extraPlugins")||[],i=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(s),o,i)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise((e=>this.once("ready",e)))),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,...t){try{return this.commands.execute(e,...t)}catch(e){s.Bb.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}}var m=o("./node_modules/lodash-es/isFunction.js");function b(e){if(!(0,m.Z)(e.updateSourceElement))throw new s.Bb("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(function(e){return!!e&&"textarea"===e.tagName.toLowerCase()}(t)&&t.form){let o;const s=t.form,i=()=>e.updateSourceElement();(0,m.Z)(s.submit)&&(o=s.submit,s.submit=()=>{i(),o.apply(s)}),s.addEventListener("submit",i),e.on("destroy",(()=>{s.removeEventListener("submit",i),o&&(s.submit=o)}))}}function _(e){return class extends e{setData(e){this.data.set(e)}getData(e){return this.data.get(e)}}}{const e=_(Object);_.setData=e.prototype.setData,_.getData=e.prototype.getData}function w(e){return class extends e{updateSourceElement(e=this.data.get()){if(!this.sourceElement)throw new s.Bb("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),o=this.sourceElement instanceof HTMLTextAreaElement;t||o?(0,s.jS)(this.sourceElement,e):(0,s.jS)(this.sourceElement,"")}}}function k(e){const t=e.sourceElement;if(t){if(t.ckeditorInstance)throw new s.Bb("editor-source-element-already-used",e);t.ckeditorInstance=e,e.once("destroy",(()=>{delete t.ckeditorInstance}))}}w.updateSourceElement=w(Object).prototype.updateSourceElement;class v extends h{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new s.FE({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new s.Bb("pendingactions-add-invalid-message",this);const t=new((0,s.Re)());return t.set("message",e),this._actions.add(t),this.hasAny=!0,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]()}}const y={bold:'',cancel:'',caption:'',check:'',cog:'',eraser:'',image:'',lowVision:'',importExport:'',paragraph:'',plus:'',text:'',alignBottom:'',alignMiddle:'',alignTop:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',objectLeft:'',objectCenter:'',objectRight:'',objectFullWidth:'',objectInline:'',objectBlockLeft:'',objectBlockRight:'',objectSizeFull:'',objectSizeLarge:'',objectSizeSmall:'',objectSizeMedium:'',pencil:'',pilcrow:'',quote:'',threeVerticalDots:''}},"./packages/ckeditor5-engine/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{kW:()=>Ye,r7:()=>We,KU:()=>Xn,uz:()=>Ei,Yc:()=>Ai,tn:()=>Uo,f4:()=>Tn,uj:()=>Ss,pG:()=>Lt,dK:()=>Ut,qZ:()=>Kt,qD:()=>ct,jH:()=>ni,W_:()=>is,Ay:()=>bn,X5:()=>Ci,IZ:()=>Fi,jP:()=>ln,iE:()=>Ts,zj:()=>Li,xO:()=>T,Hn:()=>Yn,dM:()=>Qn,Qj:()=>$t,Bz:()=>Ji,Ly:()=>as,e6:()=>ps,Th:()=>Ot,A_:()=>Ae,aY:()=>Yo,xv:()=>os,Po:()=>ns,yj:()=>er,G7:()=>Xo,m1:()=>Ye,By:()=>Me,Ux:()=>Je,y_:()=>at,W2:()=>Be,y9:()=>Oe,pc:()=>et,wx:()=>nt,Xj:()=>y,dq:()=>ot,QR:()=>Ar,sI:()=>Er,vt:()=>Dr,J8:()=>zr,DA:()=>l,ID:()=>c,KT:()=>Hn,I8:()=>Pr,mq:()=>xr,oz:()=>yr,YG:()=>je,m0:()=>Tr,uT:()=>Cr,$_:()=>h,SB:()=>wr,D5:()=>ar,G9:()=>hr,IT:()=>lr,zz:()=>pr,WK:()=>br,Zb:()=>gr,PX:()=>vr,Q7:()=>u,NJ:()=>d,Rf:()=>tn});var s=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),i=o.n(s),n=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-engine/theme/placeholder.css"),r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i()(n.Z,r);n.Z.locals;const a=new WeakMap;function c(e){const{view:t,element:o,text:s,isDirectHost:i=!0,keepOnFocus:n=!1}=e,r=t.document;a.has(r)||(a.set(r,new Map),r.registerPostFixer((e=>p(r,e))),r.on("change:isComposing",(()=>{t.change((e=>p(r,e)))}),{priority:"high"})),a.get(r).set(o,{text:s,isDirectHost:i,keepOnFocus:n,hostElement:i?o:null}),t.change((e=>p(r,e)))}function l(e,t){const o=t.document;e.change((e=>{if(!a.has(o))return;const s=a.get(o),i=s.get(t);e.removeAttribute("data-placeholder",i.hostElement),h(e,i.hostElement),s.delete(t)}))}function d(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}function h(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}function u(e,t){if(!e.isAttached())return!1;const o=Array.from(e.getChildren()).some((e=>!e.is("uiElement")));if(o)return!1;const s=e.document,i=s.selection.anchor;return(!s.isComposing||!i||i.parent!==e)&&(!!t||(!s.isFocused||!!i&&i.parent!==e))}function p(e,t){const o=a.get(e),s=[];let i=!1;for(const[e,n]of o)n.isDirectHost&&(s.push(e),f(t,e,n)&&(i=!0));for(const[e,n]of o){if(n.isDirectHost)continue;const o=g(e);o&&(s.includes(o)||(n.hostElement=o,f(t,e,n)&&(i=!0)))}return i}function f(e,t,o){const{text:s,isDirectHost:i,hostElement:n}=o;let r=!1;n.getAttribute("data-placeholder")!==s&&(e.setAttribute("data-placeholder",s,n),r=!0);return(i||1==t.childCount)&&u(n,o.keepOnFocus)?d(e,n)&&(r=!0):h(e,n)&&(r=!0),r}function g(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}var m=o("./packages/ckeditor5-utils/src/index.ts");class b{is(){throw new Error("is() method is abstract")}}var _=o("./node_modules/lodash-es/_baseClone.js"),w=4;const k=function(e){return(0,_.Z)(e,w)};o("./packages/ckeditor5-utils/src/version.ts");class v extends((0,m.ln)(b)){constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new m.Bb("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let o=e.includeSelf?this:this.parent;for(;o;)t[e.parentFirst?"push":"unshift"](o),o=o.parent;return t}getCommonAncestor(e,t={}){const o=this.getAncestors(t),s=e.getAncestors(t);let i=0;for(;o[i]==s[i]&&o[i];)i++;return 0===i?null:o[i-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),o=e.getPath(),s=(0,m.Rt)(t,o);switch(s){case"prefix":return!0;case"extension":return!1;default:return t[s]e.data.length)throw new m.Bb("view-textproxy-wrong-offsetintext",this);if(o<0||t+o>e.data.length)throw new m.Bb("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+o),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}getAncestors(e={}){const t=[];let o=e.includeSelf?this.textNode:this.parent;for(;null!==o;)t[e.parentFirst?"push":"unshift"](o),o=o.parent;return t}}x.prototype.is=function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e};var P=o("./node_modules/lodash-es/isPlainObject.js");class T{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const o=C(t,e);if(o)return{element:t,pattern:e,match:o}}return null}matchAll(...e){const t=[];for(const o of e)for(const e of this._patterns){const s=C(o,e);s&&t.push({element:o,pattern:e,match:s})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function C(e,t){if("function"==typeof t)return t(e);const o={};return t.name&&(o.name=function(e,t){if(e instanceof RegExp)return!!t.match(e);return e===t}(t.name,e.name),!o.name)||t.attributes&&(o.attributes=function(e,t){const o=new Set(t.getAttributeKeys());(0,P.Z)(e)?(void 0!==e.style&&(0,m.KE)("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&(0,m.KE)("matcher-pattern-deprecated-attributes-class-key",e)):(o.delete("style"),o.delete("class"));return A(e,o,(e=>t.getAttribute(e)))}(t.attributes,e),!o.attributes)||t.classes&&(o.classes=function(e,t){return A(e,t.getClassNames(),(()=>{}))}(t.classes,e),!o.classes)||t.styles&&(o.styles=function(e,t){return A(e,t.getStyleNames(!0),(e=>t.getStyle(e)))}(t.styles,e),!o.styles)?null:o}function A(e,t,o){const s=function(e){if(Array.isArray(e))return e.map((e=>(0,P.Z)(e)?(void 0!==e.key&&void 0!==e.value||(0,m.KE)("matcher-pattern-missing-key-or-value",e),[e.key,e.value]):[e,!0]));if((0,P.Z)(e))return Object.entries(e);return[[e,!0]]}(e),i=Array.from(t),n=[];if(s.forEach((([e,t])=>{i.forEach((s=>{(function(e,t){return!0===e||e===t||e instanceof RegExp&&t.match(e)})(e,s)&&function(e,t,o){if(!0===e)return!0;const s=o(t);return e===s||e instanceof RegExp&&!!String(s).match(e)}(t,s,o)&&n.push(s)}))})),s.length&&!(n.lengthi?0:i+t),(o=o>i?i:o)<0&&(o+=i),i=t>o?0:o-t>>>0,t>>>=0;for(var n=Array(i);++st===e));return Array.isArray(t)}set(e,t){if((0,E.Z)(e))for(const[t,o]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,o,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=Ee(e);Y(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map((e=>e.join(":"))).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!(0,E.Z)(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find((([t])=>t===e));return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){if(this.isEmpty)return[];if(e)return this._styleProcessor.getStyleNames(this._styles);return this._getStylesEntries().map((([e])=>e))}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const o of t)e.push(...this._styleProcessor.getReducedForm(o,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const o=t.splice(0,t.length-1).join("."),s=X(this._styles,o);if(!s)return;!Array.from(Object.keys(s)).length&&this.remove(o)}}class Ae{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,o){if((0,E.Z)(t))Se(o,Ee(e),t);else if(this._normalizers.has(e)){const s=this._normalizers.get(e),{path:i,value:n}=s(t);Se(o,i,n)}else Se(o,e,t)}getNormalized(e,t){if(!e)return ve({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const o=this._extractors.get(e);if("string"==typeof o)return X(t,o);const s=o(e,t);if(s)return s}return X(t,Ee(e))}getReducedForm(e,t){const o=this.getNormalized(e,t);if(void 0===o)return[];if(this._reducers.has(e)){return this._reducers.get(e)(o)}return[[e,o]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter((t=>{const o=this.getNormalized(t,e);return o&&"object"==typeof o?Object.keys(o).length:o})),o=new Set([...t,...Object.keys(e)]);return Array.from(o.values())}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 o of t)this._mapStyleNames(o,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function Ee(e){return e.replace("-",".")}function Se(e,t,o){let s=o;(0,E.Z)(o)&&(s=ve({},X(e,t),o)),Te(e,t,s)}class Oe extends v{constructor(e,t,o,s){if(super(e),this.name=t,this._attrs=function(e){const t=(0,m.qL)(e);for(const[e,o]of t)null===o?t.delete(e):"string"!=typeof o&&t.set(e,String(o));return t}(o),this._children=[],s&&this._insertChild(0,s),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");Re(this._classes,e),this._attrs.delete("class")}this._styles=new Ce(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._unsafeAttributesToRender=[]}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof Oe))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,o]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==o)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new T(...e);let o=this.parent;for(;o&&!o.is("documentFragment");){if(t.match(o))return o;o=o.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),o=Array.from(this._attrs).map((e=>`${e[0]}="${e[1]}"`)).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==o?"":` ${o}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const o of this.getChildren())t.push(o._clone(e));const o=new this.constructor(this.document,this.name,this._attrs,t);return o._classes=new Set(this._classes),o._styles.set(this._styles.getNormalized()),o._customProperties=new Map(this._customProperties),o.getFillerOffset=this.getFillerOffset,o._unsafeAttributesToRender=this._unsafeAttributesToRender,o}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let o=0;const s=function(e,t){if("string"==typeof t)return[new y(e,t)];(0,m.TW)(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new y(e,t):t instanceof x?new y(e,t.data):t))}(this.document,t);for(const t of s)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,o++;return o}_removeChildren(e,t=1){this._fireChange("children",this);for(let o=e;o0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of(0,m.qo)(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of(0,m.qo)(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),(0,P.Z)(e)?this._styles.set(e):this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of(0,m.qo)(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Re(e,t){const o=t.split(/\s+/);e.clear(),o.forEach((t=>e.add(t)))}Oe.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Me extends Oe{constructor(...e){super(...e),this.getFillerOffset=je}}function je(){const e=[...this.getChildren()],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}Me.prototype.is=function(e,t){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Be extends((0,m.Re)(Me)){constructor(...e){super(...e);const t=e[0];this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",(e=>e&&t.selection.editableElement==this)),this.listenTo(t.selection,"change",(()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this}))}destroy(){this.stopListening()}}Be.prototype.is=function(e,t){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};const Ve=Symbol("rootName");class Ne extends Be{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(Ve)}set rootName(e){this._setCustomProperty(Ve,e)}set _name(e){this.name=e}}Ne.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===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"===e};class Ie{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new m.Bb("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new m.Bb("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=De._createAt(e.startPosition):this.position=De._createAt(e.boundaries["backward"==e.direction?"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,o,s;do{s=this.position,({done:t,value:o}=this.next())}while(!t&&e(o));t||(this.position=s)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,o=e.parent;if(null===o.parent&&e.offset===o.childCount)return{done:!0,value:void 0};if(o===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let s;if(o instanceof y){if(e.isAtEnd)return this.position=De._createAfter(o),this._next();s=o.data[e.offset]}else s=o.getChild(e.offset);if(s instanceof Oe)return this.shallow?e.offset++:e=new De(s,0),this.position=e,this._formatReturnValue("elementStart",s,t,e,1);if(s instanceof y){if(this.singleCharacters)return e=new De(s,0),this.position=e,this._next();{let o,i=s.data.length;return s==this._boundaryEndParent?(i=this.boundaries.end.offset,o=new x(s,0,i),e=De._createAfter(o)):(o=new x(s,0,s.data.length),e.offset++),this.position=e,this._formatReturnValue("text",o,t,e,i)}}if("string"==typeof s){let s;if(this.singleCharacters)s=1;else{s=(o===this._boundaryEndParent?this.boundaries.end.offset:o.data.length)-e.offset}const i=new x(o,e.offset,s);return e.offset+=s,this.position=e,this._formatReturnValue("text",i,t,e,s)}return e=De._createAfter(o),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",o,t,e)}_previous(){let e=this.position.clone();const t=this.position,o=e.parent;if(null===o.parent&&0===e.offset)return{done:!0,value:void 0};if(o==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let s;if(o instanceof y){if(e.isAtStart)return this.position=De._createBefore(o),this._previous();s=o.data[e.offset-1]}else s=o.getChild(e.offset-1);if(s instanceof Oe)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",s,t,e,1)):(e=new De(s,s.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",s,t,e));if(s instanceof y){if(this.singleCharacters)return e=new De(s,s.data.length),this.position=e,this._previous();{let o,i=s.data.length;if(s==this._boundaryStartParent){const t=this.boundaries.start.offset;o=new x(s,t,s.data.length-t),i=o.data.length,e=De._createBefore(o)}else o=new x(s,0,s.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",o,t,e,i)}}if("string"==typeof s){let s;if(this.singleCharacters)s=1;else{const t=o===this._boundaryStartParent?this.boundaries.start.offset:0;s=e.offset-t}e.offset-=s;const i=new x(o,e.offset,s);return this.position=e,this._formatReturnValue("text",i,t,e,s)}return e=De._createBefore(o),this.position=e,this._formatReturnValue("elementStart",o,t,e,1)}_formatReturnValue(e,t,o,s,i){return t instanceof x&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?o=De._createAfter(t.textNode):(s=De._createAfter(t.textNode),this.position=s)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?o=De._createBefore(t.textNode):(s=De._createBefore(t.textNode),this.position=s))),{done:!1,value:{type:e,item:t,previousPosition:o,nextPosition:s,length:i}}}}class De extends b{constructor(e,t){super(),this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const 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;for(;!(e instanceof Be);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=De._createAt(this),o=t.offset+e;return t.offset=o<0?0:o,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const o=new Ie(t);return o.skip(e),o.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),o=e.getAncestors();let s=0;for(;t[s]==o[s]&&t[s];)s++;return 0===s?null:t[s-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],o=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),o.push(e.offset);const s=(0,m.Rt)(t,o);switch(s){case"prefix":return"before";case"extension":return"after";default:return t[s]0?new this(o,s):new this(s,o)}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(De._createBefore(e),t)}}function Fe(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}ze.prototype.is=function(e){return"range"===e||"view:range"===e};class Le extends((0,m.ln)(b)){constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}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];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)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!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let o=!1;for(const s of e._ranges)if(t.isEqual(s)){o=!0;break}if(!o)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=(0,m.QX)(this.getRanges());if(t!=(0,m.QX)(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let o=!1;for(let s of e.getRanges())if(s=s.getTrimmed(),t.start.isEqual(s.start)&&t.end.isEqual(s.end)){o=!0;break}if(!o)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,o,s]=e;if("object"==typeof o&&(s=o,o=void 0),null===t)this._setRanges([]),this._setFakeOptions(s);else if(t instanceof Le||t instanceof Ze)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof ze)this._setRanges([t],s&&s.backward),this._setFakeOptions(s);else if(t instanceof De)this._setRanges([new ze(t)]),this._setFakeOptions(s);else if(t instanceof v){const e=!!s&&!!s.backward;let i;if(void 0===o)throw new m.Bb("view-selection-setto-required-second-parameter",this);i="in"==o?ze._createIn(t):"on"==o?ze._createOn(t):new ze(De._createAt(t,o)),this._setRanges([i],e),this._setFakeOptions(s)}else{if(!(0,m.TW)(t))throw new m.Bb("view-selection-setto-not-selectable",this);this._setRanges(t,s&&s.backward),this._setFakeOptions(s)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new m.Bb("view-selection-setfocus-no-ranges",this);const o=De._createAt(e,t);if("same"==o.compareWith(this.focus))return;const s=this.anchor;this._ranges.pop(),"before"==o.compareWith(s)?this._addRange(new ze(o,s),!0):this._addRange(new ze(s,o)),this.fire("change")}_setRanges(e,t=!1){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=!1){if(!(e instanceof ze))throw new m.Bb("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new m.Bb("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new ze(e.start,e.end))}}Le.prototype.is=function(e){return"selection"===e||"view:selection"===e};class Ze extends((0,m.ln)(b)){constructor(...e){super(),this._selection=new Le,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}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)}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}}Ze.prototype.is=function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e};class We extends m.M3{constructor(e,t,o){super(e,t),this.startRange=o,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const He=Symbol("bubbling contexts");function $e(e){return class extends e{fire(e,...t){try{const o=e instanceof m.M3?e:new m.M3(this,e),s=Ge(this);if(!s.size)return;if(qe(o,"capturing",this),Ue(s,"$capture",o,...t))return o.return;const i=o.startRange||this.selection.getFirstRange(),n=i?i.getContainedElement():null,r=!!n&&Boolean(Ke(s,n));let a=n||function(e){if(!e)return null;const t=e.start.parent,o=e.end.parent,s=t.getPath(),i=o.getPath();return s.length>i.length?t:o}(i);if(qe(o,"atTarget",a),!r){if(Ue(s,"$text",o,...t))return o.return;qe(o,"bubbling",a)}for(;a;){if(a.is("rootElement")){if(Ue(s,"$root",o,...t))return o.return}else if(a.is("element")&&Ue(s,a.name,o,...t))return o.return;if(Ue(s,a,o,...t))return o.return;a=a.parent,qe(o,"bubbling",a)}return qe(o,"bubbling",this),Ue(s,"$document",o,...t),o.return}catch(e){m.Bb.rethrowUnexpectedError(e,this)}}_addEventListener(e,t,o){const s=(0,m.qo)(o.context||"$document"),i=Ge(this);for(const n of s){let s=i.get(n);s||(s=new((0,m.ln)()),i.set(n,s)),this.listenTo(s,e,t,o)}}_removeEventListener(e,t){const o=Ge(this);for(const s of o.values())this.stopListening(s,e,t)}}}{const e=$e(Object);["fire","_addEventListener","_removeEventListener"].forEach((t=>{$e[t]=e.prototype[t]}))}function qe(e,t,o){e instanceof We&&(e._eventPhase=t,e._currentTarget=o)}function Ue(e,t,o,...s){const i="string"==typeof t?e.get(t):Ke(e,t);return!!i&&(i.fire(o,...s),o.stop.called)}function Ke(e,t){for(const[o,s]of e)if("function"==typeof o&&o(t))return s;return null}function Ge(e){return e[He]||(e[He]=new Map),e[He]}class Je extends($e((0,m.Re)())){constructor(e){super(),this.selection=new Ze,this.roots=new m.FE({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),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=!1;do{for(const o of this._postFixers)if(t=o(e),t)break}while(t)}}class Ye extends Oe{constructor(...e){super(...e),this.getFillerOffset=Xe,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new m.Bb("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function Xe(){if(Qe(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Qe(e)>1)return null;e=e.parent}return!e||Qe(e)>1?null:this.childCount}function Qe(e){return Array.from(e.getChildren()).filter((e=>!e.is("uiElement"))).length}Ye.DEFAULT_PRIORITY=10,Ye.prototype.is=function(e,t){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class et extends Oe{constructor(e,t,o,s){super(e,t,o,s),this.getFillerOffset=tt}_insertChild(e,t){if(t&&(t instanceof v||Array.from(t).length>0))throw new m.Bb("view-emptyelement-cannot-add",[this,t]);return 0}}function tt(){return null}et.prototype.is=function(e,t){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class ot extends Oe{constructor(...e){super(...e),this.getFillerOffset=it}_insertChild(e,t){if(t&&(t instanceof v||Array.from(t).length>0))throw new m.Bb("view-uielement-cannot-add",[this,t]);return 0}render(e,t){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 st(e){e.document.on("arrowKey",((t,o)=>function(e,t,o){if(t.keyCode==m.Do.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),s=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(s||t.shiftKey){const t=e.focusNode,i=e.focusOffset,n=o.domPositionToView(t,i);if(null===n)return;let r=!1;const a=n.getLastMatchingPosition((e=>(e.item.is("uiElement")&&(r=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement")))));if(r){const t=o.viewPositionToDom(a);s?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,o,e.domConverter)),{priority:"low"})}function it(){return null}ot.prototype.is=function(e,t){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class nt extends Oe{constructor(...e){super(...e),this.getFillerOffset=rt}_insertChild(e,t){if(t&&(t instanceof v||Array.from(t).length>0))throw new m.Bb("view-rawelement-cannot-add",[this,t]);return 0}render(){}}function rt(){return null}nt.prototype.is=function(e,t){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class at extends((0,m.ln)(b)){constructor(e,t){super(),this.document=e,this._children=[],t&&this._insertChild(0,t),this._customProperties=new Map}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}_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 o=0;const s=function(e,t){if("string"==typeof t)return[new y(e,t)];(0,m.TW)(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new y(e,t):t instanceof x?new y(e,t.data):t))}(this.document,t);for(const t of s)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,o++;return o}_removeChildren(e,t=1){this._fireChange("children",this);for(let o=e;o{const o=e[e.length-1],s=!t.is("uiElement");return o&&o.breakAttributes==s?o.nodes.push(t):e.push({breakAttributes:s,nodes:[t]}),e}),[]);let s=null,i=e;for(const{nodes:e,breakAttributes:t}of o){const o=this._insertNodes(i,e,t);s||(s=o.start),i=o.end}return s?new ze(s,i):new ze(e)}remove(e){const t=e instanceof ze?e:ze._createOn(e);if(bt(t,this.document),t.isCollapsed)return new at(this.document);const{start:o,end:s}=this._breakAttributesRange(t,!0),i=o.parent,n=s.offset-o.offset,r=i._removeChildren(o.offset,n);for(const e of r)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(o);return t.start=a,t.end=a.clone(),new at(this.document,r)}clear(e,t){bt(e,this.document);const o=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const s of o){const o=s.item;let i;if(o.is("element")&&t.isSimilar(o))i=ze._createOn(o);else if(!s.nextPosition.isAfter(e.start)&&o.is("$textProxy")){const e=o.getAncestors().find((e=>e.is("element")&&t.isSimilar(e)));e&&(i=ze._createIn(e))}i&&(i.end.isAfter(e.end)&&(i.end=e.end),i.start.isBefore(e.start)&&(i.start=e.start),this.remove(i))}}move(e,t){let o;if(t.isAfter(e.end)){const s=(t=this._breakAttributes(t,!0)).parent,i=s.childCount;e=this._breakAttributesRange(e,!0),o=this.remove(e),t.offset+=s.childCount-i}else o=this.remove(e);return this.insert(t,o)}wrap(e,t){if(!(t instanceof Ye))throw new m.Bb("view-writer-wrap-invalid-attribute",this.document);if(bt(e,this.document),e.isCollapsed){let s=e.start;s.parent.is("element")&&(o=s.parent,!Array.from(o.getChildren()).some((e=>!e.is("uiElement"))))&&(s=s.getLastMatchingPosition((e=>e.item.is("uiElement")))),s=this._wrapPosition(s,t);const i=this.document.selection;return i.isCollapsed&&i.getFirstPosition().isEqual(e.start)&&this.setSelection(s),new ze(s)}return this._wrapRange(e,t);var o}unwrap(e,t){if(!(t instanceof Ye))throw new m.Bb("view-writer-unwrap-invalid-attribute",this.document);if(bt(e,this.document),e.isCollapsed)return e;const{start:o,end:s}=this._breakAttributesRange(e,!0),i=o.parent,n=this._unwrapChildren(i,o.offset,s.offset,t),r=this.mergeAttributes(n.start);r.isEqual(n.start)||n.end.offset--;const a=this.mergeAttributes(n.end);return new ze(r,a)}rename(e,t){const o=new Me(this.document,e,t.getAttributes());return this.insert(De._createAfter(t),o),this.move(ze._createIn(t),De._createAt(o,0)),this.remove(ze._createOn(t)),o}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return De._createAt(e,t)}createPositionAfter(e){return De._createAfter(e)}createPositionBefore(e){return De._createBefore(e)}createRange(...e){return new ze(...e)}createRangeOn(e){return ze._createOn(e)}createRangeIn(e){return ze._createIn(e)}createSelection(...e){return new Le(...e)}createSlot(e){if(!this._slotFactory)throw new m.Bb("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,o){let s,i;if(s=o?lt(e):e.parent.is("$text")?e.parent.parent:e.parent,!s)throw new m.Bb("view-writer-invalid-position-container",this.document);i=o?this._breakAttributes(e,!0):e.parent.is("$text")?ut(e):e;const n=s._insertChild(i.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const r=i.getShiftedBy(n),a=this.mergeAttributes(i);a.isEqual(i)||r.offset--;const c=this.mergeAttributes(r);return new ze(a,c)}_wrapChildren(e,t,o,s){let i=t;const n=[];for(;i!1,e.parent._insertChild(e.offset,o);const s=new ze(e,e.getShiftedBy(1));this.wrap(s,t);const i=new De(o.parent,o.index);o._remove();const n=i.nodeBefore,r=i.nodeAfter;return n instanceof y&&r instanceof y?pt(n,r):ht(i)}_wrapAttributeElement(e,t){if(!_t(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const o of e.getAttributeKeys())if("class"!==o&&"style"!==o&&t.hasAttribute(o)&&t.getAttribute(o)!==e.getAttribute(o))return!1;for(const o of e.getStyleNames())if(t.hasStyle(o)&&t.getStyle(o)!==e.getStyle(o))return!1;for(const o of e.getAttributeKeys())"class"!==o&&"style"!==o&&(t.hasAttribute(o)||this.setAttribute(o,e.getAttribute(o),t));for(const o of e.getStyleNames())t.hasStyle(o)||this.setStyle(o,e.getStyle(o),t);for(const o of e.getClassNames())t.hasClass(o)||this.addClass(o,t);return!0}_unwrapAttributeElement(e,t){if(!_t(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const o of e.getAttributeKeys())if("class"!==o&&"style"!==o&&(!t.hasAttribute(o)||t.getAttribute(o)!==e.getAttribute(o)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const o of e.getStyleNames())if(!t.hasStyle(o)||t.getStyle(o)!==e.getStyle(o))return!1;for(const o of e.getAttributeKeys())"class"!==o&&"style"!==o&&this.removeAttribute(o,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const o=e.start,s=e.end;if(bt(e,this.document),e.isCollapsed){const o=this._breakAttributes(e.start,t);return new ze(o,o)}const i=this._breakAttributes(s,t),n=i.parent.childCount,r=this._breakAttributes(o,t);return i.offset+=i.parent.childCount-n,new ze(r,i)}_breakAttributes(e,t=!1){const o=e.offset,s=e.parent;if(e.parent.is("emptyElement"))throw new m.Bb("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new m.Bb("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new m.Bb("view-writer-cannot-break-raw-element",this.document);if(!t&&s.is("$text")&&mt(s.parent))return e.clone();if(mt(s))return e.clone();if(s.is("$text"))return this._breakAttributes(ut(e),t);if(o==s.childCount){const e=new De(s.parent,s.index+1);return this._breakAttributes(e,t)}if(0===o){const e=new De(s.parent,s.index);return this._breakAttributes(e,t)}{const e=s.index+1,i=s._clone();s.parent._insertChild(e,i),this._addToClonedElementsGroup(i);const n=s.childCount-o,r=s._removeChildren(o,n);i._appendChild(r);const a=new De(s.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 o=this._cloneGroups.get(t);o||(o=new Set,this._cloneGroups.set(t,o)),o.add(e),e._clonesGroup=o}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const o=this._cloneGroups.get(t);o&&o.delete(e)}}function lt(e){let t=e.parent;for(;!mt(t);){if(!t)return;t=t.parent}return t}function dt(e,t){return e.priorityt.priority)&&e.getIdentity()o instanceof e)))throw new m.Bb("view-writer-insert-invalid-node-type",t);o.is("$text")||gt(o.getChildren(),t)}}function mt(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function bt(e,t){const o=lt(e.start),s=lt(e.end);if(!o||!s||o!==s)throw new m.Bb("view-writer-invalid-range-container",t)}function _t(e,t){return null===e.id&&null===t.id}const wt=e=>e.createTextNode(" "),kt=e=>{const t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},vt=e=>{const t=e.createElement("br");return t.dataset.ckeFiller="true",t},yt=7,xt="⁠".repeat(yt);function Pt(e){return(0,m.Gs)(e)&&e.data.substr(0,yt)===xt}function Tt(e){return e.data.length==yt&&Pt(e)}function Ct(e){return Pt(e)?e.data.slice(yt):e.data}function At(e,t){if(t.keyCode==m.Do.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,o=e.getRangeAt(0).startOffset;Pt(t)&&o<=yt&&e.collapse(t,0)}}}var Et=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-engine/theme/renderer.css"),St={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i()(Et.Z,St);Et.Z.locals;class Ot extends((0,m.Re)()){constructor(e,t){super(),this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),m.OB.isBlink&&!m.OB.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()})),this.set("isComposing",!1),this.on("change:isComposing",(()=>{this.isComposing||this.render()})),this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new m.Bb("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!m.OB.isAndroid)return;let e=null;const t=!(m.OB.isBlink&&!m.OB.isAndroid)||!this.isSelecting;for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=De._createBefore(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)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),o=t.parent.ownerDocument;Pt(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=Rt(o,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){if(!this.domConverter.mapViewToDom(e))return;const t=Array.from(this.domConverter.mapViewToDom(e).childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),s=this._diffNodeLists(t,o),i=this._findReplaceActions(s,t,o);if(-1!==i.indexOf("replace")){const s={equal:0,insert:0,delete:0};for(const n of i)if("replace"===n){const i=s.equal+s.insert,n=s.equal+s.delete,r=e.getChild(i);!r||r.is("uiElement")||r.is("rawElement")||this._updateElementMappings(r,t[n]),(0,m.Od)(o[i]),s.equal++}else s[n]++}}_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();return e.parent.is("$text")?De._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&(0,m.Gs)(t.parent)&&Pt(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Pt(e))throw new m.Bb("view-renderer-filler-was-lost",this);Tt(e)?e.remove():e.data=e.data.substr(yt),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,o=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor((e=>e.hasAttribute("contenteditable")));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;if(o===t.getFillerOffset())return!1;const s=e.nodeBefore,i=e.nodeAfter;return!(s instanceof y||i instanceof y)&&(!m.OB.isAndroid||!s&&!i)}_updateText(e,t){const o=this.domConverter.findCorrespondingDomText(e);let s=this.domConverter.viewToDom(e).data;const i=t.inlineFillerPosition;i&&i.parent==e.parent&&i.offset==e.index&&(s=xt+s),Vt(o,s)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const o=Array.from(t.attributes).map((e=>e.name)),s=e.getAttributeKeys();for(const o of s)this.domConverter.setDomElementAttribute(t,o,e.getAttribute(o),e);for(const s of o)e.hasAttribute(s)||this.domConverter.removeDomElementAttribute(t,s)}_updateChildren(e,t){const o=this.domConverter.mapViewToDom(e);if(!o)return;if(m.OB.isAndroid){let e=null;for(const t of Array.from(o.childNodes)){if(e&&(0,m.Gs)(e)&&(0,m.Gs)(t)){o.normalize();break}e=t}}const s=t.inlineFillerPosition,i=o.childNodes,n=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));s&&s.parent===e&&Rt(o.ownerDocument,n,s.offset);const r=this._diffNodeLists(i,n),a=m.OB.isAndroid?this._findReplaceActions(r,i,n,{replaceText:!0}):r;let c=0;const l=new Set;for(const e of a)"delete"===e?(l.add(i[c]),(0,m.Od)(i[c])):"equal"!==e&&"replace"!==e||c++;c=0;for(const e of a)"insert"===e?((0,m.ZQ)(o,c,n[c]),c++):"replace"===e?(Vt(i[c],n[c].data),c++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(n[c])),c++);for(const e of l)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return e=function(e,t){const o=Array.from(e);if(0==o.length||!t)return o;const s=o[o.length-1];s==t&&o.pop();return o}(e,this._fakeSelectionContainer),(0,m.Hg)(e,t,Bt.bind(null,this.domConverter))}_findReplaceActions(e,t,o,s={}){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let i=[],n=[],r=[];const a={equal:0,insert:0,delete:0};for(const c of e)"insert"===c?r.push(o[a.equal+a.insert]):"delete"===c?n.push(t[a.equal+a.delete]):(i=i.concat((0,m.Hg)(n,r,s.replaceText?jt:Mt).map((e=>"equal"===e?"replace":e))),i.push("equal"),n=[],r=[]),a[c]++;return i.concat((0,m.Hg)(n,r,s.replaceText?jt:Mt).map((e=>"equal"===e?"replace":e)))}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(m.OB.isBlink&&!m.OB.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&m.OB.isAndroid||this._updateDomSelection(e))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const o=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(o,this.selection),!this._fakeSelectionNeedsUpdate(e))return;o.parentElement&&o.parentElement==e||e.appendChild(o),o.textContent=this.selection.fakeSelectionLabel||" ";const s=t.getSelection(),i=t.createRange();s.removeAllRanges(),i.selectNodeContents(o),s.addRange(i)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const o=this.domConverter.viewPositionToDom(this.selection.anchor),s=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(o.parent,o.offset),t.extend(s.parent,s.offset),m.OB.isGecko&&function(e,t){const o=e.parent;if(o.nodeType!=Node.ELEMENT_NODE||e.offset!=o.childNodes.length-1)return;const s=o.childNodes[e.offset];s&&"BR"==s.tagName&&t.addRange(t.getRangeAt(0))}(s,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,o=e.ownerDocument.getSelection();return!t||t.parentElement!==e||(o.anchorNode!==t&&!t.contains(o.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const o=e.activeElement,s=this.domConverter.mapDomToView(o);o&&s&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function Rt(e,t,o){const s=t instanceof Array?t:t.childNodes,i=s[o];if((0,m.Gs)(i))return i.data=xt+i.data,i;{const i=e.createTextNode(xt);return Array.isArray(t)?s.splice(o,0,i):(0,m.ZQ)(t,o,i),i}}function Mt(e,t){return(0,m.UG)(e)&&(0,m.UG)(t)&&!(0,m.Gs)(e)&&!(0,m.Gs)(t)&&!(0,m.C3)(e)&&!(0,m.C3)(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function jt(e,t){return(0,m.UG)(e)&&(0,m.UG)(t)&&(0,m.Gs)(e)&&(0,m.Gs)(t)}function Bt(e,t,o){return t===o||((0,m.Gs)(t)&&(0,m.Gs)(o)?t.data===o.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(o)))}function Vt(e,t){const o=e.data;if(o==t)return;const s=(0,m.HZ)(o,t);for(const t of s)"insert"===t.type?e.insertData(t.index,t.values.join("")):e.deleteData(t.index,t.howMany)}const Nt=vt(m.CO.document),It=wt(m.CO.document),Dt=kt(m.CO.document),zt="data-ck-unsafe-attribute-",Ft="data-ck-unsafe-element";class Lt{constructor(e,t={}){this.document=e,this.renderingMode=t.renderingMode||"editing",this.blockFillerMode=t.blockFillerMode||("editing"===this.renderingMode?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument="editing"===this.renderingMode?m.CO.document:m.CO.document.implementation.createHTMLDocument(""),this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new T,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Le(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 Array.from(e.children))this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,o){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&(("srcdoc"!==e||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===o&&("src"===e||"srcset"===e)||("source"===o&&"srcset"===e||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const o=(new DOMParser).parseFromString(t,"text/html"),s=o.createDocumentFragment(),i=o.body.childNodes;for(;i.length>0;)s.appendChild(i[0]);const n=o.createTreeWalker(s,NodeFilter.SHOW_ELEMENT),r=[];let a;for(;a=n.nextNode();)r.push(a);for(const e of r){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(Ht(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(s)}viewToDom(e,t={}){if(e.is("$text")){const t=this._processDataFromViewText(e);return this._domDocument.createTextNode(t)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let o;if(e.is("documentFragment"))o=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(o,e);else{if(e.is("uiElement"))return o="$comment"===e.name?this._domDocument.createComment(e.getCustomProperty("$rawContent")):e.render(this._domDocument,this),t.bind&&this.bindElements(o,e),o;this._shouldRenameElement(e.name)?(Ht(e.name),o=this._createReplacementDomElement(e.name)):o=e.hasAttribute("xmlns")?this._domDocument.createElementNS(e.getAttribute("xmlns"),e.name):this._domDocument.createElement(e.name),e.is("rawElement")&&e.render(o,this),t.bind&&this.bindElements(o,e);for(const t of e.getAttributeKeys())this.setDomElementAttribute(o,t,e.getAttribute(t),e)}if(!1!==t.withChildren)for(const s of this.viewChildrenToDom(e,t))o.appendChild(s);return o}}setDomElementAttribute(e,t,o,s){const i=this.shouldRenderAttribute(t,o,e.tagName.toLowerCase())||s&&s.shouldRenderUnsafeAttribute(t);i||(0,m.KE)("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:o}),e.hasAttribute(t)&&!i?e.removeAttribute(t):e.hasAttribute(zt+t)&&i&&e.removeAttribute(zt+t),e.setAttribute(i?t:zt+t,o)}removeDomElementAttribute(e,t){t!=Ft&&(e.removeAttribute(t),e.removeAttribute(zt+t))}*viewChildrenToDom(e,t={}){const o=e.getFillerOffset&&e.getFillerOffset();let s=0;for(const i of e.getChildren()){o===s&&(yield this._getBlockFiller());const e=i.is("element")&&!!i.getCustomProperty("dataPipeline:transparentRendering")&&!(0,m.Ps)(i.getAttributes());e&&"data"==this.renderingMode?yield*this.viewChildrenToDom(i,t):(e&&(0,m.KE)("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:i}),yield this.viewToDom(i,t)),s++}o===s&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),o=this.viewPositionToDom(e.end),s=this._domDocument.createRange();return s.setStart(t.parent,t.offset),s.setEnd(o.parent,o.offset),s}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const o=this.findCorrespondingDomText(t);if(!o)return null;let s=e.offset;return Pt(o)&&(s+=yt),{parent:o,offset:s}}{let o,s,i;if(0===e.offset){if(o=this.mapViewToDom(t),!o)return null;i=o.childNodes[0]}else{const t=e.nodeBefore;if(s=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(t),!s)return null;o=s.parentNode,i=s.nextSibling}if((0,m.Gs)(i)&&Pt(i))return{parent:i,offset:yt};return{parent:o,offset:s?(0,m.cq)(s)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const o=this.getHostViewElement(e);if(o)return o;if((0,m.C3)(e)&&t.skipComments)return null;if((0,m.Gs)(e)){if(Tt(e))return null;{const t=this._processDataFromDomText(e);return""===t?null:new y(this.document,t)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let o;if(this.isDocumentFragment(e))o=new at(this.document),t.bind&&this.bindDocumentFragments(e,o);else{o=this._createViewElement(e,t),t.bind&&this.bindElements(e,o);const s=e.attributes;if(s)for(let e=s.length,t=0;t{const{scrollLeft:t,scrollTop:o}=e;s.push([t,o])})),t.focus(),Zt(t,(e=>{const[t,o]=s.shift();e.scrollLeft=t,e.scrollTop=o})),m.CO.window.scrollTo(e,o)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(Nt):!("BR"!==e.tagName||!Wt(e,this.blockElements)||1!==e.parentNode.childNodes.length)||(e.isEqualNode(Dt)||function(e,t){const o=e.isEqualNode(It);return o&&Wt(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements))}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch(e){return!1}const o=t.collapsed;return t.detach(),o}getHostViewElement(e){const t=(0,m.dk)(e);for(t.pop();t.length;){const e=t.pop(),o=this._domToViewMapping.get(e);if(o&&(o.is("uiElement")||o.is("rawElement")))return o}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return wt(this._domDocument);case"markedNbsp":return kt(this._domDocument);case"br":return vt(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if((0,m.Gs)(e)&&Pt(e)&&tthis.preElements.includes(e.name))))return t;if(" "==t.charAt(0)){const o=this._getTouchingInlineViewNode(e,!1);!(o&&o.is("$textProxy")&&this._nodeEndsWithSpace(o))&&o||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const o=this._getTouchingInlineViewNode(e,!0),s=o&&o.is("$textProxy")&&" "==o.data.charAt(0);" "!=t.charAt(t.length-2)&&o&&!s||(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!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(function(e,t){const o=(0,m.dk)(e);return o.some((e=>e.tagName&&t.includes(e.tagName.toLowerCase())))}(e,this.preElements))return Ct(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const o=this._getTouchingInlineDomNode(e,!1),s=this._getTouchingInlineDomNode(e,!0),i=this._checkShouldLeftTrimDomText(e,o),n=this._checkShouldRightTrimDomText(e,s);i&&(t=t.replace(/^ /,"")),n&&(t=t.replace(/ $/,"")),t=Ct(new Text(t)),t=t.replace(/ \u00A0/g," ");const r=s&&this.isElement(s)&&"BR"!=s.tagName,a=s&&(0,m.Gs)(s)&&" "==s.data.charAt(0);return(/( |\u00A0)\u00A0$/.test(t)||!s||r||a)&&(t=t.replace(/\u00A0$/," ")),(i||o&&this.isElement(o)&&"BR"!=o.tagName)&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?"BR"===t.tagName:!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!Pt(e)}_getTouchingInlineViewNode(e,t){const o=new Ie({startPosition:t?De._createAfter(e):De._createBefore(e),direction:t?"forward":"backward"});for(const e of o){if(e.item.is("element")&&this.inlineObjectElements.includes(e.item.name))return e.item;if(e.item.is("containerElement"))return null;if(e.item.is("element","br"))return null;if(e.item.is("$textProxy"))return e.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const o=t?"firstChild":"lastChild",s=t?"nextSibling":"previousSibling";let i=!0,n=e;do{if(!i&&n[o]?n=n[o]:n[s]?(n=n[s],i=!1):(n=n.parentNode,i=!0),!n||this._isBlockElement(n))return null}while(!(0,m.Gs)(n)&&"BR"!=n.tagName&&!this._isInlineObjectElement(n));return n}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if((0,m.C3)(e))return new ot(this.document,"$comment");const o=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new Oe(this.document,o)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const o=this._domDocument.createElement("span");if(o.setAttribute(Ft,e),t){for(;t.firstChild;)o.appendChild(t.firstChild);for(const e of t.getAttributeNames())o.setAttribute(e,t.getAttribute(e))}return o}}function Zt(e,t){let o=e;for(;o;)t(o),o=o.parentElement}function Wt(e,t){const o=e.parentNode;return!!o&&!!o.tagName&&t.includes(o.tagName.toLowerCase())}function Ht(e){"script"===e&&(0,m.KE)("domconverter-unsafe-script-element-detected"),"style"===e&&(0,m.KE)("domconverter-unsafe-style-element-detected")}class $t extends((0,m.Xu)()){constructor(e){super(),this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}var qt=o("./node_modules/lodash-es/assignIn.js");class Ut{constructor(e,t,o){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,(0,qt.Z)(this,o)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Kt extends $t{constructor(e){super(e),this.useCapture=!1}observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach((t=>{this.listenTo(e,t,((e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)}),{useCapture:this.useCapture})}))}fire(e,t,o){this.isEnabled&&this.document.fire(e,new Ut(this.view,t,o))}}class Gt extends Kt{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return(0,m.Cq)(this)}};this.fire(e.type,e,t)}}var Jt=o("./node_modules/lodash-es/debounce.js");class Yt extends $t{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=(0,Jt.Z)((e=>{this.document.fire("selectionChangeDone",e)}),200)}observe(){const e=this.document;e.on("arrowKey",((t,o)=>{e.selection.isFake&&this.isEnabled&&o.preventDefault()}),{context:"$capture"}),e.on("arrowKey",((t,o)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(o.keyCode)}),{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,o=new Le(t.getRanges(),{backward:t.isBackward,fake:!1});e!=m.Do.arrowleft&&e!=m.Do.arrowup||o.setTo(o.getFirstPosition()),e!=m.Do.arrowright&&e!=m.Do.arrowdown||o.setTo(o.getLastPosition());const s={oldSelection:t,newSelection:o,domSelection:null};this.document.fire("selectionChange",s),this._fireSelectionChangeDoneDebounced(s)}}var Xt="__lodash_hash_undefined__";const Qt=function(e){return this.__data__.set(e,Xt),this};const eo=function(e){return this.__data__.has(e)};function to(e){var t=-1,o=null==e?0:e.length;for(this.__data__=new B.Z;++ta))return!1;var l=n.get(e),d=n.get(t);if(l&&d)return l==t&&d==e;var h=-1,u=!0,p=o&ro?new oo:void 0;for(n.set(e,t),n.set(t,e);++h{this._isFocusChanging=!0,this._renderTimeoutId=setTimeout((()=>{this.flush(),e.change((()=>{}))}),50)})),t.on("blur",((o,s)=>{const i=t.selection.editableElement;null!==i&&i!==s.target||(t.isFocused=!1,this._isFocusChanging=!1,e.change((()=>{})))}))}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class $o extends $t{constructor(e){super(e),this.mutationObserver=e.getObserver(Zo),this.focusObserver=e.getObserver(Ho),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=(0,Jt.Z)((e=>{this.document.fire("selectionChangeDone",e)}),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=(0,Jt.Z)((()=>this.document.isSelecting=!1),5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,o=()=>{this.document.isSelecting&&(this._handleSelectionChange(null,t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(e,"keydown",o,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",o,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",o,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",((e,o)=>{this.document.isComposing&&!m.OB.isAndroid||(this._handleSelectionChange(o,t),this._documentIsSelectingInactivityTimeoutDebounced())})),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_handleSelectionChange(e,t){if(!this.isEnabled)return;const o=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(o.anchorNode))return;this.mutationObserver.flush();const s=this.domConverter.domSelectionToView(o);if(0!=s.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(s)&&this.domConverter.isDomSelectionCorrect(o)||++this._loopbackCounter>60))if(this.focusObserver.flush(),this.selection.isSimilar(s))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:s,domSelection:o};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class qo extends Kt{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",(()=>{t.isComposing=!0}),{priority:"low"}),t.on("compositionend",(()=>{t.isComposing=!1}),{priority:"low"})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class Uo{constructor(e,t={}){this._files=t.cacheFiles?Ko(e):null,this._native=e}get files(){return this._files||(this._files=Ko(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}function Ko(e){const t=Array.from(e.files||[]),o=Array.from(e.items||[]);return t.length?t:o.filter((e=>"file"===e.kind)).map((e=>e.getAsFile()))}class Go extends Kt{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){const t=e.getTargetRanges(),o=this.view,s=o.document;let i=null,n=null,r=[];if(e.dataTransfer&&(i=new Uo(e.dataTransfer)),null!==e.data?n=e.data:i&&(n=i.getData("text/plain")),s.selection.isFake)r=Array.from(s.selection.getRanges());else if(t.length)r=t.map((e=>o.domConverter.domRangeToView(e)));else if(m.OB.isAndroid){const t=e.target.ownerDocument.defaultView.getSelection();r=Array.from(o.domConverter.domSelectionToView(t).getRanges())}if(m.OB.isAndroid&&"insertCompositionText"==e.inputType&&n&&n.endsWith("\n"))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[o.createRange(r[0].end)]});else if("insertText"==e.inputType&&n&&n.includes("\n")){const t=n.split(/\n{1,2}/g);let o=r;for(let n=0;n{if(this.isEnabled&&(0,m.dj)(t.keyCode)){const o=new We(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(o,t),o.stop.called&&e.stop()}}))}observe(){}}class Yo extends $t{constructor(e){super(e);const t=this.document;t.on("keydown",((e,o)=>{if(!this.isEnabled||o.keyCode!=m.Do.tab||o.ctrlKey)return;const s=new We(t,"tab",t.selection.getFirstRange());t.fire(s,o),s.stop.called&&e.stop()}))}observe(){}}class Xo extends((0,m.Re)()){constructor(e){super(),this.document=new Je(e),this.domConverter=new Lt(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Ot(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new ct(this.document),this.addObserver(Zo),this.addObserver(Ho),this.addObserver($o),this.addObserver(Gt),this.addObserver(Yt),this.addObserver(qo),this.addObserver(Jo),this.addObserver(Go),this.addObserver(Yo),this.document.on("arrowKey",At,{priority:"low"}),st(this),this.on("render",(()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=!0})),this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=!0}))}attachDomRoot(e,t="main"){const o=this.document.getRoot(t);o._name=e.tagName.toLowerCase();const s={};for(const{name:t,value:i}of Array.from(e.attributes))s[t]=i,"class"===t?this._writer.addClass(i.split(" "),o):this._writer.setAttribute(t,i,o);this._initialDomRootAttributes.set(e,s);const i=()=>{this._writer.setAttribute("contenteditable",(!o.isReadOnly).toString(),o),o.isReadOnly?this._writer.addClass("ck-read-only",o):this._writer.removeClass("ck-read-only",o)};i(),this.domRoots.set(t,e),this.domConverter.bindElements(e,o),this._renderer.markToSync("children",o),this._renderer.markToSync("attributes",o),this._renderer.domDocuments.add(e.ownerDocument),o.on("change:children",((e,t)=>this._renderer.markToSync("children",t))),o.on("change:attributes",((e,t)=>this._renderer.markToSync("attributes",t))),o.on("change:text",((e,t)=>this._renderer.markToSync("text",t))),o.on("change:isReadOnly",(()=>this.change(i))),o.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const o of this._observers.values())o.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach((({name:e})=>t.removeAttribute(e)));const o=this._initialDomRootAttributes.get(t);for(const e in o)t.setAttribute(e,o[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,o]of this.domRoots)t.observe(o,e);return t.enable(),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();e&&(0,m.mR)({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new m.Bb("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){m.Bb.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(Ho).flush(),this.change((()=>{}))}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return De._createAt(e,t)}createPositionAfter(e){return De._createAfter(e)}createPositionBefore(e){return De._createBefore(e)}createRange(...e){return new ze(...e)}createRangeOn(e){return ze._createOn(e)}createRangeIn(e){return ze._createIn(e)}createSelection(...e){return new Le(...e)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change((()=>{}))}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class Qo{is(){throw new Error("is() method is abstract")}}class es extends Qo{constructor(e){super(),this.parent=null,this._attrs=(0,m.qL)(e)}get document(){return null}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new m.Bb("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new m.Bb("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let o=e.includeSelf?this:this.parent;for(;o;)t[e.parentFirst?"push":"unshift"](o),o=o.parent;return t}getCommonAncestor(e,t={}){const o=this.getAncestors(t),s=e.getAncestors(t);let i=0;for(;o[i]==s[i]&&o[i];)i++;return 0===i?null:o[i-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),o=e.getPath(),s=(0,m.Rt)(t,o);switch(s){case"prefix":return!0;case"extension":return!1;default:return t[s](e[t[0]]=t[1],e)),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=(0,m.qL)(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}es.prototype.is=function(e){return"node"===e||"model:node"===e};class ts{constructor(e){this._nodes=[],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-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?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 m.Bb("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const o of this._nodes){if(e>=t&&ee.toJSON()))}}class os extends es{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new os(this.data,this.getAttributes())}static fromJSON(e){return new os(e.data,e.attributes)}}os.prototype.is=function(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e};class ss extends Qo{constructor(e,t,o){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new m.Bb("model-textproxy-wrong-offsetintext",this);if(o<0||t+o>e.offsetSize)throw new m.Bb("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+o),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let o=e.includeSelf?this:this.parent;for(;o;)t[e.parentFirst?"push":"unshift"](o),o=o.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()}}ss.prototype.is=function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e};class is extends es{constructor(e,t,o){super(t),this._children=new ts,this.name=e,o&&this._insertChild(0,o)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}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 o of e)t=t.getChild(t.offsetToIndex(o));return t}findAncestor(e,t={}){let o=t.includeSelf?this:this.parent;for(;o;){if(o.name===e)return o;o=o.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map((e=>e._clone(!0))):void 0;return new is(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const o=function(e){if("string"==typeof e)return[new os(e)];(0,m.TW)(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new os(e):e instanceof ss?new os(e.data,e.getAttributes()):e))}(t);for(const e of o)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,o)}_removeChildren(e,t=1){const o=this._children._removeNodes(e,t);for(const e of o)e.parent=null;return o}static fromJSON(e){let t;if(e.children){t=[];for(const o of e.children)o.name?t.push(is.fromJSON(o)):t.push(os.fromJSON(o))}return new is(e.name,e.attributes,t)}}is.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e};class ns{constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new m.Bb("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new m.Bb("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=as._createAt(this.boundaries["backward"==this.direction?"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,o,s,i;do{s=this.position,i=this._visitedParent,({done:t,value:o}=this.next())}while(!t&&e(o));t||(this.position=s,this._visitedParent=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),o=this._visitedParent;if(null===o.parent&&t.offset===o.maxOffset)return{done:!0,value:void 0};if(o===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const s=cs(t,o),i=s||ls(t,o,s);if(i instanceof is)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=i),this.position=t,rs("elementStart",i,e,t,1);if(i instanceof os){let s;if(this.singleCharacters)s=1;else{let e=i.endOffset;this._boundaryEndParent==o&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),s=t.offset-e}const i=t.offset-n.startOffset,r=new ss(n,i-s,s);return t.offset-=s,this.position=t,rs("text",r,e,t,s)}return t.path.pop(),this.position=t,this._visitedParent=o.parent,rs("elementStart",o,e,t,1)}}function rs(e,t,o,s,i){return{done:!1,value:{type:e,item:t,previousPosition:o,nextPosition:s,length:i}}}class as extends Qo{constructor(e,t,o="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new m.Bb("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new m.Bb("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=o}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;t1)return!1;if(1===t)return hs(e,this,o);if(-1===t)return hs(this,e,o)}return this.path.length===e.path.length||(this.path.length>e.path.length?us(this.path,t):us(e.path,t))}hasSameParentAs(e){if(this.root!==e.root)return!1;const t=this.getParentPath(),o=e.getParentPath();return"same"==(0,m.Rt)(t,o)}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=as._createAt(this)}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;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let o;return t.containsPosition(this)||t.start.isEqual(this)?(o=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(o=o._getTransformedByDeletion(e.deletionPosition,1))):o=this.isEqual(e.deletionPosition)?as._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),o}_getTransformedByDeletion(e,t){const o=as._createAt(this);if(this.root!=e.root)return o;if("same"==(0,m.Rt)(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;o.offset-=t}}else if("prefix"==(0,m.Rt)(e.getParentPath(),this.getParentPath())){const s=e.path.length-1;if(e.offset<=this.path[s]){if(e.offset+t>this.path[s])return null;o.path[s]-=t}}return o}_getTransformedByInsertion(e,t){const o=as._createAt(this);if(this.root!=e.root)return o;if("same"==(0,m.Rt)(e.getParentPath(),this.getParentPath()))(e.offset=t;){if(e.path[s]+i!==o.maxOffset)return!1;i=1,s--,o=o.parent}return!0}(e,o+1))}function us(e,t){for(;tt+1;){const t=s.maxOffset-o.offset;0!==t&&e.push(new ps(o,o.getShiftedBy(t))),o.path=o.path.slice(0,-1),o.offset++,s=s.parent}for(;o.path.length<=this.end.path.length;){const t=this.end.path[o.path.length-1],s=t-o.offset;0!==s&&e.push(new ps(o,o.getShiftedBy(s))),o.offset=t,o.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new ns(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new ns(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new ns(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 ps(this.start,this.end)]}getTransformedByOperations(e){const t=[new ps(this.start,this.end)];for(const o of e)for(let e=0;e0?new this(o,s):new this(s,o)}static _createIn(e){return new this(as._createAt(e,0),as._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(as._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new m.Bb("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort(((e,t)=>e.start.isAfter(t.start)?1:-1));const o=e.indexOf(t),s=new this(t.start,t.end);if(o>0)for(let t=o-1;e[t].end.isEqual(s.start);t++)s.start=as._createAt(e[t].start);for(let t=o+1;t{if(t.viewPosition)return;const o=this._modelToViewMapping.get(t.modelPosition.parent);if(!o)throw new m.Bb("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(o,t.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((e,t)=>{if(t.modelPosition)return;const o=this.findMappedViewAncestor(t.viewPosition),s=this._viewToModelMapping.get(o),i=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,o);t.modelPosition=as._createAt(s,i)}),{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const o=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e),this._modelToViewMapping.get(o)==e&&this._modelToViewMapping.delete(o))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const o=this._markerNameToElements.get(t)||new Set;o.add(e);const s=this._elementToMarkerNames.get(e)||new Set;s.add(t),this._markerNameToElements.set(t,o),this._elementToMarkerNames.set(e,s)}unbindElementFromMarkerName(e,t){const o=this._markerNameToElements.get(t);o&&(o.delete(e),0==o.size&&this._markerNameToElements.delete(t));const s=this._elementToMarkerNames.get(e);s&&(s.delete(t),0==s.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new ps(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new ze(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const o={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",o),o.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const o=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())o.add(t);else o.add(e);return o}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,o){if(o!=e){return this._toModelOffset(e.parent,e.index,o)+this._toModelOffset(e,t,e)}if(e.is("$text"))return t;let s=0;for(let o=0;o1?t[0]+":"+t[1]:t[0]}class bs extends((0,m.ln)()){constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,o){const s=this._createConversionApi(o,e.getRefreshedItems());for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,s);const i=this._reduceChanges(e.getChanges());for(const e of i)"insert"===e.type?this._convertInsert(ps._createFromPositionAndShift(e.position,e.length),s):"reinsert"===e.type?this._convertReinsert(ps._createFromPositionAndShift(e.position,e.length),s):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,s):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,s);for(const e of s.mapper.flushUnboundMarkerNames()){const o=t.get(e).getRange();this._convertMarkerRemove(e,o,s),this._convertMarkerAdd(e,o,s)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,s);s.mapper.flushDeferredBindings(),s.consumable.verifyAllConsumed("insert")}convert(e,t,o,s={}){const i=this._createConversionApi(o,void 0,s);this._convertInsert(e,i);for(const[e,o]of t)this._convertMarkerAdd(e,o,i);i.consumable.verifyAllConsumed("insert")}convertSelection(e,t,o){const s=Array.from(t.getMarkersAtPosition(e.getFirstPosition())),i=this._createConversionApi(o);if(this._addConsumablesForSelection(i.consumable,e,s),this.fire("selection",{selection:e},i),e.isCollapsed){for(const t of s){const o=t.getRange();if(!_s(e.getFirstPosition(),t,i.mapper))continue;const s={item:e,markerName:t.name,markerRange:o};i.consumable.test(e,"addMarker:"+t.name)&&this.fire(`addMarker:${t.name}`,s,i)}for(const t of e.getAttributeKeys()){const o={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};i.consumable.test(e,"attribute:"+o.attributeKey)&&this.fire(`attribute:${o.attributeKey}:$text`,o,i)}}}_convertInsert(e,t,o={}){o.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,Array.from(e));for(const o of Array.from(e.getWalker({shallow:!0})).map(ws))this._testAndFire("insert",o,t)}_convertRemove(e,t,o,s){this.fire(`remove:${o}`,{position:e,length:t},s)}_convertAttribute(e,t,o,s,i){this._addConsumablesForRange(i.consumable,e,`attribute:${t}`);for(const n of e){const e={item:n.item,range:ps._createFromPositionAndShift(n.previousPosition,n.length),attributeKey:t,attributeOldValue:o,attributeNewValue:s};this._testAndFire(`attribute:${t}`,e,i)}}_convertReinsert(e,t){const o=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,o);for(const e of o.map(ws))this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,o){if("$graveyard"==t.root.rootName)return;const s=`addMarker:${e}`;if(o.consumable.add(t,s),this.fire(s,{markerName:e,markerRange:t},o),o.consumable.consume(t,s)){this._addConsumablesForRange(o.consumable,t,s);for(const i of t.getItems()){if(!o.consumable.test(i,s))continue;const n={item:i,range:ps._createOn(i),markerName:e,markerRange:t};this.fire(s,n,o)}}}_convertMarkerRemove(e,t,o){"$graveyard"!=t.root.rootName&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},o)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const o of t){const t=o.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const o of t.getAttributeKeys())e.add(t,"attribute:"+o)}}return e}_addConsumablesForRange(e,t,o){for(const s of t.getItems())e.add(s,o);return e}_addConsumablesForSelection(e,t,o){e.add(t,"selection");for(const s of o)e.add(t,"addMarker:"+s.name);for(const o of t.getAttributeKeys())e.add(t,"attribute:"+o);return e}_testAndFire(e,t,o){const s=function(e,t){const o=t.item.is("element")?t.item.name:"$text";return`${e}:${o}`}(e,t),i=t.item.is("$textProxy")?o.consumable._getSymbolForTextProxy(t.item):t.item,n=this._firedEventsMap.get(o),r=n.get(i);if(r){if(r.has(s))return;r.add(s)}else n.set(i,new Set([s]));this.fire(s,t,o)}_testAndFireAddAttributes(e,t){const o={item:e,range:ps._createOn(e)};for(const e of o.item.getAttributeKeys())o.attributeKey=e,o.attributeOldValue=null,o.attributeNewValue=o.item.getAttribute(e),this._testAndFire(`attribute:${e}`,o,t)}_createConversionApi(e,t=new Set,o={}){const s={...this._conversionApi,consumable:new gs,writer:e,options:o,convertItem:e=>this._convertInsert(ps._createOn(e),s),convertChildren:e=>this._convertInsert(ps._createIn(e),s,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,s),canReuseView:e=>!t.has(s.mapper.toModelElement(e))};return this._firedEventsMap.set(s,new Map),s}}function _s(e,t,o){const s=t.getRange(),i=Array.from(e.getAncestors());i.shift(),i.reverse();return!i.some((e=>{if(s.containsItem(e)){return!!o.toViewElement(e).getCustomProperty("addHighlight")}}))}function ws(e){return{item:e.item,range:ps._createFromPositionAndShift(e.previousPosition,e.length)}}class ks extends((0,m.ln)(Qo)){constructor(...e){super(),this._lastRangeBackward=!1,this._attrs=new Map,this._ranges=[],e.length&&this.setTo(...e)}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(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let o=!1;for(const s of e._ranges)if(t.isEqual(s)){o=!0;break}if(!o)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new ps(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new ps(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new ps(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){let[t,o,s]=e;if("object"==typeof o&&(s=o,o=void 0),null===t)this._setRanges([]);else if(t instanceof ks)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof ps)this._setRanges([t],!!s&&!!s.backward);else if(t instanceof as)this._setRanges([new ps(t)]);else if(t instanceof es){const e=!!s&&!!s.backward;let i;if("in"==o)i=ps._createIn(t);else if("on"==o)i=ps._createOn(t);else{if(void 0===o)throw new m.Bb("model-selection-setto-required-second-parameter",[this,t]);i=new ps(as._createAt(t,o))}this._setRanges([i],e)}else{if(!(0,m.TW)(t))throw new m.Bb("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,s&&!!s.backward)}}_setRanges(e,t=!1){const o=Array.from(e),s=o.some((t=>{if(!(t instanceof ps))throw new m.Bb("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every((e=>!e.isEqual(t)))}));(o.length!==this._ranges.length||s)&&(this._replaceAllRanges(o),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(null===this.anchor)throw new m.Bb("model-selection-setfocus-no-ranges",[this,e]);const o=as._createAt(e,t);if("same"==o.compareWith(this.focus))return;const s=this.anchor;this._ranges.length&&this._popRange(),"before"==o.compareWith(s)?(this._pushRange(new ps(o,s)),this._lastRangeBackward=!0):(this._pushRange(new ps(s,o)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}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){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const o=xs(t.start,e);o&&Ps(o,t)&&(yield o);for(const o of t.getWalker()){const s=o.item;"elementEnd"==o.type&&ys(s,e,t)&&(yield s)}const s=xs(t.end,e);s&&!t.end.isTouching(as._createAt(s,0))&&Ps(s,t)&&(yield s)}}containsEntireContent(e=this.anchor.root){const t=as._createAt(e,0),o=as._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&o.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new ps(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function vs(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function ys(e,t,o){return vs(e,t)&&Ps(e,o)}function xs(e,t){const o=e.parent.root.document.model.schema,s=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const n=s.find((e=>!i&&(i=o.isLimit(e),!i&&vs(e,t))));return s.forEach((e=>t.add(e))),n}function Ps(e,t){const o=function(e){const t=e.root.document.model.schema;let o=e.parent;for(;o;){if(t.isBlock(o))return o;o=o.parent}}(e);if(!o)return!0;return!t.containsRange(ps._createOn(o),!0)}ks.prototype.is=function(e){return"selection"===e||"model:selection"===e};class Ts extends((0,m.ln)(ps)){constructor(e,t){super(e,t),Cs.call(this)}detach(){this.stopListening()}toRange(){return new ps(this.start,this.end)}static fromRange(e){return new Ts(e.start,e.end)}}function Cs(){this.listenTo(this.root.document.model,"applyOperation",((e,t)=>{const o=t[0];o.isDocumentOperation&&As.call(this,o)}),{priority:"low"})}function As(e){const t=this.getTransformedByOperation(e),o=ps._createFromRanges(t),s=!o.isEqual(this),i=function(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!1}(this,e);let n=null;if(s){"$graveyard"==o.root.rootName&&(n="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=o.start,this.end=o.end,this.fire("change:range",t,{deletionPosition:n})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:n})}Ts.prototype.is=function(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e};const Es="selection:";class Ss extends((0,m.ln)(Qo)){constructor(e){super(),this._selection=new Os(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(!1)}observeMarkers(e){this._selection.observeMarkers(e)}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_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 Es+e}static _isStoreAttributeKey(e){return e.startsWith(Es)}}Ss.prototype.is=function(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e};class Os extends ks{constructor(e){super(),this.markers=new m.FE({idProperty:"name"}),this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",((e,t)=>{const o=t[0];o.isDocumentOperation&&"marker"!=o.type&&"rename"!=o.type&&"noop"!=o.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))}),{priority:"lowest"}),this.on("change:range",(()=>{this._validateSelectionRanges(this.getRanges())})),this.listenTo(this._model.markers,"update",((e,t,o,s)=>{this._updateMarker(t,s)})),this.listenTo(this._document,"change",((e,t)=>{!function(e,t){const o=e.document.differ;for(const s of o.getChanges()){if("insert"!=s.type)continue;const o=s.position.parent;s.length===o.maxOffset&&e.enqueueChange(t,(e=>{const t=Array.from(o.getAttributeKeys()).filter((e=>e.startsWith(Es)));for(const s of t)e.removeAttribute(s,o)}))}}(this._model,t)}))}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=s.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}})),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const o=t.name.split(":",1)[0];if(!this._observedMarkers.has(o))continue;const s=t.getRange();for(const o of this.getRanges())s.containsRange(o,!o.isCollapsed)&&e.push(t)}const o=Array.from(this.markers);for(const o of e)this.markers.has(o)||(this.markers.add(o),t=!0);for(const o of Array.from(this.markers))e.includes(o)||(this.markers.remove(o),t=!0);t&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateMarker(e,t){const o=e.name.split(":",1)[0];if(!this._observedMarkers.has(o))return;let s=!1;const i=Array.from(this.markers),n=this.markers.has(e);if(t){let o=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){o=!0;break}o&&!n?(this.markers.add(e),s=!0):!o&&n&&(this.markers.remove(e),s=!0)}else n&&(this.markers.remove(e),s=!0);s&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateAttributes(e){const t=(0,m.qL)(this._getSurroundingAttributes()),o=(0,m.qL)(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const s=[];for(const[e,t]of this.getAttributes())o.has(e)&&o.get(e)===t||s.push(e);for(const[e]of o)this.hasAttribute(e)||s.push(e);s.length>0&&this.fire("change:attribute",{attributeKeys:s,directChange:!1})}_setAttribute(e,t,o=!0){const s=o?"normal":"low";if("low"==s&&"normal"==this._attributePriority.get(e))return!1;return super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,s),!0)}_removeAttribute(e,t=!0){const o=t?"normal":"low";return("low"!=o||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,o),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[t,o]of this.getAttributes())e.get(t)!==o&&this._removeAttribute(t,!1);for(const[o,s]of e){this._setAttribute(o,s,!1)&&t.add(o)}return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(Es)){const o=t.substr(Es.length);yield[o,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let o=null;if(this.isCollapsed){const s=e.textNode?e.textNode:e.nodeBefore,i=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(o=Rs(s)),o||(o=Rs(i)),!this.isGravityOverridden&&!o){let e=s;for(;e&&!t.isInline(e)&&!o;)e=e.previousSibling,o=Rs(e)}if(!o){let e=i;for(;e&&!t.isInline(e)&&!o;)e=e.nextSibling,o=Rs(e)}o||(o=this.getStoredAttributes())}else{const e=this.getFirstRange();for(const s of e){if(s.item.is("element")&&t.isObject(s.item))break;if("text"==s.type){o=s.item.getAttributes();break}}}return o}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Rs(e){return e instanceof ss||e instanceof os?e.getAttributes():null}class Ms{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var js=1,Bs=4;const Vs=function(e){return(0,_.Z)(e,js|Bs)};class Ns extends Ms{elementToElement(e){return this.add(function(e){const t=zs(e.model),o=Fs(e.view,"container");t.attributes.length&&(t.children=!0);return s=>{s.on(`insert:${t.name}`,function(e,t=Ks){return(o,s,i)=>{if(!t(s.item,i.consumable,{preflight:!0}))return;const n=e(s.item,i,s);if(!n)return;t(s.item,i.consumable);const r=i.mapper.toViewPosition(s.range.start);i.mapper.bindElements(s.item,n),i.writer.insert(r,n),i.convertAttributes(s.item),qs(n,s.item.getChildren(),i,{reconversion:s.reconversion})}}(o,$s(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&s.on("reduceChanges",Hs(t),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){const t=zs(e.model),o=Fs(e.view,"container");return t.children=!0,s=>{if(s._conversionApi.schema.checkChild(t.name,"$text"))throw new m.Bb("conversion-element-to-structure-disallowed-text",s,{elementName:t.name});var i,n;s.on(`insert:${t.name}`,(i=o,n=$s(t),(e,t,o)=>{if(!n(t.item,o.consumable,{preflight:!0}))return;const s=new Map;o.writer._registerSlotFactory(function(e,t,o){return(s,i="children")=>{const n=s.createContainerElement("$slot");let r=null;if("children"===i)r=Array.from(e.getChildren());else{if("function"!=typeof i)throw new m.Bb("conversion-slot-mode-unknown",o.dispatcher,{modeOrFilter:i});r=Array.from(e.getChildren()).filter((e=>i(e)))}return t.set(n,r),n}}(t.item,s,o));const r=i(t.item,o,t);if(o.writer._clearSlotFactory(),!r)return;!function(e,t,o){const s=Array.from(t.values()).flat(),i=new Set(s);if(i.size!=s.length)throw new m.Bb("conversion-slot-filter-overlap",o.dispatcher,{element:e});if(i.size!=e.childCount)throw new m.Bb("conversion-slot-filter-incomplete",o.dispatcher,{element:e})}(t.item,s,o),n(t.item,o.consumable);const a=o.mapper.toViewPosition(t.range.start);o.mapper.bindElements(t.item,r),o.writer.insert(a,r),o.convertAttributes(t.item),function(e,t,o,s){o.mapper.on("modelToViewPosition",r,{priority:"highest"});let i=null,n=null;for([i,n]of t)qs(e,n,o,s),o.writer.move(o.writer.createRangeIn(i),o.writer.createPositionBefore(i)),o.writer.remove(i);function r(e,t){const o=t.modelPosition.nodeAfter,s=n.indexOf(o);s<0||(t.viewPosition=t.mapper.findPositionIn(i,s))}o.mapper.off("modelToViewPosition",r)}(r,s,o,{reconversion:t.reconversion})}),{priority:e.converterPriority||"normal"}),s.on("reduceChanges",Hs(t),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){e=Vs(e);let t=e.model;"string"==typeof t&&(t={key:t});let o=`attribute:${t.key}`;t.name&&(o+=":"+t.name);if(t.values)for(const o of t.values)e.view[o]=Fs(e.view[o],"attribute");else e.view=Fs(e.view,"attribute");const s=Ls(e);return t=>{t.on(o,function(e){return(t,o,s)=>{if(!s.consumable.test(o.item,t.name))return;const i=e(o.attributeOldValue,s,o),n=e(o.attributeNewValue,s,o);if(!i&&!n)return;s.consumable.consume(o.item,t.name);const r=s.writer,a=r.document.selection;if(o.item instanceof ks||o.item instanceof Ss)r.wrap(a.getFirstRange(),n);else{let e=s.mapper.toViewRange(o.range);null!==o.attributeOldValue&&i&&(e=r.unwrap(e,i)),null!==o.attributeNewValue&&n&&r.wrap(e,n)}}}(s),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=Vs(e);let t=e.model;"string"==typeof t&&(t={key:t});let o=`attribute:${t.key}`;t.name&&(o+=":"+t.name);if(t.values)for(const o of t.values)e.view[o]=Zs(e.view[o]);else e.view=Zs(e.view);const s=Ls(e);return t=>{var i;t.on(o,(i=s,(e,t,o)=>{if(!o.consumable.test(t.item,e.name))return;const s=i(t.attributeOldValue,o,t),n=i(t.attributeNewValue,o,t);if(!s&&!n)return;o.consumable.consume(t.item,e.name);const r=o.mapper.toViewElement(t.item),a=o.writer;if(!r)throw new m.Bb("conversion-attribute-to-attribute-on-text",o.dispatcher,t);if(null!==t.attributeOldValue&&s)if("class"==s.key){const e=(0,m.qo)(s.value);for(const t of e)a.removeClass(t,r)}else if("style"==s.key){const e=Object.keys(s.value);for(const t of e)a.removeStyle(t,r)}else a.removeAttribute(s.key,r);if(null!==t.attributeNewValue&&n)if("class"==n.key){const e=(0,m.qo)(n.value);for(const t of e)a.addClass(t,r)}else if("style"==n.key){const e=Object.keys(n.value);for(const t of e)a.setStyle(t,n.value[t],r)}else a.setAttribute(n.key,n.value,r)}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){const t=Fs(e.view,"ui");return o=>{var s;o.on(`addMarker:${e.model}`,(s=t,(e,t,o)=>{t.isOpening=!0;const i=s(t,o);t.isOpening=!1;const n=s(t,o);if(!i||!n)return;const r=t.markerRange;if(r.isCollapsed&&!o.consumable.consume(r,e.name))return;for(const t of r)if(!o.consumable.consume(t.item,e.name))return;const a=o.mapper,c=o.writer;c.insert(a.toViewPosition(r.start),i),o.mapper.bindElementToMarker(i,t.markerName),r.isCollapsed||(c.insert(a.toViewPosition(r.end),n),o.mapper.bindElementToMarker(n,t.markerName)),e.stop()}),{priority:e.converterPriority||"normal"}),o.on(`removeMarker:${e.model}`,((e,t,o)=>{const s=o.mapper.markerNameToElements(t.markerName);if(s){for(const e of s)o.mapper.unbindElementFromMarkerName(e,t.markerName),o.writer.clear(o.writer.createRangeOn(e),e);o.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var o;t.on(`addMarker:${e.model}`,(o=e.view,(e,t,s)=>{if(!t.item)return;if(!(t.item instanceof ks||t.item instanceof Ss||t.item.is("$textProxy")))return;const i=Ws(o,t,s);if(!i)return;if(!s.consumable.consume(t.item,e.name))return;const n=s.writer,r=Is(n,i),a=n.document.selection;if(t.item instanceof ks||t.item instanceof Ss)n.wrap(a.getFirstRange(),r);else{const e=s.mapper.toViewRange(t.range),o=n.wrap(e,r);for(const e of o.getItems())if(e.is("attributeElement")&&e.isSimilar(r)){s.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,function(e){return(t,o,s)=>{if(!o.item)return;if(!(o.item instanceof is))return;const i=Ws(e,o,s);if(!i)return;if(!s.consumable.test(o.item,t.name))return;const n=s.mapper.toViewElement(o.item);if(n&&n.getCustomProperty("addHighlight")){s.consumable.consume(o.item,t.name);for(const e of ps._createIn(o.item))s.consumable.consume(e.item,t.name);n.getCustomProperty("addHighlight")(n,i,s.writer),s.mapper.bindElementToMarker(n,o.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,function(e){return(t,o,s)=>{if(o.markerRange.isCollapsed)return;const i=Ws(e,o,s);if(!i)return;const n=Is(s.writer,i),r=s.mapper.markerNameToElements(o.markerName);if(r){for(const e of r)if(s.mapper.unbindElementFromMarkerName(e,o.markerName),e.is("attributeElement"))s.writer.unwrap(s.writer.createRangeOn(e),n);else{e.getCustomProperty("removeHighlight")(e,i.id,s.writer)}s.writer.clearClonedElementsGroup(o.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){e=Vs(e);const t=e.model;let o=e.view;o||(o=o=>({group:t,name:o.substr(e.model.length+1)}));return s=>{var i;s.on(`addMarker:${t}`,(i=o,(e,t,o)=>{const s=i(t.markerName,o);if(!s)return;const n=t.markerRange;o.consumable.consume(n,e.name)&&(Ds(n,!1,o,t,s),Ds(n,!0,o,t,s),e.stop())}),{priority:e.converterPriority||"normal"}),s.on(`removeMarker:${t}`,function(e){return(t,o,s)=>{const i=e(o.markerName,s);if(!i)return;const n=s.mapper.markerNameToElements(o.markerName);if(n){for(const e of n)s.mapper.unbindElementFromMarkerName(e,o.markerName),e.is("containerElement")?(r(`data-${i.group}-start-before`,e),r(`data-${i.group}-start-after`,e),r(`data-${i.group}-end-before`,e),r(`data-${i.group}-end-after`,e)):s.writer.clear(s.writer.createRangeOn(e),e);s.writer.clearClonedElementsGroup(o.markerName),t.stop()}function r(e,t){if(t.hasAttribute(e)){const o=new Set(t.getAttribute(e).split(","));o.delete(i.name),0==o.size?s.writer.removeAttribute(e,t):s.writer.setAttribute(e,Array.from(o).join(","),t)}}}}(o),{priority:e.converterPriority||"normal"})}}(e))}}function Is(e,t){const o=e.createAttributeElement("span",t.attributes);return t.classes&&o._addClass(t.classes),"number"==typeof t.priority&&(o._priority=t.priority),o._id=t.id,o}function Ds(e,t,o,s,i){const n=t?e.start:e.end,r=n.nodeAfter&&n.nodeAfter.is("element")?n.nodeAfter:null,a=n.nodeBefore&&n.nodeBefore.is("element")?n.nodeBefore:null;if(r||a){let e,n;t&&r||!t&&!a?(e=r,n=!0):(e=a,n=!1);const c=o.mapper.toViewElement(e);if(c)return void function(e,t,o,s,i,n){const r=`data-${n.group}-${t?"start":"end"}-${o?"before":"after"}`,a=e.hasAttribute(r)?e.getAttribute(r).split(","):[];a.unshift(n.name),s.writer.setAttribute(r,a.join(","),e),s.mapper.bindElementToMarker(e,i.markerName)}(c,t,n,o,s,i)}!function(e,t,o,s,i){const n=`${i.group}-${t?"start":"end"}`,r=i.name?{name:i.name}:null,a=o.writer.createUIElement(n,r);o.writer.insert(e,a),o.mapper.bindElementToMarker(a,s.markerName)}(o.mapper.toViewPosition(n),t,o,s,i)}function zs(e){return"string"==typeof e&&(e={name:e}),e.attributes?Array.isArray(e.attributes)||(e.attributes=[e.attributes]):e.attributes=[],e.children=!!e.children,e}function Fs(e,t){return"function"==typeof e?e:(o,s)=>function(e,t,o){"string"==typeof e&&(e={name:e});let s;const i=t.writer,n=Object.assign({},e.attributes);if("container"==o)s=i.createContainerElement(e.name,n);else if("attribute"==o){const t={priority:e.priority||Ye.DEFAULT_PRIORITY};s=i.createAttributeElement(e.name,n,t)}else s=i.createUIElement(e.name,n);if(e.styles){const t=Object.keys(e.styles);for(const o of t)i.setStyle(o,e.styles[o],s)}if(e.classes){const t=e.classes;if("string"==typeof t)i.addClass(t,s);else for(const e of t)i.addClass(e,s)}return s}(e,s,t)}function Ls(e){return e.model.values?(t,o,s)=>{const i=e.view[t];return i?i(t,o,s):null}:e.view}function Zs(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function Ws(e,t,o){const s="function"==typeof e?e(t,o):e;return s?(s.priority||(s.priority=10),s.id||(s.id=t.markerName),s):null}function Hs(e){const t=function(e){return(t,o)=>{if(!t.is("element",e.name))return!1;if("attribute"==o.type){if(e.attributes.includes(o.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,o)=>{const s=[];o.reconvertedElements||(o.reconvertedElements=new Set);for(const e of o.changes){const i="attribute"==e.type?e.range.start.nodeAfter:e.position.parent;if(i&&t(i,e)){if(!o.reconvertedElements.has(i)){o.reconvertedElements.add(i);const e=as._createBefore(i);s.push({type:"remove",name:i.name,position:e,length:1},{type:"reinsert",name:i.name,position:e,length:1})}}else s.push(e)}o.changes=s}}function $s(e){return(t,o,s={})=>{const i=["insert"];for(const o of e.attributes)t.hasAttribute(o)&&i.push(`attribute:${o}`);return!!i.every((e=>o.test(t,e)))&&(s.preflight||i.forEach((e=>o.consume(t,e))),!0)}}function qs(e,t,o,s){for(const i of t)Us(e.root,i,o,s)||o.convertItem(i)}function Us(e,t,o,s){const{writer:i,mapper:n}=o;if(!s.reconversion)return!1;const r=n.toViewElement(t);return!(!r||r.root==e)&&(!!o.canReuseView(r)&&(i.move(i.createRangeOn(r),n.toViewPosition(as._createBefore(t))),!0))}function Ks(e,t,{preflight:o}={}){return o?t.test(e,"insert"):t.consume(e,"insert")}function Gs(e){const{schema:t,document:o}=e.model;for(const s of o.getRootNames()){const i=o.getRoot(s);if(i.isEmpty&&!t.checkChild(i,"$text")&&t.checkChild(i,"paragraph"))return e.insertElement("paragraph",i),!0}return!1}function Js(e,t,o){const s=o.createContext(e);return!!o.checkChild(s,"paragraph")&&!!o.checkChild(s.push("paragraph"),t)}function Ys(e,t){const o=t.createElement("paragraph");return t.insert(o,e),t.createPositionAt(o,0)}class Xs extends Ms{elementToElement(e){return this.add(Qs(e))}elementToAttribute(e){return this.add(function(e){e=Vs(e),oi(e);const t=si(e,!1),o=ei(e.view),s=o?`element:${o}`:"element";return o=>{o.on(s,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=Vs(e);let t=null;("string"==typeof e.view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key;let o;if("class"==t||"style"==t){o={["class"==t?"classes":"styles"]:e.view.value}}else{o={attributes:{[t]:void 0===e.view.value?/[\s\S]*/:e.view.value}}}e.view.name&&(o.name=e.view.name);return e.view=o,t}(e));oi(e,t);const o=si(e,!0);return t=>{t.on("element",o,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){const t=function(e){return(t,o)=>{const s="string"==typeof e?e:e(t,o);return o.writer.createElement("$marker",{"data-name":s})}}(e.model);return Qs({...e,model:t})}(e))}dataToMarker(e){return this.add(function(e){e=Vs(e),e.model||(e.model=t=>t?e.view+":"+t:e.view);const t={view:e.view,model:e.model},o=ti(ii(t,"start")),s=ti(ii(t,"end"));return i=>{i.on(`element:${e.view}-start`,o,{priority:e.converterPriority||"normal"}),i.on(`element:${e.view}-end`,s,{priority:e.converterPriority||"normal"});const n=m.tA.get("low"),r=m.tA.get("highest"),a=m.tA.get(e.converterPriority)/r;i.on("element",function(e){return(t,o,s)=>{const i=`data-${e.view}`;function n(t,i){for(const n of i){const i=e.model(n,s),r=s.writer.createElement("$marker",{"data-name":i});s.writer.insert(r,t),o.modelCursor.isEqual(t)?o.modelCursor=o.modelCursor.getShiftedBy(1):o.modelCursor=o.modelCursor._getTransformedByInsertion(t,1),o.modelRange=o.modelRange._getTransformedByInsertion(t,1)[0]}}(s.consumable.test(o.viewItem,{attributes:i+"-end-after"})||s.consumable.test(o.viewItem,{attributes:i+"-start-after"})||s.consumable.test(o.viewItem,{attributes:i+"-end-before"})||s.consumable.test(o.viewItem,{attributes:i+"-start-before"}))&&(o.modelRange||Object.assign(o,s.convertChildren(o.viewItem,o.modelCursor)),s.consumable.consume(o.viewItem,{attributes:i+"-end-after"})&&n(o.modelRange.end,o.viewItem.getAttribute(i+"-end-after").split(",")),s.consumable.consume(o.viewItem,{attributes:i+"-start-after"})&&n(o.modelRange.end,o.viewItem.getAttribute(i+"-start-after").split(",")),s.consumable.consume(o.viewItem,{attributes:i+"-end-before"})&&n(o.modelRange.start,o.viewItem.getAttribute(i+"-end-before").split(",")),s.consumable.consume(o.viewItem,{attributes:i+"-start-before"})&&n(o.modelRange.start,o.viewItem.getAttribute(i+"-start-before").split(",")))}}(t),{priority:n+a})}}(e))}}function Qs(e){const t=ti(e=Vs(e)),o=ei(e.view),s=o?`element:${o}`:"element";return o=>{o.on(s,t,{priority:e.converterPriority||"normal"})}}function ei(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function ti(e){const t=new T(e.view);return(o,s,i)=>{const n=t.match(s.viewItem);if(!n)return;const r=n.match;if(r.name=!0,!i.consumable.test(s.viewItem,r))return;const a=function(e,t,o){return e instanceof Function?e(t,o):o.writer.createElement(e)}(e.model,s.viewItem,i);a&&i.safeInsert(a,s.modelCursor)&&(i.consumable.consume(s.viewItem,r),i.convertChildren(s.viewItem,a),i.updateConversionResult(a,s))}}function oi(e,t=null){const o=null===t||(e=>e.getAttribute(t)),s="object"!=typeof e.model?e.model:e.model.key,i="object"!=typeof e.model||void 0===e.model.value?o:e.model.value;e.model={key:s,value:i}}function si(e,t){const o=new T(e.view);return(s,i,n)=>{if(!i.modelRange&&t)return;const r=o.match(i.viewItem);if(!r)return;if(!function(e,t){const o="function"==typeof e?e(t):e;if("object"==typeof o&&!ei(o))return!1;return!o.classes&&!o.attributes&&!o.styles}(e.view,i.viewItem)?delete r.match.name:r.match.name=!0,!n.consumable.test(i.viewItem,r.match))return;const a=e.model.key,c="function"==typeof e.model.value?e.model.value(i.viewItem,n):e.model.value;if(null===c)return;i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor));const l=function(e,t,o,s){let i=!1;for(const n of Array.from(e.getItems({shallow:o})))s.schema.checkAttribute(n,t.key)&&(i=!0,n.hasAttribute(t.key)||s.writer.setAttribute(t.key,t.value,n));return i}(i.modelRange,{key:a,value:c},t,n);l&&(n.consumable.test(i.viewItem,{name:!0})&&(r.match.name=!0),n.consumable.consume(i.viewItem,r.match))}}function ii(e,t){return{view:`${e.view}-${t}`,model:(t,o)=>{const s=t.getAttribute("name"),i=e.model(s,o);return o.writer.createElement("$marker",{"data-name":i})}}}class ni extends((0,m.Re)()){constructor(e,t){super(),this.model=e,this.view=new Xo(t),this.mapper=new fs,this.downcastDispatcher=new bs({mapper:this.mapper,schema:e.schema});const o=this.model.document,s=o.selection,i=this.model.markers;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(o,"change",(()=>{this.view.change((e=>{this.downcastDispatcher.convertChanges(o.differ,i,e),this.downcastDispatcher.convertSelection(s,i,e)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(o,s)=>{const i=s.newSelection,n=[];for(const e of i.getRanges())n.push(t.toModelRange(e));const r=e.createSelection(n,{backward:i.isBackward});r.isEqual(e.document.selection)||e.change((e=>{e.setSelection(r)}))}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",((e,t,o)=>{if(!o.consumable.consume(t.item,e.name))return;const s=o.writer,i=o.mapper.toViewPosition(t.range.start),n=s.createText(t.item.data);s.insert(i,n)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,o)=>{o.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||o.convertChildren(t.item)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((e,t,o)=>{const s=o.mapper.toViewPosition(t.position),i=t.position.getShiftedBy(t.length),n=o.mapper.toViewPosition(i,{isPhantom:!0}),r=o.writer.createRange(s,n),a=o.writer.remove(r.getTrimmed());for(const e of o.writer.createRangeIn(a).getItems())o.mapper.unbindViewElement(e,{defer:!0})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,o)=>{const s=o.writer,i=s.document.selection;for(const e of i.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&o.writer.mergeAttributes(e.start);s.setSelection(null)}),{priority:"high"}),this.downcastDispatcher.on("selection",((e,t,o)=>{const s=t.selection;if(s.isCollapsed)return;if(!o.consumable.consume(s,"selection"))return;const i=[];for(const e of s.getRanges())i.push(o.mapper.toViewRange(e));o.writer.setSelection(i,{backward:s.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,o)=>{const s=t.selection;if(!s.isCollapsed)return;if(!o.consumable.consume(s,"selection"))return;const i=o.writer,n=s.getFirstPosition(),r=o.mapper.toViewPosition(n),a=i.breakAttributes(r);i.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((e=>{if("$graveyard"==e.rootName)return null;const t=new Ne(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t}))}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,o=this.model.markers.get(t);if(!o)throw new m.Bb("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change((()=>{this.model.markers._refresh(o)}))}reconvertItem(e){this.model.change((()=>{this.model.document.differ._refreshItem(e)}))}}class ri{constructor(){this._consumables=new Map}add(e,t){let o;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?o=this._consumables.get(e):(o=new ci(e),this._consumables.set(e,o)),o.add(t))}test(e,t){const o=this._consumables.get(e);return void 0===o?null:e.is("$text")||e.is("documentFragment")?o:o.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const o=this._consumables.get(e);void 0!==o&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):o.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},o=e.getAttributeKeys();for(const e of o)"style"!=e&&"class"!=e&&t.attributes.push(e);const s=e.getClassNames();for(const e of s)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 ri),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,ri.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const o of e.getChildren())t=ri.createFrom(o,t);return t}}const ai=["attributes","classes","styles"];class ci{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t of ai)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t of ai)if(t in e){const o=this._test(t,e[t]);if(!0!==o)return o}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t of ai)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t of ai)t in e&&this._revert(t,e[t])}_add(e,t){const o=(0,S.Z)(t)?t:[t],s=this._consumables[e];for(const t of o){if("attributes"===e&&("class"===t||"style"===t))throw new m.Bb("viewconsumable-invalid-attribute",this);if(s.set(t,!0),"styles"===e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))s.set(e,!0)}}_test(e,t){const o=(0,S.Z)(t)?t:[t],s=this._consumables[e];for(const t of o)if("attributes"!==e||"class"!==t&&"style"!==t){const e=s.get(t);if(void 0===e)return null;if(!e)return!1}else{const e="class"==t?"classes":"styles",o=this._test(e,[...this._consumables[e].keys()]);if(!0!==o)return o}return!0}_consume(e,t){const o=(0,S.Z)(t)?t:[t],s=this._consumables[e];for(const t of o)if("attributes"!==e||"class"!==t&&"style"!==t){if(s.set(t,!1),"styles"==e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))s.set(e,!1)}else{const e="class"==t?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const o=(0,S.Z)(t)?t:[t],s=this._consumables[e];for(const t of o)if("attributes"!==e||"class"!==t&&"style"!==t){!1===s.get(t)&&s.set(t,!0)}else{const e="class"==t?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class li extends((0,m.Re)()){constructor(){super(),this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((e,t)=>{t[0]=new di(t[0])}),{priority:"highest"}),this.on("checkChild",((e,t)=>{t[0]=new di(t[0]),t[1]=this.getDefinition(t[1])}),{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new m.Bb("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new m.Bb("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,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);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const o=this.getDefinition(e.last);return!!o&&o.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof as){const t=e.nodeBefore,o=e.nodeAfter;if(!(t instanceof is))throw new m.Bb("schema-check-merge-no-element-before",this);if(!(o instanceof is))throw new m.Bb("schema-check-merge-no-element-after",this);return this.checkMerge(t,o)}for(const o of t.getChildren())if(!this.checkChild(e,o))return!1;return!0}addChildCheck(e){this.on("checkChild",((t,[o,s])=>{if(!s)return;const i=e(o,s);"boolean"==typeof i&&(t.stop(),t.return=i)}),{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",((t,[o,s])=>{const i=e(o,s);"boolean"==typeof i&&(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 as)t=e.parent;else{t=(e instanceof ps?[e]:Array.from(e.getRanges())).reduce(((e,t)=>{const o=t.getCommonAncestor();return e?e.getCommonAncestor(o,{includeSelf:!0}):o}),null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const o=[...e.getFirstPosition().getAncestors(),new os("",e.getAttributes())];return this.checkAttribute(o,t)}{const o=e.getRanges();for(const e of o)for(const o of e)if(this.checkAttribute(o.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const o of e)yield*this._getValidRangesForRange(o,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new ps(e);let o,s;const i=e.getAncestors().reverse().find((e=>this.isLimit(e)))||e.root;"both"!=t&&"backward"!=t||(o=new ns({boundaries:ps._createIn(i),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(s=new ns({boundaries:ps._createIn(i),startPosition:e}));for(const e of function*(e,t){let o=!1;for(;!o;){if(o=!0,e){const t=e.next();t.done||(o=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(o=!1,yield{walker:t,value:e.value})}}}(o,s)){const t=e.walker==o?"elementEnd":"elementStart",s=e.value;if(s.type==t&&this.isObject(s.item))return ps._createOn(s.item);if(this.checkChild(s.nextPosition,"$text"))return new ps(s.nextPosition)}return null}findAllowedParent(e,t){let o=e.parent;for(;o;){if(this.checkChild(o,t))return o;if(this.isLimit(o))return null;o=o.parent}return null}setAllowedAttributes(e,t,o){const s=o.model;for(const[i,n]of Object.entries(t))s.schema.checkAttribute(e,i)&&o.setAttribute(i,n,e)}removeDisallowedAttributes(e,t){for(const o of e)if(o.is("$text"))xi(this,o,t);else{const e=ps._createIn(o).getPositions();for(const o of e){xi(this,o.nodeBefore||o.parent,t)}}}getAttributesWithProperty(e,t,o){const s={};for(const[i,n]of e.getAttributes()){const e=this.getAttributeProperties(i);void 0!==e[t]&&(void 0!==o&&o!==e[t]||(s[i]=n))}return s}createContext(e){return new di(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,o=Object.keys(t);for(const s of o)e[s]=hi(t[s],s);for(const t of o)ui(e,t);for(const t of o)pi(e,t);for(const t of o)fi(e,t);for(const t of o)gi(e,t),mi(e,t);for(const t of o)bi(e,t),_i(e,t),wi(e,t);this._compiledDefinitions=e}_checkContextMatch(e,t,o=t.length-1){const s=t.getItem(o);if(e.allowIn.includes(s.name)){if(0==o)return!0;{const e=this.getDefinition(s);return this._checkContextMatch(e,t,o-1)}}return!1}*_getValidRangesForRange(e,t){let o=e.start,s=e.start;for(const i of e.getItems({shallow:!0}))i.is("element")&&(yield*this._getValidRangesForRange(ps._createIn(i),t)),this.checkAttribute(i,t)||(o.isEqual(s)||(yield new ps(o,s)),o=as._createAfter(i)),s=as._createAfter(i);o.isEqual(s)||(yield new ps(o,s))}}class di{constructor(e){if(e instanceof di)return e;let t;t="string"==typeof e?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(yi)}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 di([e]);return t._items=[...this._items,...t._items],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 hi(e,t){const o={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(e,t){for(const o of e){const e=Object.keys(o).filter((e=>e.startsWith("is")));for(const s of e)t[s]=!!o[s]}}(e,o),ki(e,o,"allowIn"),ki(e,o,"allowContentOf"),ki(e,o,"allowWhere"),ki(e,o,"allowAttributes"),ki(e,o,"allowAttributesOf"),ki(e,o,"allowChildren"),ki(e,o,"inheritTypesFrom"),function(e,t){for(const o of e){const e=o.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}(e,o),o}function ui(e,t){const o=e[t];for(const s of o.allowChildren){const o=e[s];o&&o.allowIn.push(t)}o.allowChildren.length=0}function pi(e,t){for(const o of e[t].allowContentOf)if(e[o]){vi(e,o).forEach((e=>{e.allowIn.push(t)}))}delete e[t].allowContentOf}function fi(e,t){for(const o of e[t].allowWhere){const s=e[o];if(s){const o=s.allowIn;e[t].allowIn.push(...o)}}delete e[t].allowWhere}function gi(e,t){for(const o of e[t].allowAttributesOf){const s=e[o];if(s){const o=s.allowAttributes;e[t].allowAttributes.push(...o)}}delete e[t].allowAttributesOf}function mi(e,t){const o=e[t];for(const t of o.inheritTypesFrom){const s=e[t];if(s){const e=Object.keys(s).filter((e=>e.startsWith("is")));for(const t of e)t in o||(o[t]=s[t])}}delete o.inheritTypesFrom}function bi(e,t){const o=e[t],s=o.allowIn.filter((t=>e[t]));o.allowIn=Array.from(new Set(s))}function _i(e,t){const o=e[t];for(const s of o.allowIn){e[s].allowChildren.push(t)}}function wi(e,t){const o=e[t];o.allowAttributes=Array.from(new Set(o.allowAttributes))}function ki(e,t,o){for(const s of e){const e=s[o];"string"==typeof e?t[o].push(e):Array.isArray(e)&&t[o].push(...e)}}function vi(e,t){const o=e[t];return(s=e,Object.keys(s).map((e=>s[e]))).filter((e=>e.allowIn.includes(o.name)));var s}function yi(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function xi(e,t,o){for(const s of t.getAttributeKeys())e.checkAttribute(t,s)||o.removeAttribute(s,t)}class Pi extends((0,m.ln)()){constructor(e){super(),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(e,t)=>this._convertItem(e,t),convertChildren:(e,t)=>this._convertChildren(e,t),safeInsert:(e,t)=>this._safeInsert(e,t),updateConversionResult:(e,t)=>this._updateConversionResult(e,t),splitToAllowedParent:(e,t)=>this._splitToAllowedParent(e,t),getSplitParts:e=>this._getSplitParts(e),keepEmptyElement:e=>this._keepEmptyElement(e)}}convert(e,t,o=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let o;for(const s of new di(e)){const e={};for(const t of s.getAttributeKeys())e[t]=s.getAttribute(t);const i=t.createElement(s.name,e);o&&t.insert(i,o),o=as._createAt(i,0)}return o}(o,t),this.conversionApi.writer=t,this.conversionApi.consumable=ri.createFrom(e),this.conversionApi.store={};const{modelRange:s}=this._convertItem(e,this._modelCursor),i=t.createDocumentFragment();if(s){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,i);i.markers=function(e,t){const o=new Set,s=new Map,i=ps._createIn(e).getItems();for(const e of i)e.is("element","$marker")&&o.add(e);for(const e of o){const o=e.getAttribute("data-name"),i=t.createPositionBefore(e);s.has(o)?s.get(o).end=i.clone():s.set(o,new ps(i.clone())),t.remove(e)}return s}(i,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,i}_convertItem(e,t){const o={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,o,this.conversionApi):e.is("$text")?this.fire("text",o,this.conversionApi):this.fire("documentFragment",o,this.conversionApi),o.modelRange&&!(o.modelRange instanceof ps))throw new m.Bb("view-conversion-dispatcher-incorrect-result",this);return{modelRange:o.modelRange,modelCursor:o.modelCursor}}_convertChildren(e,t){let o=t.is("position")?t:as._createAt(t,0);const s=new ps(o);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,o);e.modelRange instanceof ps&&(s.end=e.modelRange.end,o=e.modelCursor)}return{modelRange:s,modelCursor:o}}_safeInsert(e,t){const o=this._splitToAllowedParent(e,t);return!!o&&(this.conversionApi.writer.insert(e,o.position),!0)}_updateConversionResult(e,t){const o=this._getSplitParts(e),s=this.conversionApi.writer;t.modelRange||(t.modelRange=s.createRange(s.createPositionBefore(e),s.createPositionAfter(o[o.length-1])));const i=this._cursorParents.get(e);t.modelCursor=i?s.createPositionAt(i,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:o,writer:s}=this.conversionApi;let i=o.findAllowedParent(t,e);if(i){if(i===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(i)&&(i=null)}if(!i)return Js(t,e,o)?{position:Ys(t,s)}:null;const n=this.conversionApi.writer.split(t,i),r=[];for(const e of n.range.getWalker())if("elementEnd"==e.type)r.push(e.item);else{const t=r.pop(),o=e.item;this._registerSplitPair(t,o)}const a=n.range.end.parent;return this._cursorParents.set(e,a),{position:n.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const o=this._splitParts.get(e);this._splitParts.set(t,o),o.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&!this._emptyElementsToKeep.has(t)&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}class Ti{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class Ci{constructor(e){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new Lt(e,{renderingMode:"data"}),this.htmlWriter=new Ti}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){e.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),o=t.createDocumentFragment(),s=t.body.childNodes;for(;s.length>0;)o.appendChild(s[0]);return o}}class Ai extends((0,m.ln)()){constructor(e,t){super(),this.model=e,this.mapper=new fs,this.downcastDispatcher=new bs({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",((e,t,o)=>{if(!o.consumable.consume(t.item,e.name))return;const s=o.writer,i=o.mapper.toViewPosition(t.range.start),n=s.createText(t.item.data);s.insert(i,n)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,o)=>{o.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||o.convertChildren(t.item)}),{priority:"lowest"}),this.upcastDispatcher=new Pi({schema:e.schema}),this.viewDocument=new Je(t),this.stylesProcessor=t,this.htmlProcessor=new Ci(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new ct(this.viewDocument),this.upcastDispatcher.on("text",((e,t,{schema:o,consumable:s,writer:i})=>{let n=t.modelCursor;if(!s.test(t.viewItem))return;if(!o.checkChild(n,"$text")){if(!Js(n,"$text",o))return;if(0==t.viewItem.data.trim().length)return;const e=n.nodeBefore;n=Ys(n,i),e&&e.is("element","$marker")&&(i.move(i.createRangeOn(e),n),n=i.createPositionAfter(e))}s.consume(t.viewItem);const r=i.createText(t.viewItem.data);i.insert(r,n),t.modelRange=i.createRange(n,n.getShiftedBy(r.offsetSize)),t.modelCursor=t.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((e,t,o)=>{if(!t.modelRange&&o.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:s}=o.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=s}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((e,t,o)=>{if(!t.modelRange&&o.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:s}=o.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=s}}),{priority:"lowest"}),(0,m.Re)().prototype.decorate.call(this,"init"),(0,m.Re)().prototype.decorate.call(this,"set"),(0,m.Re)().prototype.decorate.call(this,"get"),(0,m.Re)().prototype.decorate.call(this,"toView"),(0,m.Re)().prototype.decorate.call(this,"toModel"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange({isUndoable:!1},Gs)}),{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:o="empty"}=e;if(!this._checkIfRootsExists([t]))throw new m.Bb("datacontroller-get-non-existent-root",this);const s=this.model.document.getRoot(t);return"empty"!==o||this.model.hasContent(s,{ignoreWhitespaces:!0})?this.stringify(s,e):""}stringify(e,t={}){const o=this.toView(e,t);return this.processor.toData(o)}toView(e,t={}){const o=this.viewDocument,s=this._viewWriter;this.mapper.clearBindings();const i=ps._createIn(e),n=new at(o);this.mapper.bindElements(e,n);const r=e.is("documentFragment")?e.markers:function(e){const t=[],o=e.root.document;if(!o)return new Map;const s=ps._createIn(e);for(const e of o.model.markers){const o=e.getRange(),i=o.isCollapsed,n=o.start.isEqual(s.start)||o.end.isEqual(s.end);if(i&&n)t.push([e.name,o]);else{const i=s.getIntersection(o);i&&t.push([e.name,i])}}return t.sort((([e,t],[o,s])=>{if("after"!==t.end.compareWith(s.start))return 1;if("before"!==t.start.compareWith(s.end))return-1;switch(t.start.compareWith(s.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(s.end)){case"before":return 1;case"after":return-1;default:return o.localeCompare(e)}}})),new Map(t)}(e);return this.downcastDispatcher.convert(i,r,s,t),n}init(e){if(this.model.document.version)throw new m.Bb("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new m.Bb("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},(e=>{for(const o of Object.keys(t)){const s=this.model.document.getRoot(o);e.insert(this.parse(t[o],s),s,0)}})),Promise.resolve()}set(e,t={}){let o={};if("string"==typeof e?o.main=e:o=e,!this._checkIfRootsExists(Object.keys(o)))throw new m.Bb("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},(e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(o)){const s=this.model.document.getRoot(t);e.remove(e.createRangeIn(s)),e.insert(this.parse(o[t],s),s,0)}}))}parse(e,t="$root"){const o=this.processor.toView(e);return this.toModel(o,t)}toModel(e,t="$root"){return this.model.change((o=>this.upcastDispatcher.convert(e,o,t)))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}class Ei{constructor(e,t){this._helpers=new Map,this._downcast=(0,m.qo)(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=(0,m.qo)(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const o=this._downcast.includes(t);if(!this._upcast.includes(t)&&!o)throw new m.Bb("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:o})}for(e){if(!this._helpers.has(e))throw new m.Bb("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:o}of Si(e))this.for("upcast").elementToElement({model:t,view:o,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:o}of Si(e))this.for("upcast").elementToAttribute({view:o,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:o}of Si(e))this.for("upcast").attributeToAttribute({view:o,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:o}){if(this._helpers.has(e))throw new m.Bb("conversion-group-exists",this);const s=o?new Ns(t):new Xs(t);this._helpers.set(e,s)}}function*Si(e){if(e.model.values)for(const t of e.model.values){const o={key:e.model.key,value:t},s=e.view[t],i=e.upcastAlso?e.upcastAlso[t]:void 0;yield*Oi(o,s,i)}else yield*Oi(e.model,e.view,e.upcastAlso)}function*Oi(e,t,o){if(yield{model:e,view:t},o)for(const t of(0,m.qo)(o))yield{model:e,view:t}}class Ri{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function Mi(e,t){const o=Vi(t),s=o.reduce(((e,t)=>e+t.offsetSize),0),i=e.parent;Ii(e);const n=e.index;return i._insertChild(n,o),Ni(i,n+o.length),Ni(i,n),new ps(e,e.getShiftedBy(s))}function ji(e){if(!e.isFlat)throw new m.Bb("operation-utils-remove-range-not-flat",this);const t=e.start.parent;Ii(e.start),Ii(e.end);const o=t._removeChildren(e.start.index,e.end.index-e.start.index);return Ni(t,e.start.index),o}function Bi(e,t){if(!e.isFlat)throw new m.Bb("operation-utils-move-range-not-flat",this);const o=ji(e);return Mi(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),o)}function Vi(e){const t=[];!function e(o){if("string"==typeof o)t.push(new os(o));else if(o instanceof ss)t.push(new os(o.data,o.getAttributes()));else if(o instanceof es)t.push(o);else if((0,m.TW)(o))for(const t of o)e(t)}(e);for(let e=1;ee.maxOffset)throw new m.Bb("move-operation-nodes-do-not-exist",this);if(e===t&&o=o&&this.targetPosition.path[e]e._clone(!0)))),t=new Fi(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new as(e,[0]);return new zi(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0)))),Mi(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const o=[];for(const t of e.nodes)t.name?o.push(is.fromJSON(t)):o.push(os.fromJSON(t));const s=new Fi(as.fromJSON(e.position,t),o,e.baseVersion);return s.shouldReceiveAttributes=e.shouldReceiveAttributes,s}}class Li extends Ri{constructor(e,t,o,s,i,n){super(n),this.name=e,this.oldRange=t?t.clone():null,this.newRange=o?o.clone():null,this.affectsData=i,this._markers=s}get type(){return"marker"}clone(){return new Li(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Li(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){this.newRange?this._markers._set(this.name,this.newRange,!0,this.affectsData):this._markers._remove(this.name)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new Li(e.name,e.oldRange?ps.fromJSON(e.oldRange,t):null,e.newRange?ps.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}const Zi=function(e,t){return Fo(e,t)};class Wi extends Ri{constructor(e,t,o,s,i){super(i),this.range=e.clone(),this.key=t,this.oldValue=void 0===o?null:o,this.newValue=void 0===s?null:s}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new Wi(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Wi(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new m.Bb("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!Zi(e.getAttribute(this.key),this.oldValue))throw new m.Bb("attribute-operation-wrong-old-value",this,{item:e,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&e.hasAttribute(this.key))throw new m.Bb("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){Zi(this.oldValue,this.newValue)||function(e,t,o){Ii(e.start),Ii(e.end);for(const s of e.getItems({shallow:!0})){const e=s.is("$textProxy")?s.textNode:s;null!==o?e._setAttribute(t,o):e._removeAttribute(t),Ni(e.parent,e.index)}Ni(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new Wi(ps.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Hi extends Ri{get type(){return"noop"}clone(){return new Hi(this.baseVersion)}getReversed(){return new Hi(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}class $i extends Ri{constructor(e,t,o,s){super(s),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=o}get type(){return"rename"}clone(){return new $i(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new $i(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof is))throw new m.Bb("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new m.Bb("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new $i(as.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class qi extends Ri{constructor(e,t,o,s,i){super(i),this.root=e,this.key=t,this.oldValue=o,this.newValue=s}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new qi(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new qi(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new m.Bb("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new m.Bb("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new m.Bb("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new m.Bb("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new qi(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Ui extends Ri{constructor(e,t,o,s,i){super(i),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=o.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=s.clone()}get type(){return"merge"}get deletionPosition(){return new as(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ps(this.sourcePosition,e)}clone(){return new Ui(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),o=new as(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new Ki(e,this.howMany,o,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new m.Bb("merge-operation-source-position-invalid",this);if(!t.parent)throw new m.Bb("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new m.Bb("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;Bi(ps._createIn(e),this.targetPosition),Bi(ps._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const o=as.fromJSON(e.sourcePosition,t),s=as.fromJSON(e.targetPosition,t),i=as.fromJSON(e.graveyardPosition,t);return new this(o,e.howMany,s,i,e.baseVersion)}}class Ki extends Ri{constructor(e,t,o,s,i){super(i),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=o,this.graveyardPosition=s?s.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new as(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ps(this.splitPosition,e)}clone(){return new Ki(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new as(e,[0]);return new Ui(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const s=e.range.getDifference(t.range).map((t=>new Wi(t,e.key,e.oldValue,e.newValue,0))),i=e.range.getIntersection(t.range);return i&&o.aIsStrong&&s.push(new Wi(i,t.key,t.newValue,e.newValue,0)),0==s.length?[new Hi(0)]:s}return[e]})),Xi(Wi,Fi,((e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const o=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map((t=>new Wi(t,e.key,e.oldValue,e.newValue,e.baseVersion)));if(t.shouldReceiveAttributes){const s=rn(t,e.key,e.oldValue);s&&o.unshift(s)}return o}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]})),Xi(Wi,Ui,((e,t)=>{const o=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&o.push(ps._createFromPositionAndShift(t.graveyardPosition,1));const s=e.range._getTransformedByMergeOperation(t);return s.isCollapsed||o.push(s),o.map((t=>new Wi(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),Xi(Wi,zi,((e,t)=>function(e,t){const o=ps._createFromPositionAndShift(t.sourcePosition,t.howMany);let s=null,i=[];o.containsRange(e,!0)?s=e:e.start.hasSameParentAs(o.start)?(i=e.getDifference(o),s=e.getIntersection(o)):i=[e];const n=[];for(let e of i){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const o=t.getMovedRangeStart(),s=e.start.hasSameParentAs(o),i=e._getTransformedByInsertion(o,t.howMany,s);n.push(...i)}s&&n.push(s._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return n}(e.range,t).map((t=>new Wi(t,e.key,e.oldValue,e.newValue,e.baseVersion))))),Xi(Wi,Ki,((e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const o=e.clone();return o.range=new ps(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,o]}return e.range=e.range._getTransformedBySplitOperation(t),[e]})),Xi(Fi,Wi,((e,t)=>{const o=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const s=rn(e,t.key,t.newValue);s&&o.push(s)}return o})),Xi(Fi,Fi,((e,t,o)=>(e.position.isEqual(t.position)&&o.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e]))),Xi(Fi,zi,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),Xi(Fi,Ki,((e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]))),Xi(Fi,Ui,((e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]))),Xi(Li,Fi,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]))),Xi(Li,Li,((e,t,o)=>{if(e.name==t.name){if(!o.aIsStrong)return[new Hi(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]})),Xi(Li,Ui,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]))),Xi(Li,zi,((e,t,o)=>{if(e.oldRange&&(e.oldRange=ps._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(o.abRelation){const s=ps._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==o.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.end=s.end,e.newRange.start.path=o.abRelation.path,[e];if("right"==o.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=s.start,e.newRange.end.path=o.abRelation.path,[e]}e.newRange=ps._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]})),Xi(Li,Ki,((e,t,o)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(o.abRelation){const s=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&o.abRelation.wasStartBeforeMergedElement?e.newRange.start=as._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!o.abRelation.wasInLeftElement&&(e.newRange.start=as._createAt(t.moveTargetPosition)),e.newRange.end.isEqual(t.splitPosition)&&o.abRelation.wasInRightElement?e.newRange.end=as._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&o.abRelation.wasEndBeforeMergedElement?e.newRange.end=as._createAt(t.insertionPosition):e.newRange.end=s.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]})),Xi(Ui,Fi,((e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]))),Xi(Ui,Ui,((e,t,o)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(o.bWasUndone){const o=t.graveyardPosition.path.slice();return o.push(0),e.sourcePosition=new as(t.graveyardPosition.root,o),e.howMany=0,[e]}return[new Hi(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!o.bWasUndone&&"splitAtSource"!=o.abRelation){const s="$graveyard"==e.targetPosition.root.rootName,i="$graveyard"==t.targetPosition.root.rootName;if(i&&!s||!(s&&!i)&&o.aIsStrong){const o=t.targetPosition._getTransformedByMergeOperation(t),s=e.targetPosition._getTransformedByMergeOperation(t);return[new zi(o,e.howMany,s,0)]}return[new Hi(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&o.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),Xi(Ui,zi,((e,t,o)=>{const s=ps._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!o.bWasUndone&&!o.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&s.containsPosition(e.sourcePosition)?[new Hi(0)]:(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])})),Xi(Ui,Ki,((e,t,o)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){const s=0!=t.howMany,i=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(s||i||"mergeTargetNotMoved"==o.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==o.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==o.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),Xi(zi,Fi,((e,t)=>{const o=ps._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=o.start,e.howMany=o.end.offset-o.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),Xi(zi,zi,((e,t,o)=>{const s=ps._createFromPositionAndShift(e.sourcePosition,e.howMany),i=ps._createFromPositionAndShift(t.sourcePosition,t.howMany);let n,r=o.aIsStrong,a=!o.aIsStrong;if("insertBefore"==o.abRelation||"insertAfter"==o.baRelation?a=!0:"insertAfter"!=o.abRelation&&"insertBefore"!=o.baRelation||(a=!1),n=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),an(e,t)&&an(t,e))return[t.getReversed()];if(s.containsPosition(t.targetPosition)&&s.containsRange(i,!0))return s.start=s.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),s.end=s.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),cn([s],n);if(i.containsPosition(e.targetPosition)&&i.containsRange(s,!0))return s.start=s.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),s.end=s.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),cn([s],n);const c=(0,m.Rt)(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return s.start=s.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),s.end=s.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),cn([s],n);"remove"!=e.type||"remove"==t.type||o.aWasUndone||o.forceWeakRemove?"remove"==e.type||"remove"!=t.type||o.bWasUndone||o.forceWeakRemove||(r=!1):r=!0;const l=[],d=s.getDifference(i);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const o="same"==(0,m.Rt)(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),s=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,o);l.push(...s)}const h=s.getIntersection(i);return null!==h&&r&&(h.start=h.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),h.end=h.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===l.length?l.push(h):1==l.length?i.start.isBefore(s.start)||i.start.isEqual(s.start)?l.unshift(h):l.push(h):l.splice(1,0,h)),0===l.length?[new Hi(e.baseVersion)]:cn(l,n)})),Xi(zi,Ki,((e,t,o)=>{let s=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=o.abRelation||(s=e.targetPosition._getTransformedBySplitOperation(t));const i=ps._createFromPositionAndShift(e.sourcePosition,e.howMany);if(i.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=s,[e];if(i.start.hasSameParentAs(t.splitPosition)&&i.containsPosition(t.splitPosition)){let e=new ps(t.splitPosition,i.end);e=e._getTransformedBySplitOperation(t);return cn([new ps(i.start,t.splitPosition),e],s)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==o.abRelation&&(s=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==o.abRelation&&(s=e.targetPosition);const n=[i._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const s=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);e.howMany>1&&s&&!o.aWasUndone&&n.push(ps._createFromPositionAndShift(t.insertionPosition,1))}return cn(n,s)})),Xi(zi,Ui,((e,t,o)=>{const s=ps._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&s.containsPosition(t.sourcePosition))if("remove"!=e.type||o.forceWeakRemove){if(1==e.howMany)return o.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new Hi(0)]}else if(!o.aWasUndone){const o=[];let s=t.graveyardPosition.clone(),i=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(o.push(new zi(e.sourcePosition,e.howMany-1,e.targetPosition,0)),s=s._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));const n=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),r=new zi(s,1,n,0),a=r.getMovedRangeStart().path.slice();a.push(0);const c=new as(r.targetPosition.root,a);i=i._getTransformedByMove(s,n,1);const l=new zi(i,t.howMany,c,0);return o.push(r),o.push(l),o}const i=ps._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),Xi($i,Fi,((e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]))),Xi($i,Ui,((e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]))),Xi($i,zi,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),Xi($i,$i,((e,t,o)=>{if(e.position.isEqual(t.position)){if(!o.aIsStrong)return[new Hi(0)];e.oldName=t.newName}return[e]})),Xi($i,Ki,((e,t)=>{const o=e.position.path,s=t.splitPosition.getParentPath();if("same"==(0,m.Rt)(o,s)&&!t.graveyardPosition){const t=new $i(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),Xi(qi,qi,((e,t,o)=>{if(e.root===t.root&&e.key===t.key){if(!o.aIsStrong||e.newValue===t.newValue)return[new Hi(0)];e.oldValue=t.newValue}return[e]})),Xi(Ki,Fi,((e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!o.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const o=t.graveyardPosition.path.slice();o.push(0);const s=new as(t.graveyardPosition.root,o),i=Ki.getInsertionPosition(new as(t.graveyardPosition.root,o)),n=new Ki(s,0,i,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Ki.getInsertionPosition(e.splitPosition),e.graveyardPosition=n.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[n,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Ki.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),Xi(Ki,zi,((e,t,o)=>{const s=ps._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const i=s.start.isEqual(e.graveyardPosition)||s.containsPosition(e.graveyardPosition);if(!o.bWasUndone&&i){const o=e.splitPosition._getTransformedByMoveOperation(t),s=e.graveyardPosition._getTransformedByMoveOperation(t),i=s.path.slice();i.push(0);const n=new as(s.root,i);return[new zi(o,e.howMany,n,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const i=e.splitPosition.isEqual(t.targetPosition);if(i&&("insertAtSource"==o.baRelation||"splitBefore"==o.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=Ki.getInsertionPosition(e.splitPosition),[e];if(i&&o.abRelation&&o.abRelation.howMany){const{howMany:t,offset:s}=o.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(s),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&s.containsPosition(e.splitPosition)){const o=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=o,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new Hi(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new Hi(0)];if("splitBefore"==o.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const s="$graveyard"==e.splitPosition.root.rootName,i="$graveyard"==t.splitPosition.root.rootName;if(i&&!s||!(s&&!i)&&o.aIsStrong){const o=[];return t.howMany&&o.push(new zi(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&o.push(new zi(e.splitPosition,e.howMany,e.moveTargetPosition,0)),o}return[new Hi(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==o.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==o.baRelation){const o=t.insertionPosition.path.slice();o.push(0);const s=new as(t.insertionPosition.root,o);return[e,new zi(e.insertionPosition,1,s,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset{const o=t[0];o.isDocumentOperation&&hn.call(this,o)}),{priority:"low"})}function hn(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)}}ln.prototype.is=function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e};class un{constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},(0,m.KE)("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:o=!0,isUndo:s=!1,isTyping:i=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=o,this.isUndo=s,this.isTyping=i}get type(){return(0,m.KE)("batch-type-deprecated"),"default"}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class pn{constructor(e){this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set,this._markerCollection=e}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}bufferOperation(e){const t=e;switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),o=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),o||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=ps._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const o=t.graveyardPosition.parent;this._markInsert(o,t.graveyardPosition.offset,1);const s=t.targetPosition.parent;this._isInInsertedElement(s)||this._markInsert(s,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,o){const s=this._changedMarkers.get(e);s?(s.newMarkerData=o,null==s.oldMarkerData.range&&null==o.range&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{newMarkerData:o,oldMarkerData:t})}getMarkersToRemove(){const e=[];for(const[t,o]of this._changedMarkers)null!=o.oldMarkerData.range&&e.push({name:t,range:o.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,o]of this._changedMarkers)null!=o.newMarkerData.range&&e.push({name:t,range:o.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map((([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}})))}hasDataChanges(){if(this._changesInElement.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const o=e.range&&!t.range,s=!e.range&&t.range,i=e.range&&t.range&&!e.range.isEqual(t.range);if(o||s||i)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const o=this._changesInElement.get(e).sort(((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamee));for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(mn),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e);const t=ps._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_markInsert(e,t,o){const s={type:"insert",offset:t,howMany:o,count:this._changeCount++};this._markChange(e,s)}_markRemove(e,t,o){const s={type:"remove",offset:t,howMany:o,count:this._changeCount++};this._markChange(e,s),this._removeAllNestedChanges(e,t,o)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const o=this._getChangesForElement(e);this._handleChange(t,o),o.push(t);for(let e=0;eo.offset){if(s>i){const e={type:"attribute",offset:i,howMany:s-i,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=o.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=o.offset&&e.offseti?(e.nodesToHandle=s-i,e.offset=i):e.nodesToHandle=0);if("remove"==o.type&&e.offseto.offset){const i={type:"attribute",offset:o.offset,howMany:s-o.offset,count:this._changeCount++};this._handleChange(i,t),t.push(i),e.nodesToHandle=o.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==o.type&&(e.offset>=o.offset&&s<=i?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=o.offset&&s>=i&&(o.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,o){return{type:"insert",position:as._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,o){return{type:"remove",position:as._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,o){const s=[];o=new Map(o);for(const[i,n]of t){const t=o.has(i)?o.get(i):null;t!==n&&s.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:i,attributeOldValue:n,attributeNewValue:t,changeCount:this._changeCount++}),o.delete(i)}for(const[t,i]of o)s.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:i,changeCount:this._changeCount++});return s}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const o=this._changesInElement.get(t),s=e.startOffset;if(o)for(const e of o)if("insert"==e.type&&s>=e.offset&&ss){for(let t=0;tthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new m.Bb("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const o=this._operations[0];void 0===e&&(e=o.baseVersion);let s=t-1;for(const[t,o]of this._gaps)e>t&&et&&sthis.lastOperation.baseVersion)return[];let i=this._baseVersionToOperationIndex.get(e);void 0===i&&(i=0);let n=this._baseVersionToOperationIndex.get(s);return void 0===n&&(n=this._operations.length-1),this._operations.slice(i,n+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(void 0!==t)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class _n extends is{constructor(e,t,o="main"){super(t),this._document=e,this.rootName=o}get document(){return this._document}toJSON(){return this.rootName}}_n.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e};const wn="$graveyard";class kn extends((0,m.ln)()){constructor(e){super(),this.model=e,this.history=new bn,this.selection=new Ss(this),this.roots=new m.FE({idProperty:"rootName"}),this.differ=new pn(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",wn),this.listenTo(e,"applyOperation",((e,t)=>{const o=t[0];o.isDocumentOperation&&this.differ.bufferOperation(o)}),{priority:"high"}),this.listenTo(e,"applyOperation",((e,t)=>{const o=t[0];o.isDocumentOperation&&this.history.addOperation(o)}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(e.markers,"update",((e,t,o,s,i)=>{const n={...t.getData(),range:s};this.differ.bufferMarkerChange(t.name,i,n),null===o&&t.on("change",((e,o)=>{const s=t.getData();this.differ.bufferMarkerChange(t.name,{...s,range:o},s)}))}))}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(wn)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new m.Bb("model-document-createroot-name-exists",this,{name:t});const o=new _n(this,e,t);return this.roots.add(o),o}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!=wn))}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=k(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_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(),t=this.model,o=t.schema,s=t.createPositionFromPath(e,[0]);return o.getNearestSelectionRange(s)||t.createRange(s)}_validateSelectionRange(e){return vn(e.start)&&vn(e.end)}_callPostFixers(e){let t=!1;do{for(const o of this._postFixers)if(this.selection.refresh(),t=o(e),t)break}while(t)}}function vn(e){const t=e.textNode;if(t){const o=t.data,s=e.offset-t.startOffset;return!(0,m.to)(o,s)&&!(0,m.pp)(o,s)}return!0}class yn extends((0,m.ln)()){constructor(){super(...arguments),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof xn?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,o=!1,s=!1){const i=e instanceof xn?e.name:e;if(i.includes(","))throw new m.Bb("markercollection-incorrect-marker-name",this);const n=this._markers.get(i);if(n){const e=n.getData(),r=n.getRange();let a=!1;return r.isEqual(t)||(n._attachLiveRange(Ts.fromRange(t)),a=!0),o!=n.managedUsingOperations&&(n._managedUsingOperations=o,a=!0),"boolean"==typeof s&&s!=n.affectsData&&(n._affectsData=s,a=!0),a&&this.fire(`update:${i}`,n,r,t,e),n}const r=Ts.fromRange(t),a=new xn(i,r,o,s);return this._markers.set(i,a),this.fire(`update:${i}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof xn?e.name:e,o=this._markers.get(t);return!!o&&(this._markers.delete(t),this.fire(`update:${t}`,o,o.getRange(),null,o.getData()),this._destroyMarker(o),!0)}_refresh(e){const t=e instanceof xn?e.name:e,o=this._markers.get(t);if(!o)throw new m.Bb("markercollection-refresh-marker-not-exists",this);const s=o.getRange();this.fire(`update:${t}`,o,s,s,o.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(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())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class xn extends((0,m.ln)(Qo)){constructor(e,t,o,s){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=o,this._affectsData=s}get managedUsingOperations(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new m.Bb("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}xn.prototype.is=function(e){return"marker"===e||"model:marker"===e};class Pn extends Ri{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new m.Bb("detach-operation-on-document-node",this)}_execute(){ji(ps._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Tn extends Qo{constructor(e){super(),this.markers=new Map,this._children=new ts,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 0===this.childCount}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}getAncestors(){return[]}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 o of e)t=t.getChild(t.offsetToIndex(o));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 o of e)o.name?t.push(is.fromJSON(o)):t.push(os.fromJSON(o));return new Tn(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const o=function(e){if("string"==typeof e)return[new os(e)];(0,m.TW)(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new os(e):e instanceof ss?new os(e.data,e.getAttributes()):e))}(t);for(const e of o)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,o)}_removeChildren(e,t=1){const o=this._children._removeNodes(e,t);for(const e of o)e.parent=null;return o}}Tn.prototype.is=function(e){return"documentFragment"===e||"model:documentFragment"===e};class Cn{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new os(e,t)}createElement(e,t){return new is(e,t)}createDocumentFragment(){return new Tn}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,o=0){if(this._assertWriterUsedCorrectly(),e instanceof os&&""==e.data)return;const s=as._createAt(t,o);if(e.parent){if(Rn(e.root,s.root))return void this.move(ps._createOn(e),s);if(e.root.document)throw new m.Bb("model-writer-insert-forbidden-move",this);this.remove(e)}const i=s.root.document?s.root.document.version:null,n=new Fi(s,e,i);if(e instanceof os&&(n.shouldReceiveAttributes=!0),this.batch.addOperation(n),this.model.applyOperation(n),e instanceof Tn)for(const[t,o]of e.markers){const e=as._createAt(o.root,0),i={range:new ps(o.start._getCombined(e,s),o.end._getCombined(e,s)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,i):this.addMarker(t,i)}}insertText(e,t,o,s){t instanceof Tn||t instanceof is||t instanceof as?this.insert(this.createText(e),t,o):this.insert(this.createText(e,t),o,s)}insertElement(e,t,o,s){t instanceof Tn||t instanceof is||t instanceof as?this.insert(this.createElement(e),t,o):this.insert(this.createElement(e,t),o,s)}append(e,t){this.insert(e,t,"end")}appendText(e,t,o){t instanceof Tn||t instanceof is?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),o,"end")}appendElement(e,t,o){t instanceof Tn||t instanceof is?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),o,"end")}setAttribute(e,t,o){if(this._assertWriterUsedCorrectly(),o instanceof ps){const s=o.getMinimalFlatRanges();for(const o of s)An(this,e,t,o)}else En(this,e,t,o)}setAttributes(e,t){for(const[o,s]of(0,m.qL)(e))this.setAttribute(o,s,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof ps){const o=t.getMinimalFlatRanges();for(const t of o)An(this,e,null,t)}else En(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof ps)for(const o of e.getItems())t(o);else t(e)}move(e,t,o){if(this._assertWriterUsedCorrectly(),!(e instanceof ps))throw new m.Bb("writer-move-invalid-range",this);if(!e.isFlat)throw new m.Bb("writer-move-range-not-flat",this);const s=as._createAt(t,o);if(s.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!Rn(e.root,s.root))throw new m.Bb("writer-move-different-document",this);const i=e.root.document?e.root.document.version:null,n=new zi(e.start,e.end.offset-e.start.offset,s,i);this.batch.addOperation(n),this.model.applyOperation(n)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof ps?e:ps._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),On(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,o=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof is))throw new m.Bb("writer-merge-no-element-before",this);if(!(o instanceof is))throw new m.Bb("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,o){return this.model.createPositionFromPath(e,t,o)}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){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,o=e.nodeAfter;this.move(ps._createIn(o),as._createAt(t,"end")),this.remove(o)}_merge(e){const t=as._createAt(e.nodeBefore,"end"),o=as._createAt(e.nodeAfter,0),s=e.root.document.graveyard,i=new as(s,[0]),n=e.root.document.version,r=new Ui(o,e.nodeAfter.maxOffset,t,i,n);this.batch.addOperation(r),this.model.applyOperation(r)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof is))throw new m.Bb("writer-rename-not-element-instance",this);const o=e.root.document?e.root.document.version:null,s=new $i(as._createBefore(e),e.name,t,o);this.batch.addOperation(s),this.model.applyOperation(s)}split(e,t){this._assertWriterUsedCorrectly();let o,s,i=e.parent;if(!i.parent)throw new m.Bb("writer-split-element-no-parent",this);if(t||(t=i.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new m.Bb("writer-split-invalid-limit-element",this);do{const t=i.root.document?i.root.document.version:null,n=i.maxOffset-e.offset,r=Ki.getInsertionPosition(e),a=new Ki(e,n,r,null,t);this.batch.addOperation(a),this.model.applyOperation(a),o||s||(o=i,s=e.parent.nextSibling),i=(e=this.createPositionAfter(e.parent)).parent}while(i!==t);return{position:e,range:new ps(as._createAt(o,"end"),as._createAt(s,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new m.Bb("writer-wrap-range-not-flat",this);const o=t instanceof is?t:new is(t);if(o.childCount>0)throw new m.Bb("writer-wrap-element-not-empty",this);if(null!==o.parent)throw new m.Bb("writer-wrap-element-attached",this);this.insert(o,e.start);const s=new ps(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(s,as._createAt(o,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new m.Bb("writer-unwrap-element-no-parent",this);this.move(ps._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new m.Bb("writer-addmarker-no-usingoperation",this);const o=t.usingOperation,s=t.range,i=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new m.Bb("writer-addmarker-marker-exists",this);if(!s)throw new m.Bb("writer-addmarker-no-range",this);return o?(Sn(this,e,null,s,i),this.model.markers.get(e)):this.model.markers._set(e,s,o,i)}updateMarker(e,t){this._assertWriterUsedCorrectly();const o="string"==typeof e?e:e.name,s=this.model.markers.get(o);if(!s)throw new m.Bb("writer-updatemarker-marker-not-exists",this);if(!t)return(0,m.KE)("writer-updatemarker-reconvert-using-editingcontroller",{markerName:o}),void this.model.markers._refresh(s);const i="boolean"==typeof t.usingOperation,n="boolean"==typeof t.affectsData,r=n?t.affectsData:s.affectsData;if(!i&&!t.range&&!n)throw new m.Bb("writer-updatemarker-wrong-options",this);const a=s.getRange(),c=t.range?t.range:a;i&&t.usingOperation!==s.managedUsingOperations?t.usingOperation?Sn(this,o,null,c,r):(Sn(this,o,a,null,r),this.model.markers._set(o,c,void 0,r)):s.managedUsingOperations?Sn(this,o,a,c,r):this.model.markers._set(o,c,void 0,r)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new m.Bb("writer-removemarker-no-marker",this);const o=this.model.markers.get(t);if(!o.managedUsingOperations)return void this.model.markers._remove(t);Sn(this,t,o.getRange(),null,o.affectsData)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,o]of(0,m.qL)(e))this._setSelectionAttribute(t,o)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)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 o=this.model.document.selection;if(o.isCollapsed&&o.anchor.parent.isEmpty){const s=Ss._getStoreAttributeKey(e);this.setAttribute(s,t,o.anchor.parent)}o._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const o=Ss._getStoreAttributeKey(e);this.removeAttribute(o,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new m.Bb("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const o of this.model.markers){if(!o.managedUsingOperations)continue;const s=o.getRange();let i=!1;if("move"===e){const e=t;i=e.containsPosition(s.start)||e.start.isEqual(s.start)||e.containsPosition(s.end)||e.end.isEqual(s.end)}else{const e=t,o=e.nodeBefore,n=e.nodeAfter,r=s.start.parent==o&&s.start.isAtEnd,a=s.end.parent==n&&0==s.end.offset,c=s.end.nodeAfter==n,l=s.start.nodeAfter==n;i=r||a||c||l}i&&this.updateMarker(o.name,{range:s})}}}function An(e,t,o,s){const i=e.model,n=i.document;let r,a,c,l=s.start;for(const e of s.getWalker({shallow:!0}))c=e.item.getAttribute(t),r&&a!=c&&(a!=o&&d(),l=r),r=e.nextPosition,a=c;function d(){const s=new ps(l,r),c=s.root.document?n.version:null,d=new Wi(s,t,a,o,c);e.batch.addOperation(d),i.applyOperation(d)}r instanceof as&&r!=l&&a!=o&&d()}function En(e,t,o,s){const i=e.model,n=i.document,r=s.getAttribute(t);let a,c;if(r!=o){if(s.root===s){const e=s.document?n.version:null;c=new qi(s,t,r,o,e)}else{a=new ps(as._createBefore(s),e.createPositionAfter(s));const i=a.root.document?n.version:null;c=new Wi(a,t,r,o,i)}e.batch.addOperation(c),i.applyOperation(c)}}function Sn(e,t,o,s,i){const n=e.model,r=n.document,a=new Li(t,o,s,n.markers,!!i,r.version);e.batch.addOperation(a),n.applyOperation(a)}function On(e,t,o,s){let i;if(e.root.document){const o=s.document,n=new as(o.graveyard,[0]);i=new zi(e,t,n,o.version)}else i=new Pn(e,t);o.addOperation(i),s.applyOperation(i)}function Rn(e,t){return e===t||e instanceof _n&&t instanceof _n}function Mn(e){e.document.registerPostFixer((t=>function(e,t){const o=t.document.selection,s=t.schema,i=[];let n=!1;for(const e of o.getRanges()){const t=jn(e,s);t&&!t.isEqual(e)?(i.push(t),n=!0):i.push(e)}n&&e.setSelection(function(e){const t=[...e],o=new Set;let s=1;for(;s!o.has(t)))}(i),{backward:o.isBackward});return!1}(t,e)))}function jn(e,t){return e.isCollapsed?function(e,t){const o=e.start,s=t.getNearestSelectionRange(o);if(!s){const e=o.getAncestors().reverse().find((e=>t.isObject(e)));return e?ps._createOn(e):null}if(!s.isCollapsed)return s;const i=s.start;if(o.isEqual(i))return null;return new ps(i)}(e,t):function(e,t){const{start:o,end:s}=e,i=t.checkChild(o,"$text"),n=t.checkChild(s,"$text"),r=t.getLimitElement(o),a=t.getLimitElement(s);if(r===a){if(i&&n)return null;if(function(e,t,o){const s=e.nodeAfter&&!o.isLimit(e.nodeAfter)||o.checkChild(e,"$text"),i=t.nodeBefore&&!o.isLimit(t.nodeBefore)||o.checkChild(t,"$text");return s||i}(o,s,t)){const e=o.nodeAfter&&t.isSelectable(o.nodeAfter)?null:t.getNearestSelectionRange(o,"forward"),i=s.nodeBefore&&t.isSelectable(s.nodeBefore)?null:t.getNearestSelectionRange(s,"backward"),n=e?e.start:o,r=i?i.end:s;return new ps(n,r)}}const c=r&&!r.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const e=o.nodeAfter&&s.nodeBefore&&o.nodeAfter.parent===s.nodeBefore.parent,i=c&&(!e||!Vn(o.nodeAfter,t)),n=l&&(!e||!Vn(s.nodeBefore,t));let d=o,h=s;return i&&(d=as._createBefore(Bn(r,t))),n&&(h=as._createAfter(Bn(a,t))),new ps(d,h)}return null}(e,t)}function Bn(e,t){let o=e,s=o;for(;t.isLimit(s)&&s.parent;)o=s,s=s.parent;return o}function Vn(e,t){return e&&t.isSelectable(e)}function Nn(e,t,o={}){if(t.isCollapsed)return;const s=t.getFirstRange();if("$graveyard"==s.root.rootName)return;const i=e.schema;e.change((e=>{if(!o.doNotResetEntireContent&&function(e,t){const o=e.getLimitElement(t);if(!t.containsEntireContent(o))return!1;const s=t.getFirstRange();if(s.start.parent==s.end.parent)return!1;return e.checkChild(o,"paragraph")}(i,t))return void function(e,t){const o=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(o)),Fn(e,e.createPositionAt(o,0),t)}(e,t);const n={};if(!o.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(n,i.getAttributesWithProperty(e,"copyOnReplace",!0))}const[r,a]=function(e){const t=e.root.document.model,o=e.start;let s=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const o=function(e){const t=e.parent,o=t.root.document.model.schema,s=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of s){if(o.isLimit(e))return null;if(o.isBlock(e))return e}}(s);if(o&&s.isTouching(t.createPositionAt(o,0))){const o=t.createSelection(e);t.modifySelection(o,{direction:"backward"});const i=o.getLastPosition(),n=t.createRange(i,s);t.hasContent(n,{ignoreMarkers:!0})||(s=i)}}return[ln.fromPosition(o,"toPrevious"),ln.fromPosition(s,"toNext")]}(s);r.isTouching(a)||e.remove(e.createRange(r,a)),o.leaveUnmerged||(!function(e,t,o){const s=e.model;if(!zn(e.model.schema,t,o))return;const[i,n]=function(e,t){const o=e.getAncestors(),s=t.getAncestors();let i=0;for(;o[i]&&o[i]==s[i];)i++;return[o[i],s[i]]}(t,o);if(!i||!n)return;!s.hasContent(i,{ignoreMarkers:!0})&&s.hasContent(n,{ignoreMarkers:!0})?Dn(e,t,o,i.parent):In(e,t,o,i.parent)}(e,r,a),i.removeDisallowedAttributes(r.parent.getChildren(),e)),Ln(e,t,r),!o.doNotAutoparagraph&&function(e,t){const o=e.checkChild(t,"$text"),s=e.checkChild(t,"paragraph");return!o&&s}(i,r)&&Fn(e,r,t,n),r.detach(),a.detach()}))}function In(e,t,o,s){const i=t.parent,n=o.parent;if(i!=s&&n!=s){for(t=e.createPositionAfter(i),(o=e.createPositionBefore(n)).isEqual(t)||e.insert(n,t),e.merge(t);o.parent.isEmpty;){const t=o.parent;o=e.createPositionBefore(t),e.remove(t)}zn(e.model.schema,t,o)&&In(e,t,o,s)}}function Dn(e,t,o,s){const i=t.parent,n=o.parent;if(i!=s&&n!=s){for(t=e.createPositionAfter(i),(o=e.createPositionBefore(n)).isEqual(t)||e.insert(i,o);t.parent.isEmpty;){const o=t.parent;t=e.createPositionBefore(o),e.remove(o)}o=e.createPositionBefore(n),function(e,t){const o=t.nodeBefore,s=t.nodeAfter;o.name!=s.name&&e.rename(o,s.name);e.clearAttributes(o),e.setAttributes(Object.fromEntries(s.getAttributes()),o),e.merge(t)}(e,o),zn(e.model.schema,t,o)&&Dn(e,t,o,s)}}function zn(e,t,o){const s=t.parent,i=o.parent;return s!=i&&(!e.isLimit(s)&&!e.isLimit(i)&&function(e,t,o){const s=new ps(e,t);for(const e of s.getWalker())if(o.isLimit(e.item))return!1;return!0}(t,o,e))}function Fn(e,t,o,s={}){const i=e.createElement("paragraph");e.model.schema.setAllowedAttributes(i,s,e),e.insert(i,t),Ln(e,o,e.createPositionAt(i,0))}function Ln(e,t,o){t instanceof Ss?e.setSelection(o):t.setTo(o)}function Zn(e,t){const o=[];Array.from(e.getItems({direction:"backward"})).map((e=>t.createRangeOn(e))).filter((t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end)))).forEach((e=>{o.push(e.start.parent),t.remove(e)})),o.forEach((e=>{let o=e;for(;o.parent&&o.isEmpty;){const e=t.createRangeOn(o);o=o.parent,t.remove(e)}}))}class Wn{constructor(e,t,o){this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null,this._nodeToSelect=null,this.model=e,this.writer=t,this.position=o,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),o=this.writer.createPositionAfter(e);if(o.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new m.Bb("insertcontent-invalid-insertion-position",this);this.position=o,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?ps._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new ps(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=ln.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new m.Bb("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=ln.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=ln.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof is))return;if(!this._canMergeLeft(e))return;const t=ln._createBefore(e);t.stickiness="toNext";const o=ln.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=ln._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=ln._createAt(t.nodeBefore,"end","toNext")),this.position=o.toPosition(),o.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof is))return;if(!this._canMergeRight(e))return;const t=ln._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new m.Bb("insertcontent-invalid-insertion-position",this);this.position=as._createAt(t.nodeBefore,"end");const o=ln.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=ln._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=ln._createAt(t.nodeBefore,0,"toPrevious")),this.position=o.toPosition(),o.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof is&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof is&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function Hn(e,t,o="auto"){const s=e.getSelectedElement();if(s&&t.schema.isObject(s)&&!t.schema.isInline(s))return"before"==o||"after"==o?t.createRange(t.createPositionAt(s,o)):t.createRangeOn(s);const i=(0,m.Ps)(e.getSelectedBlocks());if(!i)return t.createRange(e.focus);if(i.isEmpty)return t.createRange(t.createPositionAt(i,0));const n=t.createPositionAfter(i);return e.focus.isTouching(n)?t.createRange(n):t.createRange(t.createPositionBefore(i))}function $n(e,t,o,s,i={}){if(!e.schema.isObject(t))throw new m.Bb("insertobject-element-not-an-object",e,{object:t});let n;n=o?o instanceof ks||o instanceof Ss?o:e.createSelection(o,s):e.document.selection;let r=n;i.findOptimalPosition&&e.schema.isBlock(t)&&(r=e.createSelection(Hn(n,e,i.findOptimalPosition)));const a=(0,m.Ps)(n.getSelectedBlocks()),c={};return a&&Object.assign(c,e.schema.getAttributesWithProperty(a,"copyOnReplace",!0)),e.change((o=>{r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});let s=t;const n=r.anchor.parent;!e.schema.checkChild(n,t)&&e.schema.checkChild(n,"paragraph")&&e.schema.checkChild("paragraph",t)&&(s=o.createElement("paragraph"),o.insert(t,s)),e.schema.setAllowedAttributes(s,c,o);const a=e.insertContent(s,r);return a.isCollapsed||i.setSelection&&function(e,t,o,s){const i=e.model;if("on"==o)return void e.setSelection(t,"on");if("after"!=o)throw new m.Bb("insertobject-invalid-place-parameter-value",i);let n=t.nextSibling;if(i.schema.isInline(t))return void e.setSelection(t,"after");const r=n&&i.schema.checkChild(n,"$text");!r&&i.schema.checkChild(t.parent,"paragraph")&&(n=e.createElement("paragraph"),i.schema.setAllowedAttributes(n,s,e),i.insertContent(n,e.createPositionAfter(t)));n&&e.setSelection(n,0)}(o,t,i.setSelection,c),a}))}const qn=' ,.?!:;"-()';function Un(e,t){const{isForward:o,walker:s,unit:i,schema:n,treatEmojiAsSingleUnit:r}=e,{type:a,item:c,nextPosition:l}=t;if("text"==a)return"word"===e.unit?function(e,t){let o=e.position.textNode;o||(o=t?e.position.nodeAfter:e.position.nodeBefore);for(;o&&o.is("$text");){const s=e.position.offset-o.startOffset;if(Jn(o,s,t))o=t?e.position.nodeAfter:e.position.nodeBefore;else{if(Gn(o.data,s,t))break;e.next()}}return e.position}(s,o):function(e,t,o){const s=e.position.textNode;if(s){const i=s.data;let n=e.position.offset-s.startOffset;for(;(0,m.to)(i,n)||"character"==t&&(0,m.pp)(i,n)||o&&(0,m.YK)(i,n);)e.next(),n=e.position.offset-s.startOffset}return e.position}(s,i,r);if(a==(o?"elementStart":"elementEnd")){if(n.isSelectable(c))return as._createAt(c,o?"after":"before");if(n.checkChild(l,"$text"))return l}else{if(n.isLimit(c))return void s.skip((()=>!0));if(n.checkChild(l,"$text"))return l}}function Kn(e,t){const o=e.root,s=as._createAt(o,t?"end":0);return t?new ps(e,s):new ps(s,e)}function Gn(e,t,o){const s=t+(o?0:-1);return qn.includes(e.charAt(s))}function Jn(e,t,o){return t===(o?e.offsetSize:0)}class Yn extends((0,m.Re)()){constructor(){super(),this.markers=new yn,this.document=new kn(this),this.schema=new li,this._pendingChanges=[],this._currentWriter=null,["insertContent","insertObject","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach((e=>this.decorate(e))),this.on("applyOperation",((e,t)=>{t[0]._validate()}),{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(((e,t)=>{if("$marker"===t.name)return!0})),Mn(this),this.document.registerPostFixer(Gs)}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new un,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){m.Bb.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new un):e instanceof un||(e=new un(e)):e=new un,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){m.Bb.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,o){return function(e,t,o,s){return e.change((i=>{let n;n=o?o instanceof ks||o instanceof Ss?o:i.createSelection(o,s):e.document.selection,n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0});const r=new Wn(e,i,n.anchor),a=[];let c;if(t.is("documentFragment")){if(t.markers.size){const e=[];for(const[o,s]of t.markers){const{start:t,end:i}=s,n=t.isEqual(i);e.push({position:t,name:o,isCollapsed:n},{position:i,name:o,isCollapsed:n})}e.sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:o,name:s,isCollapsed:n}of e){let e=null,r=null;const c=o.parent===t&&o.isAtStart,l=o.parent===t&&o.isAtEnd;c||l?n&&(r=c?"start":"end"):(e=i.createElement("$marker"),i.insert(e,o)),a.push({name:s,element:e,collapsed:r})}}c=t.getChildren()}else c=[t];r.handleNodes(c);let l=r.getSelectionRange();if(t.is("documentFragment")&&a.length){const e=l?Ts.fromRange(l):null,t={};for(let e=a.length-1;e>=0;e--){const{name:o,element:s,collapsed:n}=a[e],c=!t[o];if(c&&(t[o]=[]),s){const e=i.createPositionAt(s,"before");t[o].push(e),i.remove(s)}else{const e=r.getAffectedRange();if(!e){n&&t[o].push(r.position);continue}n?t[o].push(e[n]):t[o].push(c?e.start:e.end)}}for(const[e,[o,s]]of Object.entries(t))o&&s&&o.root===s.root&&i.addMarker(e,{usingOperation:!0,affectsData:!0,range:new ps(o,s)});e&&(l=e.toRange(),e.detach())}l&&(n instanceof Ss?i.setSelection(l):n.setTo(l));const d=r.getAffectedRange()||e.createRange(n.anchor);return r.destroy(),d}))}(this,e,t,o)}insertObject(e,t,o,s){return $n(this,e,t,o,s)}deleteContent(e,t){Nn(this,e,t)}modifySelection(e,t){!function(e,t,o={}){const s=e.schema,i="backward"!=o.direction,n=o.unit?o.unit:"character",r=!!o.treatEmojiAsSingleUnit,a=t.focus,c=new ns({boundaries:Kn(a,i),singleCharacters:!0,direction:i?"forward":"backward"}),l={walker:c,schema:s,isForward:i,unit:n,treatEmojiAsSingleUnit:r};let d;for(;d=c.next();){if(d.done)return;const o=Un(l,d.value);if(o)return void(t instanceof Ss?e.change((e=>{e.setSelectionFocus(o)})):t.setFocus(o))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change((e=>{const o=e.createDocumentFragment(),s=t.getFirstRange();if(!s||s.isCollapsed)return o;const i=s.start.root,n=s.start.getCommonPath(s.end),r=i.getNodeByPath(n);let a;a=s.start.parent==s.end.parent?s:e.createRange(e.createPositionAt(r,s.start.path[n.length]),e.createPositionAt(r,s.end.path[n.length]+1));const c=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),o):e.append(e.cloneElement(t,!0),o);if(a!=s){const t=s._getTransformedByMove(a.start,e.createPositionAt(o,0),c)[0],i=e.createRange(e.createPositionAt(o,0),t.start);Zn(e.createRange(t.end,e.createPositionAt(o,"end")),e),Zn(i,e)}return o}))}(this,e)}hasContent(e,t={}){const o=e instanceof ps?e:ps._createIn(e);if(o.isCollapsed)return!1;const{ignoreWhitespaces:s=!1,ignoreMarkers:i=!1}=t;if(!i)for(const e of this.markers.getMarkersIntersectingRange(o))if(e.affectsData)return!0;for(const e of o.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!s)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}createPositionFromPath(e,t,o){return new as(e,t,o)}createPositionAt(e,t){return as._createAt(e,t)}createPositionAfter(e){return as._createAfter(e)}createPositionBefore(e){return as._createBefore(e)}createRange(e,t){return new ps(e,t)}createRangeIn(e){return ps._createIn(e)}createRangeOn(e){return ps._createOn(e)}createSelection(...e){return new ks(...e)}createBatch(e){return new un(e)}createOperationFromJSON(e){return Ji.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new Cn(this,t);const o=this._pendingChanges[0].callback(this._currentWriter);e.push(o),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}class Xn extends Kt{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Qn extends Kt{constructor(e){super(e),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class er{constructor(e){this.document=e}createDocumentFragment(e){return new at(this.document,e)}createElement(e,t,o){return new Oe(this.document,e,t,o)}createText(e){return new y(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,o){return o._insertChild(e,t)}removeChildren(e,t,o){return o._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const o=e.parent;if(o){const s=o.getChildIndex(e);return this.removeChildren(s,1,o),this.insertChild(s,t,o),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const o=t.getChildIndex(e);this.remove(e),this.insertChild(o,e.getChildren(),t)}}rename(e,t){const o=new Oe(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,o)?o:null}setAttribute(e,t,o){o._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,o){(0,P.Z)(e)&&void 0===o?t._setStyle(e):o._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,o){o._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return De._createAt(e,t)}createPositionAfter(e){return De._createAfter(e)}createPositionBefore(e){return De._createBefore(e)}createRange(e,t){return new ze(e,t)}createRangeOn(e){return ze._createOn(e)}createRangeIn(e){return ze._createIn(e)}createSelection(...e){return new Le(...e)}}const tr=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,or=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,sr=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,ir=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,nr=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,rr=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","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function ar(e){return e.startsWith("#")?tr.test(e):e.startsWith("rgb")?or.test(e)||sr.test(e):e.startsWith("hsl")?ir.test(e)||nr.test(e):rr.has(e.toLowerCase())}const cr=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function lr(e){return cr.includes(e)}const dr=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function hr(e){return dr.test(e)}const ur=/^[+-]?[0-9]*([.][0-9]+)?%$/;function pr(e){return ur.test(e)}const fr=["repeat-x","repeat-y","repeat","space","round","no-repeat"];function gr(e){return fr.includes(e)}const mr=["center","top","bottom","left","right"];function br(e){return mr.includes(e)}const _r=["fixed","scroll","local"];function wr(e){return _r.includes(e)}const kr=/^url\(/;function vr(e){return kr.test(e)}function yr(e=""){if(""===e)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const t=Cr(e),o=t[0],s=t[2]||o,i=t[1]||o;return{top:o,bottom:s,right:i,left:t[3]||i}}function xr(e){return t=>{const{top:o,right:s,bottom:i,left:n}=t,r=[];return[o,s,n,i].every((e=>!!e))?r.push([e,Pr(t)]):(o&&r.push([e+"-top",o]),s&&r.push([e+"-right",s]),i&&r.push([e+"-bottom",i]),n&&r.push([e+"-left",n])),r}}function Pr({top:e,right:t,bottom:o,left:s}){const i=[];return s!==t?i.push(e,t,o,s):o!==e?i.push(e,t,o):t!==e?i.push(e,t):i.push(e),i.join(" ")}function Tr(e){return t=>({path:e,value:yr(t)})}function Cr(e){return e.replace(/, /g,",").split(" ").map((e=>e.replace(/,/g,", ")))}function Ar(e){e.setNormalizer("background",(e=>{const t={},o=Cr(e);for(const e of o)gr(e)?(t.repeat=t.repeat||[],t.repeat.push(e)):br(e)?(t.position=t.position||[],t.position.push(e)):wr(e)?t.attachment=e:ar(e)?t.color=e:vr(e)&&(t.image=e);return{path:"background",value:t}})),e.setNormalizer("background-color",(e=>({path:"background.color",value:e}))),e.setReducer("background",(e=>{const t=[];return t.push(["background-color",e.color]),t})),e.setStyleRelation("background",["background-color"])}function Er(e){e.setNormalizer("border",(e=>{const{color:t,style:o,width:s}=Vr(e);return{path:"border",value:{color:yr(t),style:yr(o),width:yr(s)}}})),e.setNormalizer("border-top",Sr("top")),e.setNormalizer("border-right",Sr("right")),e.setNormalizer("border-bottom",Sr("bottom")),e.setNormalizer("border-left",Sr("left")),e.setNormalizer("border-color",Or("color")),e.setNormalizer("border-width",Or("width")),e.setNormalizer("border-style",Or("style")),e.setNormalizer("border-top-color",Mr("color","top")),e.setNormalizer("border-top-style",Mr("style","top")),e.setNormalizer("border-top-width",Mr("width","top")),e.setNormalizer("border-right-color",Mr("color","right")),e.setNormalizer("border-right-style",Mr("style","right")),e.setNormalizer("border-right-width",Mr("width","right")),e.setNormalizer("border-bottom-color",Mr("color","bottom")),e.setNormalizer("border-bottom-style",Mr("style","bottom")),e.setNormalizer("border-bottom-width",Mr("width","bottom")),e.setNormalizer("border-left-color",Mr("color","left")),e.setNormalizer("border-left-style",Mr("style","left")),e.setNormalizer("border-left-width",Mr("width","left")),e.setExtractor("border-top",jr("top")),e.setExtractor("border-right",jr("right")),e.setExtractor("border-bottom",jr("bottom")),e.setExtractor("border-left",jr("left")),e.setExtractor("border-top-color","border.color.top"),e.setExtractor("border-right-color","border.color.right"),e.setExtractor("border-bottom-color","border.color.bottom"),e.setExtractor("border-left-color","border.color.left"),e.setExtractor("border-top-width","border.width.top"),e.setExtractor("border-right-width","border.width.right"),e.setExtractor("border-bottom-width","border.width.bottom"),e.setExtractor("border-left-width","border.width.left"),e.setExtractor("border-top-style","border.style.top"),e.setExtractor("border-right-style","border.style.right"),e.setExtractor("border-bottom-style","border.style.bottom"),e.setExtractor("border-left-style","border.style.left"),e.setReducer("border-color",xr("border-color")),e.setReducer("border-style",xr("border-style")),e.setReducer("border-width",xr("border-width")),e.setReducer("border-top",Nr("top")),e.setReducer("border-right",Nr("right")),e.setReducer("border-bottom",Nr("bottom")),e.setReducer("border-left",Nr("left")),e.setReducer("border",function(){return t=>{const o=Br(t,"top"),s=Br(t,"right"),i=Br(t,"bottom"),n=Br(t,"left"),r=[o,s,i,n],a={width:e(r,"width"),style:e(r,"style"),color:e(r,"color")},c=Ir(a,"all");if(c.length)return c;const l=Object.entries(a).reduce(((e,[t,o])=>(o&&(e.push([`border-${t}`,o]),r.forEach((e=>delete e[t]))),e)),[]);return[...l,...Ir(o,"top"),...Ir(s,"right"),...Ir(i,"bottom"),...Ir(n,"left")]};function e(e,t){return e.map((e=>e[t])).reduce(((e,t)=>e==t?e:null))}}()),e.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]),e.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]),e.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]),e.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]),e.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]),e.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function Sr(e){return t=>{const{color:o,style:s,width:i}=Vr(t),n={};return void 0!==o&&(n.color={[e]:o}),void 0!==s&&(n.style={[e]:s}),void 0!==i&&(n.width={[e]:i}),{path:"border",value:n}}}function Or(e){return t=>({path:"border",value:Rr(t,e)})}function Rr(e,t){return{[t]:yr(e)}}function Mr(e,t){return o=>({path:"border",value:{[e]:{[t]:o}}})}function jr(e){return(t,o)=>{if(o.border)return Br(o.border,e)}}function Br(e,t){const o={};return e.width&&e.width[t]&&(o.width=e.width[t]),e.style&&e.style[t]&&(o.style=e.style[t]),e.color&&e.color[t]&&(o.color=e.color[t]),o}function Vr(e){const t={},o=Cr(e);for(const e of o)hr(e)||/thin|medium|thick/.test(e)?t.width=e:lr(e)?t.style=e:t.color=e;return t}function Nr(e){return t=>Ir(t,e)}function Ir(e,t){const o=[];if(e&&e.width&&o.push("width"),e&&e.style&&o.push("style"),e&&e.color&&o.push("color"),3==o.length){const s=o.map((t=>e[t])).join(" ");return["all"==t?["border",s]:[`border-${t}`,s]]}return"all"==t?[]:o.map((o=>[`border-${t}-${o}`,e[o]]))}function Dr(e){e.setNormalizer("margin",Tr("margin")),e.setNormalizer("margin-top",(e=>({path:"margin.top",value:e}))),e.setNormalizer("margin-right",(e=>({path:"margin.right",value:e}))),e.setNormalizer("margin-bottom",(e=>({path:"margin.bottom",value:e}))),e.setNormalizer("margin-left",(e=>({path:"margin.left",value:e}))),e.setReducer("margin",xr("margin")),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function zr(e){e.setNormalizer("padding",Tr("padding")),e.setNormalizer("padding-top",(e=>({path:"padding.top",value:e}))),e.setNormalizer("padding-right",(e=>({path:"padding.right",value:e}))),e.setNormalizer("padding-bottom",(e=>({path:"padding.bottom",value:e}))),e.setNormalizer("padding-left",(e=>({path:"padding.left",value:e}))),e.setReducer("padding",xr("padding")),e.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}},"./packages/ckeditor5-enter/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{C:()=>d,G:()=>f});var s=o("./packages/ckeditor5-core/src/index.ts");function*i(e,t){for(const o of t)o&&e.getAttributeProperties(o[0]).copyOnEnter&&(yield o)}class n extends s.mY{execute(){this.editor.model.change((e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})}))}enterBlock(e){const t=this.editor.model,o=t.document.selection,s=t.schema,n=o.isCollapsed,a=o.getFirstRange(),c=a.start.parent,l=a.end.parent;if(s.isLimit(c)||s.isLimit(l))return n||c!=l||t.deleteContent(o),!1;if(n){const t=i(e.model.schema,o.getAttributes());return r(e,a.start),e.setSelectionAttribute(t),!0}{const s=!(a.start.isAtStart&&a.end.isAtEnd),i=c==l;if(t.deleteContent(o,{leaveUnmerged:s}),s){if(i)return r(e,o.focus),!0;e.setSelection(l,0)}}return!1}}function r(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}var a=o("./packages/ckeditor5-engine/src/index.ts");const c={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class l extends a.Qj{constructor(e){super(e);const t=this.document;t.on("beforeinput",((o,s)=>{if(!this.isEnabled)return;const i=s.domEvent,n=c[s.inputType];if(!n)return;const r=new a.r7(t,"enter",s.targetRanges[0]);t.fire(r,new a.dK(e,i,{isSoft:n.isSoft})),r.stop.called&&o.stop()}))}observe(){}}class d extends s.Sy{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,o=t.document;t.addObserver(l),e.commands.add("enter",new n(e)),this.listenTo(o,"enter",((s,i)=>{o.isComposing||i.preventDefault(),i.isSoft||(e.execute("enter"),t.scrollToTheSelection())}),{priority:"low"})}}class h extends s.mY{execute(){const e=this.editor.model,t=e.document;e.change((o=>{!function(e,t,o){const s=o.isCollapsed,n=o.getFirstRange(),r=n.start.parent,a=n.end.parent,c=r==a;if(s){const s=i(e.schema,o.getAttributes());u(e,t,n.end),t.removeSelectionAttribute(o.getAttributeKeys()),t.setSelectionAttribute(s)}else{const s=!(n.start.isAtStart&&n.end.isAtEnd);e.deleteContent(o,{leaveUnmerged:s}),c?u(e,t,o.focus):s&&t.setSelection(a,0)}}(e,o,t.selection),this.fire("afterExecute",{writer:o})}))}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const o=t.anchor;if(!o||!e.checkChild(o,"softBreak"))return!1;const s=t.getFirstRange(),i=s.start.parent,n=s.end.parent;if((p(i,e)||p(n,e))&&i!==n)return!1;return!0}(e.schema,t.selection)}}function u(e,t,o){const s=t.createElement("softBreak");e.insertContent(s,o),t.setSelection(s,"after")}function p(e,t){return!e.is("rootElement")&&(t.isLimit(e)||p(e.parent,t))}class f extends s.Sy{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,o=e.conversion,s=e.editing.view,i=s.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),o.for("upcast").elementToElement({model:"softBreak",view:"br"}),o.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),s.addObserver(l),e.commands.add("shiftEnter",new h(e)),this.listenTo(i,"enter",((t,o)=>{i.isComposing||o.preventDefault(),o.isSoft&&(e.execute("shiftEnter"),s.scrollToTheSelection())}),{priority:"low"})}}},"./packages/ckeditor5-typing/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{HG:()=>w,II:()=>d,cL:()=>V,uL:()=>y,mh:()=>x,Mq:()=>k,VD:()=>F,Up:()=>v,Im:()=>Z});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts");class n{constructor(e,t=20){this._batch=null,this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class r extends s.mY{constructor(e,t){super(e),this._buffer=new n(e.model,t)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,o=t.document,s=e.text||"",i=s.length;let n=o.selection;e.selection?n=e.selection:e.range&&(n=t.createSelection(e.range));const r=e.resultRange;t.enqueueChange(this._buffer.batch,(e=>{this._buffer.lock(),t.deleteContent(n),s&&t.insertContent(e.createText(s,o.selection.getAttributes()),n),r?e.setSelection(r):n.is("documentSelection")||e.setSelection(n),this._buffer.unlock(),this._buffer.input(i)}))}}var a=o("./packages/ckeditor5-engine/src/index.ts");const c=["insertText","insertReplacementText"];class l extends a.Qj{constructor(e){super(e),i.OB.isAndroid&&c.push("insertCompositionText");const t=e.document;t.on("beforeinput",((o,s)=>{if(!this.isEnabled)return;const{data:n,targetRanges:r,inputType:l,domEvent:d}=s;if(!c.includes(l))return;const h=new i.M3(t,"insertText");t.fire(h,new a.dK(e,d,{text:n,selection:e.createSelection(r)})),h.stop.called&&o.stop()})),t.on("compositionend",((o,{data:s,domEvent:n})=>{this.isEnabled&&!i.OB.isAndroid&&s&&t.fire("insertText",new a.dK(e,n,{text:s,selection:t.selection}))}),{priority:"lowest"})}observe(){}}class d extends s.Sy{static get pluginName(){return"Input"}init(){const e=this.editor,t=e.model,o=e.editing.view,s=t.document.selection;o.addObserver(l);const n=new r(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",n),e.commands.add("input",n),this.listenTo(o.document,"insertText",((s,n)=>{o.document.isComposing||n.preventDefault();const{text:r,selection:a,resultRange:c}=n,l=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t)));let d=r;if(i.OB.isAndroid){const e=Array.from(l[0].getItems()).reduce(((e,t)=>e+(t.is("$textProxy")?t.data:"")),"");e&&(e.length<=d.length?d.startsWith(e)&&(d=d.substring(e.length),l[0].start=l[0].start.getShiftedBy(e.length)):e.startsWith(d)&&(l[0].start=l[0].start.getShiftedBy(d.length),d=""))}const h={text:d,selection:t.createSelection(l)};c&&(h.resultRange=e.editing.mapper.toModelRange(c)),e.execute("insertText",h)})),i.OB.isAndroid?this.listenTo(o.document,"keydown",((e,i)=>{!s.isCollapsed&&229==i.keyCode&&o.document.isComposing&&h(t,n)})):this.listenTo(o.document,"compositionstart",(()=>{s.isCollapsed||h(t,n)}))}}function h(e,t){if(!t.isEnabled)return;const o=t.buffer;o.lock(),e.enqueueChange(o.batch,(()=>{e.deleteContent(e.document.selection)})),o.unlock()}class u extends s.mY{constructor(e,t){super(e),this.direction=t,this._buffer=new n(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,o=t.document;t.enqueueChange(this._buffer.batch,(s=>{this._buffer.lock();const n=s.createSelection(e.selection||o.selection),r=e.sequence||1,a=n.isCollapsed;if(n.isCollapsed&&t.modifySelection(n,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(r))return void this._replaceEntireContentWithParagraph(s);if(this._shouldReplaceFirstBlockWithParagraph(n,r))return void this.editor.execute("paragraph",{selection:n});if(n.isCollapsed)return;let c=0;n.getFirstRange().getMinimalFlatRanges().forEach((e=>{c+=(0,i.QX)(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),t.deleteContent(n,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(c),s.setSelection(n),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,o=t.document.selection,s=t.schema.getLimitElement(o);if(!(o.isCollapsed&&o.containsEntireContent(s)))return!1;if(!t.schema.checkChild(s,"paragraph"))return!1;const i=s.getChild(0);return!i||!i.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,o=t.document.selection,s=t.schema.getLimitElement(o),i=e.createElement("paragraph");e.remove(e.createRangeIn(s)),e.insert(i,s),e.setSelection(i,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const o=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const s=e.getFirstPosition(),i=o.schema.getLimitElement(s),n=i.getChild(0);return s.parent==n&&(!!e.containsEntireContent(n)&&(!!o.schema.checkChild(i,"paragraph")&&"paragraph"!=n.name))}}const p="word",f="selection",g="backward",m="forward",b={deleteContent:{unit:f,direction:g},deleteContentBackward:{unit:"codePoint",direction:g},deleteWordBackward:{unit:p,direction:g},deleteHardLineBackward:{unit:f,direction:g},deleteSoftLineBackward:{unit:f,direction:g},deleteContentForward:{unit:"character",direction:m},deleteWordForward:{unit:p,direction:m},deleteHardLineForward:{unit:f,direction:m},deleteSoftLineForward:{unit:f,direction:m}};class _ extends a.Qj{constructor(e){super(e);const t=e.document;let o=0;t.on("keydown",(()=>{o++})),t.on("keyup",(()=>{o=0})),t.on("beforeinput",((s,n)=>{if(!this.isEnabled)return;const{targetRanges:r,domEvent:c,inputType:l}=n,d=b[l];if(!d)return;const h={direction:d.direction,unit:d.unit,sequence:o};h.unit==f&&(h.selectionToRemove=e.createSelection(r[0])),i.OB.isAndroid&&"deleteContentBackward"===l&&(h.sequence=1,1!=r.length||r[0].start.parent==r[0].end.parent&&r[0].start.offset+1==r[0].end.offset||(h.unit=f,h.selectionToRemove=e.createSelection(r)));const u=new a.r7(t,"delete",r[0]);t.fire(u,new a.dK(e,c,h)),u.stop.called&&s.stop()})),i.OB.isBlink&&function(e){const t=e.view,o=t.document;let s=null,n=!1;function r(e){return e==i.Do.backspace||e==i.Do.delete}function c(e){return e==i.Do.backspace?g:m}o.on("keydown",((e,{keyCode:t})=>{s=t,n=!1})),o.on("keyup",((i,{keyCode:l,domEvent:d})=>{const h=o.selection,u=e.isEnabled&&l==s&&r(l)&&!h.isCollapsed&&!n;if(s=null,u){const e=h.getFirstRange(),s=new a.r7(o,"delete",e),i={unit:f,direction:c(l),selectionToRemove:h};o.fire(s,new a.dK(t,d,i))}})),o.on("beforeinput",((e,{inputType:t})=>{const o=b[t];r(s)&&o&&o.direction==c(s)&&(n=!0)}),{priority:"high"}),o.on("beforeinput",((e,{inputType:t,data:o})=>{s==i.Do.delete&&"insertText"==t&&""==o&&e.stop()}),{priority:"high"})}(this)}observe(){}}class w extends s.Sy{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,o=t.document,s=e.model.document;t.addObserver(_),this._undoOnBackspace=!1;const i=new u(e,"forward");e.commands.add("deleteForward",i),e.commands.add("forwardDelete",i),e.commands.add("delete",new u(e,"backward")),this.listenTo(o,"delete",((s,i)=>{o.isComposing||i.preventDefault();const{direction:n,sequence:r,selectionToRemove:a,unit:c}=i,l="forward"===n?"deleteForward":"delete",d={sequence:r};if("selection"==c){const t=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t)));d.selection=e.model.createSelection(t)}else d.unit=c;e.execute(l,d),t.scrollToTheSelection()}),{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(o,"delete",((t,o)=>{this._undoOnBackspace&&"backward"==o.direction&&1==o.sequence&&"codePoint"==o.unit&&(this._undoOnBackspace=!1,e.execute("undo"),o.preventDefault(),t.stop())}),{context:"$capture"}),this.listenTo(s,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class k extends s.Sy{static get requires(){return[d,w]}static get pluginName(){return"Typing"}}function v(e,t){let o=e.start;return{text:Array.from(e.getItems()).reduce(((e,s)=>s.is("$text")||s.is("$textProxy")?e+s.data:(o=t.createPositionAfter(s),"")),""),range:t.createRange(o,e.end)}}class y extends((0,i.Re)()){constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",(()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))})),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",((t,{directChange:o})=>{o&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))})),this.listenTo(e,"change:data",((e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})}))}_evaluateTextBeforeSelection(e,t={}){const o=this.model,s=o.document.selection,i=o.createRange(o.createPositionAt(s.focus.parent,0),s.focus),{text:n,range:r}=v(i,o),a=this.testCallback(n);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const o=Object.assign(t,{text:n,range:r});"object"==typeof a&&Object.assign(o,a),this.fire(`matched:${e}`,o)}}}class x extends s.Sy{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,o=e.editing.view,s=e.locale,n=t.document.selection;this.listenTo(o.document,"arrowKey",((e,t)=>{if(!n.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const o=t.keyCode==i.Do.arrowright,r=t.keyCode==i.Do.arrowleft;if(!o&&!r)return;const a=s.contentLanguageDirection;let c=!1;c="ltr"===a&&o||"rtl"===a&&r?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===c&&e.stop()}),{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(n,"change:range",((e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&A(n.getFirstPosition(),this.attributes)||this._restoreGravity())}))}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,o=this.editor.model.document.selection,s=o.getFirstPosition();return!this._isGravityOverridden&&((!s.isAtStart||!P(o,t))&&(!!A(s,t)&&(C(e),this._overrideGravity(),!0)))}_handleBackwardMovement(e){const t=this.attributes,o=this.editor.model,s=o.document.selection,i=s.getFirstPosition();return this._isGravityOverridden?(C(e),this._restoreGravity(),T(o,t,i),!0):i.isAtStart?!!P(s,t)&&(C(e),T(o,t,i),!0):!!function(e,t){const o=e.getShiftedBy(-1);return A(o,t)}(i,t)&&(i.isAtEnd&&!P(s,t)&&A(i,t)?(C(e),T(o,t,i),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}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 P(e,t){for(const o of t)if(e.hasAttribute(o))return!0;return!1}function T(e,t,o){const s=o.nodeBefore;e.change((e=>{s?e.setSelectionAttribute(s.getAttributes()):e.removeSelectionAttribute(t)}))}function C(e){e.preventDefault()}function A(e,t){const{nodeBefore:o,nodeAfter:s}=e;for(const e of t){const t=o?o.getAttribute(e):void 0;if((s?s.getAttribute(e):void 0)!==t)return!0}return!1}var E=o("./node_modules/lodash-es/toString.js"),S=/[\\^$.*+?()[\]{}|]/g,O=RegExp(S.source);const R=function(e){return(e=(0,E.Z)(e))&&O.test(e)?e.replace(S,"\\$&"):e},M={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:z('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:z("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:z("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:z('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:z('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:z("'"),to:[null,"‚",null,"’"]}},j={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},B=["symbols","mathematical","typography","quotes"];class V extends s.Sy{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}constructor(e){super(e),e.config.define("typing",{transformations:{include:B}})}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTransformationWatchers()}_enableTransformationWatchers(){const e=this.editor,t=e.model,o=e.plugins.get("Delete"),s=function(e){const t=e.extra||[],o=e.remove||[],s=e=>!o.includes(e);return function(e){const t=new Set;for(const o of e)if("string"==typeof o&&j[o])for(const e of j[o])t.add(e);else t.add(o);return Array.from(t)}(e.include.concat(t).filter(s)).filter(s).map((e=>"string"==typeof e&&M[e]?M[e]:e)).filter((e=>"object"==typeof e)).map((e=>({from:N(e.from),to:I(e.to)})))}(e.config.get("typing.transformations")),i=new y(e.model,(e=>{for(const t of s){if(t.from.test(e))return{normalizedTransformation:t}}}));i.on("matched:data",((e,s)=>{if(!s.batch.isTyping)return;const{from:i,to:n}=s.normalizedTransformation,r=i.exec(s.text),a=n(r.slice(1)),c=s.range;let l=r.index;t.enqueueChange((e=>{for(let o=1;o{o.requestUndoOnBackspace()}))}))})),i.bind("isEnabled").to(this)}}function N(e){return"string"==typeof e?new RegExp(`(${R(e)})$`):e}function I(e){return"string"==typeof e?()=>[e]:e instanceof Array?()=>e:e}function D(e){return(e.textNode?e.textNode:e.nodeAfter).getAttributes()}function z(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function F(e,t,o,s){return s.createRange(L(e,t,o,!0,s),L(e,t,o,!1,s))}function L(e,t,o,s,i){let n=e.textNode||(s?e.nodeBefore:e.nodeAfter),r=null;for(;n&&n.getAttribute(t)==o;)r=n,n=s?n.previousSibling:n.nextSibling;return r?i.createPositionAt(r,s?"before":"after"):e}function Z(e,t,o,s){const i=e.editing.view,n=new Set;i.document.registerPostFixer((i=>{const r=e.model.document.selection;let a=!1;if(r.hasAttribute(t)){const c=F(r.getFirstPosition(),t,r.getAttribute(t),e.model),l=e.editing.mapper.toViewRange(c);for(const e of l.getItems())e.is("element",o)&&!e.hasClass(s)&&(i.addClass(s,e),n.add(e),a=!0)}return a})),e.conversion.for("editingDowncast").add((e=>{function t(){i.change((e=>{for(const t of n.values())e.removeClass(s,t),n.delete(t)}))}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})}))}},"./packages/ckeditor5-ui/src/index.ts":(e,t,o)=>{"use strict";function s({emitter:e,activator:t,callback:o,contextElements:s}){e.listenTo(document,"mousedown",((e,i)=>{if(!t())return;const n="function"==typeof i.composedPath?i.composedPath():[],r="function"==typeof s?s():s;for(const e of r)if(e.contains(i.target)||n.includes(e))return;o()}))}function i(e){const t=e;t.set("_isCssTransitionsDisabled",!1),t.disableCssTransitions=()=>{t._isCssTransitionsDisabled=!0},t.enableCssTransitions=()=>{t._isCssTransitionsDisabled=!1},t.extendTemplate({attributes:{class:[t.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function n({view:e}){e.listenTo(e.element,"submit",((t,o)=>{o.preventDefault(),e.fire("submit")}),{useCapture:!0})}function r({keystrokeHandler:e,focusTracker:t,gridItems:o,numberOfColumns:s,uiLanguageDirection:i}){const n="number"==typeof s?()=>s:s;function r(e){return s=>{const i=o.find((e=>e.element===t.focusedElement)),n=o.getIndex(i),r=e(n,o);o.get(r).focus(),s.stopPropagation(),s.preventDefault()}}function a(e,t){return e===t-1?0:e+1}function c(e,t){return 0===e?t-1:e-1}e.set("arrowright",r(((e,t)=>"rtl"===i?c(e,t.length):a(e,t.length)))),e.set("arrowleft",r(((e,t)=>"rtl"===i?a(e,t.length):c(e,t.length)))),e.set("arrowup",r(((e,t)=>{let o=e-n();return o<0&&(o=e+n()*Math.floor(t.length/n()),o>t.length-1&&(o-=n())),o}))),e.set("arrowdown",r(((e,t)=>{let o=e+n();return o>t.length-1&&(o=e%n()),o})))}o.d(t,{no:()=>qe,Jf:()=>Wt,ee:()=>Jt,BK:()=>I,py:()=>lt,r5:()=>W,J6:()=>ee,_9:()=>J,_Y:()=>te,WB:()=>Vt,J0:()=>ae,_n:()=>ne,S8:()=>tt,fF:()=>nt,I0:()=>ue,Gp:()=>ft,mO:()=>F,VY:()=>kt,r1:()=>ht,Xs:()=>wt,pq:()=>_t,Em:()=>bt,Dn:()=>ct,KP:()=>xt,dn:()=>Se,Bv:()=>Ee,Hn:()=>St,P_:()=>At,Rm:()=>de,lp:()=>Lt,BM:()=>q,YS:()=>m,$y:()=>fe,jB:()=>ye,gE:()=>Qe,G7:()=>p,vX:()=>c,IJ:()=>r,Pm:()=>De,up:()=>Ne,eC:()=>s,t9:()=>Ve,FH:()=>Ct,sh:()=>Tt,R:()=>Pt,Mh:()=>Fe,k6:()=>U,fe:()=>i,S1:()=>K,jY:()=>G,iw:()=>me,GI:()=>n});var a=o("./packages/ckeditor5-utils/src/index.ts");class c extends a.FE{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",((e,t,o)=>{this._renderViewIntoCollectionParent(t,o)})),this.on("remove",((e,t)=>{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||!e.every((e=>"string"==typeof e)))throw new a.Bb("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const o of this)for(const s of e)o.delegate(s).to(t);this.on("add",((o,s)=>{for(const o of e)s.delegate(o).to(t)})),this.on("remove",((o,s)=>{for(const o of e)s.stopDelegating(o,t)}))}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}var l=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),d=o.n(l),h=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/globals/globals.css"),u={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(h.Z,u);h.Z.locals;class p extends((0,a.Xu)((0,a.Re)())){constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new a.FE,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((t,o)=>{o.locale=e,o.t=e&&e.t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=m.bind(this,this)}createCollection(e){const t=new c(e);return this._viewCollections.add(t),t}registerChild(e){(0,a.TW)(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){(0,a.TW)(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new m(e)}extendTemplate(e){m.extend(this.template,e)}render(){if(this.isRendered)throw new a.Bb("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((e=>e.destroy())),this.template&&this.template._revertData&&this.template.revert(this.element)}}var f=o("./node_modules/lodash-es/cloneDeepWith.js"),g=o("./node_modules/lodash-es/isObject.js");class m extends((0,a.ln)()){constructor(e){super(),Object.assign(this,C(T(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new a.Bb("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const o of t.children)M(o)?yield o:j(o)&&(yield*e(o))}(this)}static bind(e,t){return{to:(o,s)=>new _({eventNameOrFunction:o,attribute:o,observable:e,emitter:t,callback:s}),if:(o,s,i)=>new w({observable:e,emitter:t,attribute:o,valueIfTrue:s,callback:i})}}static extend(e,t){if(e._isRendered)throw new a.Bb("template-extend-render",[this,e]);O(e,C(T(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new a.Bb("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),k(this.text)?this._bindToObservable({schema:this.text,updater:y(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,o=e.revertData;for(const s in this.attributes){const i=t.getAttribute(s),n=this.attributes[s];o&&(o.attributes[s]=i);const r=V(n)?n[0].ns:null;if(k(n)){const a=V(n)?n[0].value:n;o&&N(s)&&a.unshift(i),this._bindToObservable({schema:a,updater:x(t,s,r),data:e})}else if("style"==s&&"string"!=typeof n[0])this._renderStyleAttribute(n[0],e);else{o&&i&&N(s)&&n.unshift(i);const e=n.map((e=>e&&e.value||e)).reduce(((e,t)=>e.concat(t)),[]).reduce(E,"");R(e)||t.setAttributeNS(r,s,e)}}}_renderStyleAttribute(e,t){const o=t.node;for(const s in e){const i=e[s];k(i)?this._bindToObservable({schema:[i],updater:P(o,s),data:t}):o.style[s]=i}}_renderElementChildren(e){const t=e.node,o=e.intoFragment?document.createDocumentFragment():t,s=e.isApplying;let i=0;for(const n of this.children)if(B(n)){if(!s){n.setParent(t);for(const e of n)o.appendChild(e.element)}}else if(M(n))s||(n.isRendered||n.render(),o.appendChild(n.element));else if((0,a.UG)(n))o.appendChild(n);else if(s){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),n._renderNode({intoFragment:!1,node:o.childNodes[i++],isApplying:!0,revertData:t})}else o.appendChild(n.render());e.intoFragment&&t.appendChild(o)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const o=this.eventListeners[t].map((o=>{const[s,i]=t.split("@");return o.activateDomEventListener(s,i,e)}));e.revertData&&e.revertData.bindings.push(o)}}_bindToObservable({schema:e,updater:t,data:o}){const s=o.revertData;v(e,t,o);const i=e.filter((e=>!R(e))).filter((e=>e.observable)).map((s=>s.activateAttributeListener(e,t,o)));s&&s.bindings.push(i)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)return void(e.textContent=t.text);const o=e;for(const e in t.attributes){const s=t.attributes[e];null===s?o.removeAttribute(e):o.setAttribute(e,s)}for(let e=0;ev(e,t,o);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,s),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,s)}}}class _ extends b{constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,o){const s=(e,o)=>{t&&!o.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(o):this.observable.fire(this.eventNameOrFunction,o))};return this.emitter.listenTo(o.node,e,s),()=>{this.emitter.stopListening(o.node,e,s)}}}class w extends b{constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!R(super.getValue(e))&&(this.valueIfTrue||!0)}}function k(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(k):e instanceof b)}function v(e,t,{node:o}){const s=function(e,t){return e.map((e=>e instanceof b?e.getValue(t):e))}(e,o);let i;i=1==e.length&&e[0]instanceof w?s[0]:s.reduce(E,""),R(i)?t.remove():t.set(i)}function y(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function x(e,t,o){return{set(s){e.setAttributeNS(o,t,s)},remove(){e.removeAttributeNS(o,t)}}}function P(e,t){return{set(o){e.style[t]=o},remove(){e.style[t]=null}}}function T(e){return(0,f.Z)(e,(e=>{if(e&&(e instanceof b||j(e)||M(e)||B(e)))return e}))}function C(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=(0,a.qo)(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)A(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=(0,a.qo)(e[t].value)),A(e,t)}(e.attributes);const t=[];if(e.children)if(B(e.children))t.push(e.children);else for(const o of e.children)j(o)||M(o)||(0,a.UG)(o)?t.push(o):t.push(new m(o));e.children=t}return e}function A(e,t){e[t]=(0,a.qo)(e[t])}function E(e,t){return R(t)?e:R(e)?t:`${e} ${t}`}function S(e,t){for(const o in t)e[o]?e[o].push(...t[o]):e[o]=t[o]}function O(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),S(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),S(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new a.Bb("ui-template-extend-children-mismatch",e);let o=0;for(const s of t.children)O(e.children[o++],s)}}function R(e){return!e&&0!==e}function M(e){return e instanceof p}function j(e){return e instanceof m}function B(e){return e instanceof c}function V(e){return(0,g.Z)(e[0])&&e[0].ns}function N(e){return"class"==e||"style"==e}class I extends c{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new m({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");e||(e=(0,a.az)(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}var D=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/icon/icon.css"),z={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(D.Z,z);D.Z.locals;class F extends p{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon","ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],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").querySelector("svg"),t=e.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:t,value:o}of Array.from(e.attributes))F.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,o);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((e=>{e.style.fill=this.fillColor}))}}F.presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];var L=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/button/button.css"),Z={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(L.Z,Z);L.Z.locals;class W extends p{constructor(e){super(e);const t=this.bindTemplate,o=(0,a.hQ)();this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._createLabelView(o),this.iconView=new F,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));const s={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||"button")),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${o}`,"aria-disabled":t.if("isEnabled",!0,(e=>!e)),"aria-pressed":t.to("isOn",(e=>!!this.isToggleable&&String(!!e))),"data-cke-tooltip-text":t.to("_tooltipString"),"data-cke-tooltip-position":t.to("tooltipPosition")},children:this.children,on:{click:t.to((e=>{this.isEnabled?this.fire("execute"):e.preventDefault()}))}};a.OB.isSafari&&(s.on.mousedown=t.to((e=>{this.focus(),e.preventDefault()}))),this.setTemplate(s)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createLabelView(e){const t=new p,o=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:o.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new p;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(e=>(0,a.XU)(e)))}]}),e}_getTooltipString(e,t,o){return e?"string"==typeof e?e:(o&&(o=(0,a.XU)(o)),e instanceof Function?e(t,o):`${t}${o?` (${o})`:""}`):""}}var H=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/button/switchbutton.css"),$={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(H.Z,$);H.Z.locals;class q extends W{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new p;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}function U(e,t){const o=e.t,s={Black:o("Black"),"Dim grey":o("Dim grey"),Grey:o("Grey"),"Light grey":o("Light grey"),White:o("White"),Red:o("Red"),Orange:o("Orange"),Yellow:o("Yellow"),"Light green":o("Light green"),Green:o("Green"),Aquamarine:o("Aquamarine"),Turquoise:o("Turquoise"),"Light blue":o("Light blue"),Blue:o("Blue"),Purple:o("Purple")};return t.map((e=>{const t=s[e.label];return t&&t!=e.label&&(e.label=t),e}))}function K(e){return e.map(G).filter((e=>!!e))}function G(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class J extends W{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon='',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 Y=o("./packages/ckeditor5-utils/src/keystrokehandler.ts"),X=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/colorgrid/colorgrid.css"),Q={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(X.Z,Q);X.Z.locals;class ee extends p{constructor(e,t){super(e);const o=t&&t.colorDefinitions||[];this.columns=t&&t.columns?t.columns:5;const s={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new a.Rh,this.keystrokes=new Y.Z,this.items.on("add",((e,t)=>{t.isOn=t.color===this.selectedColor})),o.forEach((e=>{const t=new J;t.set({color:e.color,label:e.label,tooltip:!0,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:s}}),this.on("change:selectedColor",((e,t,o)=>{for(const e of this.items)e.isOn=e.color===o}))}focus(){this.items.length&&this.items.first.focus()}focusLast(){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),r({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}class te{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(oe(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new a.Bb("componentfactory-item-missing",this,{name:e});return this._components.get(oe(e)).callback(this.editor.locale)}has(e){return this._components.has(oe(e))}}function oe(e){return String(e).toLowerCase()}var se=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/dropdown.css"),ie={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(se.Z,ie);se.Z.locals;class ne extends p{constructor(e,t,o){super(e);const s=this.bindTemplate;this.buttonView=t,this.panelView=o,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.keystrokes=new a.VD,this.focusTracker=new a.Rh,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",s.to("class"),s.if("isEnabled","ck-disabled",(e=>!e))],id:s.to("id"),"aria-describedby":s.to("ariaDescribedById")},children:[t,o]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":s.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",(()=>{this.isOpen=!this.isOpen})),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",((e,t,o)=>{o&&("auto"===this.panelPosition?this.panelView.position=ne._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)})),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",((e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())})),this.keystrokes.set("arrowright",((e,t)=>{this.isOpen&&t()})),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:o,southWest:s,northEast:i,northWest:n,southMiddleEast:r,southMiddleWest:a,northMiddleEast:c,northMiddleWest:l}=ne.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[o,s,r,a,e,i,n,c,l,t]:[s,o,a,r,e,n,i,l,c,t]}}ne.defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),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"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})},ne._getOptimalPosition=a.xZ;const re='';class ae extends W{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e)))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new F;return e.content=re,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}var ce=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/splitbutton.css"),le={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(ce.Z,le);ce.Z.locals;class de extends p{constructor(e){super(e);const t=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new a.VD,this.focusTracker=new a.Rh,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",t.to("class"),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)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())})),this.keystrokes.set("arrowleft",((e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(){const e=new W;return 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),e}_createArrowView(){const e=new W,t=e.bindTemplate;return e.icon=re,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}class he extends p{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",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){const e=this.children.first;"function"==typeof e.focus?e.focus():(0,a.KE)("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}class ue{constructor(e){if(this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let o=e.actions[t];"string"==typeof o&&(o=[o]);for(const s of o)e.keystrokeHandler.set(s,((e,o)=>{this[t](),o()}))}}get first(){return this.focusables.find(pe)||null}get last(){return this.focusables.filter(pe).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find(((t,o)=>{const s=t.element===this.focusTracker.focusedElement;return s&&(e=o),s})),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,o=this.focusables.length;if(!o)return null;if(null===t)return this[1===e?"first":"last"];let s=(t+o+e)%o;do{const t=this.focusables.get(s);if(pe(t))return t;s=(s+o+e)%o}while(s!==t);return null}}function pe(e){return!(!e.focus||!(0,a.pn)(e.element))}class fe extends p{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class ge extends p{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function me(e){return Array.isArray(e)?{items:e,removeItems:[]}:e?Object.assign({items:[],removeItems:[]},e):{items:[],removeItems:[]}}var be=o("./packages/ckeditor5-core/src/index.ts"),_e=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/toolbar/toolbar.css"),we={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(_e.Z,we);_e.Z.locals;const{threeVerticalDots:ke}=be.ci,ve={alignLeft:be.ci.alignLeft,bold:be.ci.bold,importExport:be.ci.importExport,paragraph:be.ci.paragraph,plus:be.ci.plus,text:be.ci.text,threeVerticalDots:be.ci.threeVerticalDots};class ye extends p{constructor(e,t){super(e);const o=this.bindTemplate,s=this.t;this.options=t||{},this.set("ariaLabel",s("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new a.Rh,this.keystrokes=new a.VD,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new xe(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const i="rtl"===e.uiLanguageDirection;this._focusCycler=new ue({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[i?"arrowright":"arrowleft","arrowup"],focusNext:[i?"arrowleft":"arrowright","arrowdown"]}});const n=["ck","ck-toolbar",o.to("class"),o.if("isCompact","ck-toolbar_compact")];var r;this.options.shouldGroupWhenFull&&this.options.isFloating&&n.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:n,role:"toolbar","aria-label":o.to("ariaLabel"),style:{maxWidth:o.to("maxWidth")}},children:this.children,on:{mousedown:(r=this,r.bindTemplate.to((e=>{e.target===r.element&&e.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new Te(this):new Pe(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(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,o){this.items.addMany(this._buildItemsFromConfig(e,t,o))}_buildItemsFromConfig(e,t,o){const s=me(e),i=o||s.removeItems;return this._cleanItemsConfiguration(s.items,t,i).map((e=>(0,g.Z)(e)?this._createNestedToolbarDropdown(e,t,i):"|"===e?new fe:"-"===e?new ge:t.create(e))).filter((e=>!!e))}_cleanItemsConfiguration(e,t,o){const s=e.filter(((e,s,i)=>"|"===e||-1===o.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||((0,a.KE)("toolbarview-line-break-ignored-when-grouping-items",i),!1):!(!(0,g.Z)(e)&&!t.has(e))||((0,a.KE)("toolbarview-item-unavailable",{item:e}),!1))));return this._cleanSeparatorsAndLineBreaks(s)}_cleanSeparatorsAndLineBreaks(e){const t=e=>"-"!==e&&"|"!==e,o=e.length,s=e.findIndex(t);if(-1===s)return[];const i=o-e.slice().reverse().findIndex(t);return e.slice(s,i).filter(((e,o,s)=>{if(t(e))return!0;return!(o>0&&s[o-1]===e)}))}_createNestedToolbarDropdown(e,t,o){let{label:s,icon:i,items:n,tooltip:r=!0,withText:c=!1}=e;if(n=this._cleanItemsConfiguration(n,t,o),!n.length)return null;const l=Ve(this.locale);return s||(0,a.KE)("toolbarview-nested-toolbar-dropdown-missing-label",e),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:s,tooltip:r,withText:!!c}),!1!==i?l.buttonView.icon=ve[i]||i||ke:l.buttonView.withText=!0,Ne(l,(()=>l.toolbarView._buildItemsFromConfig(n,t,o))),l}}class xe extends p{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Pe{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),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 Te{constructor(e){this.view=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=!1,e.itemsView.children.bindTo(this.ungroupedItems).using((e=>e)),this.ungroupedItems.on("change",this._updateFocusCycleableItems.bind(this)),e.children.on("change",this._updateFocusCycleableItems.bind(this)),e.items.on("change",((e,t)=>{const o=t.index,s=Array.from(t.added);for(const e of t.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=o;ethis.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,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(!(0,a.pn)(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,o=new a.UL(e.lastChild),s=new a.UL(e);if(!this.cachedPadding){const o=a.CO.window.getComputedStyle(e),s="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(o[s])}return"ltr"===t?o.right>s.right-this.cachedPadding:o.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)})),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new fe),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)),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,t=e.t,o=Ve(e);return o.class="ck-toolbar__grouped-dropdown",o.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",Ne(o,this.groupedItems),o.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:ke}),o}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((e=>{this.viewFocusables.add(e)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var Ce=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/list/list.css"),Ae={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Ce.Z,Ae);Ce.Z.locals;class Ee extends p{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new a.Rh,this.keystrokes=new a.VD,this._focusCycler=new ue({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],"aria-label":t.to("ariaLabel")},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)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Se extends p{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",(e=>!e))]},children:this.children})}focus(){this.children.first.focus()}}class Oe extends p{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var Re=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css"),Me={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Re.Z,Me);Re.Z.locals;var je=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/dropdown/listdropdown.css"),Be={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(je.Z,Be);je.Z.locals;function Ve(e,t=ae){const o=new t(e),i=new he(e),n=new ne(e,o,i);return o.bind("isEnabled").to(n),o instanceof de?o.arrowView.bind("isOn").to(n,"isOpen"):o.bind("isOn").to(n,"isOpen"),function(e){(function(e){e.on("render",(()=>{s({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})}))})(e),function(e){e.on("execute",(t=>{t.source instanceof q||(e.isOpen=!1)}))}(e),function(e){e.focusTracker.on("change:isFocused",((t,o,s)=>{e.isOpen&&!s&&(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",((t,o)=>{e.isOpen&&(e.panelView.focus(),o())})),e.keystrokes.set("arrowup",((t,o)=>{e.isOpen&&(e.panelView.focusLast(),o())}))}(e),function(e){e.on("change:isOpen",((t,o,s)=>{if(s)return;const i=e.panelView.element;i&&i.contains(a.CO.document.activeElement)&&e.buttonView.focus()}))}(e),function(e){e.on("change:isOpen",((t,o,s)=>{s&&e.panelView.focus()}),{priority:"low"})}(e)}(n),n}function Ne(e,t,o={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?Ie(e,t,o):e.once("change:isOpen",(()=>Ie(e,t,o)),{priority:"highest"}),o.enableActiveItemFocusOnDropdownOpen&&Fe(e,(()=>e.toolbarView.items.find((e=>e.isOn))))}function Ie(e,t,o){const s=e.locale,i=s.t,n=e.toolbarView=new ye(s),r="function"==typeof t?t():t;n.ariaLabel=o.ariaLabel||i("Dropdown toolbar"),o.maxWidth&&(n.maxWidth=o.maxWidth),o.class&&(n.class=o.class),o.isCompact&&(n.isCompact=o.isCompact),o.isVertical&&(n.isVertical=!0),r instanceof c?n.items.bindTo(r).using((e=>e)):n.items.addMany(r),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function De(e,t,o={}){e.isOpen?ze(e,t,o):e.once("change:isOpen",(()=>ze(e,t,o)),{priority:"highest"}),Fe(e,(()=>e.listView.items.find((e=>e instanceof Se&&e.children.first.isOn))))}function ze(e,t,o){const s=e.locale,i=e.listView=new Ee(s),n="function"==typeof t?t():t;i.ariaLabel=o.ariaLabel,i.items.bindTo(n).using((e=>{if("separator"===e.type)return new Oe(s);if("button"===e.type||"switchbutton"===e.type){const t=new Se(s);let o;return o="button"===e.type?new W(s):new q(s),o.bind(...Object.keys(e.model)).to(e.model),o.delegate("execute").to(t),t.children.add(o),t}return null})),e.panelView.children.add(i),i.items.delegate("execute").to(e)}function Fe(e,t){e.on("change:isOpen",(()=>{if(!e.isOpen)return;const o=t();o&&("function"==typeof o.focus?o.focus():(0,a.KE)("ui-dropdown-focus-child-on-open-child-missing-focus",{view:o}))}),{priority:a.tA.low-10})}var Le=o("./node_modules/lodash-es/isElement.js"),Ze=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/balloonpanel.css"),We={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Ze.Z,We);Ze.Z.locals;const He=(0,a.nn)("px"),$e=a.CO.document.body;class qe extends p{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,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",He),left:t.to("left",He)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=qe.defaultPositions,o=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,t.viewportStickyNorth],limiter:$e,fitInViewport:!0},e),s=qe._getOptimalPosition(o),i=parseInt(s.left),n=parseInt(s.top),r=s.name,a=s.config||{},{withArrow:c=!0}=a;this.top=n,this.left=i,this.position=r,this.withArrow=c}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=Ue(e.target),o=e.limiter?Ue(e.limiter):$e;this.listenTo(a.CO.document,"scroll",((s,i)=>{const n=i.target,r=t&&n.contains(t),a=o&&n.contains(o);!r&&!a&&t&&o||this.attachTo(e)}),{useCapture:!0}),this.listenTo(a.CO.window,"resize",(()=>{this.attachTo(e)}))}_stopPinning(){this.stopListening(a.CO.document,"scroll"),this.stopListening(a.CO.window,"resize")}}function Ue(e){return(0,Le.Z)(e)?e:(0,a.bR)(e)?e.commonAncestorContainer:"function"==typeof e?Ue(e()):null}function Ke(e={}){const{sideOffset:t=qe.arrowSideOffset,heightOffset:o=qe.arrowHeightOffset,stickyVerticalOffset:s=qe.stickyVerticalOffset,config:i}=e;return{northWestArrowSouthWest:(e,o)=>({top:n(e,o),left:e.left-t,name:"arrow_sw",...i&&{config:i}}),northWestArrowSouthMiddleWest:(e,o)=>({top:n(e,o),left:e.left-.25*o.width-t,name:"arrow_smw",...i&&{config:i}}),northWestArrowSouth:(e,t)=>({top:n(e,t),left:e.left-t.width/2,name:"arrow_s",...i&&{config:i}}),northWestArrowSouthMiddleEast:(e,o)=>({top:n(e,o),left:e.left-.75*o.width+t,name:"arrow_sme",...i&&{config:i}}),northWestArrowSouthEast:(e,o)=>({top:n(e,o),left:e.left-o.width+t,name:"arrow_se",...i&&{config:i}}),northArrowSouthWest:(e,o)=>({top:n(e,o),left:e.left+e.width/2-t,name:"arrow_sw",...i&&{config:i}}),northArrowSouthMiddleWest:(e,o)=>({top:n(e,o),left:e.left+e.width/2-.25*o.width-t,name:"arrow_smw",...i&&{config:i}}),northArrowSouth:(e,t)=>({top:n(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...i&&{config:i}}),northArrowSouthMiddleEast:(e,o)=>({top:n(e,o),left:e.left+e.width/2-.75*o.width+t,name:"arrow_sme",...i&&{config:i}}),northArrowSouthEast:(e,o)=>({top:n(e,o),left:e.left+e.width/2-o.width+t,name:"arrow_se",...i&&{config:i}}),northEastArrowSouthWest:(e,o)=>({top:n(e,o),left:e.right-t,name:"arrow_sw",...i&&{config:i}}),northEastArrowSouthMiddleWest:(e,o)=>({top:n(e,o),left:e.right-.25*o.width-t,name:"arrow_smw",...i&&{config:i}}),northEastArrowSouth:(e,t)=>({top:n(e,t),left:e.right-t.width/2,name:"arrow_s",...i&&{config:i}}),northEastArrowSouthMiddleEast:(e,o)=>({top:n(e,o),left:e.right-.75*o.width+t,name:"arrow_sme",...i&&{config:i}}),northEastArrowSouthEast:(e,o)=>({top:n(e,o),left:e.right-o.width+t,name:"arrow_se",...i&&{config:i}}),southWestArrowNorthWest:e=>({top:r(e),left:e.left-t,name:"arrow_nw",...i&&{config:i}}),southWestArrowNorthMiddleWest:(e,o)=>({top:r(e),left:e.left-.25*o.width-t,name:"arrow_nmw",...i&&{config:i}}),southWestArrowNorth:(e,t)=>({top:r(e),left:e.left-t.width/2,name:"arrow_n",...i&&{config:i}}),southWestArrowNorthMiddleEast:(e,o)=>({top:r(e),left:e.left-.75*o.width+t,name:"arrow_nme",...i&&{config:i}}),southWestArrowNorthEast:(e,o)=>({top:r(e),left:e.left-o.width+t,name:"arrow_ne",...i&&{config:i}}),southArrowNorthWest:e=>({top:r(e),left:e.left+e.width/2-t,name:"arrow_nw",...i&&{config:i}}),southArrowNorthMiddleWest:(e,o)=>({top:r(e),left:e.left+e.width/2-.25*o.width-t,name:"arrow_nmw",...i&&{config:i}}),southArrowNorth:(e,t)=>({top:r(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...i&&{config:i}}),southArrowNorthMiddleEast:(e,o)=>({top:r(e),left:e.left+e.width/2-.75*o.width+t,name:"arrow_nme",...i&&{config:i}}),southArrowNorthEast:(e,o)=>({top:r(e),left:e.left+e.width/2-o.width+t,name:"arrow_ne",...i&&{config:i}}),southEastArrowNorthWest:e=>({top:r(e),left:e.right-t,name:"arrow_nw",...i&&{config:i}}),southEastArrowNorthMiddleWest:(e,o)=>({top:r(e),left:e.right-.25*o.width-t,name:"arrow_nmw",...i&&{config:i}}),southEastArrowNorth:(e,t)=>({top:r(e),left:e.right-t.width/2,name:"arrow_n",...i&&{config:i}}),southEastArrowNorthMiddleEast:(e,o)=>({top:r(e),left:e.right-.75*o.width+t,name:"arrow_nme",...i&&{config:i}}),southEastArrowNorthEast:(e,o)=>({top:r(e),left:e.right-o.width+t,name:"arrow_ne",...i&&{config:i}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-o,name:"arrow_e",...i&&{config:i}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+o,name:"arrow_w",...i&&{config:i}}),viewportStickyNorth:(e,t,o)=>e.getIntersection(o)?{top:o.top+s,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...i}}:null};function n(e,t){return e.top-t.height-o}function r(e){return e.bottom+o}}qe.arrowSideOffset=25,qe.arrowHeightOffset=10,qe.stickyVerticalOffset=20,qe._getOptimalPosition=a.xZ,qe.defaultPositions=Ke();var Ge=o("./node_modules/lodash-es/debounce.js"),Je=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/tooltip/tooltip.css"),Ye={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Je.Z,Ye);Je.Z.locals;const Xe="ck-tooltip";class Qe extends((0,a.Xu)()){constructor(e){if(super(),Qe._editors.add(e),Qe._instance)return Qe._instance;Qe._instance=this,this.tooltipTextView=new p(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new qe(e.locale),this.balloonPanelView.class=Xe,this.balloonPanelView.content.add(this.tooltipTextView),this._resizeObserver=null,this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._pinTooltipDebounced=(0,Ge.Z)(this._pinTooltip,600),this.listenTo(a.CO.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(a.CO.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(a.CO.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(a.CO.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(a.CO.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;Qe._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),Qe._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),Qe._instance=null)}static getPositioningFunctions(e){const t=Qe.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onEnterOrFocus(e,{target:t}){const o=et(t);var s;o&&(o!==this._currentElementWithTooltip&&(this._unpinTooltip(),this._pinTooltipDebounced(o,{text:(s=o).dataset.ckeTooltipText,position:s.dataset.ckeTooltipPosition||"s",cssClass:s.dataset.ckeTooltipClass||""})))}_onLeaveOrBlur(e,{target:t,relatedTarget:o}){if("mouseleave"===e.name){if(!(0,Le.Z)(t))return;if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const e=et(t),s=et(o);e&&e!==s&&this._unpinTooltip()}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._unpinTooltip()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:o,cssClass:s}){const i=(0,a.Ps)(Qe._editors.values()).ui.view.body;i.has(this.balloonPanelView)||i.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.pin({target:e,positions:Qe.getPositioningFunctions(o)}),this._resizeObserver=new a.do(e,(()=>{(0,a.pn)(e)||this._unpinTooltip()})),this.balloonPanelView.class=[Xe,s].filter((e=>e)).join(" ");for(const e of Qe._editors)this.listenTo(e.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=o}_unpinTooltip(){this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of Qe._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver&&this._resizeObserver.destroy()}_updateTooltipPosition(){(0,a.pn)(this._currentElementWithTooltip)?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:Qe.getPositioningFunctions(this._currentTooltipPosition)}):this._unpinTooltip()}}function et(e){return(0,Le.Z)(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}Qe.defaultBalloonPositions=Ke({heightOffset:5,sideOffset:13}),Qe._editors=new Set,Qe._instance=null;class tt extends((0,a.Re)()){constructor(e){super(),this.editor=e,this.componentFactory=new te(e),this.focusTracker=new a.Rh,this.tooltipManager=new Qe(e),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.isReady=!1,this.once("ready",(()=>{this.isReady=!0})),this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this.listenTo(e.editing.view.document,"layoutChanged",(()=>this.update())),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor);for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const o=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?o():this.once("ready",o)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)):e.once("render",(()=>{this.focusTracker.add(e.element),this.editor.keystrokes.listenTo(e.element)})),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const o=e.config.get("toolbar.viewportTopOffset");return o?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:o}):{top:0}}_initFocusTracking(){const e=this.editor,t=e.editing.view;let o,s;e.keystrokes.set("Alt+F10",((e,i)=>{const n=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(n)&&!Array.from(t.domRoots.values()).includes(n)&&(o=n);const r=this._getCurrentFocusedToolbarDefinition();r&&s||(s=this._getFocusableCandidateToolbarDefinitions());for(let e=0;e{const i=this._getCurrentFocusedToolbarDefinition();i&&(o?(o.focus(),o=null):e.editing.view.focus(),i.options.afterBlur&&i.options.afterBlur(),s())}))}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:o,options:s}=t;((0,a.pn)(o.element)||s.beforeFocus)&&e.push(t)}return e.sort(((e,t)=>ot(e)-ot(t))),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:o}}=e;return o&&o(),!!(0,a.pn)(t.element)&&(t.focus(),!0)}}function ot(e){const{toolbarView:t,options:o}=e;let s=10;return(0,a.pn)(t.element)&&s--,o.isContextual&&s--,s}var st=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/editorui/editorui.css"),it={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(st.Z,it);st.Z.locals;class nt extends p{constructor(e){super(e),this.body=new I(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}var rt=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/label/label.css"),at={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(rt.Z,at);rt.Z.locals;class ct extends p{constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${(0,a.hQ)()}`;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 lt extends nt{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,t=new ct;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class dt extends p{constructor(e,t,o){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",!1),this._editableElement=o,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",(()=>this._updateIsFocusedClasses())),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change((o=>{const s=e.document.getRoot(t.name);o.addClass(t.isFocused?"ck-focused":"ck-blurred",s),o.removeClass(t.isFocused?"ck-blurred":"ck-focused",s)}))}e.isRenderingInProgress?function o(s){e.once("change:isRenderingInProgress",((e,i,n)=>{n?o(s):t(s)}))}(this):t(this)}}class ht extends dt{constructor(e,t,o,s={}){super(e,t,o);const i=e.t;this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}}),this._generateLabel=s.label||(()=>i("Editor editing area: %0",this.name))}render(){super.render();const e=this._editingView;e.change((t=>{const o=e.document.getRoot(this.name);t.setAttribute("aria-label",this._generateLabel(this),o)}))}}var ut=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/formheader/formheader.css"),pt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(ut.Z,pt);ut.Z.locals;class ft extends p{constructor(e,t={}){super(e);const o=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",o.to("class")]},children:this.children});const s=new p(e);s.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"]},children:[{text:o.to("label")}]}),this.children.add(s)}}var gt=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/input/input.css"),mt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(gt.Z,mt);gt.Z.locals;class bt extends p{constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.focusTracker=new a.Rh,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0),this.set("inputMode","text");const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),inputmode:t.to("inputMode"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to(((...e)=>{this.fire("input",...e),this._updateIsEmpty()})),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",((e,t,o)=>{this._setDomElementValue(o),this._updateIsEmpty()}))}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class _t extends bt{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class wt extends bt{constructor(e,{min:t,max:o,step:s}={}){super(e);const i=this.bindTemplate;this.set("min",t),this.set("max",o),this.set("step",s),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:i.to("min"),max:i.to("max"),step:i.to("step")}})}}class kt extends p{constructor(e){super(e);const t=this.bindTemplate;this.setTemplate({tag:"iframe",attributes:{class:["ck","ck-reset_all"],sandbox:"allow-same-origin allow-scripts"},on:{load:t.to("loaded")}})}render(){return new Promise((e=>(this.on("loaded",e),super.render())))}}var vt=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css"),yt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(vt.Z,yt);vt.Z.locals;class xt extends p{constructor(e,t){super(e);const o=`ck-labeled-field-view-${(0,a.hQ)()}`,s=`ck-labeled-field-view-status-${(0,a.hQ)()}`;this.fieldView=t(this,o,s),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(o),this.statusView=this._createStatusView(s),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),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)),i.if("isEmpty","ck-labeled-field-view_empty"),i.if("isFocused","ck-labeled-field-view_focused"),i.if("placeholder","ck-labeled-field-view_placeholder"),i.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new ct(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new p(this.locale),o=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",o.if("errorText","ck-labeled-field-view__status_error"),o.if("_statusText","ck-hidden",(e=>!e))],id:e,role:o.if("errorText","alert")},children:[{text:o.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function Pt(e,t,o){const s=new _t(e.locale);return s.set({id:t,ariaDescribedById:o}),s.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),s.bind("hasError").to(e,"errorText",(e=>!!e)),s.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(s),s}function Tt(e,t,o){const s=new wt(e.locale);return s.set({id:t,ariaDescribedById:o,inputMode:"numeric"}),s.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),s.bind("hasError").to(e,"errorText",(e=>!!e)),s.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(s),s}function Ct(e,t,o){const s=Ve(e.locale);return s.set({id:t,ariaDescribedById:o}),s.bind("isEnabled").to(e),s}class At extends be.eO{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=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}var Et=o("./node_modules/lodash-es/assignIn.js");class St extends((0,a.Re)()){constructor(e,t){super(),t&&(0,Et.Z)(this,t),e&&this.set(e)}}var Ot=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/balloonrotator.css"),Rt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Ot.Z,Rt);Ot.Z.locals;var Mt=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/fakepanel.css"),jt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Mt.Z,jt);Mt.Z.locals;const Bt=(0,a.nn)("px");class Vt extends be.Sy{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this._view=null,this._rotatorView=null,this._fakePanelsView=null,this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.set("visibleView",null),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=null,this._fakePanelsView=null}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new a.Bb("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const o=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),o.set(e.view,e),this._viewToStack.set(e.view,o),o===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new a.Bb("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){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 a.Bb("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new qe(this.editor.locale),this.editor.ui.view.body.add(this._view),this.editor.ui.focusTracker.add(this._view.element),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find((t=>t[1]===e))[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;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;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Nt(this.editor.locale),t=this.editor.locale.t;return 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,o)=>{if(o<2)return"";const s=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[s,o])})),e.buttonNextView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()})),e.buttonPrevView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()})),e}_createFakePanelsView(){const e=new It(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>=2?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),e}_showView({view:e,balloonClassName:t="",withArrow:o=!0,singleViewMode:s=!1}){this.view.class=t,this.view.withArrow=o,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),s&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}}class Nt extends p{constructor(e){super(e);const t=e.t,o=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new a.Rh,this.buttonPrevView=this._createButtonView(t("Previous"),''),this.buttonNextView=this._createButtonView(t("Next"),''),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",o.to("isNavigationVisible",(e=>e?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:o.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const o=new W(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o}}class It extends p{constructor(e,t){super(e);const o=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",o.to("numberOfPanels",(e=>e?"":"ck-hidden"))],style:{top:o.to("top",Bt),left:o.to("left",Bt),width:o.to("width",Bt),height:o.to("height",Bt)}},children:this.content}),this.on("change:numberOfPanels",((e,t,o,s)=>{o>s?this._addPanels(o-s):this._removePanels(s-o),this.updatePosition()}))}_addPanels(e){for(;e--;){const e=new p;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;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,{width:o,height:s}=new a.UL(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:o,height:s})}}}var Dt=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/panel/stickypanel.css"),zt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Dt.Z,zt);Dt.Z.locals;const Ft=(0,a.nn)("px");class Lt extends p{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new m({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",(e=>e?"block":"none")),height:t.to("isSticky",(e=>e?Ft(this._panelRect.height):null))}}}).render(),this._contentPanel=new m({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?Ft(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:t.to("_hasViewportTopOffset",(e=>e?Ft(this.viewportTopOffset):null)),bottom:t.to("_isStickyToTheLimiter",(e=>e?Ft(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(a.CO.window,"scroll",(()=>{this._checkIfShouldBeSticky()})),this.listenTo(this,"change:isActive",(()=>{this._checkIfShouldBeSticky()}))}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top{this.focusTracker.add(e.ui.getEditableElement()),this.focusTracker.add(this.toolbarView.element)})),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this.show(!0),afterBlur:()=>this.hide(),isContextual:!0}),this._resizeObserver=null,this._balloon=e.plugins.get(Vt),this._fireSelectionChangeDebounced=(0,Ge.Z)((()=>this.fire("_selectionChangeDebounced")),200),this.decorate("show")}init(){const e=this.editor,t=e.model.document.selection;this.listenTo(this.focusTracker,"change:isFocused",((e,t,o)=>{const s=this._balloon.visibleView===this.toolbarView;!o&&s?this.hide():o&&this.show()})),this.listenTo(t,"change:range",((e,o)=>{(o.directChange||t.isCollapsed)&&this.hide(),this._fireSelectionChangeDebounced()})),this.listenTo(this,"_selectionChangeDebounced",(()=>{this.editor.editing.view.document.isFocused&&this.show()})),this._balloonConfig.shouldNotGroupWhenFull||this.listenTo(e,"ready",(()=>{const t=e.ui.view.editable.element;this._resizeObserver=new a.do(t,(e=>{this.toolbarView.maxWidth=Zt(.9*e.contentRect.width)}))})),this.listenTo(this.toolbarView,"groupedItemsUpdate",(()=>{this._updatePosition()}))}afterInit(){const e=this.editor.ui.componentFactory;this.toolbarView.fillFromConfig(this._balloonConfig,e)}_createToolbarView(){const e=this.editor.locale.t,t=!this._balloonConfig.shouldNotGroupWhenFull,o=new ye(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return o.ariaLabel=e("Editor contextual toolbar"),o.render(),o}show(e=!1){const t=this.editor,o=t.model.document.selection,s=t.model.schema;this._balloon.hasView(this.toolbarView)||o.isCollapsed&&!e||function(e,t){if(1===e.rangeCount)return!1;return[...e.getRanges()].every((e=>{const o=e.getContainedElement();return o&&t.isSelectable(o)}))}(o,s)||Array.from(this.toolbarView.items).every((e=>void 0!==e.isEnabled&&!e.isEnabled))||(this.listenTo(this.editor.ui,"update",(()=>{this._updatePosition()})),this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"}))}hide(){this._balloon.hasView(this.toolbarView)&&(this.stopListening(this.editor.ui,"update"),this._balloon.remove(this.toolbarView))}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document,o=t.selection,s=t.selection.isBackward;return{target:()=>{const t=s?o.getFirstRange():o.getLastRange(),i=a.UL.getDomRangeRects(e.domConverter.viewRangeToDom(t));return s?i[0]:(i.length>1&&0===i[i.length-1].width&&i.pop(),i[i.length-1])},positions:this._getBalloonPositions(s)}}_updatePosition(){this._balloon.updatePosition(this._getBalloonPositionData())}destroy(){super.destroy(),this.stopListening(),this._fireSelectionChangeDebounced.cancel(),this.toolbarView.destroy(),this.focusTracker.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getBalloonPositions(e){const t=a.OB.isSafari&&a.OB.isiOS?Ke({heightOffset:Math.max(qe.arrowHeightOffset,Math.round(20/a.CO.window.visualViewport.scale))}):qe.defaultPositions;return e?[t.northWestArrowSouth,t.northWestArrowSouthWest,t.northWestArrowSouthEast,t.northWestArrowSouthMiddleEast,t.northWestArrowSouthMiddleWest,t.southWestArrowNorth,t.southWestArrowNorthWest,t.southWestArrowNorthEast,t.southWestArrowNorthMiddleWest,t.southWestArrowNorthMiddleEast]:[t.southEastArrowNorth,t.southEastArrowNorthEast,t.southEastArrowNorthWest,t.southEastArrowNorthMiddleEast,t.southEastArrowNorthMiddleWest,t.northEastArrowSouth,t.northEastArrowSouthEast,t.northEastArrowSouthWest,t.northEastArrowSouthMiddleEast,t.northEastArrowSouthMiddleWest]}}var Ht=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css"),$t={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};d()(Ht.Z,$t);Ht.Z.locals;const qt=(0,a.nn)("px");class Ut extends W{constructor(e){super(e);const t=this.bindTemplate;this.isVisible=!1,this.isToggleable=!0,this.set("top",0),this.set("left",0),this.extendTemplate({attributes:{class:"ck-block-toolbar-button",style:{top:t.to("top",(e=>qt(e))),left:t.to("left",(e=>qt(e)))}}})}}const Kt=(0,a.nn)("px"),{pilcrow:Gt}=be.ci;class Jt extends be.Sy{static get pluginName(){return"BlockToolbar"}constructor(e){super(e),this._blockToolbarConfig=me(this.editor.config.get("blockToolbar")),this.toolbarView=this._createToolbarView(),this.panelView=this._createPanelView(),this.buttonView=this._createButtonView(),this._resizeObserver=null,s({emitter:this.panelView,contextElements:[this.panelView.element,this.buttonView.element],activator:()=>this.panelView.isVisible,callback:()=>this._hidePanel()})}init(){const e=this.editor;this.listenTo(e.model.document.selection,"change:range",((e,t)=>{t.directChange&&this._hidePanel()})),this.listenTo(e.ui,"update",(()=>this._updateButton())),this.listenTo(e,"change:isReadOnly",(()=>this._updateButton()),{priority:"low"}),this.listenTo(e.ui.focusTracker,"change:isFocused",(()=>this._updateButton())),this.listenTo(this.buttonView,"change:isVisible",((e,t,o)=>{o?this.buttonView.listenTo(window,"resize",(()=>this._updateButton())):(this.buttonView.stopListening(window,"resize"),this._hidePanel())})),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this._showPanel(),afterBlur:()=>this._hidePanel()})}afterInit(){const e=this.editor.ui.componentFactory,t=this._blockToolbarConfig;this.toolbarView.fillFromConfig(t,e);for(const e of this.toolbarView.items)e.on("execute",(()=>this._hidePanel(!0)),{priority:"high"});t.shouldNotGroupWhenFull||this.listenTo(this.editor,"ready",(()=>{const e=this.editor.ui.view.editable.element;this._resizeObserver=new a.do(e,(()=>{this.toolbarView.maxWidth=this._getToolbarMaxWidth()}))}))}destroy(){super.destroy(),this.panelView.destroy(),this.buttonView.destroy(),this.toolbarView.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_createToolbarView(){const e=this.editor.locale.t,t=!this._blockToolbarConfig.shouldNotGroupWhenFull,o=new ye(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return o.ariaLabel=e("Editor block content toolbar"),o.focusTracker.on("change:isFocused",((e,t,o)=>{o||this._hidePanel()})),o}_createPanelView(){const e=this.editor,t=new qe(e.locale);return t.content.add(this.toolbarView),t.class="ck-toolbar-container",e.ui.view.body.add(t),e.ui.focusTracker.add(t.element),this.toolbarView.keystrokes.set("Esc",((e,t)=>{this._hidePanel(!0),t()})),t}_createButtonView(){const e=this.editor,t=e.t,o=new Ut(e.locale),s=o.bindTemplate;return o.set({label:t("Edit block"),icon:Gt,withText:!1}),o.extendTemplate({on:{mousedown:s.to((e=>{a.OB.isSafari&&this.panelView.isVisible&&this.toolbarView.focus(),e.preventDefault()}))}}),o.bind("isOn").to(this.panelView,"isVisible"),o.bind("tooltip").to(this.panelView,"isVisible",(e=>!e)),this.listenTo(o,"execute",(()=>{this.panelView.isVisible?this._hidePanel(!0):this._showPanel()})),e.ui.view.body.add(o),e.ui.focusTracker.add(o.element),o}_updateButton(){const e=this.editor,t=e.model,o=e.editing.view;if(!e.ui.focusTracker.isFocused)return void this._hideButton();if(e.isReadOnly)return void this._hideButton();const s=Array.from(t.document.selection.getSelectedBlocks())[0];if(!s||Array.from(this.toolbarView.items).every((e=>!e.isEnabled)))return void this._hideButton();const i=o.domConverter.mapViewToDom(e.editing.mapper.toViewElement(s));this.buttonView.isVisible=!0,this._attachButtonToElement(i),this.panelView.isVisible&&this._showPanel()}_hideButton(){this.buttonView.isVisible=!1}_showPanel(){if(!this.buttonView.isVisible)return;const e=this.panelView.isVisible;this.panelView.show(),this.toolbarView.maxWidth=this._getToolbarMaxWidth(),this.panelView.pin({target:this.buttonView.element,limiter:this.editor.ui.getEditableElement()}),e||this.toolbarView.items.get(0).focus()}_hidePanel(e){this.panelView.isVisible=!1,e&&this.editor.editing.view.focus()}_attachButtonToElement(e){const t=window.getComputedStyle(e),o=new a.UL(this.editor.ui.getEditableElement()),s=parseInt(t.paddingTop,10),i=parseInt(t.lineHeight,10)||1.2*parseInt(t.fontSize,10),n=(0,a.xZ)({element:this.buttonView.element,target:e,positions:[(e,t)=>{let n;return n="ltr"===this.editor.locale.uiLanguageDirection?o.left-t.width:o.right,{top:e.top+s+(i-t.height)/2,left:n}}]});this.buttonView.top=n.top,this.buttonView.left=n.left}_getToolbarMaxWidth(){const e=this.editor.ui.view.editable.element,t=new a.UL(e),o=new a.UL(this.buttonView.element),s="rtl"===this.editor.locale.uiLanguageDirection?o.left-t.right+o.width:t.left-o.left;return Kt(t.width+s)}}},"./packages/ckeditor5-utils/src/ckeditorerror.ts":(e,t,o)=>{"use strict";o.d(t,{H:()=>r,KE:()=>n,ZP:()=>i});const s="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";class i extends Error{constructor(e,t,o){super(function(e,t){const o=new WeakSet,s=(e,t)=>{if("object"==typeof t&&null!==t){if(o.has(t))return`[object ${t.constructor.name}]`;o.add(t)}return t},i=t?` ${JSON.stringify(t,s)}`:"",n=a(e);return e+i+n}(e,o)),this.name="CKEditorError",this.context=t,this.data=o}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const o=new i(e.message,t);throw o.stack=e.stack,o}}function n(e,t){console.warn(...c(e,t))}function r(e,t){console.error(...c(e,t))}function a(e){return`\nRead more: ${s}#error-${e}`}function c(e,t){const o=a(e);return t?[e,t,o]:[e,o]}},"./packages/ckeditor5-utils/src/dom/emittermixin.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>c});var s=o("./packages/ckeditor5-utils/src/emittermixin.ts"),i=o("./packages/ckeditor5-utils/src/uid.ts"),n=o("./packages/ckeditor5-utils/src/dom/isnode.ts"),r=o("./packages/ckeditor5-utils/src/dom/iswindow.ts");const a=c((0,s.ZP)());function c(e){if(!e)return a;return class extends e{listenTo(e,t,o,s={}){if((0,n.Z)(e)||(0,r.Z)(e)){const i={capture:!!s.useCapture,passive:!!s.usePassive},n=this._getProxyEmitter(e,i)||new l(e,i);this.listenTo(n,t,o,s)}else super.listenTo(e,t,o,s)}stopListening(e,t,o){if((0,n.Z)(e)||(0,r.Z)(e)){const s=this._getAllProxyEmitters(e);for(const e of s)this.stopListening(e,t,o)}else super.stopListening(e,t,o)}_getProxyEmitter(e,t){return(0,s.Rl)(this,d(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map((t=>this._getProxyEmitter(e,t))).filter((e=>!!e))}}}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{c[e]=a.prototype[e]}));class l extends((0,s.ZP)()){constructor(e,t){super(),(0,s.Hv)(this,d(e,t)),this._domNode=e,this._options=t}attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,o){this.attach(e),(0,s.ZP)().prototype._addEventListener.call(this,e,t,o)}_removeEventListener(e,t){(0,s.ZP)().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function d(e,t){let o=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=(0,i.Z)())}(e);for(const e of Object.keys(t).sort())t[e]&&(o+="-"+e);return o}},"./packages/ckeditor5-utils/src/dom/isnode.ts":(e,t,o)=>{"use strict";function s(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}o.d(t,{Z:()=>s})},"./packages/ckeditor5-utils/src/dom/iswindow.ts":(e,t,o)=>{"use strict";function s(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}o.d(t,{Z:()=>s})},"./packages/ckeditor5-utils/src/emittermixin.ts":(e,t,o)=>{"use strict";o.d(t,{Hv:()=>f,Rl:()=>p,ZP:()=>u});var s=o("./packages/ckeditor5-utils/src/eventinfo.ts"),i=o("./packages/ckeditor5-utils/src/uid.ts"),n=o("./packages/ckeditor5-utils/src/priorities.ts"),r=o("./packages/ckeditor5-utils/src/inserttopriorityarray.ts"),a=(o("./packages/ckeditor5-utils/src/version.ts"),o("./packages/ckeditor5-utils/src/ckeditorerror.ts"));const c=Symbol("listeningTo"),l=Symbol("emitterId"),d=Symbol("delegations"),h=u(Object);function u(e){if(!e)return h;return class extends e{on(e,t,o){this.listenTo(this,e,t,o)}once(e,t,o){let s=!1;this.listenTo(this,e,((e,...o)=>{s||(s=!0,e.off(),t.call(this,e,...o))}),o)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,o,s={}){let i,n;this[c]||(this[c]={});const r=this[c];g(e)||f(e);const a=g(e);(i=r[a])||(i=r[a]={emitter:e,callbacks:{}}),(n=i.callbacks[t])||(n=i.callbacks[t]=[]),n.push(o),function(e,t,o,s,i){t._addEventListener?t._addEventListener(o,s,i):e._addEventListener.call(t,o,s,i)}(this,e,t,o,s)}stopListening(e,t,o){const s=this[c];let i=e&&g(e);const n=s&&i?s[i]:void 0,r=n&&t?n.callbacks[t]:void 0;if(!(!s||e&&!n||t&&!r))if(o){k(this,e,t,o);-1!==r.indexOf(o)&&(1===r.length?delete n.callbacks[t]:k(this,e,t,o))}else if(r){for(;o=r.pop();)k(this,e,t,o);delete n.callbacks[t]}else if(n){for(t in n.callbacks)this.stopListening(e,t);delete s[i]}else{for(i in s)this.stopListening(s[i].emitter);delete this[c]}}fire(e,...t){try{const o=e instanceof s.Z?e:new s.Z(this,e),i=o.name;let n=_(this,i);if(o.path.push(this),n){const e=[o,...t];n=Array.from(n);for(let t=0;t{this[d]||(this[d]=new Map),e.forEach((e=>{const s=this[d].get(e);s?s.set(t,o):this[d].set(e,new Map([[t,o]]))}))}}}stopDelegating(e,t){if(this[d])if(e)if(t){const o=this[d].get(e);o&&o.delete(t)}else this[d].delete(e);else this[d].clear()}_addEventListener(e,t,o){!function(e,t){const o=m(e);if(o[t])return;let s=t,i=null;const n=[];for(;""!==s&&!o[s];)o[s]={callbacks:[],childEvents:[]},n.push(o[s]),i&&o[s].childEvents.push(i),i=s,s=s.substr(0,s.lastIndexOf(":"));if(""!==s){for(const e of n)e.callbacks=o[s].callbacks.slice();o[s].childEvents.push(i)}}(this,e);const s=b(this,e),i={callback:t,priority:n.Z.get(o.priority)};for(const e of s)(0,r.Z)(e,i)}_removeEventListener(e,t){const o=b(this,e);for(const e of o)for(let o=0;o-1?_(e,t.substr(0,t.lastIndexOf(":"))):null}function w(e,t,o){for(let[i,n]of e){n?"function"==typeof n&&(n=n(t.name)):n=t.name;const e=new s.Z(t.source,n);e.path=[...t.path],i.fire(e,...o)}}function k(e,t,o,s){t._removeEventListener?t._removeEventListener(o,s):e._removeEventListener.call(t,o,s)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{u[e]=h.prototype[e]}))},"./packages/ckeditor5-utils/src/env.ts":(e,t,o)=>{"use strict";o.d(t,{ZP:()=>n});const s=function(){try{return navigator.userAgent.toLowerCase()}catch(e){return""}}(),i={isMac:r(s),isWindows:function(e){return e.indexOf("windows")>-1}(s),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(s),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(s),isiOS:function(e){return!!e.match(/iphone|ipad/i)||r(e)&&navigator.maxTouchPoints>0}(s),isAndroid:function(e){return e.indexOf("android")>-1}(s),isBlink:function(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}(s),features:{isRegExpUnicodePropertySupported:function(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}()}},n=i;function r(e){return e.indexOf("macintosh")>-1}},"./packages/ckeditor5-utils/src/eventinfo.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});const s=function(){return function e(){e.called=!0}};class i{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=s(),this.off=s()}}},"./packages/ckeditor5-utils/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{Bb:()=>h.ZP,FE:()=>je,De:()=>D,Xu:()=>L.Z,a6:()=>T,ln:()=>l.ZP,M3:()=>d.Z,Rh:()=>Ve,VD:()=>Ne.Z,go:()=>Re,Re:()=>w,UL:()=>X,do:()=>oe,Rt:()=>A,QX:()=>C,az:()=>B,Hg:()=>a,OB:()=>s.ZP,HZ:()=>i,wm:()=>Z,Ps:()=>Be,dk:()=>$,Cq:()=>Ce.Cq,yy:()=>q,XU:()=>Ce.XU,j9:()=>Ee,mA:()=>Ce.mA,xZ:()=>he,CO:()=>H,cq:()=>ne,ZQ:()=>re,VG:()=>ze.Z,dj:()=>Ce.dj,tO:()=>Ze,C3:()=>ae,Zt:()=>Ce.Zt,Cb:()=>We,pp:()=>qe,YK:()=>Ke,to:()=>$e,TW:()=>E,nA:()=>He,UG:()=>ce.Z,bR:()=>K,Gs:()=>U,pn:()=>le,Do:()=>Ce.Do,H:()=>h.H,KE:()=>h.KE,CD:()=>c,Zz:()=>Ce.Zz,tA:()=>De.Z,Od:()=>fe,F0:()=>me,mR:()=>ge,jS:()=>se,x:()=>Le,qo:()=>Se,qL:()=>Ie,nn:()=>ie,hQ:()=>Me.Z,i8:()=>Ge.Z});var s=o("./packages/ckeditor5-utils/src/env.ts");function i(e,t,o,s){o=o||function(e,t){return e===t};const i=Array.isArray(e)?e:Array.prototype.slice.call(e),a=Array.isArray(t)?t:Array.prototype.slice.call(t),c=function(e,t,o){const s=n(e,t,o);if(-1===s)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const i=r(e,s),a=r(t,s),c=n(i,a,o),l=e.length-c,d=t.length-c;return{firstIndex:s,lastIndexOld:l,lastIndexNew:d}}(i,a,o),l=s?function(e,t){const{firstIndex:o,lastIndexOld:s,lastIndexNew:i}=e;if(-1===o)return Array(t).fill("equal");let n=[];o>0&&(n=n.concat(Array(o).fill("equal")));i-o>0&&(n=n.concat(Array(i-o).fill("insert")));s-o>0&&(n=n.concat(Array(s-o).fill("delete")));i0&&o.push({index:s,type:"insert",values:e.slice(s,n)});i-s>0&&o.push({index:s+(n-s),type:"delete",howMany:i-s});return o}(a,c);return l}function n(e,t,o){for(let s=0;s200||i>200||s+i>300)return a.fastDiff(e,t,o,!0);let n,r;if(ia?-1:1;h[s+d]&&(h[s]=h[s+d].slice(0)),h[s]||(h[s]=[]),h[s].push(i>a?n:r);let p=Math.max(i,a),f=p-s;for(;fd;f--)u[f]=p(f);u[d]=p(d),g++}while(u[d]!==l);return h[d].slice(1)}function c(e,...t){t.forEach((t=>{const o=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);o.concat(s).forEach((o=>{if(o in e.prototype)return;if("function"==typeof t&&("length"==o||"name"==o||"prototype"==o))return;const s=Object.getOwnPropertyDescriptor(t,o);s.enumerable=!1,Object.defineProperty(e.prototype,o,s)}))}))}a.fastDiff=i;var l=o("./packages/ckeditor5-utils/src/emittermixin.ts"),d=o("./packages/ckeditor5-utils/src/eventinfo.ts"),h=o("./packages/ckeditor5-utils/src/ckeditorerror.ts"),u=o("./node_modules/lodash-es/isObject.js");const p=Symbol("observableProperties"),f=Symbol("boundObservables"),g=Symbol("boundProperties"),m=Symbol("decoratedMethods"),b=Symbol("decoratedOriginal"),_=w((0,l.ZP)());function w(e){if(!e)return _;return class extends e{set(e,t){if((0,u.Z)(e))return void Object.keys(e).forEach((t=>{this.set(t,e[t])}),this);k(this);const o=this[p];if(e in this&&!o.has(e))throw new h.ZP("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>o.get(e),set(t){const s=o.get(e);let i=this.fire(`set:${e}`,e,t,s);void 0===i&&(i=t),s===i&&o.has(e)||(o.set(e,i),this.fire(`change:${e}`,e,i,s))}}),this[e]=t}bind(...e){if(!e.length||!x(e))throw new h.ZP("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new h.ZP("observable-bind-duplicate-properties",this);k(this);const t=this[g];e.forEach((e=>{if(t.has(e))throw new h.ZP("observable-bind-rebind",this)}));const o=new Map;return e.forEach((e=>{const s={property:e,to:[]};t.set(e,s),o.set(e,s)})),{to:v,toMany:y,_observable:this,_bindProperties:e,_to:[],_bindings:o}}unbind(...e){if(!this[p])return;const t=this[g],o=this[f];if(e.length){if(!x(e))throw new h.ZP("observable-unbind-wrong-properties",this);e.forEach((e=>{const s=t.get(e);s&&(s.to.forEach((([e,t])=>{const i=o.get(e),n=i[t];n.delete(s),n.size||delete i[t],Object.keys(i).length||(o.delete(e),this.stopListening(e,"change"))})),t.delete(e))}))}else o.forEach(((e,t)=>{this.stopListening(t,"change")})),o.clear(),t.clear()}decorate(e){k(this);const t=this[e];if(!t)throw new h.ZP("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,((e,o)=>{e.return=t.apply(this,o)})),this[e]=function(...t){return this.fire(e,t)},this[e][b]=t,this[m]||(this[m]=[]),this[m].push(e)}stopListening(e,t,o){if(!e&&this[m]){for(const e of this[m])this[e]=this[e][b];delete this[m]}super.stopListening(e,t,o)}}}function k(e){e[p]||(Object.defineProperty(e,p,{value:new Map}),Object.defineProperty(e,f,{value:new Map}),Object.defineProperty(e,g,{value:new Map}))}function v(...e){const t=function(...e){if(!e.length)throw new h.ZP("observable-bind-to-parse-error",null);const t={to:[]};let o;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach((e=>{if("string"==typeof e)o.properties.push(e);else{if("object"!=typeof e)throw new h.ZP("observable-bind-to-parse-error",null);o={observable:e,properties:[]},t.to.push(o)}})),t}(...e),o=Array.from(this._bindings.keys()),s=o.length;if(!t.callback&&t.to.length>1)throw new h.ZP("observable-bind-to-no-callback",this);if(s>1&&t.callback)throw new h.ZP("observable-bind-to-extra-callback",this);var i;t.to.forEach((e=>{if(e.properties.length&&e.properties.length!==s)throw new h.ZP("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(o[0]).callback=t.callback),i=this._observable,this._to.forEach((e=>{const t=i[f];let o;t.get(e.observable)||i.listenTo(e.observable,"change",((s,n)=>{o=t.get(e.observable)[n],o&&o.forEach((e=>{P(i,e.property)}))}))})),function(e){let t;e._bindings.forEach(((o,s)=>{e._to.forEach((i=>{t=i.properties[o.callback?0:e._bindProperties.indexOf(s)],o.to.push([i.observable,t]),function(e,t,o,s){const i=e[f],n=i.get(o),r=n||{};r[s]||(r[s]=new Set);r[s].add(t),n||i.set(o,r)}(e._observable,o,i.observable,t)}))}))}(this),this._bindProperties.forEach((e=>{P(this._observable,e)}))}function y(e,t,o){if(this._bindings.size>1)throw new h.ZP("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const o=e.map((e=>[e,t]));return Array.prototype.concat.apply([],o)}(e,t),o)}function x(e){return e.every((e=>"string"==typeof e))}function P(e,t){const o=e[g].get(t);let s;o.callback?s=o.callback.apply(e,o.to.map((e=>e[0][e[1]]))):(s=o.to[0],s=s[0][s[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=s:e.set(t,s)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{w[e]=_.prototype[e]}));class T{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach((({element:e,newElement:t})=>{e.style.display="",t&&t.remove()})),this._replacedElements=[]}}function C(e){let t=0;for(const o of e)t++;return t}function A(e,t){const o=Math.min(e.length,t.length);for(let s=0;s{this._setToTarget(e,s,t[s],o)}))}}function z(e){return(0,N.Z)(e,F)}function F(e){return(0,I.Z)(e)?e:void 0}var L=o("./packages/ckeditor5-utils/src/dom/emittermixin.ts");function Z(e){let t=e.parentElement;if(!t)return null;for(;"BODY"!=t.tagName;){const e=t.style.overflowY||o.g.window.getComputedStyle(t).overflowY;if("auto"===e||"scroll"===e)break;if(t=t.parentElement,!t)return null}return t}let W;try{W={window,document}}catch(e){W={window:{},document:{}}}const H=W;function $(e){const t=[];let o=e;for(;o&&o.nodeType!=Node.DOCUMENT_NODE;)t.unshift(o),o=o.parentNode;return t}function q(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}function U(e){return"[object Text]"==Object.prototype.toString.call(e)}function K(e){return"[object Range]"==Object.prototype.toString.apply(e)}var G=o("./packages/ckeditor5-utils/src/dom/iswindow.ts");function J(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 Y=["top","right","bottom","left","width","height"];class X{constructor(e){const t=K(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),te(e)||t)if(t){const t=X.getDomRangeRects(e);Q(this,X.getBoundingRect(t))}else Q(this,e.getBoundingClientRect());else if((0,G.Z)(e)){const{innerWidth:t,innerHeight:o}=e;Q(this,{top:0,right:t,bottom:o,left:0,width:t,height:o})}else Q(this,e)}clone(){return new X(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,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),width:0,height:0};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new X(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!ee(e)){let o=e.parentNode||e.commonAncestorContainer;for(;o&&!ee(o);){const e=new X(o),s=t.getIntersection(e);if(!s)return null;s.getArea(){for(const t of e){const e=oe._getElementCallbacks(t.target);if(e)for(const o of e)o(t)}}))}}function se(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function ie(e){return t=>t+e}function ne(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function re(e,t,o){e.insertBefore(o,e.childNodes[t]||null)}function ae(e){return e&&e.nodeType===Node.COMMENT_NODE}oe._observerInstance=null,oe._elementCallbacks=null;var ce=o("./packages/ckeditor5-utils/src/dom/isnode.ts");function le(e){return!!(e&&e.getClientRects&&e.getClientRects().length)}var de=o("./node_modules/lodash-es/isFunction.js");function he({element:e,target:t,positions:o,limiter:s,fitInViewport:i,viewportOffsetConfig:n}){(0,de.Z)(t)&&(t=t()),(0,de.Z)(s)&&(s=s());const r=function(e){return e&&e.parentNode?e.offsetParent===H.document.body?null:e.offsetParent:null}(e),a=new X(e),c=new X(t);let l;const d=i&&function(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new X(H.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t}(n)||null,h={targetRect:c,elementRect:a,positionedElementAncestor:r,viewportRect:d};if(s||i){const e=s&&new X(s).getVisible();Object.assign(h,{limiterRect:e,viewportRect:d}),l=function(e,t){const{elementRect:o}=t,s=o.getArea(),i=e.map((e=>new pe(e,t))).filter((e=>!!e.name));let n=0,r=null;for(const e of i){const{limiterIntersectionArea:t,viewportIntersectionArea:o}=e;if(t===s)return e;const i=o**2+t**2;i>n&&(n=i,r=e)}return r}(o,h)||new pe(o[0],h)}else l=new pe(o[0],h);return l}function ue(e){const{scrollX:t,scrollY:o}=H.window;return e.clone().moveBy(t,o)}class pe{constructor(e,t){const o=e(t.targetRect,t.elementRect,t.viewportRect);if(!o)return;const{left:s,top:i,name:n,config:r}=o;this.name=n,this.config=r,this._positioningFunctionCorrdinates={left:s,top:i},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;if(e){const t=this._options.viewportRect;if(!t)return e.getIntersectionArea(this._rect);{const o=e.getIntersection(t);if(o)return o.getIntersectionArea(this._rect)}}return 0}get viewportIntersectionArea(){const e=this._options.viewportRect;return e?e.getIntersectionArea(this._rect):0}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=ue(this._rect),this._options.positionedElementAncestor&&function(e,t){const o=ue(new X(t)),s=J(t);let i=0,n=0;i-=o.left,n-=o.top,i+=t.scrollLeft,n+=t.scrollTop,i-=s.left,n-=s.top,e.moveBy(i,n)}(this._cachedAbsoluteRect,this._options.positionedElementAncestor)),this._cachedAbsoluteRect}}function fe(e){const t=e.parentNode;t&&t.removeChild(e)}function ge({target:e,viewportOffset:t=0}){const o=xe(e);let s=o,i=null;for(;s;){let n;n=Pe(s==o?e:i),_e(n,(()=>Te(e,s)));const r=Te(e,s);if(be(s,r,t),s.parent!=s){if(i=s.frameElement,s=s.parent,!i)return}else s=null}}function me(e){_e(Pe(e),(()=>new X(e)))}function be(e,t,o){const s=t.clone().moveBy(0,o),i=t.clone().moveBy(0,-o),n=new X(e).excludeScrollbarsAndBorders();if(![i,s].every((e=>n.contains(e)))){let{scrollX:r,scrollY:a}=e;ke(i,n)?a-=n.top-t.top+o:we(s,n)&&(a+=t.bottom-n.bottom+o),ve(t,n)?r-=n.left-t.left+o:ye(t,n)&&(r+=t.right-n.right+o),e.scrollTo(r,a)}}function _e(e,t){const o=xe(e);let s,i;for(;e!=o.document.body;)i=t(),s=new X(e).excludeScrollbarsAndBorders(),s.contains(i)||(ke(i,s)?e.scrollTop-=s.top-i.top:we(i,s)&&(e.scrollTop+=i.bottom-s.bottom),ve(i,s)?e.scrollLeft-=s.left-i.left:ye(i,s)&&(e.scrollLeft+=i.right-s.right)),e=e.parentNode}function we(e,t){return e.bottom>t.bottom}function ke(e,t){return e.topt.right}function xe(e){return K(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Pe(e){if(K(e)){let t=e.commonAncestorContainer;return U(t)&&(t=t.parentNode),t}return e.parentNode}function Te(e,t){const o=xe(e),s=new X(e);if(o===t)return s;{let e=o;for(;e!=t;){const t=e.frameElement,o=new X(t).excludeScrollbarsAndBorders();s.moveBy(o.left,o.top),e=e.parent}}return s}var Ce=o("./packages/ckeditor5-utils/src/keyboard.ts");const Ae=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Ee(e){return Ae.includes(e)?"rtl":"ltr"}function Se(e){return Array.isArray(e)?e:[e]}function Oe(e,t,o=1){if("number"!=typeof o)throw new h.ZP("translation-service-quantity-not-a-number",null,{quantity:o});const s=Object.keys(H.window.CKEDITOR_TRANSLATIONS).length;1===s&&(e=Object.keys(H.window.CKEDITOR_TRANSLATIONS)[0]);const i=t.id||t.string;if(0===s||!function(e,t){return!!H.window.CKEDITOR_TRANSLATIONS[e]&&!!H.window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}(e,i))return 1!==o?t.plural:t.string;const n=H.window.CKEDITOR_TRANSLATIONS[e].dictionary,r=H.window.CKEDITOR_TRANSLATIONS[e].getPluralForm||(e=>1===e?0:1),a=n[i];if("string"==typeof a)return a;return a[Number(r(o))]}H.window.CKEDITOR_TRANSLATIONS||(H.window.CKEDITOR_TRANSLATIONS={});class Re{constructor({uiLanguage:e="en",contentLanguage:t}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Ee(this.uiLanguage),this.contentLanguageDirection=Ee(this.contentLanguage),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Se(t),"string"==typeof e&&(e={string:e});const o=!!e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,((e,o)=>othis._items.length||t<0)throw new h.ZP("collection-add-item-invalid-index",this);let o=0;for(const s of e){const e=this._getItemIdBeforeAdding(s),i=t+o;this._items.splice(i,0,s),this._itemMap.set(e,s),this.fire("add",s,i),o++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new h.ZP("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,o]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:o}),t}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new h.ZP("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding((t=>new e(t)))},using:e=>{"function"==typeof e?this._setUpBindToBinding(e):this._setUpBindToBinding((t=>t[e]))}}}_setUpBindToBinding(e){const t=this._bindToCollection,o=(o,s,i)=>{const n=t._bindToCollection==this,r=t._bindToInternalToExternalMap.get(s);if(n&&r)this._bindToExternalToInternalMap.set(s,r),this._bindToInternalToExternalMap.set(r,s);else{const o=e(s);if(!o)return void this._skippedIndexesFromExternal.push(i);let n=i;for(const e of this._skippedIndexesFromExternal)i>e&&n--;for(const e of t._skippedIndexesFromExternal)n>=e&&n++;this._bindToExternalToInternalMap.set(s,o),this._bindToInternalToExternalMap.set(o,s),this.add(o,n);for(let e=0;e{const s=this._bindToExternalToInternalMap.get(t);s&&this.remove(s),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((e,t)=>(ot&&e.push(t),e)),[])}))}_getItemIdBeforeAdding(e){const t=this._idProperty;let o;if(t in e){if(o=e[t],"string"!=typeof o)throw new h.ZP("collection-add-invalid-id",this);if(this.get(o))throw new h.ZP("collection-add-item-already-exists",this)}else e[t]=o=(0,Me.Z)();return o}_remove(e){let t,o,s,i=!1;const n=this._idProperty;if("string"==typeof e?(o=e,s=this._itemMap.get(o),i=!s,s&&(t=this._items.indexOf(s))):"number"==typeof e?(t=e,s=this._items[t],i=!s,s&&(o=s[n])):(s=e,o=s[n],t=this._items.indexOf(s),i=-1==t||!this._itemMap.get(o)),i)throw new h.ZP("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(o);const r=this._bindToInternalToExternalMap.get(s);return this._bindToInternalToExternalMap.delete(s),this._bindToExternalToInternalMap.delete(r),this.fire("remove",s,t),[s,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Be(e){const t=e.next();return t.done?null:t.value}class Ve extends((0,L.Z)(w())){constructor(){super(),this._elements=new Set,this._nextEventLoopTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}add(e){if(this._elements.has(e))throw new h.ZP("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",(()=>this._focus(e)),{useCapture:!0}),this.listenTo(e,"blur",(()=>this._blur()),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout((()=>{this.focusedElement=null,this.isFocused=!1}),0)}}var Ne=o("./packages/ckeditor5-utils/src/keystrokehandler.ts");function Ie(e){return E(e)?new Map(e):function(e){const t=new Map;for(const o in e)t.set(o,e[o]);return t}(e)}var De=o("./packages/ckeditor5-utils/src/priorities.ts"),ze=o("./packages/ckeditor5-utils/src/inserttopriorityarray.ts");const Fe=1e4;function Le(e,t,o,s){if(Math.max(t.length,e.length)>Fe)return e.slice(0,o).concat(t).concat(e.slice(o+s,e.length));{const i=Array.from(e);return i.splice(o,s,...t),i}}function Ze(e){return!!e&&1==e.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e)}function We(e){return!!e&&1==e.length&&/[\ud800-\udbff]/.test(e)}function He(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}function $e(e,t){return We(e.charAt(t-1))&&He(e.charAt(t))}function qe(e,t){return Ze(e.charAt(t))}const Ue=function(){const e=/\p{Regional_Indicator}{2}/u.source,t="(?:"+[/\p{Emoji}[\u{E0020}-\u{E007E}]+\u{E007F}/u,/\p{Emoji}\u{FE0F}?\u{20E3}/u,/\p{Emoji}\u{FE0F}/u,/(?=\p{General_Category=Other_Symbol})\p{Emoji}\p{Emoji_Modifier}*/u].map((e=>e.source)).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}();function Ke(e,t){const o=String(e).matchAll(Ue);return Array.from(o).some((e=>e.index{"use strict";o.d(t,{Z:()=>i});var s=o("./packages/ckeditor5-utils/src/priorities.ts");function i(e,t){const o=s.Z.get(t.priority);for(let i=0;i{"use strict";o.d(t,{Cq:()=>l,Do:()=>a,XU:()=>h,Zt:()=>f,Zz:()=>d,dj:()=>u,mA:()=>p});var s=o("./packages/ckeditor5-utils/src/ckeditorerror.ts"),i=o("./packages/ckeditor5-utils/src/env.ts");const n={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},r={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},a=function(){const e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){e[String.fromCharCode(t).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;for(const t of"`-=[];',./\\")e[t]=t.charCodeAt(0);return e}(),c=Object.fromEntries(Object.entries(a).map((([e,t])=>[t,e.charAt(0).toUpperCase()+e.slice(1)])));function l(e){let t;if("string"==typeof e){if(t=a[e.toLowerCase()],!t)throw new s.ZP("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?a.alt:0)+(e.ctrlKey?a.ctrl:0)+(e.shiftKey?a.shift:0)+(e.metaKey?a.cmd:0);return t}function d(e){return"string"==typeof e&&(e=function(e){return e.split("+").map((e=>e.trim()))}(e)),e.map((e=>"string"==typeof e?function(e){if(e.endsWith("!"))return l(e.slice(0,-1));const t=l(e);return i.ZP.isMac&&t==a.ctrl?a.cmd:t}(e):e)).reduce(((e,t)=>t+e),0)}function h(e){let t=d(e);return Object.entries(i.ZP.isMac?n:r).reduce(((e,[o,s])=>(0!=(t&a[o])&&(t&=~a[o],e+=s),e)),"")+(t?c[t]:"")}function u(e){return e==a.arrowright||e==a.arrowleft||e==a.arrowup||e==a.arrowdown}function p(e,t){const o="ltr"===t;switch(e){case a.arrowleft:return o?"left":"right";case a.arrowright:return o?"right":"left";case a.arrowup:return"up";case a.arrowdown:return"down"}}function f(e,t){const o=p(e,t);return"down"===o||"right"===o}},"./packages/ckeditor5-utils/src/keystrokehandler.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./packages/ckeditor5-utils/src/dom/emittermixin.ts"),i=o("./packages/ckeditor5-utils/src/keyboard.ts");class n{constructor(){this._listener=new((0,s.Z)())}listenTo(e){this._listener.listenTo(e,"keydown",((e,t)=>{this._listener.fire("_keydown:"+(0,i.Cq)(t),t)}))}set(e,t,o={}){const s=(0,i.Zz)(e),n=o.priority;this._listener.listenTo(this._listener,"_keydown:"+s,((e,o)=>{t(o,(()=>{o.preventDefault(),o.stopPropagation(),e.stop()})),e.return=!0}),{priority:n})}press(e){return!!this._listener.fire("_keydown:"+(0,i.Cq)(e),e)}destroy(){this._listener.stopListening()}}},"./packages/ckeditor5-utils/src/priorities.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s={get(e="normal"){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5}},"./packages/ckeditor5-utils/src/uid.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});const s=new Array(256).fill("").map(((e,t)=>("0"+t.toString(16)).slice(-2)));function i(){const e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,o=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0;return"e"+s[e>>0&255]+s[e>>8&255]+s[e>>16&255]+s[e>>24&255]+s[t>>0&255]+s[t>>8&255]+s[t>>16&255]+s[t>>24&255]+s[o>>0&255]+s[o>>8&255]+s[o>>16&255]+s[o>>24&255]+s[i>>0&255]+s[i>>8&255]+s[i>>16&255]+s[i>>24&255]}},"./packages/ckeditor5-utils/src/version.ts":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./packages/ckeditor5-utils/src/ckeditorerror.ts");const i="36.0.1",n=i,r="object"==typeof window?window:o.g;if(r.CKEDITOR_VERSION)throw new s.ZP("ckeditor-duplicated-modules",null);r.CKEDITOR_VERSION=i},"./packages/ckeditor5-widget/src/index.ts":(e,t,o)=>{"use strict";o.d(t,{s4:()=>f,Uo:()=>g,$L:()=>W,WR:()=>te,e8:()=>$,Ww:()=>I,KT:()=>P,id:()=>y,Qd:()=>m,em:()=>k,l6:()=>v,XC:()=>b,sC:()=>x,$n:()=>T});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-engine/src/index.ts"),n=o("./packages/ckeditor5-typing/src/index.ts"),r=o("./packages/ckeditor5-utils/src/index.ts"),a=o("./packages/ckeditor5-ui/src/index.ts"),c=o("./packages/ckeditor5-enter/src/index.ts");class l extends((0,r.ln)()){constructor(){super(),this._stack=[]}add(e,t){const o=this._stack,s=o[0];this._insertDescriptor(e);const i=o[0];s===i||d(s,i)||this.fire("change:top",{oldDescriptor:s,newDescriptor:i,writer:t})}remove(e,t){const o=this._stack,s=o[0];this._removeDescriptor(e);const i=o[0];s===i||d(s,i)||this.fire("change:top",{oldDescriptor:s,newDescriptor:i,writer:t})}_insertDescriptor(e){const t=this._stack,o=t.findIndex((t=>t.id===e.id));if(d(e,t[o]))return;o>-1&&t.splice(o,1);let s=0;for(;t[s]&&h(t[s],e);)s++;t.splice(s,0,e)}_removeDescriptor(e){const t=this._stack,o=t.findIndex((t=>t.id===e));o>-1&&t.splice(o,1)}}function d(e,t){return e&&t&&e.priority==t.priority&&u(e.classes)==u(t.classes)}function h(e,t){return e.priority>t.priority||!(e.priorityu(t.classes)}function u(e){return Array.isArray(e)?e.sort().join(","):e}const p='',f="ck-widget",g="ck-widget_selected";function m(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function b(e,t,o={}){if(!e.is("containerElement"))throw new r.Bb("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass(f,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=C,t.setCustomProperty("widgetLabel",[],e),o.label&&v(e,o.label),o.hasSelectionHandle&&function(e,t){const o=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),o=new a.mO;return o.set("content",p),o.render(),t.appendChild(o.element),t}));t.insert(t.createPositionAt(e,0),o),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),k(e,t),e}function _(e,t,o){if(t.classes&&o.addClass((0,r.qo)(t.classes),e),t.attributes)for(const s in t.attributes)o.setAttribute(s,t.attributes[s],e)}function w(e,t,o){if(t.classes&&o.removeClass((0,r.qo)(t.classes),e),t.attributes)for(const s in t.attributes)o.removeAttribute(s,e)}function k(e,t,o=_,s=w){const i=new l;i.on("change:top",((t,i)=>{i.oldDescriptor&&s(e,i.oldDescriptor,i.writer),i.newDescriptor&&o(e,i.newDescriptor,i.writer)}));t.setCustomProperty("addHighlight",((e,t,o)=>i.add(t,o)),e),t.setCustomProperty("removeHighlight",((e,t,o)=>i.remove(t,o)),e)}function v(e,t){e.getCustomProperty("widgetLabel").push(t)}function y(e){return e.getCustomProperty("widgetLabel").reduce(((e,t)=>"function"==typeof t?e?e+". "+t():t():e?e+". "+t:t),"")}function x(e,t,o={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),t.setAttribute("role","textbox",e),o.label&&t.setAttribute("aria-label",o.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",((o,s,i)=>{t.setAttribute("contenteditable",i?"false":"true",e)})),e.on("change:isFocused",((o,s,i)=>{i?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)})),k(e,t),e}function P(e,t){const o=e.getSelectedElement();if(o){const s=S(e);if(s)return t.createRange(t.createPositionAt(o,s))}return(0,i.KT)(e,t)}function T(e,t){return(o,s)=>{const{mapper:i,viewPosition:n}=s,r=i.findMappedViewAncestor(n);if(!t(r))return;const a=i.toModelElement(r);s.modelPosition=e.createPositionAt(a,n.isAtStart?"before":"after")}}function C(){return null}const A="widget-type-around";function E(e,t,o){return!!e&&m(e)&&!o.isInline(t)}function S(e){return e.getAttribute(A)}var O=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),R=o.n(O),M=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widgettypearound.css"),j={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};R()(M.Z,j);M.Z.locals;const B=["before","after"],V=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,N="ck-widget__type-around_disabled";class I extends s.Sy{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[c.C,n.HG]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",((o,s,i)=>{t.change((e=>{for(const o of t.document.roots)i?e.removeClass(N,o):e.addClass(N,o)})),i||e.model.change((e=>{e.removeSelectionAttribute(A)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const o=this.editor,s=o.editing.view,i=o.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);o.execute("insertParagraph",{position:o.model.createPositionAt(e,t),attributes:i}),s.focus(),s.scrollToTheSelection()}_listenToIfEnabled(e,t,o,s){this.listenTo(e,t,((...e)=>{this.isEnabled&&o(...e)}),s)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=S(e);if(!t)return!1;const o=e.getSelectedElement();return this._insertParagraph(o,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,o=e.locale.t,s={before:o("Insert paragraph before block"),after:o("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",((e,i,n)=>{const r=n.mapper.toViewElement(i.item);if(r&&E(r,i.item,t)){!function(e,t,o){const s=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const o=this.toDomElement(e);return function(e,t){for(const o of B){const s=new a.YS({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${o}`],title:t[o],"aria-hidden":"true"},children:[e.ownerDocument.importNode(V,!0)]});e.appendChild(s.render())}}(o,t),function(e){const t=new a.YS({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(o),o}));e.insert(e.createPositionAt(o,"end"),s)}(n.writer,s,r);r.getCustomProperty("widgetLabel").push((()=>this.isEnabled?o("Press Enter to type after or press Shift + Enter to type before the widget"):""))}}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,o=t.document.selection,s=t.schema,i=e.editing.view;function n(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(i.document,"arrowKey",((e,t)=>{this._handleArrowKeyPress(e,t)}),{context:[m,"$text"],priority:"high"}),this._listenToIfEnabled(o,"change:range",((t,o)=>{o.directChange&&e.model.change((e=>{e.removeSelectionAttribute(A)}))})),this._listenToIfEnabled(t.document,"change:data",(()=>{const t=o.getSelectedElement();if(t){if(E(e.editing.mapper.toViewElement(t),t,s))return}e.model.change((e=>{e.removeSelectionAttribute(A)}))})),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",((e,t,o)=>{const i=o.writer;if(this._currentFakeCaretModelElement){const e=o.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(i.removeClass(B.map(n),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=o.mapper.toViewElement(r);if(!E(a,r,s))return;const c=S(t.selection);c&&(i.addClass(n(c),a),this._currentFakeCaretModelElement=r)})),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",((t,o,s)=>{s||e.model.change((e=>{e.removeSelectionAttribute(A)}))}))}_handleArrowKeyPress(e,t){const o=this.editor,s=o.model,i=s.document.selection,n=s.schema,a=o.editing.view,c=t.keyCode,l=(0,r.Zt)(c,o.locale.contentLanguageDirection),d=a.document.selection.getSelectedElement();let h;E(d,o.editing.mapper.toModelElement(d),n)?h=this._handleArrowKeyPressOnSelectedWidget(l):i.isCollapsed?h=this._handleArrowKeyPressWhenSelectionNextToAWidget(l):t.shiftKey||(h=this._handleArrowKeyPressWhenNonCollapsedSelection(l)),h&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,o=S(t.document.selection);return t.change((t=>{if(!o)return t.setSelectionAttribute(A,e?"after":"before"),!0;if(!(o===(e?"after":"before")))return t.removeSelectionAttribute(A),!0;return!1}))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,o=t.model,s=o.schema,i=t.plugins.get("Widget"),n=i._getObjectElementNextToSelection(e);return!!E(t.editing.mapper.toViewElement(n),n,s)&&(o.change((t=>{i._setSelectionOverElement(n),t.setSelectionAttribute(A,e?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,o=t.model,s=o.schema,i=t.editing.mapper,n=o.document.selection,r=e?n.getLastPosition().nodeBefore:n.getFirstPosition().nodeAfter;return!!E(i.toViewElement(r),r,s)&&(o.change((t=>{t.setSelection(r,"on"),t.setSelectionAttribute(A,e?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",((o,s)=>{const i=s.domTarget.closest(".ck-widget__type-around__button");if(!i)return;const n=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(i),r=function(e,t){const o=e.closest(".ck-widget");return t.mapDomToView(o)}(i,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,n),s.preventDefault(),o.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,o=e.editing.view;this._listenToIfEnabled(o.document,"enter",((o,s)=>{if("atTarget"!=o.eventPhase)return;const i=t.getSelectedElement(),n=e.editing.mapper.toViewElement(i),r=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:E(n,i,r)&&(this._insertParagraph(i,s.isSoft?"before":"after"),a=!0),a&&(s.preventDefault(),o.stop())}),{context:m})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,o)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(o.selection=e.selection)}),{priority:"high"}),r.OB.isAndroid?this._listenToIfEnabled(e,"keydown",((e,t)=>{229==t.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()})):this._listenToIfEnabled(e,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,o=e.model,s=o.schema;this._listenToIfEnabled(t.document,"delete",((t,i)=>{if("atTarget"!=t.eventPhase)return;const n=S(o.document.selection);if(!n)return;const r=i.direction,a=o.document.selection.getSelectedElement(),c="forward"==r;if("before"===n===c)e.execute("delete",{selection:o.createSelection(a,"on")});else{const t=s.getNearestSelectionRange(o.createPositionAt(a,n),r);if(t)if(t.isCollapsed){const i=o.createSelection(t.start);if(o.modifySelection(i,{direction:r}),i.focus.isEqual(t.start)){const e=function(e,t){let o=t;for(const s of t.getAncestors({parentFirst:!0})){if(s.childCount>1||e.isLimit(s))break;o=s}return o}(s,t.start.parent);o.deleteContent(o.createSelection(e,"on"),{doNotAutoparagraph:!0})}else o.change((o=>{o.setSelection(t),e.execute(c?"deleteForward":"delete")}))}else o.change((o=>{o.setSelection(t),e.execute(c?"deleteForward":"delete")}))}i.preventDefault(),t.stop()}),{context:m})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,o=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",((e,[s,i])=>{if(i&&!i.is("documentSelection"))return;const n=S(o);return n?(e.stop(),t.change((e=>{const i=o.getSelectedElement(),r=t.createPositionAt(i,n),a=e.createSelection(r),c=t.insertContent(s,a);return e.setSelection(a),c}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",((e,o)=>{const[,s,,i={}]=o;if(s&&!s.is("documentSelection"))return;const n=S(t);n&&(i.findOptimalPosition=n,o[3]=i)}),{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",((e,[o])=>{if(o&&!o.is("documentSelection"))return;S(t)&&e.stop()}),{priority:"high"})}}function D(e){const t=e.model;return(o,s)=>{const i=s.keyCode==r.Do.arrowup,n=s.keyCode==r.Do.arrowdown,a=s.shiftKey,c=t.document.selection;if(!i&&!n)return;const l=n;if(a&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(c,l))return;const d=function(e,t,o){const s=e.model;if(o){const e=t.isCollapsed?t.focus:t.getLastPosition(),o=z(s,e,"forward");if(!o)return null;const i=s.createRange(e,o),n=F(s.schema,i,"backward");return n?s.createRange(e,n):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),o=z(s,e,"backward");if(!o)return null;const i=s.createRange(o,e),n=F(s.schema,i,"forward");return n?s.createRange(n,e):null}}(e,c,l);if(d){if(d.isCollapsed){if(c.isCollapsed)return;if(a)return}(d.isCollapsed||function(e,t,o){const s=e.model,i=e.view.domConverter;if(o){const e=s.createSelection(t.start);s.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=s.createRange(e.focus,t.end))}const n=e.mapper.toViewRange(t),a=i.viewRangeToDom(n),c=r.UL.getDomRangeRects(a);let l;for(const e of c)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,d,l))&&(t.change((e=>{const o=l?d.end:d.start;if(a){const s=t.createSelection(c.anchor);s.setFocus(o),e.setSelection(s)}else e.setSelection(o)})),o.stop(),s.preventDefault(),s.stopPropagation())}}}function z(e,t,o){const s=e.schema,i=e.createRangeIn(t.root),n="forward"==o?"elementStart":"elementEnd";for(const{previousPosition:e,item:r,type:a}of i.getWalker({startPosition:t,direction:o})){if(s.isLimit(r)&&!s.isInline(r))return e;if(a==n&&s.isBlock(r))return null}return null}function F(e,t,o){const s="backward"==o?t.end:t.start;if(e.checkChild(s,"$text"))return s;for(const{nextPosition:s}of t.getWalker({direction:o}))if(e.checkChild(s,"$text"))return s;return null}var L=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widget.css"),Z={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};R()(L.Z,Z);L.Z.locals;class W extends s.Sy{static get pluginName(){return"Widget"}static get requires(){return[I,n.HG]}init(){const e=this.editor,t=e.editing.view,o=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",((t,o,s)=>{const i=s.writer,n=o.selection;if(n.isCollapsed)return;const r=n.getSelectedElement();if(!r)return;const a=e.editing.mapper.toViewElement(r);m(a)&&s.consumable.consume(n,"selection")&&i.setSelection(i.createRangeOn(a),{fake:!0,label:y(a)})})),this.editor.editing.downcastDispatcher.on("selection",((e,t,o)=>{this._clearPreviouslySelectedWidgets(o.writer);const s=o.writer,i=s.document.selection;let n=null;for(const e of i.getRanges())for(const t of e){const e=t.item;m(e)&&!H(e,n)&&(s.addClass(g,e),this._previouslySelected.add(e),n=e)}}),{priority:"low"}),t.addObserver(i.dM),this.listenTo(o,"mousedown",((...e)=>this._onMousedown(...e))),this.listenTo(o,"arrowKey",((...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)}),{context:[m,"$text"]}),this.listenTo(o,"arrowKey",((...e)=>{this._preventDefaultOnArrowKeyPress(...e)}),{context:"$root"}),this.listenTo(o,"arrowKey",D(this.editor.editing),{context:"$text"}),this.listenTo(o,"delete",((e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())}),{context:"$root"})}_onMousedown(e,t){const o=this.editor,s=o.editing.view,i=s.document;let n=t.target;if(function(e){let t=e;for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(m(t))return!1;t=t.parent}return!1}(n)){if((r.OB.isSafari||r.OB.isGecko)&&t.domEvent.detail>=3){const e=o.editing.mapper,s=n.is("attributeElement")?n.findAncestor((e=>!e.is("attributeElement"))):n,i=e.toModelElement(s);t.preventDefault(),this.editor.model.change((e=>{e.setSelection(i,"in")}))}return}if(!m(n)&&(n=n.findAncestor(m),!n))return;r.OB.isAndroid&&t.preventDefault(),i.isFocused||s.focus();const a=o.editing.mapper.toModelElement(n);this._setSelectionOverElement(a)}_handleSelectionChangeOnArrowKeyPress(e,t){const o=t.keyCode,s=this.editor.model,i=s.schema,n=s.document.selection,a=n.getSelectedElement(),c=(0,r.mA)(o,this.editor.locale.contentLanguageDirection),l="down"==c||"right"==c,d="up"==c||"down"==c;if(a&&i.isObject(a)){const o=l?n.getLastPosition():n.getFirstPosition(),r=i.getNearestSelectionRange(o,l?"forward":"backward");return void(r&&(s.change((e=>{e.setSelection(r)})),t.preventDefault(),e.stop()))}if(!n.isCollapsed&&!t.shiftKey){const o=n.getFirstPosition(),r=n.getLastPosition(),a=o.nodeAfter,c=r.nodeBefore;return void((a&&i.isObject(a)||c&&i.isObject(c))&&(s.change((e=>{e.setSelection(l?r:o)})),t.preventDefault(),e.stop()))}if(!n.isCollapsed)return;const h=this._getObjectElementNextToSelection(l);if(h&&i.isObject(h)){if(i.isInline(h)&&d)return;this._setSelectionOverElement(h),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const o=this.editor.model,s=o.schema,i=o.document.selection.getSelectedElement();i&&s.isObject(i)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const o=this._getObjectElementNextToSelection(e);return o?(this.editor.model.change((e=>{let s=t.anchor.parent;for(;s.isEmpty;){const t=s;s=t.parent,e.remove(t)}this._setSelectionOverElement(o)})),!0):void 0}_setSelectionOverElement(e){this.editor.model.change((t=>{t.setSelection(t.createRangeOn(e))}))}_getObjectElementNextToSelection(e){const t=this.editor.model,o=t.schema,s=t.document.selection,i=t.createSelection(s);if(t.modifySelection(i,{direction:e?"forward":"backward"}),i.isEqual(s))return null;const n=e?i.focus.nodeBefore:i.focus.nodeAfter;return n&&o.isObject(n)?n:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(g,t);this._previouslySelected.clear()}}function H(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}class $ extends s.Sy{static get requires(){return[a.WB]}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=>{(function(e){const t=e.getSelectedElement();return!(!t||!m(t))})(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:o,getRelatedElement:s,balloonClassName:i="ck-toolbar-container"}){if(!o.length)return void(0,r.KE)("widget-toolbar-no-items",{toolbarId:e});const n=this.editor,c=n.t,l=new a.jB(n.locale);if(l.ariaLabel=t||c("Widget toolbar"),this._toolbarDefinitions.has(e))throw new r.Bb("widget-toolbar-duplicated",this,{toolbarId:e});const d={view:l,getRelatedElement:s,balloonClassName:i,itemsConfig:o,initialized:!1};n.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{const e=s(n.editing.view.document.selection);e&&this._showToolbar(d,e)},afterBlur:()=>{this._hideToolbar(d)}}),this._toolbarDefinitions.set(e,d)}_updateToolbarsVisibility(){let e=0,t=null,o=null;for(const s of this._toolbarDefinitions.values()){const i=s.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&i)if(this.editor.ui.focusTracker.isFocused){const n=i.getAncestors().length;n>e&&(e=n,t=i,o=s)}else this._isToolbarVisible(s)&&this._hideToolbar(s);else this._isToolbarInBalloon(s)&&this._hideToolbar(s)}o&&this._showToolbar(o,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?q(this.editor,t):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:U(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);q(this.editor,t)}})))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function q(e,t){const o=e.plugins.get("ContextualBalloon"),s=U(e,t);o.updatePosition(s)}function U(e,t){const o=e.editing.view,s=a.no.defaultPositions;return{target:o.domConverter.mapViewToDom(t),positions:[s.northArrowSouth,s.northArrowSouthWest,s.northArrowSouthEast,s.southArrowNorth,s.southArrowNorthWest,s.southArrowNorthEast,s.viewportStickyNorth]}}class K extends((0,r.Re)()){constructor(e){super(),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}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,o){const s=new r.UL(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const o of t)if(e.classList.contains(G(o)))return o}(e),this._referenceCoordinates=function(e,t){const o=new r.UL(e),s=t.split("-"),i={x:"right"==s[1]?o.right:o.left,y:"bottom"==s[0]?o.bottom:o.top};return i.x+=e.ownerDocument.defaultView.scrollX,i.y+=e.ownerDocument.defaultView.scrollY,i}(t,function(e){const t=e.split("-"),o={top:"bottom",bottom:"top",left:"right",right:"left"};return`${o[t[0]]}-${o[t[1]]}`}(this.activeHandlePosition)),this._originalWidth=s.width,this._originalHeight=s.height,this._aspectRatio=s.width/s.height;const i=o.style.width;i&&i.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(i):this._originalWidthPercents=function(e,t){const o=e.parentElement,s=parseFloat(o.ownerDocument.defaultView.getComputedStyle(o).width);return t.width/s*100}(o,s)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function G(e){return`ck-widget__resizer__handle-${e}`}class J extends a.G7{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",(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)=>null!==e&&null!==t)),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",((t,o,s)=>"px"===e.unit?`${t}×${o}`:`${s}%`)),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",((e,t,o)=>t<50||o<50?"above-center":e))}_dismiss(){this.unbind(),this._isVisible=!1}}class Y extends((0,r.Re)()){constructor(e){super(),this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",((e,t)=>e&&t)),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",(e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())}),{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change((e=>{e.removeClass("ck-hidden",this._viewResizerWrapper)}))}hide(){this._options.editor.editing.view.change((e=>{e.addClass("ck-hidden",this._viewResizerWrapper)}))}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change((o=>{const s=o.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const o=this.toDomElement(t);return e._appendHandles(o),e._appendSizeUI(o),o}));o.insert(o.createPositionAt(t,"end"),s),o.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=s,this.isVisible||this.hide()})),this.on("change:isVisible",(()=>{this.isVisible?(this.show(),this.redraw()):this.hide()}))}begin(e){this._state=new K(this._options),this._sizeView._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);this._options.editor.editing.view.change((e=>{const o=this._options.unit||"%",s=("%"===o?t.widthPercents:t.width)+o;e.setStyle("width",s,this._options.viewElement)}));const o=this._getHandleHost(),s=new r.UL(o),i=Math.round(s.width),n=Math.round(s.height),a=new r.UL(o);t.width=Math.round(a.width),t.height=Math.round(a.height),this.redraw(s),this.state.update({...t,handleHostWidth:i,handleHostHeight:n})}commit(){const e=this._options.unit||"%",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(!((o=t)&&o.ownerDocument&&o.ownerDocument.contains(o)))return;var o;const s=t.parentElement,i=this._getHandleHost(),n=this._viewResizerWrapper,a=[n.getStyle("width"),n.getStyle("height"),n.getStyle("left"),n.getStyle("top")];let c;if(s.isSameNode(i)){const t=e||new r.UL(i);c=[t.width+"px",t.height+"px",void 0,void 0]}else c=[i.offsetWidth+"px",i.offsetHeight+"px",i.offsetLeft+"px",i.offsetTop+"px"];"same"!==(0,r.Rt)(a,c)&&this._options.editor.editing.view.change((e=>{e.setStyle({width:c[0],height:c[1],left:c[2],top:c[3]},n)}))}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();this._options.editor.editing.view.change((e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(e){const t=this.state,o={x:(s=e).pageX,y:s.pageY};var s;const i=!this._options.isCentered||this._options.isCentered(this),n={x:t._referenceCoordinates.x-(o.x+t.originalWidth),y:o.y-t.originalHeight-t._referenceCoordinates.y};i&&t.activeHandlePosition.endsWith("-right")&&(n.x=o.x-(t._referenceCoordinates.x+t.originalWidth)),i&&(n.x*=2);let r=Math.abs(t.originalWidth+n.x),a=Math.abs(t.originalHeight+n.y);return"width"==(r/t.aspectRatio>a?"width":"height")?a=r/t.aspectRatio:r=a*t.aspectRatio,{width:Math.round(r),height:Math.round(a),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r*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)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const s of t)e.appendChild(new a.YS({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(o=s,`ck-widget__resizer__handle-${o}`)}}).render());var o}_appendSizeUI(e){this._sizeView=new J,this._sizeView.render(),e.appendChild(this._sizeView.element)}}var X=o("./node_modules/lodash-es/throttle.js"),Q=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-widget/theme/widgetresize.css"),ee={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};R()(Q.Z,ee);Q.Z.locals;class te extends s.Sy{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing,t=r.CO.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(i.dM),this._observer=new((0,r.Xu)()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=(0,X.Z)((()=>this.redrawSelectedResizer()),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",(()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())}),{priority:"lowest"}),this._observer.listenTo(r.CO.window,"resize",this._redrawSelectedResizerThrottled);const o=this.editor.editing.view.document.selection;o.on("change",(()=>{const e=o.getSelectedElement(),t=this.getResizerByViewElement(e)||null;t?this.select(t):this.deselect()}))}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const t=new Y(e),o=this.editor.plugins;if(t.attach(),o.has("WidgetToolbarRepository")){const e=o.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);const s=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(s)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const o=t.domTarget;Y.isResizeHandle(o)&&(this._activeResizer=this._getResizerByHandle(o)||null,this._activeResizer&&(this._activeResizer.begin(o),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}},"./src/clipboard.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Clipboard:()=>y,ClipboardPipeline:()=>l,DragDrop:()=>m,PastePlainText:()=>v});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts"),n=o("./packages/ckeditor5-engine/src/index.ts");class r extends n.qZ{constructor(e){super(e);const t=this.document;function o(e){return(o,s)=>{s.preventDefault();const n=s.dropRange?[s.dropRange]:null,r=new i.M3(t,e);t.fire(r,{dataTransfer:s.dataTransfer,method:o.name,targetRanges:n,target:s.target}),r.stop.called&&s.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(t,"paste",o("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",o("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",o("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,o="drop"==e.type||"paste"==e.type,s={dataTransfer:new n.tn(t,{cacheFiles:o})};"drop"!=e.type&&"dragover"!=e.type||(s.dropRange=function(e,t){const o=t.target.ownerDocument,s=t.clientX,i=t.clientY;let n;o.caretRangeFromPoint&&o.caretRangeFromPoint(s,i)?n=o.caretRangeFromPoint(s,i):t.rangeParent&&(n=o.createRange(),n.setStart(t.rangeParent,t.rangeOffset),n.collapse(!0));if(n)return e.domConverter.domRangeToView(n);return null}(this.view,e)),this.fire(e.type,e,s)}}const a=["figcaption","li"];function c(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 if(e.is("element","br"))t="\n";else{let o=null;for(const s of e.getChildren()){const e=c(s);o&&(o.is("containerElement")||s.is("containerElement"))&&(a.includes(o.name)||a.includes(s.name)?t+="\n":t+="\n\n"),t+=e,o=s}}return t}class l extends s.Sy{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(r),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,o=e.editing.view,s=o.document;this.listenTo(s,"clipboardInput",(t=>{e.isReadOnly&&t.stop()}),{priority:"highest"}),this.listenTo(s,"clipboardInput",((e,t)=>{const s=t.dataTransfer;let n;if(t.content)n=t.content;else{let e="";s.getData("text/html")?e=function(e){return e.replace(/(\s+)<\/span>/g,((e,t)=>1==t.length?" ":t)).replace(//g,"")}(s.getData("text/html")):s.getData("text/plain")&&(((r=(r=s.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||r.includes("
"))&&(r=`

${r}

`),e=r),n=this.editor.data.htmlProcessor.toView(e)}var r;const a=new i.M3(this,"inputTransformation");this.fire(a,{content:n,dataTransfer:s,targetRanges:t.targetRanges,method:t.method}),a.stop.called&&e.stop(),o.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,o)=>{if(o.content.isEmpty)return;const s=this.editor.data.toModel(o.content,"$clipboardHolder");0!=s.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:s,method:o.method,dataTransfer:o.dataTransfer,targetRanges:o.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,o)=>{o.resultRange=t.insertContent(o.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,o=e.editing.view.document,s=(s,i)=>{const n=i.dataTransfer;i.preventDefault();const r=e.data.toView(e.model.getSelectedContent(t.selection));o.fire("clipboardOutput",{dataTransfer:n,content:r,method:s.name})};this.listenTo(o,"copy",s,{priority:"low"}),this.listenTo(o,"cut",((t,o)=>{e.isReadOnly?o.preventDefault():s(t,o)}),{priority:"low"}),this.listenTo(o,"clipboardOutput",((o,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",c(s.content))),"cut"==s.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}var d=o("./packages/ckeditor5-widget/src/index.ts"),h=o("./node_modules/lodash-es/throttle.js"),u=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),p=o.n(u),f=o("./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./packages/ckeditor5-clipboard/theme/clipboard.css"),g={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};p()(f.Z,g);f.Z.locals;class m extends s.Sy{static get pluginName(){return"DragDrop"}static get requires(){return[l,d.$L]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=(0,h.Z)((e=>this._updateDropMarker(e)),40),this._removeDropMarkerDelayed=w((()=>this._removeDropMarker()),40),this._clearDraggableAttributesDelayed=w((()=>this._clearDraggableAttributes()),40),t.addObserver(r),t.addObserver(n.dM),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((e,t,o)=>{o?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((e,t,o)=>{o||this._finalizeDragging(!1)})),i.OB.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,o=t.document,s=e.editing.view,r=s.document;this.listenTo(r,"dragstart",((s,a)=>{const c=o.selection;if(a.target&&a.target.is("editableElement"))return void a.preventDefault();const l=a.target?k(a.target):null;if(l){const o=e.editing.mapper.toModelElement(l);this._draggedRange=n.iE.fromRange(t.createRangeOn(o)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!r.selection.isCollapsed){const e=r.selection.getSelectedElement();e&&(0,d.Qd)(e)||(this._draggedRange=n.iE.fromRange(c.getFirstRange()))}if(!this._draggedRange)return void a.preventDefault();this._draggingUid=(0,i.hQ)(),a.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const h=t.createSelection(this._draggedRange.toRange()),u=e.data.toView(t.getSelectedContent(h));r.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:u,method:"dragstart"}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(r,"dragend",((e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)}),{priority:"low"}),this.listenTo(r,"dragenter",(()=>{this.isEnabled&&s.focus()})),this.listenTo(r,"dragleave",(()=>{this._removeDropMarkerDelayed()})),this.listenTo(r,"dragging",((t,o)=>{if(!this.isEnabled)return void(o.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const s=b(e,o.targetRanges,o.target);this._draggedRange||(o.dataTransfer.dropEffect="copy"),i.OB.isGecko||("copy"==o.dataTransfer.effectAllowed?o.dataTransfer.dropEffect="copy":["all","copyMove"].includes(o.dataTransfer.effectAllowed)&&(o.dataTransfer.dropEffect="move")),s&&this._updateDropMarkerThrottled(s)}),{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",((t,o)=>{if("drop"!=o.method)return;const s=b(e,o.targetRanges,o.target);if(this._removeDropMarker(),!s)return this._finalizeDragging(!1),void t.stop();this._draggedRange&&this._draggingUid!=o.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==_(o.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(s,!0))return this._finalizeDragging(!1),void t.stop();o.targetRanges=[e.editing.mapper.toViewRange(s)]}),{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(l);e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const o=t.targetRanges.map((e=>this.editor.editing.mapper.toModelRange(e)));this.editor.model.change((e=>e.setSelection(o)))}),{priority:"high"}),e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const o="move"==_(t.dataTransfer),s=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(s&&o)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,o=t.document;this.listenTo(o,"mousedown",((s,n)=>{if(i.OB.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let r=k(n.target);if(i.OB.isBlink&&!e.isReadOnly&&!r&&!o.selection.isCollapsed){const e=o.selection.getSelectedElement();e&&(0,d.Qd)(e)||(r=o.selection.editableElement)}r&&(t.change((e=>{e.setAttribute("draggable","true",r)})),this._draggableElement=e.editing.mapper.toModelElement(r))})),this.listenTo(o,"mouseup",(()=>{i.OB.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change((t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:o})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return o.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(e){const t=this.toDomElement(e);return t.append("⁠",e.createElement("span"),"⁠"),t}))}})}_updateDropMarker(e){const t=this.editor,o=t.model.markers;t.model.change((t=>{o.has("drop-target")?o.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})}))}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change((e=>{e.removeMarker("drop-target")}))}_finalizeDragging(e){const t=this.editor,o=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&o.deleteContent(o.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function b(e,t,o){const s=e.model,n=e.editing.mapper;let r=null;const a=t?t[0].start:null;if(o.is("uiElement")&&(o=o.parent),r=function(e,t){const o=e.model,s=e.editing.mapper;if((0,d.Qd)(t))return o.createRangeOn(s.toModelElement(t));if(!t.is("editableElement")){const e=t.findAncestor((e=>(0,d.Qd)(e)||e.is("editableElement")));if((0,d.Qd)(e))return o.createRangeOn(s.toModelElement(e))}return null}(e,o),r)return r;const c=function(e,t){const o=e.editing.mapper,s=e.editing.view,i=o.toModelElement(t);if(i)return i;const n=s.createPositionBefore(t),r=o.findMappedViewAncestor(n);return o.toModelElement(r)}(e,o),l=a?n.toModelPosition(a):null;return l?(r=function(e,t,o){const s=e.model;if(!s.schema.checkChild(o,"$block"))return null;const i=s.createPositionAt(o,0),n=t.path.slice(0,i.path.length),r=s.createPositionFromPath(t.root,n),a=r.nodeAfter;if(a&&s.schema.isObject(a))return s.createRangeOn(a);return null}(e,l,c),r||(r=s.schema.getNearestSelectionRange(l,i.OB.isGecko?"forward":"backward"),r||function(e,t){const o=e.model;let s=t;for(;s;){if(o.schema.isObject(s))return o.createRangeOn(s);s=s.parent}return null}(e,l.parent))):function(e,t){const o=e.model,s=o.schema,i=o.createPositionAt(t,0);return s.getNearestSelectionRange(i,"forward")}(e,c)}function _(e){return i.OB.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function w(e,t){let o;function s(...i){s.cancel(),o=setTimeout((()=>e(...i)),t)}return s.cancel=()=>{clearTimeout(o)},s}function k(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(d.Qd);if((0,d.Qd)(e))return e;const t=e.findAncestor((e=>(0,d.Qd)(e)||e.is("editableElement")));return(0,d.Qd)(t)?t:null}class v extends s.Sy{static get pluginName(){return"PastePlainText"}static get requires(){return[l]}init(){const e=this.editor,t=e.model,o=e.editing.view,s=o.document,i=t.document.selection;let n=!1;o.addObserver(r),this.listenTo(s,"keydown",((e,t)=>{n=t.shiftKey})),e.plugins.get(l).on("contentInsertion",((e,o)=>{(n||function(e,t){if(e.childCount>1)return!1;const o=e.getChild(0);if(t.isObject(o))return!1;return 0==Array.from(o.getAttributeKeys()).length}(o.content,t.schema))&&t.change((e=>{const s=Array.from(i.getAttributes()).filter((([e])=>t.schema.getAttributeProperties(e).isFormatting));i.isCollapsed||t.deleteContent(i,{doNotAutoparagraph:!0}),s.push(...i.getAttributes());const n=e.createRangeIn(o.content);for(const t of n.getItems())t.is("$textProxy")&&e.setAttributes(s,t)}))}))}}class y extends s.Sy{static get pluginName(){return"Clipboard"}static get requires(){return[l,m,v]}}},"./src/core.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Command:()=>s.mY,Context:()=>s._y,ContextPlugin:()=>s.eO,DataApiMixin:()=>s.W9,Editor:()=>s.ML,ElementApiMixin:()=>s.xK,MultiCommand:()=>s.AJ,PendingActions:()=>s.lR,Plugin:()=>s.Sy,attachToForm:()=>s.P$,icons:()=>s.ci,secureSourceElement:()=>s.Nu});var s=o("./packages/ckeditor5-core/src/index.ts")},"./src/engine.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{AttributeElement:()=>s.kW,BubblingEventInfo:()=>s.r7,ClickObserver:()=>s.KU,Conversion:()=>s.uz,DataController:()=>s.Yc,DataTransfer:()=>s.tn,DocumentFragment:()=>s.f4,DocumentSelection:()=>s.uj,DomConverter:()=>s.pG,DomEventData:()=>s.dK,DomEventObserver:()=>s.qZ,DowncastWriter:()=>s.qD,EditingController:()=>s.jH,Element:()=>s.W_,History:()=>s.Ay,HtmlDataProcessor:()=>s.X5,InsertOperation:()=>s.IZ,LivePosition:()=>s.jP,LiveRange:()=>s.iE,MarkerOperation:()=>s.zj,Matcher:()=>s.xO,Model:()=>s.Hn,MouseObserver:()=>s.dM,Observer:()=>s.Qj,OperationFactory:()=>s.Bz,Position:()=>s.Ly,Range:()=>s.e6,Renderer:()=>s.Th,StylesProcessor:()=>s.A_,TabObserver:()=>s.aY,Text:()=>s.xv,TreeWalker:()=>s.Po,UpcastWriter:()=>s.yj,View:()=>s.G7,ViewAttributeElement:()=>s.m1,ViewContainerElement:()=>s.By,ViewDocument:()=>s.Ux,ViewDocumentFragment:()=>s.y_,ViewEditableElement:()=>s.W2,ViewElement:()=>s.y9,ViewEmptyElement:()=>s.pc,ViewRawElement:()=>s.wx,ViewText:()=>s.Xj,ViewUIElement:()=>s.dq,addBackgroundRules:()=>s.QR,addBorderRules:()=>s.sI,addMarginRules:()=>s.vt,addPaddingRules:()=>s.J8,disablePlaceholder:()=>s.DA,enablePlaceholder:()=>s.ID,findOptimalInsertionRange:()=>s.KT,getBoxSidesShorthandValue:()=>s.I8,getBoxSidesValueReducer:()=>s.mq,getBoxSidesValues:()=>s.oz,getFillerOffset:()=>s.YG,getPositionShorthandNormalizer:()=>s.m0,getShorthandValues:()=>s.uT,hidePlaceholder:()=>s.$_,isAttachment:()=>s.SB,isColor:()=>s.D5,isLength:()=>s.G9,isLineStyle:()=>s.IT,isPercentage:()=>s.zz,isPosition:()=>s.WK,isRepeat:()=>s.Zb,isURL:()=>s.PX,needsPlaceholder:()=>s.Q7,showPlaceholder:()=>s.NJ,transformSets:()=>s.Rf});var s=o("./packages/ckeditor5-engine/src/index.ts")},"./src/enter.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Enter:()=>s.C,ShiftEnter:()=>s.G});var s=o("./packages/ckeditor5-enter/src/index.ts")},"./src/paragraph.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Paragraph:()=>c,ParagraphButtonUI:()=>h});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts");class n extends s.mY{refresh(){const e=this.editor.model,t=e.document,o=(0,i.Ps)(t.selection.getSelectedBlocks());this.value=!!o&&o.is("element","paragraph"),this.isEnabled=!!o&&r(o,e.schema)}execute(e={}){const t=this.editor.model,o=t.document;t.change((s=>{const i=(e.selection||o.selection).getSelectedBlocks();for(const e of i)!e.is("element","paragraph")&&r(e,t.schema)&&s.rename(e,"paragraph")}))}}function r(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class a extends s.mY{execute(e){const t=this.editor.model,o=e.attributes;let s=e.position;t.change((e=>{const i=e.createElement("paragraph");if(o&&t.schema.setAllowedAttributes(i,o,e),!t.schema.checkChild(s.parent,i)){const o=t.schema.findAllowedParent(s,i);if(!o)return;s=e.split(s,o).position}t.insertContent(i,s),e.setSelection(i,"in")}))}}class c extends s.Sy{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new n(e)),e.commands.add("insertParagraph",new a(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>c.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}c.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);var l=o("./packages/ckeditor5-ui/src/index.ts");const d=s.ci.paragraph;class h extends s.Sy{static get requires(){return[c]}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("paragraph",(o=>{const s=new l.r5(o),i=e.commands.get("paragraph");return s.label=t("Paragraph"),s.icon=d,s.tooltip=!0,s.isToggleable=!0,s.bind("isEnabled").to(i),s.bind("isOn").to(i,"value"),s.on("execute",(()=>{e.execute("paragraph")})),s}))}}},"./src/select-all.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{SelectAll:()=>h,SelectAllEditing:()=>c,SelectAllUI:()=>d});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts");class n extends s.mY{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let o=e.schema.getLimitElement(t);if(t.containsEntireContent(o)||!r(e.schema,o))do{if(o=o.parent,!o)return}while(!r(e.schema,o));e.change((e=>{e.setSelection(o,"in")}))}}function r(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const a=(0,i.Zz)("Ctrl+A");class c extends s.Sy{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new n(e)),this.listenTo(t,"keydown",((t,o)=>{(0,i.Cq)(o)===a&&(e.execute("selectAll"),o.preventDefault())}))}}var l=o("./packages/ckeditor5-ui/src/index.ts");class d extends s.Sy{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",(t=>{const o=e.commands.get("selectAll"),s=new l.r5(t),i=t.t;return s.set({label:i("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),s.bind("isEnabled").to(o,"isEnabled"),this.listenTo(s,"execute",(()=>{e.execute("selectAll"),e.editing.view.focus()})),s}))}}class h extends s.Sy{static get requires(){return[c,d]}static get pluginName(){return"SelectAll"}}},"./src/typing.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Delete:()=>s.HG,Input:()=>s.II,TextTransformation:()=>s.cL,TextWatcher:()=>s.uL,TwoStepCaretMovement:()=>s.mh,Typing:()=>s.Mq,findAttributeRange:()=>s.VD,getLastTextLine:()=>s.Up,inlineHighlight:()=>s.Im});var s=o("./packages/ckeditor5-typing/src/index.ts")},"./src/ui.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{BalloonPanelView:()=>s.no,BalloonToolbar:()=>s.Jf,BlockToolbar:()=>s.ee,BodyCollection:()=>s.BK,BoxedEditorUIView:()=>s.py,ButtonView:()=>s.r5,ColorGridView:()=>s.J6,ColorTileView:()=>s._9,ComponentFactory:()=>s._Y,ContextualBalloon:()=>s.WB,DropdownButtonView:()=>s.J0,DropdownView:()=>s._n,EditorUI:()=>s.S8,EditorUIView:()=>s.fF,FocusCycler:()=>s.I0,FormHeaderView:()=>s.Gp,IconView:()=>s.mO,IframeView:()=>s.VY,InlineEditableUIView:()=>s.r1,InputNumberView:()=>s.Xs,InputTextView:()=>s.pq,InputView:()=>s.Em,LabelView:()=>s.Dn,LabeledFieldView:()=>s.KP,ListItemView:()=>s.dn,ListView:()=>s.Bv,Model:()=>s.Hn,Notification:()=>s.P_,SplitButtonView:()=>s.Rm,StickyPanelView:()=>s.lp,SwitchButtonView:()=>s.BM,Template:()=>s.YS,ToolbarSeparatorView:()=>s.$y,ToolbarView:()=>s.jB,TooltipManager:()=>s.gE,View:()=>s.G7,ViewCollection:()=>s.vX,addKeyboardHandlingForGrid:()=>s.IJ,addListToDropdown:()=>s.Pm,addToolbarToDropdown:()=>s.up,clickOutsideHandler:()=>s.eC,createDropdown:()=>s.t9,createLabeledDropdown:()=>s.FH,createLabeledInputNumber:()=>s.sh,createLabeledInputText:()=>s.R,focusChildOnDropdownOpen:()=>s.Mh,getLocalizedColorOptions:()=>s.k6,injectCssTransitionDisabler:()=>s.fe,normalizeColorOptions:()=>s.S1,normalizeSingleColorDefinition:()=>s.jY,normalizeToolbarConfig:()=>s.iw,submitHandler:()=>s.GI});var s=o("./packages/ckeditor5-ui/src/index.ts")},"./src/undo.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Undo:()=>g,UndoEditing:()=>d,UndoUi:()=>f});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-engine/src/index.ts");class n extends s.mY{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",((e,t)=>{t[1]={...t[1]};const o=t[1];o.batchType||(o.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(e.data,"set",((e,t)=>{t[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,o={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:o}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,o){const s=this.editor.model,i=s.document,n=[],c=e.map((e=>e.getTransformedByOperations(o))),l=c.flat();for(const e of c){const t=e.filter((e=>e.root!=i.graveyard)).filter((e=>!a(e,l)));t.length&&(r(t),n.push(t[0]))}n.length&&s.change((e=>{e.setSelection(n,{backward:t})}))}_undo(e,t){const o=this.editor.model,s=o.document;this._createdBatches.add(t);const n=e.operations.slice().filter((e=>e.isDocumentOperation));n.reverse();for(const e of n){const n=e.baseVersion+1,r=Array.from(s.history.getOperations(n)),a=(0,i.Rf)([e.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const i of a)t.addOperation(i),o.applyOperation(i),s.history.setOperationAsUndone(e,i)}}}function r(e){e.sort(((e,t)=>e.start.isBefore(t.start)?-1:1));for(let t=1;tt!==e&&t.containsRange(e,!0)))}class c extends n{execute(e=null){const t=e?this._stack.findIndex((t=>t.batch==e)):this._stack.length-1,o=this._stack.splice(t,1)[0],s=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(s,(()=>{this._undo(o.batch,s);const e=this.editor.model.document.history.getOperations(o.batch.baseVersion);this._restoreSelection(o.selection.ranges,o.selection.isBackward,e),this.fire("revert",o.batch,s)})),this.refresh()}}class l extends n{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,(()=>{const o=e.batch.operations[e.batch.operations.length-1].baseVersion+1,s=this.editor.model.document.history.getOperations(o);this._restoreSelection(e.selection.ranges,e.selection.isBackward,s),this._undo(e.batch,t)})),this.refresh()}}class d extends s.Sy{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new c(e),this._redoCommand=new l(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",((e,t)=>{const o=t[0];if(!o.isDocumentOperation)return;const s=o.batch,i=this._redoCommand._createdBatches.has(s),n=this._undoCommand._createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(i?this._undoCommand.addBatch(s):n||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((e,t,o)=>{this._redoCommand.addBatch(o)})),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var h=o("./packages/ckeditor5-ui/src/index.ts");const u='',p='';class f extends s.Sy{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,o=e.t,s="ltr"==t.uiLanguageDirection?u:p,i="ltr"==t.uiLanguageDirection?p:u;this._addButton("undo",o("Undo"),"CTRL+Z",s),this._addButton("redo",o("Redo"),"CTRL+Y",i)}_addButton(e,t,o,s){const i=this.editor;i.ui.componentFactory.add(e,(n=>{const r=i.commands.get(e),a=new h.r5(n);return a.set({label:t,icon:s,keystroke:o,tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",(()=>{i.execute(e),i.editing.view.focus()})),a}))}}class g extends s.Sy{static get requires(){return[d,f]}static get pluginName(){return"Undo"}}},"./src/upload.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{Base64UploadAdapter:()=>h,FileDialogButtonView:()=>l,FileRepository:()=>r,SimpleUploadAdapter:()=>p});var s=o("./packages/ckeditor5-core/src/index.ts"),i=o("./packages/ckeditor5-utils/src/index.ts");class n extends((0,i.Re)()){constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,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;return this.total=e.size,new Promise(((o,s)=>{t.onload=()=>{const e=t.result;this._data=e,o(e)},t.onerror=()=>{s("error")},t.onabort=()=>{s("aborted")},this._reader.readAsDataURL(e)}))}abort(){this._reader.abort()}}class r extends s.Sy{static get pluginName(){return"FileRepository"}static get requires(){return[s.lR]}init(){this.loaders=new i.FE,this.loaders.on("change",(()=>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)return(0,i.KE)("filerepository-no-upload-adapter"),null;const t=new a(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),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)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e})),t}destroyLoader(e){const t=e instanceof a?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach(((e,o)=>{e===t&&this._loadersMap.delete(o)}))}_updatePendingAction(){const e=this.editor.plugins.get(s.lR);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,o=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(o(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",o)}}else e.remove(this._pendingAction),this._pendingAction=null}}class a extends((0,i.Re)()){constructor(e,t){super(),this.id=(0,i.hQ)(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new n,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(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then((e=>this._filePromiseWrapper?e:null)):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new i.Bb("filerepository-read-wrong-status",this);return this.status="reading",this.file.then((e=>this._reader.read(e))).then((e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e})).catch((e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e}))}upload(){if("idle"!=this.status)throw new i.Bb("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then((()=>this._adapter.upload())).then((e=>(this.uploadResponse=e,this.status="idle",e))).catch((e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e}))}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch((()=>{})),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise(((o,s)=>{t.rejecter=s,t.isFulfilled=!1,e.then((e=>{t.isFulfilled=!0,o(e)})).catch((e=>{t.isFulfilled=!0,s(e)}))})),t}}var c=o("./packages/ckeditor5-ui/src/index.ts");class l extends c.G7{constructor(e){super(e),this.buttonView=new c.r5(e),this._fileInputView=new d(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 d extends c.G7{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);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((()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""}))}})}open(){this.element.click()}}class h extends s.Sy{static get requires(){return[r]}static get pluginName(){return"Base64UploadAdapter"}init(){this.editor.plugins.get(r).createUploadAdapter=e=>new u(e)}}class u{constructor(e){this.loader=e}upload(){return new Promise(((e,t)=>{const o=this.reader=new window.FileReader;o.addEventListener("load",(()=>{e({default:o.result})})),o.addEventListener("error",(e=>{t(e)})),o.addEventListener("abort",(()=>{t()})),this.loader.file.then((e=>{o.readAsDataURL(e)}))}))}abort(){this.reader.abort()}}class p extends s.Sy{static get requires(){return[r]}static get pluginName(){return"SimpleUploadAdapter"}init(){const e=this.editor.config.get("simpleUpload");e&&(e.uploadUrl?this.editor.plugins.get(r).createUploadAdapter=t=>new f(t,e):(0,i.KE)("simple-upload-adapter-missing-uploadurl"))}}class f{constructor(e,t){this.loader=e,this.options=t}upload(){return this.loader.file.then((e=>new Promise(((t,o)=>{this._initRequest(),this._initListeners(t,o,e),this._sendRequest(e)}))))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,!0),e.responseType="json"}_initListeners(e,t,o){const s=this.xhr,i=this.loader,n=`Couldn't upload file: ${o.name}.`;s.addEventListener("error",(()=>t(n))),s.addEventListener("abort",(()=>t())),s.addEventListener("load",(()=>{const o=s.response;if(!o||o.error)return t(o&&o.error&&o.error.message?o.error.message:n);const i=o.url?{default:o.url}:o.urls;e({...o,urls:i})})),s.upload&&s.upload.addEventListener("progress",(e=>{e.lengthComputable&&(i.uploadTotal=e.total,i.uploaded=e.loaded)}))}_sendRequest(e){const t=this.options.headers||{},o=this.options.withCredentials||!1;for(const e of Object.keys(t))this.xhr.setRequestHeader(e,t[e]);this.xhr.withCredentials=o;const s=new FormData;s.append("upload",e),this.xhr.send(s)}}},"./src/utils.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{CKEditorError:()=>s.Bb,Collection:()=>s.FE,Config:()=>s.De,DomEmitterMixin:()=>s.Xu,ElementReplacer:()=>s.a6,EmitterMixin:()=>s.ln,EventInfo:()=>s.M3,FocusTracker:()=>s.Rh,KeystrokeHandler:()=>s.VD,Locale:()=>s.go,ObservableMixin:()=>s.Re,Rect:()=>s.UL,ResizeObserver:()=>s.do,compareArrays:()=>s.Rt,count:()=>s.QX,createElement:()=>s.az,diff:()=>s.Hg,env:()=>s.OB,fastDiff:()=>s.HZ,findClosestScrollableAncestor:()=>s.wm,first:()=>s.Ps,getAncestors:()=>s.dk,getCode:()=>s.Cq,getDataFromElement:()=>s.yy,getEnvKeystrokeText:()=>s.XU,getLanguageDirection:()=>s.j9,getLocalizedArrowKeyCodeDirection:()=>s.mA,getOptimalPosition:()=>s.xZ,global:()=>s.CO,indexOf:()=>s.cq,insertAt:()=>s.ZQ,insertToPriorityArray:()=>s.VG,isArrowKeyCode:()=>s.dj,isCombiningMark:()=>s.tO,isComment:()=>s.C3,isForwardArrowKeyCode:()=>s.Zt,isHighSurrogateHalf:()=>s.Cb,isInsideCombinedSymbol:()=>s.pp,isInsideEmojiSequence:()=>s.YK,isInsideSurrogatePair:()=>s.to,isIterable:()=>s.TW,isLowSurrogateHalf:()=>s.nA,isNode:()=>s.UG,isRange:()=>s.bR,isText:()=>s.Gs,isVisible:()=>s.pn,keyCodes:()=>s.Do,logError:()=>s.H,logWarning:()=>s.KE,mix:()=>s.CD,parseKeystroke:()=>s.Zz,priorities:()=>s.tA,remove:()=>s.Od,scrollAncestorsToShowTarget:()=>s.F0,scrollViewportToShowTarget:()=>s.mR,setDataInElement:()=>s.jS,spliceArray:()=>s.x,toArray:()=>s.qo,toMap:()=>s.qL,toUnit:()=>s.nn,uid:()=>s.hQ,version:()=>s.i8});var s=o("./packages/ckeditor5-utils/src/index.ts")},"./src/widget.js":(e,t,o)=>{"use strict";o.r(t),o.d(t,{WIDGET_CLASS_NAME:()=>s.s4,WIDGET_SELECTED_CLASS_NAME:()=>s.Uo,Widget:()=>s.$L,WidgetResize:()=>s.WR,WidgetToolbarRepository:()=>s.e8,WidgetTypeAround:()=>s.Ww,findOptimalInsertionRange:()=>s.KT,getLabel:()=>s.id,isWidget:()=>s.Qd,setHighlightHandling:()=>s.em,setLabel:()=>s.l6,toWidget:()=>s.XC,toWidgetEditable:()=>s.sC,viewToModelPositionOutsideModelElement:()=>s.$n});var s=o("./packages/ckeditor5-widget/src/index.ts")},"?7cdd":(e,t,o)=>{e.exports=o},"./node_modules/lodash-es/_ListCache.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>u});const s=function(){this.__data__=[],this.size=0};var i=o("./node_modules/lodash-es/eq.js");const n=function(e,t){for(var o=e.length;o--;)if((0,i.Z)(e[o][0],t))return o;return-1};var r=Array.prototype.splice;const a=function(e){var t=this.__data__,o=n(t,e);return!(o<0)&&(o==t.length-1?t.pop():r.call(t,o,1),--this.size,!0)};const c=function(e){var t=this.__data__,o=n(t,e);return o<0?void 0:t[o][1]};const l=function(e){return n(this.__data__,e)>-1};const d=function(e,t){var o=this.__data__,s=n(o,e);return s<0?(++this.size,o.push([e,t])):o[s][1]=t,this};function h(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_getNative.js"),i=o("./node_modules/lodash-es/_root.js");const n=(0,s.Z)(i.Z,"Map")},"./node_modules/lodash-es/_MapCache.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>T});const s=(0,o("./node_modules/lodash-es/_getNative.js").Z)(Object,"create");const i=function(){this.__data__=s?s(null):{},this.size=0};const n=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var r="__lodash_hash_undefined__",a=Object.prototype.hasOwnProperty;const c=function(e){var t=this.__data__;if(s){var o=t[e];return o===r?void 0:o}return a.call(t,e)?t[e]:void 0};var l=Object.prototype.hasOwnProperty;const d=function(e){var t=this.__data__;return s?void 0!==t[e]:l.call(t,e)};var h="__lodash_hash_undefined__";const u=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=s&&void 0===t?h:t,this};function p(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t{"use strict";o.d(t,{Z:()=>p});var s=o("./node_modules/lodash-es/_ListCache.js");const i=function(){this.__data__=new s.Z,this.size=0};const n=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o};const r=function(e){return this.__data__.get(e)};const a=function(e){return this.__data__.has(e)};var c=o("./node_modules/lodash-es/_Map.js"),l=o("./node_modules/lodash-es/_MapCache.js"),d=200;const h=function(e,t){var o=this.__data__;if(o instanceof s.Z){var i=o.__data__;if(!c.Z||i.length{"use strict";o.d(t,{Z:()=>s});const s=o("./node_modules/lodash-es/_root.js").Z.Symbol},"./node_modules/lodash-es/_Uint8Array.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=o("./node_modules/lodash-es/_root.js").Z.Uint8Array},"./node_modules/lodash-es/_arrayLikeKeys.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>d});const s=function(e,t){for(var o=-1,s=Array(e);++o{"use strict";o.d(t,{Z:()=>s});const s=function(e,t){for(var o=-1,s=t.length,i=e.length;++o{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/_baseAssignValue.js"),i=o("./node_modules/lodash-es/eq.js"),n=Object.prototype.hasOwnProperty;const r=function(e,t,o){var r=e[t];n.call(e,t)&&(0,i.Z)(r,o)&&(void 0!==o||t in e)||(0,s.Z)(e,t,o)}},"./node_modules/lodash-es/_baseAssignValue.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_defineProperty.js");const i=function(e,t,o){"__proto__"==t&&s.Z?(0,s.Z)(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}},"./node_modules/lodash-es/_baseClone.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>Pe});var s=o("./node_modules/lodash-es/_Stack.js");const i=function(e,t){for(var o=-1,s=null==e?0:e.length;++o{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_arrayPush.js"),i=o("./node_modules/lodash-es/isArray.js");const n=function(e,t,o){var n=t(e);return(0,i.Z)(e)?n:(0,s.Z)(n,o(e))}},"./node_modules/lodash-es/_baseGetTag.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>f});var s=o("./node_modules/lodash-es/_Symbol.js"),i=Object.prototype,n=i.hasOwnProperty,r=i.toString,a=s.Z?s.Z.toStringTag:void 0;const c=function(e){var t=n.call(e,a),o=e[a];try{e[a]=void 0;var s=!0}catch(e){}var i=r.call(e);return s&&(t?e[a]=o:delete e[a]),i};var l=Object.prototype.toString;const d=function(e){return l.call(e)};var h="[object Null]",u="[object Undefined]",p=s.Z?s.Z.toStringTag:void 0;const f=function(e){return null==e?void 0===e?u:h:p&&p in Object(e)?c(e):d(e)}},"./node_modules/lodash-es/_baseUnary.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e){return function(t){return e(t)}}},"./node_modules/lodash-es/_cloneArrayBuffer.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_Uint8Array.js");const i=function(e){var t=new e.constructor(e.byteLength);return new s.Z(t).set(new s.Z(e)),t}},"./node_modules/lodash-es/_cloneBuffer.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>c});var s=o("./node_modules/lodash-es/_root.js"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,n=i&&"object"==typeof module&&module&&!module.nodeType&&module,r=n&&n.exports===i?s.Z.Buffer:void 0,a=r?r.allocUnsafe:void 0;const c=function(e,t){if(t)return e.slice();var o=e.length,s=a?a(o):new e.constructor(o);return e.copy(s),s}},"./node_modules/lodash-es/_cloneTypedArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_cloneArrayBuffer.js");const i=function(e,t){var o=t?(0,s.Z)(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}},"./node_modules/lodash-es/_copyArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e,t){var o=-1,s=e.length;for(t||(t=Array(s));++o{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_assignValue.js"),i=o("./node_modules/lodash-es/_baseAssignValue.js");const n=function(e,t,o,n){var r=!o;o||(o={});for(var a=-1,c=t.length;++a{"use strict";o.d(t,{Z:()=>k});const s=function(e){return e};const i=function(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)};var n=Math.max;const r=function(e,t,o){return t=n(void 0===t?e.length-1:t,0),function(){for(var s=arguments,r=-1,a=n(s.length-t,0),c=Array(a);++r0){if(++t>=d)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(l);const f=function(e,t){return p(r(e,t,s),e+"")};var g=o("./node_modules/lodash-es/eq.js"),m=o("./node_modules/lodash-es/isArrayLike.js"),b=o("./node_modules/lodash-es/_isIndex.js"),_=o("./node_modules/lodash-es/isObject.js");const w=function(e,t,o){if(!(0,_.Z)(o))return!1;var s=typeof t;return!!("number"==s?(0,m.Z)(o)&&(0,b.Z)(t,o.length):"string"==s&&t in o)&&(0,g.Z)(o[t],e)};const k=function(e){return f((function(t,o){var s=-1,i=o.length,n=i>1?o[i-1]:void 0,r=i>2?o[2]:void 0;for(n=e.length>3&&"function"==typeof n?(i--,n):void 0,r&&w(o[0],o[1],r)&&(n=i<3?void 0:n,i=1),t=Object(t);++s{"use strict";o.d(t,{Z:()=>i});var s=o("./node_modules/lodash-es/_getNative.js");const i=function(){try{var e=(0,s.Z)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},"./node_modules/lodash-es/_freeGlobal.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s="object"==typeof global&&global&&global.Object===Object&&global},"./node_modules/lodash-es/_getAllKeys.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/_baseGetAllKeys.js"),i=o("./node_modules/lodash-es/_getSymbols.js"),n=o("./node_modules/lodash-es/keys.js");const r=function(e){return(0,s.Z)(e,n.Z,i.Z)}},"./node_modules/lodash-es/_getNative.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>_});var s=o("./node_modules/lodash-es/isFunction.js");const i=o("./node_modules/lodash-es/_root.js").Z["__core-js_shared__"];var n,r=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";const a=function(e){return!!r&&r in e};var c=o("./node_modules/lodash-es/isObject.js"),l=o("./node_modules/lodash-es/_toSource.js"),d=/^\[object .+?Constructor\]$/,h=Function.prototype,u=Object.prototype,p=h.toString,f=u.hasOwnProperty,g=RegExp("^"+p.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const m=function(e){return!(!(0,c.Z)(e)||a(e))&&((0,s.Z)(e)?g:d).test((0,l.Z)(e))};const b=function(e,t){return null==e?void 0:e[t]};const _=function(e,t){var o=b(e,t);return m(o)?o:void 0}},"./node_modules/lodash-es/_getPrototype.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=(0,o("./node_modules/lodash-es/_overArg.js").Z)(Object.getPrototypeOf,Object)},"./node_modules/lodash-es/_getSymbols.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>a});const s=function(e,t){for(var o=-1,s=null==e?0:e.length,i=0,n=[];++o{"use strict";o.d(t,{Z:()=>x});var s=o("./node_modules/lodash-es/_getNative.js"),i=o("./node_modules/lodash-es/_root.js");const n=(0,s.Z)(i.Z,"DataView");var r=o("./node_modules/lodash-es/_Map.js");const a=(0,s.Z)(i.Z,"Promise");const c=(0,s.Z)(i.Z,"Set");const l=(0,s.Z)(i.Z,"WeakMap");var d=o("./node_modules/lodash-es/_baseGetTag.js"),h=o("./node_modules/lodash-es/_toSource.js"),u="[object Map]",p="[object Promise]",f="[object Set]",g="[object WeakMap]",m="[object DataView]",b=(0,h.Z)(n),_=(0,h.Z)(r.Z),w=(0,h.Z)(a),k=(0,h.Z)(c),v=(0,h.Z)(l),y=d.Z;(n&&y(new n(new ArrayBuffer(1)))!=m||r.Z&&y(new r.Z)!=u||a&&y(a.resolve())!=p||c&&y(new c)!=f||l&&y(new l)!=g)&&(y=function(e){var t=(0,d.Z)(e),o="[object Object]"==t?e.constructor:void 0,s=o?(0,h.Z)(o):"";if(s)switch(s){case b:return m;case _:return u;case w:return p;case k:return f;case v:return g}return t});const x=y},"./node_modules/lodash-es/_initCloneObject.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>c});var s=o("./node_modules/lodash-es/isObject.js"),i=Object.create;const n=function(){function e(){}return function(t){if(!(0,s.Z)(t))return{};if(i)return i(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}}();var r=o("./node_modules/lodash-es/_getPrototype.js"),a=o("./node_modules/lodash-es/_isPrototype.js");const c=function(e){return"function"!=typeof e.constructor||(0,a.Z)(e)?{}:n((0,r.Z)(e))}},"./node_modules/lodash-es/_isIndex.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=9007199254740991,i=/^(?:0|[1-9]\d*)$/;const n=function(e,t){var o=typeof e;return!!(t=null==t?s:t)&&("number"==o||"symbol"!=o&&i.test(e))&&e>-1&&e%1==0&&e{"use strict";o.d(t,{Z:()=>i});var s=Object.prototype;const i=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||s)}},"./node_modules/lodash-es/_nodeUtil.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>a});var s=o("./node_modules/lodash-es/_freeGlobal.js"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,n=i&&"object"==typeof module&&module&&!module.nodeType&&module,r=n&&n.exports===i&&s.Z.process;const a=function(){try{var e=n&&n.require&&n.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(e){}}()},"./node_modules/lodash-es/_overArg.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e,t){return function(o){return e(t(o))}}},"./node_modules/lodash-es/_root.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/_freeGlobal.js"),i="object"==typeof self&&self&&self.Object===Object&&self;const n=s.Z||i||Function("return this")()},"./node_modules/lodash-es/_toSource.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=Function.prototype.toString;const i=function(e){if(null!=e){try{return s.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},"./node_modules/lodash-es/assignIn.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/_copyObject.js"),i=o("./node_modules/lodash-es/_createAssigner.js"),n=o("./node_modules/lodash-es/keysIn.js");const r=(0,i.Z)((function(e,t){(0,s.Z)(t,(0,n.Z)(t),e)}))},"./node_modules/lodash-es/cloneDeepWith.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/_baseClone.js"),i=1,n=4;const r=function(e,t){return t="function"==typeof t?t:void 0,(0,s.Z)(e,i|n,t)}},"./node_modules/lodash-es/debounce.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>k});var s=o("./node_modules/lodash-es/isObject.js"),i=o("./node_modules/lodash-es/_root.js");const n=function(){return i.Z.Date.now()};var r=/\s/;const a=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t};var c=/^\s+/;const l=function(e){return e?e.slice(0,a(e)+1).replace(c,""):e};var d=o("./node_modules/lodash-es/isSymbol.js"),h=NaN,u=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,f=/^0o[0-7]+$/i,g=parseInt;const m=function(e){if("number"==typeof e)return e;if((0,d.Z)(e))return h;if((0,s.Z)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=(0,s.Z)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=l(e);var o=p.test(e);return o||f.test(e)?g(e.slice(2),o?2:8):u.test(e)?h:+e};var b="Expected a function",_=Math.max,w=Math.min;const k=function(e,t,o){var i,r,a,c,l,d,h=0,u=!1,p=!1,f=!0;if("function"!=typeof e)throw new TypeError(b);function g(t){var o=i,s=r;return i=r=void 0,h=t,c=e.apply(s,o)}function k(e){var o=e-d;return void 0===d||o>=t||o<0||p&&e-h>=a}function v(){var e=n();if(k(e))return y(e);l=setTimeout(v,function(e){var o=t-(e-d);return p?w(o,a-(e-h)):o}(e))}function y(e){return l=void 0,f&&i?g(e):(i=r=void 0,c)}function x(){var e=n(),o=k(e);if(i=arguments,r=this,d=e,o){if(void 0===l)return function(e){return h=e,l=setTimeout(v,t),u?g(e):c}(d);if(p)return clearTimeout(l),l=setTimeout(v,t),g(d)}return void 0===l&&(l=setTimeout(v,t)),c}return t=m(t)||0,(0,s.Z)(o)&&(u=!!o.leading,a=(p="maxWait"in o)?_(m(o.maxWait)||0,t):a,f="trailing"in o?!!o.trailing:f),x.cancel=function(){void 0!==l&&clearTimeout(l),h=0,i=d=r=l=void 0},x.flush=function(){return void 0===l?c:y(n())},x}},"./node_modules/lodash-es/eq.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e,t){return e===t||e!=e&&t!=t}},"./node_modules/lodash-es/isArguments.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>d});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/isObjectLike.js"),n="[object Arguments]";const r=function(e){return(0,i.Z)(e)&&(0,s.Z)(e)==n};var a=Object.prototype,c=a.hasOwnProperty,l=a.propertyIsEnumerable;const d=r(function(){return arguments}())?r:function(e){return(0,i.Z)(e)&&c.call(e,"callee")&&!l.call(e,"callee")}},"./node_modules/lodash-es/isArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=Array.isArray},"./node_modules/lodash-es/isArrayLike.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/isFunction.js"),i=o("./node_modules/lodash-es/isLength.js");const n=function(e){return null!=e&&(0,i.Z)(e.length)&&!(0,s.Z)(e)}},"./node_modules/lodash-es/isBuffer.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>c});var s=o("./node_modules/lodash-es/_root.js");const i=function(){return!1};var n="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=n&&"object"==typeof module&&module&&!module.nodeType&&module,a=r&&r.exports===n?s.Z.Buffer:void 0;const c=(a?a.isBuffer:void 0)||i},"./node_modules/lodash-es/isElement.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var s=o("./node_modules/lodash-es/isObjectLike.js"),i=o("./node_modules/lodash-es/isPlainObject.js");const n=function(e){return(0,s.Z)(e)&&1===e.nodeType&&!(0,i.Z)(e)}},"./node_modules/lodash-es/isFunction.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>l});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/isObject.js"),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",c="[object Proxy]";const l=function(e){if(!(0,i.Z)(e))return!1;var t=(0,s.Z)(e);return t==r||t==a||t==n||t==c}},"./node_modules/lodash-es/isLength.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>i});var s=9007199254740991;const i=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}},"./node_modules/lodash-es/isObject.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},"./node_modules/lodash-es/isObjectLike.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(e){return null!=e&&"object"==typeof e}},"./node_modules/lodash-es/isPlainObject.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>u});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/_getPrototype.js"),n=o("./node_modules/lodash-es/isObjectLike.js"),r="[object Object]",a=Function.prototype,c=Object.prototype,l=a.toString,d=c.hasOwnProperty,h=l.call(Object);const u=function(e){if(!(0,n.Z)(e)||(0,s.Z)(e)!=r)return!1;var t=(0,i.Z)(e);if(null===t)return!0;var o=d.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&l.call(o)==h}},"./node_modules/lodash-es/isSymbol.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/isObjectLike.js"),n="[object Symbol]";const r=function(e){return"symbol"==typeof e||(0,i.Z)(e)&&(0,s.Z)(e)==n}},"./node_modules/lodash-es/isTypedArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>h});var s=o("./node_modules/lodash-es/_baseGetTag.js"),i=o("./node_modules/lodash-es/isLength.js"),n=o("./node_modules/lodash-es/isObjectLike.js"),r={};r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1;const a=function(e){return(0,n.Z)(e)&&(0,i.Z)(e.length)&&!!r[(0,s.Z)(e)]};var c=o("./node_modules/lodash-es/_baseUnary.js"),l=o("./node_modules/lodash-es/_nodeUtil.js"),d=l.Z&&l.Z.isTypedArray;const h=d?(0,c.Z)(d):a},"./node_modules/lodash-es/keys.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>l});var s=o("./node_modules/lodash-es/_arrayLikeKeys.js"),i=o("./node_modules/lodash-es/_isPrototype.js");const n=(0,o("./node_modules/lodash-es/_overArg.js").Z)(Object.keys,Object);var r=Object.prototype.hasOwnProperty;const a=function(e){if(!(0,i.Z)(e))return n(e);var t=[];for(var o in Object(e))r.call(e,o)&&"constructor"!=o&&t.push(o);return t};var c=o("./node_modules/lodash-es/isArrayLike.js");const l=function(e){return(0,c.Z)(e)?(0,s.Z)(e):a(e)}},"./node_modules/lodash-es/keysIn.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>d});var s=o("./node_modules/lodash-es/_arrayLikeKeys.js"),i=o("./node_modules/lodash-es/isObject.js"),n=o("./node_modules/lodash-es/_isPrototype.js");const r=function(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t};var a=Object.prototype.hasOwnProperty;const c=function(e){if(!(0,i.Z)(e))return r(e);var t=(0,n.Z)(e),o=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&o.push(s);return o};var l=o("./node_modules/lodash-es/isArrayLike.js");const d=function(e){return(0,l.Z)(e)?(0,s.Z)(e,!0):c(e)}},"./node_modules/lodash-es/stubArray.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});const s=function(){return[]}},"./node_modules/lodash-es/throttle.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>r});var s=o("./node_modules/lodash-es/debounce.js"),i=o("./node_modules/lodash-es/isObject.js"),n="Expected a function";const r=function(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(n);return(0,i.Z)(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),(0,s.Z)(e,t,{leading:r,maxWait:t,trailing:a})}},"./node_modules/lodash-es/toString.js":(e,t,o)=>{"use strict";o.d(t,{Z:()=>h});var s=o("./node_modules/lodash-es/_Symbol.js");const i=function(e,t){for(var o=-1,s=null==e?0:e.length,i=Array(s);++o{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var s=o("?7cdd");(window.CKEditor5=window.CKEditor5||{}).dll=s})(),function(e){e.CKEditor5=e.CKEditor5||{};const t=["utils","core","engine","ui","clipboard","enter","paragraph","select-all","typing","undo","upload","widget"];for(const o of t){const t=o.replace(/-([a-z])/g,((e,t)=>t.toUpperCase()));e.CKEditor5[t]=e.CKEditor5.dll(`./src/${o}.js`)}}(window); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/sr-latn.js b/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/sr-latn.js index 6da42b3df9e..6b7c2cd14b1 100644 --- a/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/sr-latn.js +++ b/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/sr-latn.js @@ -1 +1 @@ -!function(a){const e=a["sr-latn"]=a["sr-latn"]||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1",Aquamarine:"Zelenkastoplava",Black:"Crna",Blue:"Plava",Cancel:"Odustani","Cannot upload file:":"Postavljanje fajla je neuspešno:","Dim grey":"Bledo siva","Dropdown toolbar":"Padajuća traka sa alatkama","Edit block":"Blok uređivač","Editor block content toolbar":"Traka sa alatkama za blokiranje sadržaja uređivača","Editor contextual toolbar":"Kontekstualna traka sa alatkama Editor","Editor editing area: %0":"Oblast za uređivanje urednika: %0","Editor toolbar":"Uređivač traka sa alatkama",Green:"Zelena",Grey:"Siva","Insert paragraph after block":"Уметните одломак после блока","Insert paragraph before block":"Уметните одломак пре блока","Light blue":"Svetloplava","Light green":"Svetlo zelena","Light grey":"Svetlo siva",Next:"Sledeći",Orange:"Narandžasta","Press Enter to type after or press Shift + Enter to type before the widget":"",Previous:"Prethodni",Purple:"Ljubičasta",Red:"Crvena",Redo:"Ponovo","Remove color":"Otkloni boju","Restore default":"Vrati podrazumevano","Rich Text Editor":"Prošireni uređivač teksta","Rich Text Editor. Editing area: %0":"",Save:"Sačuvaj","Select all":"Označi sve","Show more items":"Prikaži još stavki",Turquoise:"Tirkizna",Undo:"Povlačenje","Upload in progress":"Postavljanje u toku",White:"Bela","Widget toolbar":"Видгет трака са алаткама",Yellow:"Žuta"}),e.getPluralForm=function(a){return a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file +!function(a){const e=a["sr-latn"]=a["sr-latn"]||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1",Aquamarine:"Zelenkastoplava",Black:"Crna",Blue:"Plava",Cancel:"Odustani","Cannot upload file:":"Postavljanje fajla je neuspešno:","Dim grey":"Bledo siva","Dropdown toolbar":"Padajuća traka sa alatkama","Edit block":"Blok uređivač","Editor block content toolbar":"Traka sa alatkama za blokiranje sadržaja uređivača","Editor contextual toolbar":"Kontekstualna traka sa alatkama Editor","Editor editing area: %0":"Oblast za uređivanje urednika: %0","Editor toolbar":"Uređivač traka sa alatkama",Green:"Zelena",Grey:"Siva","Insert paragraph after block":"Уметните одломак после блока","Insert paragraph before block":"Уметните одломак пре блока","Light blue":"Svetloplava","Light green":"Svetlo zelena","Light grey":"Svetlo siva",Next:"Sledeći",Orange:"Narandžasta","Press Enter to type after or press Shift + Enter to type before the widget":"Pritisnite Enter da kucate posle ili pritisnite Shift + Enter da kucate pre vidžeta",Previous:"Prethodni",Purple:"Ljubičasta",Red:"Crvena",Redo:"Ponovo","Remove color":"Otkloni boju","Restore default":"Vrati podrazumevano","Rich Text Editor":"Prošireni uređivač teksta","Rich Text Editor. Editing area: %0":"",Save:"Sačuvaj","Select all":"Označi sve","Show more items":"Prikaži još stavki",Turquoise:"Tirkizna",Undo:"Povlačenje","Upload in progress":"Postavljanje u toku",White:"Bela","Widget toolbar":"Видгет трака са алаткама",Yellow:"Žuta"}),e.getPluralForm=function(a){return a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/sr.js b/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/sr.js index 0de4f8c39ab..0e11740fe11 100644 --- a/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/sr.js +++ b/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/sr.js @@ -1 +1 @@ -!function(e){const t=e.sr=e.sr||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1",Aquamarine:"Зеленкастоплава",Black:"Црна",Blue:"Плава",Cancel:"Одустани","Cannot upload file:":"Постављање фајла је неуспешно:","Dim grey":"Бледо сива","Dropdown toolbar":"Падајућа трака са алаткама","Edit block":"Блок уређивач","Editor block content toolbar":"Трака са алаткама за блокирање садржаја уређивача","Editor contextual toolbar":"Контекстуална трака са алаткама Едитор","Editor editing area: %0":"Област за уређивање уредника: %0","Editor toolbar":"Уређивач трака са алаткама",Green:"Зелена",Grey:"Сива","Insert paragraph after block":"Umetnite odlomak posle bloka","Insert paragraph before block":"Umetnite odlomak pre bloka","Light blue":"Светлоплава","Light green":"Светлозелена","Light grey":"Светло сива",Next:"Следећи",Orange:"Нараџаста","Press Enter to type after or press Shift + Enter to type before the widget":"Pritisnite Enter da kucate posle ili pritisnite Shift + Enter da kucate pre vidžeta",Previous:"Претходни",Purple:"Љубичаста",Red:"Црвена",Redo:"Поново","Remove color":"Отклони боју","Restore default":"Врати подразумевано","Rich Text Editor":"Проширен уређивач текста","Rich Text Editor. Editing area: %0":"Uređivač obogaćenog teksta. Prostor za uređivanje: %0",Save:"Сачувај","Select all":"Означи све.","Show more items":"Прикажи још ставки",Turquoise:"Тиркизна",Undo:"Повлачење","Upload in progress":"Постављање у току",White:"Бела","Widget toolbar":"Widget traka sa alatkama",Yellow:"Жута"}),t.getPluralForm=function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file +!function(e){const o=e.sr=e.sr||{};o.dictionary=Object.assign(o.dictionary||{},{"%0 of %1":"%0 of %1",Aquamarine:"Зеленкастоплава",Black:"Црна",Blue:"Плава",Cancel:"Одустани","Cannot upload file:":"Постављање фајла је неуспешно:","Dim grey":"Бледо сива","Dropdown toolbar":"Падајућа трака са алаткама","Edit block":"Блок уређивач","Editor block content toolbar":"Трака са алаткама за блокирање садржаја уређивача","Editor contextual toolbar":"Контекстуална трака са алаткама Едитор","Editor editing area: %0":"Област за уређивање уредника: %0","Editor toolbar":"Уређивач трака са алаткама",Green:"Зелена",Grey:"Сива","Insert paragraph after block":"Umetnite odlomak posle bloka","Insert paragraph before block":"Umetnite odlomak pre bloka","Light blue":"Светлоплава","Light green":"Светлозелена","Light grey":"Светло сива",Next:"Следећи",Orange:"Нараџаста","Press Enter to type after or press Shift + Enter to type before the widget":"Притисните Ентер да куцате после или притисните Схифт + Ентер да куцате пре виџета",Previous:"Претходни",Purple:"Љубичаста",Red:"Црвена",Redo:"Поново","Remove color":"Отклони боју","Restore default":"Врати подразумевано","Rich Text Editor":"Проширен уређивач текста","Rich Text Editor. Editing area: %0":"Uređivač obogaćenog teksta. Prostor za uređivanje: %0",Save:"Сачувај","Select all":"Означи све.","Show more items":"Прикажи још ставки",Turquoise:"Тиркизна",Undo:"Повлачење","Upload in progress":"Постављање у току",White:"Бела","Widget toolbar":"Widget traka sa alatkama",Yellow:"Жута"}),o.getPluralForm=function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/ug.js b/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/ug.js index 39cc7ab8243..fa0e414a933 100644 --- a/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/ug.js +++ b/core/assets/vendor/ckeditor5/ckeditor5-dll/translations/ug.js @@ -1 +1 @@ -!function(o){const e=o.ug=o.ug||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"",Aquamarine:"",Black:"",Blue:"",Cancel:"ئىناۋەتسىز","Cannot upload file:":"يۈكلەشكە بولمايدىغان ھۆججەت:","Dim grey":"","Dropdown toolbar":"","Edit block":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor editing area: %0":"","Editor toolbar":"",Green:"",Grey:"","Light blue":"","Light green":"","Light grey":"",Next:"",Orange:"",Previous:"",Purple:"",Red:"",Redo:"تەكرارلاش","Remove color":"رەڭنى چىقىرىۋېتىش","Restore default":"","Rich Text Editor":"تېكىست تەھرىرلىگۈچ","Rich Text Editor. Editing area: %0":"",Save:"ساقلاش","Show more items":"",Turquoise:"",Undo:"يېنىۋېلىش",White:"",Yellow:""}),e.getPluralForm=function(o){return 1!=o}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file +!function(o){const e=o.ug=o.ug||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 / %1",Aquamarine:"",Black:"",Blue:"",Cancel:"ۋاز كەچ","Cannot upload file:":"يۈكلەشكە بولمايدىغان ھۆججەت:","Dim grey":"","Dropdown toolbar":"","Edit block":"","Editor block content toolbar":"","Editor contextual toolbar":"","Editor editing area: %0":"","Editor toolbar":"",Green:"",Grey:"","Light blue":"","Light green":"","Light grey":"",Next:"",Orange:"",Previous:"",Purple:"",Red:"",Redo:"تەكرارلاش","Remove color":"رەڭنى چىقىرىۋەت","Restore default":"كۆڭۈلدىكىگە قايتۇر","Rich Text Editor":"تېكىست تەھرىرلىگۈچ","Rich Text Editor. Editing area: %0":"مول تېكىست تەھرىرلىگۈچ. تەھرىرلەش رايونى: %0",Save:"ساقلا","Show more items":"تېخىمۇ كۆپ تۈرنى كۆرسەت",Turquoise:"",Undo:"يېنىۋېلىش",White:"",Yellow:""}),e.getPluralForm=function(o){return 1!=o}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/code-block/code-block.js b/core/assets/vendor/ckeditor5/code-block/code-block.js index 55f31ee0d75..c3da79f3226 100644 --- a/core/assets/vendor/ckeditor5/code-block/code-block.js +++ b/core/assets/vendor/ckeditor5/code-block/code-block.js @@ -1,5 +1,5 @@ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Insert code block":"Insert code block","Plain text":"Plain text"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var e={67:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(609),i=n.n(o)()((function(e){return e[1]}));i.push([e.id,".ck-content pre{background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;color:#353535;direction:ltr;font-style:normal;min-width:200px;padding:1em;tab-size:4;text-align:left;white-space:pre-wrap}.ck-content pre code{background:unset;border-radius:0;padding: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{background:var(--ck-color-code-block-label-background);color:#fff;font-family:var(--ck-font-face);font-size:10px;line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);right:10px;top:-1px;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}",""]);const r=i},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var r=0;r{"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function c(e){for(var t=-1,n=0;n{e.exports=n(79)("./src/core.js")},492:(e,t,n)=>{e.exports=n(79)("./src/engine.js")},331:(e,t,n)=>{e.exports=n(79)("./src/enter.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},209:(e,t,n)=>{e.exports=n(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={id:o,exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};(()=>{"use strict";n.r(o),n.d(o,{CodeBlock:()=>E,CodeBlockEditing:()=>v,CodeBlockUI:()=>A});var e=n(704),t=n(331),i=n(492),r=n(209);function a(e){const t=e.t,n=e.config.get("codeBlock.languages");for(const e of n)"Plain text"===e.label&&(e.label=t("Plain text")),void 0===e.class&&(e.class=`language-${e.language}`);return n}function c(e,t,n){const o={};for(const i of e)"class"===t?o[i[t].split(" ").shift()]=i[n]:o[i[t]]=i[n];return o}function s(e){return e.data.match(/^(\s*)/)[0]}function l(e){const t=e.document.selection,n=[];if(t.isCollapsed)n.push(t.anchor);else{const o=t.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:t}of o)if(t.is("$textProxy")&&t.parent.is("element","codeBlock")){const o=s(t.textNode),{parent:i,startOffset:r}=t.textNode,a=e.createPositionAt(i,r+o.length);n.push(a)}}return n}function d(e){const t=(0,r.first)(e.getSelectedBlocks());return t&&t.is("element","codeBlock")}function u(e,t){return!t.is("rootElement")&&!e.isLimit(t)&&e.checkChild(t.parent,"codeBlock")}class g extends e.Command{constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor,n=t.model,o=n.document.selection,i=a(t)[0],r=Array.from(o.getSelectedBlocks()),c=void 0===e.forceValue?!this.value:e.forceValue,s=function(e,t,n){if(e.language)return e.language;if(e.usePreviousLanguageChoice&&t)return t;return n}(e,this._lastLanguage,i.language);n.change((e=>{c?this._applyCodeBlock(e,r,s):this._removeCodeBlock(e,r)}))}_getValue(){const e=this.editor.model.document.selection,t=(0,r.first)(e.getSelectedBlocks());return!!!(!t||!t.is("element","codeBlock"))&&t.getAttribute("language")}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=(0,r.first)(e.getSelectedBlocks());return!!n&&u(t,n)}_applyCodeBlock(e,t,n){this._lastLanguage=n;const o=this.editor.model.schema,i=t.filter((e=>u(o,e)));for(const t of i)e.rename(t,"codeBlock"),e.setAttribute("language",n,t),o.removeDisallowedAttributes([t],e),Array.from(t.getChildren()).filter((e=>!o.checkChild(t,e))).forEach((t=>e.remove(t)));i.reverse().forEach(((t,n)=>{const o=i[n+1];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)}}}class f extends e.Command{constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((t=>{const n=l(e);for(const o of n){const n=t.createText(this._indentSequence);e.insertContent(n,o)}}))}_checkEnabled(){return!!this._indentSequence&&d(this.editor.model.document.selection)}}class m extends e.Command{constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((()=>{const t=l(e);for(const n of t){const t=p(e,n,this._indentSequence);t&&e.deleteContent(e.createSelection(t))}}))}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return!!d(e.document.selection)&&l(e).some((t=>p(e,t,this._indentSequence)))}}function p(e,t,n){const o=function(e){let t=e.parent.getChild(e.index);t&&!t.is("element","softBreak")||(t=e.nodeBefore);if(!t||t.is("element","softBreak"))return null;return t}(t);if(!o)return null;const i=s(o),r=i.lastIndexOf(n);if(r+n.length!==i.length)return null;if(-1===r)return null;const{parent:a,startOffset:c}=o;return e.createRange(e.createPositionAt(a,c+r),e.createPositionAt(a,c+r+n.length))}function h(e,t,n=!1){const o=c(t,"language","class"),i=c(t,"language","label");return(t,r,a)=>{const{writer:c,mapper:s,consumable:l}=a;if(!l.consume(r.item,"insert"))return;const d=r.item.getAttribute("language"),u=s.toViewPosition(e.createPositionBefore(r.item)),g={};n&&(g["data-language"]=i[d],g.spellcheck="false");const f=c.createContainerElement("code",{class:o[d]||null}),m=c.createContainerElement("pre",g,f);c.insert(u,m),s.bindElements(r.item,f)}}const b="paragraph";class v extends e.Plugin{static get pluginName(){return"CodeBlockEditing"}static get requires(){return[t.ShiftEnter]}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,t=e.model.schema,n=e.model,o=e.editing.view,r=e.plugins.has("DocumentListEditing"),s=a(e);e.commands.add("codeBlock",new g(e)),e.commands.add("indentCodeBlock",new f(e)),e.commands.add("outdentCodeBlock",new m(e)),this.listenTo(o.document,"tab",((t,n)=>{const o=n.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(o).isEnabled&&(e.execute(o),n.stopPropagation(),n.preventDefault(),t.stop())}),{context:"pre"}),t.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",isBlock:!0,allowAttributes:["language"]}),t.addAttributeCheck(((e,t)=>{const n=e.endsWith("codeBlock")&&t.startsWith("list")&&"list"!==t;return!(!r||!n)||!e.endsWith("codeBlock $text")&&void 0})),e.model.schema.addChildCheck(((e,t)=>{if(e.endsWith("codeBlock")&&t.isObject)return!1})),e.editing.downcastDispatcher.on("insert:codeBlock",h(n,s,!0)),e.data.downcastDispatcher.on("insert:codeBlock",h(n,s)),e.data.downcastDispatcher.on("insert:softBreak",function(e){return(t,n,o)=>{if("codeBlock"!==n.item.parent.name)return;const{writer:i,mapper:r,consumable:a}=o;if(!a.consume(n.item,"insert"))return;const c=r.toViewPosition(e.createPositionBefore(n.item));i.insert(c,i.createText("\n"))}}(n),{priority:"high"}),e.data.upcastDispatcher.on("element:code",function(e,t){const n=c(t,"class","language"),o=t[0].language;return(e,t,i)=>{const r=t.viewItem,a=r.parent;if(!a||!a.is("element","pre"))return;if(t.modelCursor.findAncestor("codeBlock"))return;const{consumable:c,writer:s}=i;if(!c.test(r,{name:!0}))return;const l=s.createElement("codeBlock"),d=[...r.getClassNames()];d.length||d.push("");for(const e of d){const t=n[e];if(t){s.setAttribute("language",t,l);break}}l.hasAttribute("language")||s.setAttribute("language",o,l),i.convertChildren(r,l),i.safeInsert(l,t.modelCursor)&&(c.consume(r,{name:!0}),i.updateConversionResult(l,t))}}(0,s)),e.data.upcastDispatcher.on("text",((e,t,{consumable:n,writer:o})=>{let i=t.modelCursor;if(!n.test(t.viewItem))return;if(!i.findAncestor("codeBlock"))return;n.consume(t.viewItem);const r=t.viewItem.data.split("\n").map((e=>o.createText(e))),a=r[r.length-1];for(const e of r)if(o.insert(e,i),i=i.getShiftedBy(e.offsetSize),e!==a){const e=o.createElement("softBreak");o.insert(e,i),i=o.createPositionAfter(e)}t.modelRange=o.createRange(t.modelCursor,i),t.modelCursor=i})),e.data.upcastDispatcher.on("element:pre",((e,t,{consumable:n})=>{const o=t.viewItem;if(o.findAncestor("pre"))return;const i=Array.from(o.getChildren()),r=i.find((e=>e.is("element","code")));if(r)for(const e of i)e!==r&&e.is("$text")&&n.consume(e,{name:!0})}),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,o)=>{let r=n.createRange(n.document.selection.anchor);if(o.targetRanges&&(r=e.editing.mapper.toModelRange(o.targetRanges[0])),!r.start.parent.is("element","codeBlock"))return;const a=o.dataTransfer.getData("text/plain"),c=new i.UpcastWriter(e.editing.view.document);o.content=function(e,t){const n=e.createDocumentFragment(),o=t.split("\n"),i=o.reduce(((t,n,i)=>(t.push(n),i{const i=o.anchor;!o.isCollapsed&&i.parent.is("element","codeBlock")&&i.hasSameParentAs(o.focus)&&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);t.checkAttribute(e,"code")&&n.setAttribute("code",!0,e)}}))}))}afterInit(){const e=this.editor,t=e.commands,n=t.get("indent"),o=t.get("outdent");n&&n.registerChildCommand(t.get("indentCodeBlock"),{priority:"highest"}),o&&o.registerChildCommand(t.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",((t,n)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(function(e,t){const n=e.model,o=n.document,i=e.editing.view,r=o.selection.getLastPosition(),a=r.nodeAfter;if(t||!o.selection.isCollapsed||!r.isAtStart)return!1;if(!B(a))return!1;return e.model.change((t=>{e.execute("enter");const n=o.selection.anchor.parent.previousSibling;t.rename(n,b),t.setSelection(n,"in"),e.model.schema.removeDisallowedAttributes([n],t),t.remove(a)})),i.scrollToTheSelection(),!0}(e,n.isSoft)||function(e,t){const n=e.model,o=n.document,i=e.editing.view,r=o.selection.getLastPosition(),a=r.nodeBefore;let c;if(t||!o.selection.isCollapsed||!r.isAtEnd||!a||!a.previousSibling)return!1;if(B(a)&&B(a.previousSibling))c=n.createRange(n.createPositionBefore(a.previousSibling),n.createPositionAfter(a));else if(k(a)&&B(a.previousSibling)&&B(a.previousSibling.previousSibling))c=n.createRange(n.createPositionBefore(a.previousSibling.previousSibling),n.createPositionAfter(a));else{if(!(k(a)&&B(a.previousSibling)&&k(a.previousSibling.previousSibling)&&B(a.previousSibling.previousSibling.previousSibling)))return!1;c=n.createRange(n.createPositionBefore(a.previousSibling.previousSibling.previousSibling),n.createPositionAfter(a))}return e.model.change((t=>{t.remove(c),e.execute("enter");const n=o.selection.anchor.parent;t.rename(n,b),e.model.schema.removeDisallowedAttributes([n],t)})),i.scrollToTheSelection(),!0}(e,n.isSoft)||function(e){const t=e.model,n=t.document,o=n.selection.getLastPosition(),i=o.nodeBefore||o.textNode;let r;i&&i.is("$text")&&(r=s(i));e.model.change((t=>{e.execute("shiftEnter"),r&&t.insertText(r,n.selection.anchor)}))}(e),n.preventDefault(),t.stop())}),{context:"pre"})}}function k(e){return e&&e.is("$text")&&!e.data.match(/\S/)}function B(e){return e&&e.is("element","softBreak")}var C=n(273);var w=n(62),x=n.n(w),S=n(67),y={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};x()(S.Z,y);S.Z.locals;class A extends e.Plugin{static get pluginName(){return"CodeBlockUI"}init(){const e=this.editor,t=e.t,n=e.ui.componentFactory,o=a(e);n.add("codeBlock",(n=>{const i=e.commands.get("codeBlock"),r=(0,C.createDropdown)(n,C.SplitButtonView),a=r.buttonView;return a.set({label:t("Insert code block"),tooltip:!0,icon:'',isToggleable:!0}),a.bind("isOn").to(i,"value",(e=>!!e)),a.on("execute",(()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()})),r.on("execute",(t=>{e.execute("codeBlock",{language:t.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()})),r.class="ck-code-block-dropdown",r.bind("isEnabled").to(i),(0,C.addListToDropdown)(r,this._getLanguageListItemDefinitions(o)),r}))}_getLanguageListItemDefinitions(e){const t=this.editor.commands.get("codeBlock"),n=new r.Collection;for(const o of e){const e={type:"button",model:new C.Model({_codeBlockLanguage:o.language,label:o.label,withText:!0})};e.model.bind("isOn").to(t,"value",(t=>t===e.model._codeBlockLanguage)),n.add(e)}return n}}class E extends e.Plugin{static get requires(){return[v,A]}static get pluginName(){return"CodeBlock"}}})(),(window.CKEditor5=window.CKEditor5||{}).codeBlock=o})(); \ No newline at end of file + */(()=>{var e={67:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n(609),i=n.n(o)()((function(e){return e[1]}));i.push([e.id,".ck-content pre{background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;color:#353535;direction:ltr;font-style:normal;min-width:200px;padding:1em;tab-size:4;text-align:left;white-space:pre-wrap}.ck-content pre code{background:unset;border-radius:0;padding: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{background:var(--ck-color-code-block-label-background);color:#fff;font-family:var(--ck-font-face);font-size:10px;line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);right:10px;top:-1px;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}",""]);const r=i},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var r=0;r{"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function c(e){for(var t=-1,n=0;n{e.exports=n(79)("./src/core.js")},492:(e,t,n)=>{e.exports=n(79)("./src/engine.js")},331:(e,t,n)=>{e.exports=n(79)("./src/enter.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},209:(e,t,n)=>{e.exports=n(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={id:o,exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};(()=>{"use strict";n.r(o),n.d(o,{CodeBlock:()=>E,CodeBlockEditing:()=>v,CodeBlockUI:()=>A});var e=n(704),t=n(331),i=n(492),r=n(209);function a(e){const t=e.t,n=e.config.get("codeBlock.languages");for(const e of n)"Plain text"===e.label&&(e.label=t("Plain text")),void 0===e.class&&(e.class=`language-${e.language}`);return n}function c(e,t,n){const o={};for(const i of e)if("class"===t){o[i[t].split(" ").shift()]=i[n]}else o[i[t]]=i[n];return o}function s(e){return e.data.match(/^(\s*)/)[0]}function l(e){const t=e.document.selection,n=[];if(t.isCollapsed)return[t.anchor];const o=t.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:t}of o){if(!t.is("$textProxy"))continue;const{parent:o,startOffset:i}=t.textNode;if(!o.is("element","codeBlock"))continue;const r=s(t.textNode),a=e.createPositionAt(o,i+r.length);n.push(a)}return n}function d(e){const t=(0,r.first)(e.getSelectedBlocks());return!!t&&t.is("element","codeBlock")}function u(e,t){return!t.is("rootElement")&&!e.isLimit(t)&&e.checkChild(t.parent,"codeBlock")}class g extends e.Command{constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor,n=t.model,o=n.document.selection,i=a(t)[0],r=Array.from(o.getSelectedBlocks()),c=null==e.forceValue?!this.value:e.forceValue,s=function(e,t,n){if(e.language)return e.language;if(e.usePreviousLanguageChoice&&t)return t;return n}(e,this._lastLanguage,i.language);n.change((e=>{c?this._applyCodeBlock(e,r,s):this._removeCodeBlock(e,r)}))}_getValue(){const e=this.editor.model.document.selection,t=(0,r.first)(e.getSelectedBlocks());return!!!(!t||!t.is("element","codeBlock"))&&t.getAttribute("language")}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=(0,r.first)(e.getSelectedBlocks());return!!n&&u(t,n)}_applyCodeBlock(e,t,n){this._lastLanguage=n;const o=this.editor.model.schema,i=t.filter((e=>u(o,e)));for(const t of i)e.rename(t,"codeBlock"),e.setAttribute("language",n,t),o.removeDisallowedAttributes([t],e),Array.from(t.getChildren()).filter((e=>!o.checkChild(t,e))).forEach((t=>e.remove(t)));i.reverse().forEach(((t,n)=>{const o=i[n+1];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)),o=n.nodeAfter;e.rename(o,"paragraph"),e.removeAttribute("language",o),e.remove(t)}e.rename(t,"paragraph"),e.removeAttribute("language",t)}}}class f extends e.Command{constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((t=>{const n=l(e);for(const o of n){const n=t.createText(this._indentSequence);e.insertContent(n,o)}}))}_checkEnabled(){return!!this._indentSequence&&d(this.editor.model.document.selection)}}class m extends e.Command{constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((()=>{const t=l(e);for(const n of t){const t=p(e,n,this._indentSequence);t&&e.deleteContent(e.createSelection(t))}}))}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return!!d(e.document.selection)&&l(e).some((t=>p(e,t,this._indentSequence)))}}function p(e,t,n){const o=function(e){let t=e.parent.getChild(e.index);t&&!t.is("element","softBreak")||(t=e.nodeBefore);if(!t||t.is("element","softBreak"))return null;return t}(t);if(!o)return null;const i=s(o),r=i.lastIndexOf(n);if(r+n.length!==i.length)return null;if(-1===r)return null;const{parent:a,startOffset:c}=o;return e.createRange(e.createPositionAt(a,c+r),e.createPositionAt(a,c+r+n.length))}function h(e,t,n=!1){const o=c(t,"language","class"),i=c(t,"language","label");return(t,r,a)=>{const{writer:c,mapper:s,consumable:l}=a;if(!l.consume(r.item,"insert"))return;const d=r.item.getAttribute("language"),u=s.toViewPosition(e.createPositionBefore(r.item)),g={};n&&(g["data-language"]=i[d],g.spellcheck="false");const f=o[d]?{class:o[d]}:void 0,m=c.createContainerElement("code",f),p=c.createContainerElement("pre",g,m);c.insert(u,p),s.bindElements(r.item,m)}}const b="paragraph";class v extends e.Plugin{static get pluginName(){return"CodeBlockEditing"}static get requires(){return[t.ShiftEnter]}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,t=e.model.schema,n=e.model,o=e.editing.view,r=e.plugins.has("DocumentListEditing"),s=a(e);e.commands.add("codeBlock",new g(e)),e.commands.add("indentCodeBlock",new f(e)),e.commands.add("outdentCodeBlock",new m(e)),this.listenTo(o.document,"tab",((t,n)=>{const o=n.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(o).isEnabled&&(e.execute(o),n.stopPropagation(),n.preventDefault(),t.stop())}),{context:"pre"}),t.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",isBlock:!0,allowAttributes:["language"]}),t.addAttributeCheck(((e,t)=>{const n=e.endsWith("codeBlock")&&t.startsWith("list")&&"list"!==t;return!(!r||!n)||!e.endsWith("codeBlock $text")&&void 0})),e.model.schema.addChildCheck(((e,t)=>{if(e.endsWith("codeBlock")&&t.isObject)return!1})),e.editing.downcastDispatcher.on("insert:codeBlock",h(n,s,!0)),e.data.downcastDispatcher.on("insert:codeBlock",h(n,s)),e.data.downcastDispatcher.on("insert:softBreak",function(e){return(t,n,o)=>{if("codeBlock"!==n.item.parent.name)return;const{writer:i,mapper:r,consumable:a}=o;if(!a.consume(n.item,"insert"))return;const c=r.toViewPosition(e.createPositionBefore(n.item));i.insert(c,i.createText("\n"))}}(n),{priority:"high"}),e.data.upcastDispatcher.on("element:code",function(e,t){const n=c(t,"class","language"),o=t[0].language;return(e,t,i)=>{const r=t.viewItem,a=r.parent;if(!a||!a.is("element","pre"))return;if(t.modelCursor.findAncestor("codeBlock"))return;const{consumable:c,writer:s}=i;if(!c.test(r,{name:!0}))return;const l=s.createElement("codeBlock"),d=[...r.getClassNames()];d.length||d.push("");for(const e of d){const t=n[e];if(t){s.setAttribute("language",t,l);break}}l.hasAttribute("language")||s.setAttribute("language",o,l),i.convertChildren(r,l),i.safeInsert(l,t.modelCursor)&&(c.consume(r,{name:!0}),i.updateConversionResult(l,t))}}(0,s)),e.data.upcastDispatcher.on("text",((e,t,{consumable:n,writer:o})=>{let i=t.modelCursor;if(!n.test(t.viewItem))return;if(!i.findAncestor("codeBlock"))return;n.consume(t.viewItem);const r=t.viewItem.data.split("\n").map((e=>o.createText(e))),a=r[r.length-1];for(const e of r)if(o.insert(e,i),i=i.getShiftedBy(e.offsetSize),e!==a){const e=o.createElement("softBreak");o.insert(e,i),i=o.createPositionAfter(e)}t.modelRange=o.createRange(t.modelCursor,i),t.modelCursor=i})),e.data.upcastDispatcher.on("element:pre",((e,t,{consumable:n})=>{const o=t.viewItem;if(o.findAncestor("pre"))return;const i=Array.from(o.getChildren()),r=i.find((e=>e.is("element","code")));if(r)for(const e of i)e!==r&&e.is("$text")&&n.consume(e,{name:!0})}),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,o)=>{let r=n.createRange(n.document.selection.anchor);if(o.targetRanges&&(r=e.editing.mapper.toModelRange(o.targetRanges[0])),!r.start.parent.is("element","codeBlock"))return;const a=o.dataTransfer.getData("text/plain"),c=new i.UpcastWriter(e.editing.view.document);o.content=function(e,t){const n=e.createDocumentFragment(),o=t.split("\n"),i=o.reduce(((t,n,i)=>(t.push(n),i{const i=o.anchor;!o.isCollapsed&&i.parent.is("element","codeBlock")&&i.hasSameParentAs(o.focus)&&n.change((n=>{const r=e.return;if(i.parent.is("element")&&(r.childCount>1||o.containsEntireContent(i.parent))){const t=n.createElement("codeBlock",i.parent.getAttributes());n.append(r,t);const o=n.createDocumentFragment();return n.append(t,o),void(e.return=o)}const a=r.getChild(0);t.checkAttribute(a,"code")&&n.setAttribute("code",!0,a)}))}))}afterInit(){const e=this.editor,t=e.commands,n=t.get("indent"),o=t.get("outdent");n&&n.registerChildCommand(t.get("indentCodeBlock"),{priority:"highest"}),o&&o.registerChildCommand(t.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",((t,n)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(function(e,t){const n=e.model,o=n.document,i=e.editing.view,r=o.selection.getLastPosition(),a=r.nodeAfter;if(t||!o.selection.isCollapsed||!r.isAtStart)return!1;if(!B(a))return!1;return e.model.change((t=>{e.execute("enter");const n=o.selection.anchor.parent.previousSibling;t.rename(n,b),t.setSelection(n,"in"),e.model.schema.removeDisallowedAttributes([n],t),t.remove(a)})),i.scrollToTheSelection(),!0}(e,n.isSoft)||function(e,t){const n=e.model,o=n.document,i=e.editing.view,r=o.selection.getLastPosition(),a=r.nodeBefore;let c;if(t||!o.selection.isCollapsed||!r.isAtEnd||!a||!a.previousSibling)return!1;if(B(a)&&B(a.previousSibling))c=n.createRange(n.createPositionBefore(a.previousSibling),n.createPositionAfter(a));else if(k(a)&&B(a.previousSibling)&&B(a.previousSibling.previousSibling))c=n.createRange(n.createPositionBefore(a.previousSibling.previousSibling),n.createPositionAfter(a));else{if(!(k(a)&&B(a.previousSibling)&&k(a.previousSibling.previousSibling)&&a.previousSibling.previousSibling&&B(a.previousSibling.previousSibling.previousSibling)))return!1;c=n.createRange(n.createPositionBefore(a.previousSibling.previousSibling.previousSibling),n.createPositionAfter(a))}return e.model.change((t=>{t.remove(c),e.execute("enter");const n=o.selection.anchor.parent;t.rename(n,b),e.model.schema.removeDisallowedAttributes([n],t)})),i.scrollToTheSelection(),!0}(e,n.isSoft)||function(e){const t=e.model,n=t.document,o=n.selection.getLastPosition(),i=o.nodeBefore||o.textNode;let r;i&&i.is("$text")&&(r=s(i));e.model.change((t=>{e.execute("shiftEnter"),r&&t.insertText(r,n.selection.anchor)}))}(e),n.preventDefault(),t.stop())}),{context:"pre"})}}function k(e){return e&&e.is("$text")&&!e.data.match(/\S/)}function B(e){return e&&e.is("element","softBreak")}var C=n(273);var w=n(62),x=n.n(w),S=n(67),y={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};x()(S.Z,y);S.Z.locals;class A extends e.Plugin{static get pluginName(){return"CodeBlockUI"}init(){const e=this.editor,t=e.t,n=e.ui.componentFactory,o=a(e);n.add("codeBlock",(n=>{const i=e.commands.get("codeBlock"),r=(0,C.createDropdown)(n,C.SplitButtonView),a=r.buttonView;return a.set({label:t("Insert code block"),tooltip:!0,icon:'',isToggleable:!0}),a.bind("isOn").to(i,"value",(e=>!!e)),a.on("execute",(()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()})),r.on("execute",(t=>{e.execute("codeBlock",{language:t.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()})),r.class="ck-code-block-dropdown",r.bind("isEnabled").to(i),(0,C.addListToDropdown)(r,(()=>this._getLanguageListItemDefinitions(o))),r}))}_getLanguageListItemDefinitions(e){const t=this.editor.commands.get("codeBlock"),n=new r.Collection;for(const o of e){const e={type:"button",model:new C.Model({_codeBlockLanguage:o.language,label:o.label,withText:!0})};e.model.bind("isOn").to(t,"value",(t=>t===e.model._codeBlockLanguage)),n.add(e)}return n}}class E extends e.Plugin{static get requires(){return[v,A]}static get pluginName(){return"CodeBlock"}}})(),(window.CKEditor5=window.CKEditor5||{}).codeBlock=o})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/code-block/translations/ug.js b/core/assets/vendor/ckeditor5/code-block/translations/ug.js index 401b2fbee33..21cc9e2e98f 100644 --- a/core/assets/vendor/ckeditor5/code-block/translations/ug.js +++ b/core/assets/vendor/ckeditor5/code-block/translations/ug.js @@ -1 +1 @@ -!function(n){const i=n.ug=n.ug||{};i.dictionary=Object.assign(i.dictionary||{},{"Insert code block":"","Plain text":"ساپ تېكىست"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file +!function(n){const i=n.ug=n.ug||{};i.dictionary=Object.assign(i.dictionary||{},{"Insert code block":"كود بۆلىكى قىستۇر","Plain text":"ساپ تېكىست"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/editor-classic/editor-classic.js b/core/assets/vendor/ckeditor5/editor-classic/editor-classic.js index c6c79aae85e..b661e662c1a 100644 --- a/core/assets/vendor/ckeditor5/editor-classic/editor-classic.js +++ b/core/assets/vendor/ckeditor5/editor-classic/editor-classic.js @@ -1,4 +1,4 @@ /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var e={655:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var o=r(609),n=r.n(o)()((function(e){return e[1]}));n.push([e.id,".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)}",""]);const i=n},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,o){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(o)for(var i=0;i{"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),c=[];function a(e){for(var t=-1,r=0;r{e.exports=r(79)("./src/core.js")},492:(e,t,r)=>{e.exports=r(79)("./src/engine.js")},273:(e,t,r)=>{e.exports=r(79)("./src/ui.js")},209:(e,t,r)=>{e.exports=r(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var o={};(()=>{"use strict";r.r(o),r.d(o,{ClassicEditor:()=>R});var e=r(704),t=r(273),n=r(492),i=r(209);class c extends e.EditorUI{constructor(e,r){super(e),this.view=r,this._toolbarConfig=(0,t.normalizeToolbarConfig)(e.config.get("toolbar")),this._elementReplacer=new i.ElementReplacer}get element(){return this.view.element}init(e){const t=this.editor,r=this.view,o=t.editing.view,n=r.editable,i=o.document.getRoot();n.name=i.rootName,r.render();const c=n.element;this.setEditableElement(n.name,c),r.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(c),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:e})=>e||0)),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,r=t.document.getRoot(),o=e.sourceElement,i=e.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder");i&&(0,n.enablePlaceholder)({view:t,element:r,text:i,isDirectHost:!1,keepOnFocus:!0})}}var a=r(62),s=r.n(a),l=r(655),d={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};s()(l.Z,d);l.Z.locals;class u extends t.BoxedEditorUIView{constructor(e,r,o={}){super(e),this.stickyPanel=new t.StickyPanelView(e),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new t.InlineEditableUIView(e,r)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}const p=function(e){return null!=e&&"object"==typeof e};const f="object"==typeof global&&global&&global.Object===Object&&global;var b="object"==typeof self&&self&&self.Object===Object&&self;const h=(f||b||Function("return this")()).Symbol;var k=Object.prototype,v=k.hasOwnProperty,m=k.toString,y=h?h.toStringTag:void 0;const g=function(e){var t=v.call(e,y),r=e[y];try{e[y]=void 0;var o=!0}catch(e){}var n=m.call(e);return o&&(t?e[y]=r:delete e[y]),n};var _=Object.prototype.toString;const w=function(e){return _.call(e)};var j=h?h.toStringTag:void 0;const O=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?g(e):w(e)};const x=function(e,t){return function(r){return e(t(r))}}(Object.getPrototypeOf,Object);var E=Function.prototype,T=Object.prototype,S=E.toString,C=T.hasOwnProperty,P=S.call(Object);const F=function(e){if(!p(e)||"[object Object]"!=O(e))return!1;var t=x(e);if(null===t)return!0;var r=C.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&S.call(r)==P};const M=function(e){return p(e)&&1===e.nodeType&&!F(e)};class R extends((0,e.DataApiMixin)((0,e.ElementApiMixin)(e.Editor))){constructor(t,r={}){if(!D(t)&&void 0!==r.initialData)throw new i.CKEditorError("editor-create-initial-data",null);super(r),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return D(e)?(0,i.getDataFromElement)(e):e}(t)),D(t)&&(this.sourceElement=t),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new u(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o});this.ui=new c(this,n),(0,e.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise((r=>{const o=new this(e,t);r(o.initPlugins().then((()=>o.ui.init(D(e)?e:null))).then((()=>o.data.init(o.config.get("initialData")))).then((()=>o.fire("ready"))).then((()=>o)))}))}}function D(e){return M(e)}})(),(window.CKEditor5=window.CKEditor5||{}).editorClassic=o})(); \ No newline at end of file + */(()=>{var e={655:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var o=r(609),n=r.n(o)()((function(e){return e[1]}));n.push([e.id,".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)}",""]);const i=n},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,o){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(o)for(var i=0;i{"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),c=[];function a(e){for(var t=-1,r=0;r{e.exports=r(79)("./src/core.js")},492:(e,t,r)=>{e.exports=r(79)("./src/engine.js")},273:(e,t,r)=>{e.exports=r(79)("./src/ui.js")},209:(e,t,r)=>{e.exports=r(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var o={};(()=>{"use strict";r.r(o),r.d(o,{ClassicEditor:()=>A});var e=r(273),t=r(492),n=r(209);class i extends e.EditorUI{constructor(t,r){super(t),this.view=r,this._toolbarConfig=(0,e.normalizeToolbarConfig)(t.config.get("toolbar")),this._elementReplacer=new n.ElementReplacer}get element(){return this.view.element}init(e){const t=this.editor,r=this.view,o=t.editing.view,n=r.editable,i=o.document.getRoot();n.name=i.rootName,r.render();const c=n.element;this.setEditableElement(n.name,c),r.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(c),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:e})=>e||0)),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,r=e.editing.view,o=r.document.getRoot(),n=e.sourceElement,i=e.config.get("placeholder")||n&&"textarea"===n.tagName.toLowerCase()&&n.getAttribute("placeholder");i&&(0,t.enablePlaceholder)({view:r,element:o,text:i,isDirectHost:!1,keepOnFocus:!0})}}var c=r(62),a=r.n(c),s=r(655),l={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(s.Z,l);s.Z.locals;class d extends e.BoxedEditorUIView{constructor(t,r,o={}){super(t),this.stickyPanel=new e.StickyPanelView(t),this.toolbar=new e.ToolbarView(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new e.InlineEditableUIView(t,r)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var u=r(704);const p=function(e){return null!=e&&"object"==typeof e};const f="object"==typeof global&&global&&global.Object===Object&&global;var b="object"==typeof self&&self&&self.Object===Object&&self;const h=(f||b||Function("return this")()).Symbol;var k=Object.prototype,v=k.hasOwnProperty,m=k.toString,y=h?h.toStringTag:void 0;const g=function(e){var t=v.call(e,y),r=e[y];try{e[y]=void 0;var o=!0}catch(e){}var n=m.call(e);return o&&(t?e[y]=r:delete e[y]),n};var _=Object.prototype.toString;const w=function(e){return _.call(e)};var j="[object Null]",O="[object Undefined]",x=h?h.toStringTag:void 0;const E=function(e){return null==e?void 0===e?O:j:x&&x in Object(e)?g(e):w(e)};const T=function(e,t){return function(r){return e(t(r))}}(Object.getPrototypeOf,Object);var S="[object Object]",C=Function.prototype,P=Object.prototype,F=C.toString,M=P.hasOwnProperty,R=F.call(Object);const D=function(e){if(!p(e)||E(e)!=S)return!1;var t=T(e);if(null===t)return!0;var r=M.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&F.call(r)==R};const N=function(e){return p(e)&&1===e.nodeType&&!D(e)};class A extends((0,u.DataApiMixin)((0,u.ElementApiMixin)(u.Editor))){constructor(e,t={}){if(!I(e)&&void 0!==t.initialData)throw new n.CKEditorError("editor-create-initial-data",null);super(t),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return I(e)?(0,n.getDataFromElement)(e):e}(e)),I(e)&&(this.sourceElement=e),this.model.document.createRoot();const r=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=new d(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:r});this.ui=new i(this,o),(0,u.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise((r=>{const o=new this(e,t);r(o.initPlugins().then((()=>o.ui.init(I(e)?e:null))).then((()=>o.data.init(o.config.get("initialData")))).then((()=>o.fire("ready"))).then((()=>o)))}))}}function I(e){return N(e)}})(),(window.CKEditor5=window.CKEditor5||{}).editorClassic=o})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/editor-decoupled/editor-decoupled.js b/core/assets/vendor/ckeditor5/editor-decoupled/editor-decoupled.js index 42b62e1be4d..8afbd529427 100644 --- a/core/assets/vendor/ckeditor5/editor-decoupled/editor-decoupled.js +++ b/core/assets/vendor/ckeditor5/editor-decoupled/editor-decoupled.js @@ -1,4 +1,4 @@ /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var t={704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},492:(t,e,o)=>{t.exports=o(79)("./src/engine.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},209:(t,e,o)=>{t.exports=o(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(r){var i=e[r];if(void 0!==i)return i.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";o.r(r),o.d(r,{DecoupledEditor:()=>F});var t=o(704),e=o(209),i=o(492);class n extends t.EditorUI{constructor(t,e){super(t),this.view=e}init(){const t=this.editor,e=this.view,o=t.editing.view,r=e.editable,i=o.document.getRoot();r.name=i.rootName,e.render();const n=r.element;this.setEditableElement(r.name,n),e.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.editor,e=this.view;e.toolbar.fillFromConfig(t.config.get("toolbar"),this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),r=t.sourceElement,n=t.config.get("placeholder")||r&&"textarea"===r.tagName.toLowerCase()&&r.getAttribute("placeholder");n&&(0,i.enablePlaceholder)({view:e,element:o,text:n,isDirectHost:!1,keepOnFocus:!0})}}var s=o(273);class l extends s.EditorUIView{constructor(t,e,o={}){super(t);const r=t.t;this.toolbar=new s.ToolbarView(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new s.InlineEditableUIView(t,e,o.editableElement,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)}),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:t.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}const a=function(t){return null!=t&&"object"==typeof t};const c="object"==typeof global&&global&&global.Object===Object&&global;var d="object"==typeof self&&self&&self.Object===Object&&self;const u=(c||d||Function("return this")()).Symbol;var h=Object.prototype,b=h.hasOwnProperty,p=h.toString,g=u?u.toStringTag:void 0;const f=function(t){var e=b.call(t,g),o=t[g];try{t[g]=void 0;var r=!0}catch(t){}var i=p.call(t);return r&&(e?t[g]=o:delete t[g]),i};var m=Object.prototype.toString;const v=function(t){return m.call(t)};var y=u?u.toStringTag:void 0;const w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":y&&y in Object(t)?f(t):v(t)};const E=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var j=Function.prototype,O=Object.prototype,x=j.toString,T=O.hasOwnProperty,D=x.call(Object);const S=function(t){if(!a(t)||"[object Object]"!=w(t))return!1;var e=E(t);if(null===e)return!0;var o=T.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&x.call(o)==D};const P=function(t){return a(t)&&1===t.nodeType&&!S(t)};class F extends((0,t.DataApiMixin)((0,t.ElementApiMixin)(t.Editor))){constructor(o,r={}){if(!C(o)&&void 0!==r.initialData)throw new e.CKEditorError("editor-create-initial-data",null);super(r),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return C(t)?(0,e.getDataFromElement)(t):t}(o)),C(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this)),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),s=new l(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:i});this.ui=new n(this,s)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,o={}){return new Promise((r=>{if(C(t)&&"TEXTAREA"===t.tagName)throw new e.CKEditorError("editor-wrong-element",null);const i=new this(t,o);r(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function C(t){return P(t)}})(),(window.CKEditor5=window.CKEditor5||{}).editorDecoupled=r})(); \ No newline at end of file + */(()=>{var t={704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},492:(t,e,o)=>{t.exports=o(79)("./src/engine.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},209:(t,e,o)=>{t.exports=o(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(r){var i=e[r];if(void 0!==i)return i.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";o.r(r),o.d(r,{DecoupledEditor:()=>_});var t=o(704),e=o(209),i=o(273),n=o(492);class s extends i.EditorUI{constructor(t,e){super(t),this.view=e}init(){const t=this.editor,e=this.view,o=t.editing.view,r=e.editable,i=o.document.getRoot();r.name=i.rootName,e.render();const n=r.element;this.setEditableElement(r.name,n),e.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.editor,e=this.view;e.toolbar.fillFromConfig(t.config.get("toolbar"),this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),r=t.sourceElement,i=t.config.get("placeholder")||r&&"textarea"===r.tagName.toLowerCase()&&r.getAttribute("placeholder");i&&(0,n.enablePlaceholder)({view:e,element:o,text:i,isDirectHost:!1,keepOnFocus:!0})}}class l extends i.EditorUIView{constructor(t,e,o={}){super(t);const r=t.t;this.toolbar=new i.ToolbarView(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new i.InlineEditableUIView(t,e,o.editableElement,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)}),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:t.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}const a=function(t){return null!=t&&"object"==typeof t};const c="object"==typeof global&&global&&global.Object===Object&&global;var d="object"==typeof self&&self&&self.Object===Object&&self;const u=(c||d||Function("return this")()).Symbol;var h=Object.prototype,b=h.hasOwnProperty,p=h.toString,g=u?u.toStringTag:void 0;const f=function(t){var e=b.call(t,g),o=t[g];try{t[g]=void 0;var r=!0}catch(t){}var i=p.call(t);return r&&(e?t[g]=o:delete t[g]),i};var m=Object.prototype.toString;const v=function(t){return m.call(t)};var y="[object Null]",w="[object Undefined]",E=u?u.toStringTag:void 0;const j=function(t){return null==t?void 0===t?w:y:E&&E in Object(t)?f(t):v(t)};const O=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var x="[object Object]",T=Function.prototype,D=Object.prototype,S=T.toString,P=D.hasOwnProperty,F=S.call(Object);const C=function(t){if(!a(t)||j(t)!=x)return!1;var e=O(t);if(null===e)return!0;var o=P.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&S.call(o)==F};const R=function(t){return a(t)&&1===t.nodeType&&!C(t)};class _ extends((0,t.DataApiMixin)((0,t.ElementApiMixin)(t.Editor))){constructor(o,r={}){if(!A(o)&&void 0!==r.initialData)throw new e.CKEditorError("editor-create-initial-data",null);super(r),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return A(t)?(0,e.getDataFromElement)(t):t}(o)),A(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this)),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new l(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:i});this.ui=new s(this,n)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,o={}){return new Promise((r=>{if(A(t)&&"TEXTAREA"===t.tagName)throw new e.CKEditorError("editor-wrong-element",null);const i=new this(t,o);r(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function A(t){return R(t)}})(),(window.CKEditor5=window.CKEditor5||{}).editorDecoupled=r})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/essentials/essentials.js b/core/assets/vendor/ckeditor5/essentials/essentials.js index 0392dd079c4..3dbb77e7155 100644 --- a/core/assets/vendor/ckeditor5/essentials/essentials.js +++ b/core/assets/vendor/ckeditor5/essentials/essentials.js @@ -1,4 +1,4 @@ /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */(()=>{var e={945:(e,r,t)=>{e.exports=t(79)("./src/clipboard.js")},704:(e,r,t)=>{e.exports=t(79)("./src/core.js")},331:(e,r,t)=>{e.exports=t(79)("./src/enter.js")},468:(e,r,t)=>{e.exports=t(79)("./src/select-all.js")},181:(e,r,t)=>{e.exports=t(79)("./src/typing.js")},254:(e,r,t)=>{e.exports=t(79)("./src/undo.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},r={};function t(s){var o=r[s];if(void 0!==o)return o.exports;var n=r[s]={exports:{}};return e[s](n,n.exports,t),n.exports}t.d=(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};(()=>{"use strict";t.r(s),t.d(s,{Essentials:()=>a});var e=t(704),r=t(945),o=t(331),n=t(468),i=t(181),l=t(254);class a extends e.Plugin{static get requires(){return[r.Clipboard,o.Enter,n.SelectAll,o.ShiftEnter,i.Typing,l.Undo]}static get pluginName(){return"Essentials"}}})(),(window.CKEditor5=window.CKEditor5||{}).essentials=s})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/heading/heading.js b/core/assets/vendor/ckeditor5/heading/heading.js index f25666afc91..e6d740c7dc6 100644 --- a/core/assets/vendor/ckeditor5/heading/heading.js +++ b/core/assets/vendor/ckeditor5/heading/heading.js @@ -1,5 +1,5 @@ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Choose heading":"Choose heading",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",Paragraph:"Paragraph","Type or paste your content here.":"Type or paste your content here.","Type your title":"Type your title"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var e={609:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(298),o=n.n(i)()((function(e){return e[1]}));o.push([e.id,".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}",""]);const a=o},298:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(i)for(var a=0;a{"use strict";var i,o=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),r=[];function s(e){for(var t=-1,n=0;n{e.exports=n(79)("./src/core.js")},492:(e,t,n)=>{e.exports=n(79)("./src/engine.js")},747:(e,t,n)=>{e.exports=n(79)("./src/paragraph.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},209:(e,t,n)=>{e.exports=n(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={id:i,exports:{}};return e[i](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var i={};(()=>{"use strict";n.r(i),n.d(i,{Heading:()=>f,HeadingButtonsUI:()=>w,HeadingEditing:()=>d,HeadingUI:()=>p,Title:()=>y});var e=n(704),t=n(747),o=n(209);class a extends e.Command{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=(0,o.first)(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>r(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change((e=>{const o=Array.from(n.selection.getSelectedBlocks()).filter((e=>r(e,i,t.schema)));for(const t of o)t.is("element",i)||e.rename(t,i)}))}}function r(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const s="paragraph";class d extends e.Plugin{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[t.Paragraph]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!==s&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new a(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,i)=>{const o=e.model.document.selection.getFirstPosition().parent;n.some((e=>o.is("element",e.model)))&&!o.is("element",s)&&0===o.childCount&&i.writer.rename(o,s)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:o.priorities.get("low")+1})}}var c=n(273);function l(e){const t=e.t,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];return t&&t!=e.title&&(e.title=t),e}))}var h=n(62),g=n.n(h),m=n(609),u={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};g()(m.Z,u);m.Z.locals;class p extends e.Plugin{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=l(e),i=t("Choose heading"),a=t("Heading");e.ui.componentFactory.add("heading",(t=>{const r={},s=new o.Collection,d=e.commands.get("heading"),l=e.commands.get("paragraph"),h=[d];for(const e of n){const t={type:"button",model:new c.Model({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),h.push(l)):(t.model.bind("isOn").to(d,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const g=(0,c.createDropdown)(t);return(0,c.addListToDropdown)(g,s),g.buttonView.set({isOn:!1,withText:!0,tooltip:a}),g.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),g.bind("isEnabled").toMany(h,"isEnabled",((...e)=>e.some((e=>e)))),g.buttonView.bind("label").to(d,"value",l,"value",((e,t)=>{const n=e||t&&"paragraph";return r[n]?r[n]:i})),this.listenTo(g,"execute",(t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:void 0),e.editing.view.focus()})),g}))}}class f extends e.Plugin{static get requires(){return[d,p]}static get pluginName(){return"Heading"}}const v={heading1:'',heading2:'',heading3:'',heading4:'',heading5:'',heading6:''};class w extends e.Plugin{init(){l(this.editor).filter((e=>"paragraph"!==e.model)).map((e=>this._createButton(e)))}_createButton(e){const t=this.editor;t.ui.componentFactory.add(e.model,(n=>{const i=new c.ButtonView(n),o=t.commands.get("heading");return i.label=e.title,i.icon=e.icon||v[e.model],i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(o),i.bind("isOn").to(o,"value",(t=>t==e.model)),i.on("execute",(()=>{t.execute("heading",{value:e.model}),t.editing.view.focus()})),i}))}}var b=n(492);const x=new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class y extends e.Plugin{static get pluginName(){return"Title"}static get requires(){return["Paragraph"]}init(){const e=this.editor,t=e.model;this._bodyPlaceholder=null,t.schema.register("title",{isBlock:!0,allowIn:"$root"}),t.schema.register("title-content",{isBlock:!0,allowIn:"title",allowAttributes:["alignment"]}),t.schema.extend("$text",{allowIn:"title-content"}),t.schema.addAttributeCheck((e=>{if(e.endsWith("title-content $text"))return!1})),e.editing.mapper.on("modelToViewPosition",C(e.editing.view)),e.data.mapper.on("modelToViewPosition",C(e.editing.view)),e.conversion.for("downcast").elementToElement({model:"title-content",view:"h1"}),e.conversion.for("downcast").add((e=>e.on("insert:title",((e,t,n)=>{n.consumable.consume(t.item,e.name)})))),e.data.upcastDispatcher.on("element:h1",H,{priority:"high"}),e.data.upcastDispatcher.on("element:h2",H,{priority:"high"}),e.data.upcastDispatcher.on("element:h3",H,{priority:"high"}),t.document.registerPostFixer((e=>this._fixTitleContent(e))),t.document.registerPostFixer((e=>this._fixTitleElement(e))),t.document.registerPostFixer((e=>this._fixBodyElement(e))),t.document.registerPostFixer((e=>this._fixExtraParagraph(e))),this._attachPlaceholders(),this._attachTabPressHandling()}getTitle(e={}){const t=this._getTitleElement().getChild(0);return this.editor.data.stringify(t,e)}getBody(e={}){const t=this.editor,n=t.data,i=t.model,o=t.model.document.getRoot(),a=t.editing.view,r=new b.DowncastWriter(a.document),s=i.createRangeIn(o),d=r.createDocumentFragment(),c=i.createPositionAfter(o.getChild(0)),l=i.createRange(c,i.createPositionAt(o,"end")),h=new Map;for(const e of i.markers){const t=l.getIntersection(e.getRange());t&&h.set(e.name,t)}return n.mapper.clearBindings(),n.mapper.bindElements(o,d),n.downcastDispatcher.convert(s,h,r,e),r.remove(r.createRangeOn(d.getChild(0))),t.data.processor.toData(d)}_getTitleElement(){const e=this.editor.model.document.getRoot();for(const t of e.getChildren())if(T(t))return t}_fixTitleContent(e){const t=this._getTitleElement();if(!t||1===t.maxOffset)return!1;const n=Array.from(t.getChildren());n.shift();for(const i of n)e.move(e.createRangeOn(i),t,"after"),e.rename(i,"paragraph");return!0}_fixTitleElement(e){const t=this.editor.model,n=t.document.getRoot(),i=Array.from(n.getChildren()).filter(T),o=i[0],a=n.getChild(0);if(a.is("element","title"))return P(i,e,t);if(!o&&!x.has(a.name)){const t=e.createElement("title");return e.insert(t,n),e.insertElement("title-content",t),!0}return x.has(a.name)?function(e,t,n){const i=t.createElement("title");t.insert(i,e,"before"),t.insert(e,i,0),t.rename(e,"title-content"),n.schema.removeDisallowedAttributes([e],t)}(a,e,t):e.move(e.createRangeOn(o),n,0),P(i,e,t),!0}_fixBodyElement(e){const t=this.editor.model.document.getRoot();return t.childCount<2&&(this._bodyPlaceholder=e.createElement("paragraph"),e.insert(this._bodyPlaceholder,t,1),!0)}_fixExtraParagraph(e){const t=this.editor.model.document.getRoot(),n=this._bodyPlaceholder;return!!function(e,t){if(!e||!e.is("element","paragraph")||e.childCount)return!1;if(t.childCount<=2||t.getChild(t.childCount-1)!==e)return!1;return!0}(n,t)&&(this._bodyPlaceholder=null,e.remove(n),!0)}_attachPlaceholders(){const e=this.editor,t=e.t,n=e.editing.view,i=n.document.getRoot(),o=e.sourceElement,a=e.config.get("title.placeholder")||t("Type your title"),r=e.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder")||t("Type or paste your content here.");let s;e.editing.downcastDispatcher.on("insert:title-content",((e,t,i)=>{(0,b.enablePlaceholder)({view:n,element:i.mapper.toViewElement(t.item),text:a,keepOnFocus:!0})})),n.document.registerPostFixer((e=>{const t=i.getChild(1);let n=!1;return t!==s&&(s&&((0,b.hidePlaceholder)(e,s),e.removeAttribute("data-placeholder",s)),e.setAttribute("data-placeholder",r,t),s=t,n=!0),n=(0,b.needsPlaceholder)(t,!0)&&2===i.childCount&&"p"===t.name?!!(0,b.showPlaceholder)(e,t)||n:!!(0,b.hidePlaceholder)(e,t)||n,n}))}_attachTabPressHandling(){const e=this.editor,t=e.model;e.keystrokes.set("TAB",((e,n)=>{t.change((e=>{const i=t.document.selection,o=Array.from(i.getSelectedBlocks());if(1===o.length&&o[0].is("element","title-content")){const i=t.document.getRoot().getChild(1);e.setSelection(i,0),n()}}))})),e.keystrokes.set("SHIFT + TAB",((n,i)=>{t.change((n=>{const a=t.document.selection;if(!a.isCollapsed)return;const r=e.model.document.getRoot(),s=(0,o.first)(a.getSelectedBlocks()),d=a.getFirstPosition(),c=r.getChild(0);s===r.getChild(1)&&d.isAtStart&&(n.setSelection(c.getChild(0),0),i())}))}))}}function H(e,t,n){const i=t.modelCursor,o=t.viewItem;if(!i.isAtStart||!i.parent.is("element","$root"))return;if(!n.consumable.consume(o,{name:!0}))return;const a=n.writer,r=a.createElement("title"),s=a.createElement("title-content");a.append(s,r),a.insert(r,i),n.convertChildren(o,s),n.updateConversionResult(r,t)}function C(e){return(t,n)=>{const i=n.modelPosition.parent;if(!i.is("element","title"))return;const o=i.parent,a=n.mapper.toViewElement(o);n.viewPosition=e.createPositionAt(a,0),t.stop()}}function T(e){return e.is("element","title")}function P(e,t,n){let i=!1;for(const o of e)0!==o.index&&(_(o,t,n),i=!0);return i}function _(e,t,n){const i=e.getChild(0);i.isEmpty?t.remove(e):(t.move(t.createRangeOn(i),e,"before"),t.rename(i,"paragraph"),t.remove(e),n.schema.removeDisallowedAttributes([i],t))}})(),(window.CKEditor5=window.CKEditor5||{}).heading=i})(); \ No newline at end of file + */(()=>{var e={609:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(298),o=n.n(i)()((function(e){return e[1]}));o.push([e.id,".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}",""]);const a=o},298:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(i)for(var a=0;a{"use strict";var i,o=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),r=[];function s(e){for(var t=-1,n=0;n{e.exports=n(79)("./src/core.js")},492:(e,t,n)=>{e.exports=n(79)("./src/engine.js")},747:(e,t,n)=>{e.exports=n(79)("./src/paragraph.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},209:(e,t,n)=>{e.exports=n(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={id:i,exports:{}};return e[i](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var i={};(()=>{"use strict";n.r(i),n.d(i,{Heading:()=>f,HeadingButtonsUI:()=>w,HeadingEditing:()=>d,HeadingUI:()=>p,Title:()=>y});var e=n(704),t=n(747),o=n(209);class a extends e.Command{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=(0,o.first)(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>r(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change((e=>{const o=Array.from(n.selection.getSelectedBlocks()).filter((e=>r(e,i,t.schema)));for(const t of o)t.is("element",i)||e.rename(t,i)}))}}function r(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const s="paragraph";class d extends e.Plugin{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[t.Paragraph]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)"paragraph"!==i.model&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new a(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,i)=>{const o=e.model.document.selection.getFirstPosition().parent;n.some((e=>o.is("element",e.model)))&&!o.is("element",s)&&0===o.childCount&&i.writer.rename(o,s)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:o.priorities.get("low")+1})}}var c=n(273);function l(e){const t=e.t,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];return t&&t!=e.title&&(e.title=t),e}))}var h=n(62),g=n.n(h),m=n(609),u={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};g()(m.Z,u);m.Z.locals;class p extends e.Plugin{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=l(e),i=t("Choose heading"),a=t("Heading");e.ui.componentFactory.add("heading",(t=>{const r={},s=new o.Collection,d=e.commands.get("heading"),l=e.commands.get("paragraph"),h=[d];for(const e of n){const t={type:"button",model:new c.Model({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),h.push(l)):(t.model.bind("isOn").to(d,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const g=(0,c.createDropdown)(t);return(0,c.addListToDropdown)(g,s),g.buttonView.set({isOn:!1,withText:!0,tooltip:a}),g.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),g.bind("isEnabled").toMany(h,"isEnabled",((...e)=>e.some((e=>e)))),g.buttonView.bind("label").to(d,"value",l,"value",((e,t)=>{const n=e||t&&"paragraph";return"boolean"==typeof n?i:r[n]?r[n]:i})),this.listenTo(g,"execute",(t=>{const{commandName:n,commandValue:i}=t.source;e.execute(n,i?{value:i}:void 0),e.editing.view.focus()})),g}))}}class f extends e.Plugin{static get requires(){return[d,p]}static get pluginName(){return"Heading"}}const v={heading1:'',heading2:'',heading3:'',heading4:'',heading5:'',heading6:''};class w extends e.Plugin{init(){l(this.editor).filter((e=>"paragraph"!==e.model)).map((e=>this._createButton(e)))}_createButton(e){const t=this.editor;t.ui.componentFactory.add(e.model,(n=>{const i=new c.ButtonView(n),o=t.commands.get("heading");return i.label=e.title,i.icon=e.icon||v[e.model],i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(o),i.bind("isOn").to(o,"value",(t=>t==e.model)),i.on("execute",(()=>{t.execute("heading",{value:e.model}),t.editing.view.focus()})),i}))}}var b=n(492);const x=new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class y extends e.Plugin{static get pluginName(){return"Title"}static get requires(){return["Paragraph"]}init(){const e=this.editor,t=e.model;this._bodyPlaceholder=null,t.schema.register("title",{isBlock:!0,allowIn:"$root"}),t.schema.register("title-content",{isBlock:!0,allowIn:"title",allowAttributes:["alignment"]}),t.schema.extend("$text",{allowIn:"title-content"}),t.schema.addAttributeCheck((e=>{if(e.endsWith("title-content $text"))return!1})),e.editing.mapper.on("modelToViewPosition",C(e.editing.view)),e.data.mapper.on("modelToViewPosition",C(e.editing.view)),e.conversion.for("downcast").elementToElement({model:"title-content",view:"h1"}),e.conversion.for("downcast").add((e=>e.on("insert:title",((e,t,n)=>{n.consumable.consume(t.item,e.name)})))),e.data.upcastDispatcher.on("element:h1",H,{priority:"high"}),e.data.upcastDispatcher.on("element:h2",H,{priority:"high"}),e.data.upcastDispatcher.on("element:h3",H,{priority:"high"}),t.document.registerPostFixer((e=>this._fixTitleContent(e))),t.document.registerPostFixer((e=>this._fixTitleElement(e))),t.document.registerPostFixer((e=>this._fixBodyElement(e))),t.document.registerPostFixer((e=>this._fixExtraParagraph(e))),this._attachPlaceholders(),this._attachTabPressHandling()}getTitle(e={}){const t=this._getTitleElement().getChild(0);return this.editor.data.stringify(t,e)}getBody(e={}){const t=this.editor,n=t.data,i=t.model,o=t.model.document.getRoot(),a=t.editing.view,r=new b.DowncastWriter(a.document),s=i.createRangeIn(o),d=r.createDocumentFragment(),c=i.createPositionAfter(o.getChild(0)),l=i.createRange(c,i.createPositionAt(o,"end")),h=new Map;for(const e of i.markers){const t=l.getIntersection(e.getRange());t&&h.set(e.name,t)}return n.mapper.clearBindings(),n.mapper.bindElements(o,d),n.downcastDispatcher.convert(s,h,r,e),r.remove(r.createRangeOn(d.getChild(0))),t.data.processor.toData(d)}_getTitleElement(){const e=this.editor.model.document.getRoot();for(const t of e.getChildren())if(T(t))return t}_fixTitleContent(e){const t=this._getTitleElement();if(!t||1===t.maxOffset)return!1;const n=Array.from(t.getChildren());n.shift();for(const i of n)e.move(e.createRangeOn(i),t,"after"),e.rename(i,"paragraph");return!0}_fixTitleElement(e){const t=this.editor.model,n=t.document.getRoot(),i=Array.from(n.getChildren()).filter(T),o=i[0],a=n.getChild(0);if(a.is("element","title"))return P(i,e,t);if(!o&&!x.has(a.name)){const t=e.createElement("title");return e.insert(t,n),e.insertElement("title-content",t),!0}return x.has(a.name)?function(e,t,n){const i=t.createElement("title");t.insert(i,e,"before"),t.insert(e,i,0),t.rename(e,"title-content"),n.schema.removeDisallowedAttributes([e],t)}(a,e,t):e.move(e.createRangeOn(o),n,0),P(i,e,t),!0}_fixBodyElement(e){const t=this.editor.model.document.getRoot();return t.childCount<2&&(this._bodyPlaceholder=e.createElement("paragraph"),e.insert(this._bodyPlaceholder,t,1),!0)}_fixExtraParagraph(e){const t=this.editor.model.document.getRoot(),n=this._bodyPlaceholder;return!!function(e,t){if(!e||!e.is("element","paragraph")||e.childCount)return!1;if(t.childCount<=2||t.getChild(t.childCount-1)!==e)return!1;return!0}(n,t)&&(this._bodyPlaceholder=null,e.remove(n),!0)}_attachPlaceholders(){const e=this.editor,t=e.t,n=e.editing.view,i=n.document.getRoot(),o=e.sourceElement,a=e.config.get("title.placeholder")||t("Type your title"),r=e.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder")||t("Type or paste your content here.");let s;e.editing.downcastDispatcher.on("insert:title-content",((e,t,i)=>{(0,b.enablePlaceholder)({view:n,element:i.mapper.toViewElement(t.item),text:a,keepOnFocus:!0})})),n.document.registerPostFixer((e=>{const t=i.getChild(1);let n=!1;return t!==s&&(s&&((0,b.hidePlaceholder)(e,s),e.removeAttribute("data-placeholder",s)),e.setAttribute("data-placeholder",r,t),s=t,n=!0),n=(0,b.needsPlaceholder)(t,!0)&&2===i.childCount&&"p"===t.name?!!(0,b.showPlaceholder)(e,t)||n:!!(0,b.hidePlaceholder)(e,t)||n,n}))}_attachTabPressHandling(){const e=this.editor,t=e.model;e.keystrokes.set("TAB",((e,n)=>{t.change((e=>{const i=t.document.selection,o=Array.from(i.getSelectedBlocks());if(1===o.length&&o[0].is("element","title-content")){const i=t.document.getRoot().getChild(1);e.setSelection(i,0),n()}}))})),e.keystrokes.set("SHIFT + TAB",((n,i)=>{t.change((n=>{const a=t.document.selection;if(!a.isCollapsed)return;const r=e.model.document.getRoot(),s=(0,o.first)(a.getSelectedBlocks()),d=a.getFirstPosition(),c=r.getChild(0);s===r.getChild(1)&&d.isAtStart&&(n.setSelection(c.getChild(0),0),i())}))}))}}function H(e,t,n){const i=t.modelCursor,o=t.viewItem;if(!i.isAtStart||!i.parent.is("element","$root"))return;if(!n.consumable.consume(o,{name:!0}))return;const a=n.writer,r=a.createElement("title"),s=a.createElement("title-content");a.append(s,r),a.insert(r,i),n.convertChildren(o,s),n.updateConversionResult(r,t)}function C(e){return(t,n)=>{const i=n.modelPosition.parent;if(!i.is("element","title"))return;const o=i.parent,a=n.mapper.toViewElement(o);n.viewPosition=e.createPositionAt(a,0),t.stop()}}function T(e){return e.is("element","title")}function P(e,t,n){let i=!1;for(const o of e)0!==o.index&&(_(o,t,n),i=!0);return i}function _(e,t,n){const i=e.getChild(0);i.isEmpty?t.remove(e):(t.move(t.createRangeOn(i),e,"before"),t.rename(i,"paragraph"),t.remove(e),n.schema.removeDisallowedAttributes([i],t))}})(),(window.CKEditor5=window.CKEditor5||{}).heading=i})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/horizontal-line/horizontal-line.js b/core/assets/vendor/ckeditor5/horizontal-line/horizontal-line.js index f8c7badd089..916fc91788e 100644 --- a/core/assets/vendor/ckeditor5/horizontal-line/horizontal-line.js +++ b/core/assets/vendor/ckeditor5/horizontal-line/horizontal-line.js @@ -1,5 +1,5 @@ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Horizontal line":"Horizontal line"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */(()=>{var e={73:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(609),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{background:#dedede;border:0;height:4px;margin:15px 0}",""]);const i=o},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i{"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n{e.exports=n(79)("./src/core.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},995:(e,t,n)=>{e.exports=n(79)("./src/widget.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{HorizontalLine:()=>f,HorizontalLineEditing:()=>l,HorizontalLineUI:()=>u});var e=n(704),t=n(995);class o extends e.Command{refresh(){const e=this.editor.model,n=e.schema,r=e.document.selection;this.isEnabled=function(e,n,r){const o=function(e,n){const r=(0,t.findOptimalInsertionRange)(e,n),o=r.start.parent;if(o.isEmpty&&!o.is("element","$root"))return o.parent;return o}(e,r);return n.checkChild(o,"horizontalLine")}(r,n,e)}execute(){const e=this.editor.model;e.change((t=>{const n=t.createElement("horizontalLine");e.insertObject(n,null,null,{setSelection:"after"})}))}}var i=n(62),a=n.n(i),s=n(73),c={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(s.Z,c);s.Z.locals;class l extends e.Plugin{static get pluginName(){return"HorizontalLineEditing"}init(){const e=this.editor,n=e.model.schema,r=e.t,i=e.conversion;n.register("horizontalLine",{inheritAllFrom:"$blockObject"}),i.for("dataDowncast").elementToElement({model:"horizontalLine",view:(e,{writer:t})=>t.createEmptyElement("hr")}),i.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(e,{writer:n})=>{const o=r("Horizontal line"),i=n.createContainerElement("div",null,n.createEmptyElement("hr"));return n.addClass("ck-horizontal-line",i),n.setCustomProperty("hr",!0,i),function(e,n,r){return n.setCustomProperty("horizontalLine",!0,e),(0,t.toWidget)(e,n,{label:r})}(i,n,o)}}),i.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),e.commands.add("horizontalLine",new o(e))}}var d=n(273);class u extends e.Plugin{static get pluginName(){return"HorizontalLineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("horizontalLine",(n=>{const r=e.commands.get("horizontalLine"),o=new d.ButtonView(n);return o.set({label:t("Horizontal line"),icon:'',tooltip:!0}),o.bind("isEnabled").to(r,"isEnabled"),this.listenTo(o,"execute",(()=>{e.execute("horizontalLine"),e.editing.view.focus()})),o}))}}class f extends e.Plugin{static get requires(){return[l,u,t.Widget]}static get pluginName(){return"HorizontalLine"}}})(),(window.CKEditor5=window.CKEditor5||{}).horizontalLine=r})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/html-support/html-support.js b/core/assets/vendor/ckeditor5/html-support/html-support.js index 2dcfb673791..315b59f80a5 100644 --- a/core/assets/vendor/ckeditor5/html-support/html-support.js +++ b/core/assets/vendor/ckeditor5/html-support/html-support.js @@ -1,5 +1,5 @@ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"HTML object":"HTML object"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var t={142:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var o=r(609),n=r.n(o)()((function(t){return t[1]}));n.push([t.id,":root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}",""]);const i=n},609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,o){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(o)for(var i=0;i{"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),s=[];function l(t){for(var e=-1,r=0;r{t.exports=r(79)("./src/core.js")},492:(t,e,r)=>{t.exports=r(79)("./src/engine.js")},209:(t,e,r)=>{t.exports=r(79)("./src/utils.js")},995:(t,e,r)=>{t.exports=r(79)("./src/widget.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={id:o,exports:{}};return t[o](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nc=void 0;var o={};(()=>{"use strict";r.r(o),r.d(o,{DataFilter:()=>po,DataSchema:()=>He,GeneralHtmlSupport:()=>rn,HtmlComment:()=>sn});var t=r(704),e=r(209);const n=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:"$text",allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}}],i=[{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{copyOnEnter:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],isInline:!0}}];const s=function(){this.__data__=[],this.size=0};const l=function(t,e){return t===e||t!=t&&e!=e};const c=function(t,e){for(var r=t.length;r--;)if(l(t[r][0],e))return r;return-1};var a=Array.prototype.splice;const u=function(t){var e=this.__data__,r=c(e,t);return!(r<0)&&(r==e.length-1?e.pop():a.call(e,r,1),--this.size,!0)};const m=function(t){var e=this.__data__,r=c(e,t);return r<0?void 0:e[r][1]};const d=function(t){return c(this.__data__,t)>-1};const h=function(t,e){var r=this.__data__,o=c(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this};function f(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991};const Gt=function(t){return null!=t&&Wt(t.length)&&!B(t)};const Kt=function(t){return Mt(t)&&Gt(t)};const Zt=function(){return!1};var Qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=Qt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Jt&&Jt.exports===Qt?j.Buffer:void 0;const Yt=(Xt?Xt.isBuffer:void 0)||Zt;var te=Function.prototype,ee=Object.prototype,re=te.toString,oe=ee.hasOwnProperty,ne=re.call(Object);const ie=function(t){if(!Mt(t)||"[object Object]"!=I(t))return!1;var e=Tt(t);if(null===e)return!0;var r=oe.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&re.call(r)==ne};var se={};se["[object Float32Array]"]=se["[object Float64Array]"]=se["[object Int8Array]"]=se["[object Int16Array]"]=se["[object Int32Array]"]=se["[object Uint8Array]"]=se["[object Uint8ClampedArray]"]=se["[object Uint16Array]"]=se["[object Uint32Array]"]=!0,se["[object Arguments]"]=se["[object Array]"]=se["[object ArrayBuffer]"]=se["[object Boolean]"]=se["[object DataView]"]=se["[object Date]"]=se["[object Error]"]=se["[object Function]"]=se["[object Map]"]=se["[object Number]"]=se["[object Object]"]=se["[object RegExp]"]=se["[object Set]"]=se["[object String]"]=se["[object WeakMap]"]=!1;const le=function(t){return Mt(t)&&Wt(t.length)&&!!se[I(t)]};const ce=function(t){return function(e){return t(e)}};var ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=ae&&"object"==typeof module&&module&&!module.nodeType&&module,me=ue&&ue.exports===ae&&y.process;const de=function(){try{var t=ue&&ue.require&&ue.require("util").types;return t||me&&me.binding&&me.binding("util")}catch(t){}}();var he=de&&de.isTypedArray;const fe=he?ce(he):le;const be=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var pe=Object.prototype.hasOwnProperty;const ge=function(t,e,r){var o=t[e];pe.call(t,e)&&l(o,r)&&(void 0!==r||e in t)||yt(t,e,r)};const ve=function(t,e,r,o){var n=!r;r||(r={});for(var i=-1,s=e.length;++i-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Re);const Me=function(t,e){return Le(Be(t,e,xe),t+"")};const Ne=function(t,e,r){if(!P(r))return!1;var o=typeof e;return!!("number"==o?Gt(r)&&Ae(e,r.length):"string"==o&&e in r)&&l(r[e],t)};const Ve=function(t){return Me((function(e,r){var o=-1,n=r.length,i=n>1?r[n-1]:void 0,s=n>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(n--,i):void 0,s&&Ne(r[0],r[1],s)&&(i=n<3?void 0:i,n=1),e=Object(e);++oe.view&&function(t,e){if("string"==typeof t)return t===e;if(t instanceof RegExp)return t.test(e);return!1}(t,e.view)))}*_getReferences(t){const{modelSchema:r}=this._definitions.get(t);if(!r)return;const o=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"];for(const n of o)for(const o of(0,e.toArray)(r[n]||[])){const e=this._definitions.get(o);o!==t&&e&&(yield*this._getReferences(e.model),yield e)}}_extendDefinition(t){const e=this._definitions.get(t.model),r=Ve({},e,t,((t,e)=>Array.isArray(t)?t.concat(e):void 0));this._definitions.set(t.model,r)}}var ze=r(492),qe=r(995);const Ue=function(t,e){for(var r=-1,o=null==t?0:t.length;++rr.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function Jr(t,{view:e,isInline:r}){const o=t.t;return(t,{writer:n})=>{const i=o("HTML object"),s=Xr(e,t,n),l=t.getAttribute("htmlAttributes");n.addClass("html-object-embed__content",s),l&&Kr(n,l,s);const c=n.createContainerElement(r?"span":"div",{class:"html-object-embed","data-html-object-embed-label":i},s);return(0,qe.toWidget)(c,n,{widgetLabel:i})}}function Xr(t,e,r){return r.createRawElement(t,null,((t,r)=>{r.setContentOf(t,e.getAttribute("htmlContent"))}))}function Yr({priority:t,view:e}){return(r,o)=>{if(!r)return;const{writer:n}=o,i=n.createAttributeElement(e,null,{priority:t});return Kr(n,r,i),i}}function to({view:t},e){return r=>{r.on(`element:${t}`,((t,r,o)=>{if(!r.modelRange||r.modelRange.isCollapsed)return;const n=e.processViewAttributes(r.viewItem,o);n&&o.writer.setAttribute("htmlAttributes",n,r.modelRange)}),{priority:"low"})}}function eo({model:t}){return e=>{e.on(`attribute:htmlAttributes:${t}`,((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e;Gr(r.writer,o,n,r.mapper.toViewElement(e.item))}))}}const ro=function(t,e){for(var r=-1,o=null==t?0:t.length,n=Array(o);++r-1;)l!==t&&co.call(l,c,1),co.call(t,c,1);return t};const uo=Me((function(t,e){return t&&t.length&&e&&e.length?ao(t,e):t}));var mo=r(62),ho=r.n(mo),fo=r(142),bo={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};ho()(fo.Z,bo);fo.Z.locals;class po extends t.Plugin{constructor(t){super(t),this._dataSchema=t.plugins.get("DataSchema"),this._allowedAttributes=new ze.Matcher,this._disallowedAttributes=new ze.Matcher,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerModelPostFixer()}static get pluginName(){return"DataFilter"}static get requires(){return[He,qe.Widget]}loadAllowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=Ao(e);this.allowElement(t),r.forEach((t=>this.allowAttributes(t)))}}loadDisallowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=Ao(e);0==r.length?this.disallowElement(t):r.forEach((t=>this.disallowAttributes(t)))}}allowElement(t){for(const r of this._dataSchema.getDefinitionsForView(t,!0))this._allowedElements.has(r)||(this._allowedElements.add(r),this._dataInitialized&&this.editor.data.once("set",(()=>{this._fireRegisterEvent(r)}),{priority:e.priorities.get("highest")+1}),this._coupledAttributes=null)}disallowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!1))this._disallowedElements.add(e.view)}allowAttributes(t){this._allowedAttributes.add(t)}disallowAttributes(t){this._disallowedAttributes.add(t)}processViewAttributes(t,e){return go(t,e,this._disallowedAttributes),go(t,e,this._allowedAttributes)}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const t of this._allowedElements)this._fireRegisterEvent(t)}),{priority:e.priorities.get("highest")+1})}_registerElementHandlers(){this.on("register",((t,r)=>{const o=this.editor.model.schema;if(r.isObject&&!o.isRegistered(r.model))this._registerObjectElement(r);else if(r.isBlock)this._registerBlockElement(r);else{if(!r.isInline)throw new e.CKEditorError("data-filter-invalid-definition",null,r);this._registerInlineElement(r)}t.stop()}),{priority:"lowest"})}_registerModelPostFixer(){const t=this.editor.model;t.document.registerPostFixer((e=>{const r=t.document.differ.getChanges();let o=!1;const n=this._getCoupledAttributesMap();for(const t of r){if("attribute"!=t.type||null!==t.attributeNewValue)continue;const r=n.get(t.attributeKey);if(r)for(const{item:n}of t.range.getWalker({shallow:!0}))for(const t of r)n.hasAttribute(t)&&(e.removeAttribute(t,n),o=!0)}return o}))}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const t of this._allowedElements)if(t.coupledAttribute&&t.model){const e=this._coupledAttributes.get(t.coupledAttribute);e?e.push(t.model):this._coupledAttributes.set(t.coupledAttribute,[t.model])}}_fireRegisterEvent(t){t.view&&this._disallowedElements.has(t.view)||this.fire(t.view?`register:${t.view}`:"register",t)}_registerObjectElement(t){const r=this.editor,o=r.model.schema,n=r.conversion,{view:i,model:s}=t;o.register(s,t.modelSchema),i&&(o.extend(t.model,{allowAttributes:["htmlAttributes","htmlContent"]}),r.data.registerRawContentMatcher({name:i}),n.for("upcast").elementToElement({view:i,model:Qr(t),converterPriority:e.priorities.get("low")+1}),n.for("upcast").add(to(t,this)),n.for("editingDowncast").elementToStructure({model:{name:s,attributes:["htmlAttributes"]},view:Jr(r,t)}),n.for("dataDowncast").elementToElement({model:s,view:(t,{writer:e})=>Xr(i,t,e)}),n.for("dataDowncast").add(eo(t)))}_registerBlockElement(t){const r=this.editor,o=r.model.schema,n=r.conversion,{view:i,model:s}=t;if(!o.isRegistered(t.model)){if(o.register(t.model,t.modelSchema),!i)return;n.for("upcast").elementToElement({model:s,view:i,converterPriority:e.priorities.get("low")+1}),n.for("downcast").elementToElement({model:s,view:i})}i&&(o.extend(t.model,{allowAttributes:"htmlAttributes"}),n.for("upcast").add(to(t,this)),n.for("downcast").add(eo(t)))}_registerInlineElement(t){const e=this.editor,r=e.model.schema,o=e.conversion,n=t.model;r.extend("$text",{allowAttributes:n}),t.attributeProperties&&r.setAttributeProperties(n,t.attributeProperties),o.for("upcast").add(function({view:t,model:e},r){return o=>{o.on(`element:${t}`,((t,o,n)=>{let i=r.processViewAttributes(o.viewItem,n);if(i||n.consumable.test(o.viewItem,{name:!0})){i=i||{},n.consumable.consume(o.viewItem,{name:!0}),o.modelRange||(o=Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor)));for(const t of o.modelRange.getItems())if(n.schema.checkAttribute(t,e)){const r=Zr(i,t.getAttribute(e)||{});n.writer.setAttribute(e,r,t)}}}),{priority:"low"})}}(t,this)),o.for("downcast").attributeToElement({model:n,view:Yr(t)})}}function go(t,e,r){const o=function(t,{consumable:e},r){const o=r.matchAll(t)||[],n=[];for(const r of o)vo(e,t,r),delete r.match.name,e.consume(t,r.match),n.push(r);return n}(t,e,r),{attributes:n,styles:i,classes:s}=function(t){const e={attributes:new Set,classes:new Set,styles:new Set};for(const r of t)for(const t in e){(r.match[t]||[]).forEach((r=>e[t].add(r)))}return e}(o),l={};if(n.size)for(const t of n)jo(t)||n.delete(t);return n.size&&(l.attributes=wo(n,(e=>t.getAttribute(e)))),i.size&&(l.styles=wo(i,(e=>t.getStyle(e)))),s.size&&(l.classes=Array.from(s)),Object.keys(l).length?l:null}function vo(t,e,r){for(const o of["attributes","classes","styles"]){const n=r.match[o];if(n)for(const r of Array.from(n))t.test(e,{[o]:[r]})||uo(n,r)}}function wo(t,e){const r={};for(const o of t){void 0!==e(o)&&(r[o]=e(o))}return r}function yo(t,e){const{name:r}=t;return ie(t[e])?Object.entries(t[e]).map((([t,o])=>({name:r,[e]:{[t]:o}}))):Array.isArray(t[e])?t[e].map((t=>({name:r,[e]:[t]}))):[t]}function Ao(t){const{name:e,attributes:r,classes:o,styles:n}=t,i=[];return r&&i.push(...yo({name:e,attributes:r},"attributes")),o&&i.push(...yo({name:e,classes:o},"classes")),n&&i.push(...yo({name:e,styles:n},"styles")),i}function jo(t){try{document.createAttribute(t)}catch(t){return!1}return!0}class _o extends t.Plugin{static get requires(){return[po]}static get pluginName(){return"CodeBlockElementSupport"}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const t=this.editor.plugins.get(po);t.on("register:pre",((e,r)=>{if("codeBlock"!==r.model)return;const o=this.editor,n=o.model.schema,i=o.conversion;n.extend("codeBlock",{allowAttributes:["htmlAttributes","htmlContentAttributes"]}),i.for("upcast").add(function(t){return e=>{e.on("element:code",((e,r,o)=>{const n=r.viewItem,i=n.parent;function s(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}i&&i.is("element","pre")&&(s(i,"htmlAttributes"),s(n,"htmlContentAttributes"))}),{priority:"low"})}}(t)),i.for("downcast").add((t=>{t.on("attribute:htmlAttributes:codeBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item).parent;Gr(r.writer,o,n,i)})),t.on("attribute:htmlContentAttributes:codeBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item);Gr(r.writer,o,n,i)}))})),e.stop()}))}}class So extends t.Plugin{static get requires(){return[po]}static get pluginName(){return"DualContentModelElementSupport"}init(){this.editor.plugins.get(po).on("register",((t,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;if(!r.paragraphLikeModel)return;if(n.isRegistered(r.model)||n.isRegistered(r.paragraphLikeModel))return;const s={model:r.paragraphLikeModel,view:r.view};n.register(r.model,r.modelSchema),n.register(s.model,{inheritAllFrom:"$block"}),i.for("upcast").elementToElement({view:r.view,model:(t,{writer:e})=>this._hasBlockContent(t)?e.createElement(r.model):e.createElement(s.model),converterPriority:e.priorities.get("low")+1}),i.for("downcast").elementToElement({view:r.view,model:r.model}),this._addAttributeConversion(r),i.for("downcast").elementToElement({view:s.view,model:s.model}),this._addAttributeConversion(s),t.stop()}))}_hasBlockContent(t){const e=this.editor.editing.view,r=e.domConverter.blockElements;for(const o of e.createRangeIn(t).getItems())if(o.is("element")&&r.includes(o.name))return!0;return!1}_addAttributeConversion(t){const e=this.editor,r=e.conversion,o=e.plugins.get(po);e.model.schema.extend(t.model,{allowAttributes:"htmlAttributes"}),r.for("upcast").add(to(t,o)),r.for("downcast").add(eo(t))}}class Oo extends t.Plugin{static get requires(){return[He]}static get pluginName(){return"HeadingElementSupport"}init(){const t=this.editor;if(!t.plugins.has("HeadingEditing"))return;const e=t.plugins.get(He),r=t.config.get("heading.options"),o=[];for(const t of r)"model"in t&&"view"in t&&(e.registerBlockElement({view:t.view,model:t.model}),o.push(t.model));e.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:o}})}}class ko extends t.Plugin{static get requires(){return[po]}static get pluginName(){return"ImageElementSupport"}init(){const t=this.editor;if(!t.plugins.has("ImageInlineEditing")&&!t.plugins.has("ImageBlockEditing"))return;const e=t.model.schema,r=t.conversion,o=t.plugins.get(po);o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("image"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on("register:img",((t,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["htmlA","htmlAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:img",((e,r,o)=>{if(!r.modelRange)return;const n=r.viewItem,i=n.parent;function s(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}function l(t){r.modelRange&&r.modelRange.getContainedElement().is("element","imageBlock")&&s(t,"htmlLinkAttributes")}s(n,"htmlAttributes"),i.is("element","a")&&l(i)}),{priority:"low"})}}(o)),r.for("downcast").add((t=>{function e(e){t.on(`attribute:${e}:imageInline`,((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item);Gr(r.writer,o,n,i)}),{priority:"low"})}function r(e,r){t.on(`attribute:${r}:imageBlock`,((t,r,o)=>{if(!o.consumable.test(r.item,t.name))return;const{attributeOldValue:n,attributeNewValue:i}=r,s=o.mapper.toViewElement(r.item),l=Eo(o.writer,s,e);l&&(Gr(o.writer,n,i,l),o.consumable.consume(r.item,t.name))}),{priority:"low"}),"a"===e&&t.on("attribute:linkHref:imageBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock"))return;const o=r.mapper.toViewElement(e.item),n=Eo(r.writer,o,"a");Kr(r.writer,e.item.getAttribute("htmlLinkAttributes"),n)}),{priority:"low"})}e("htmlAttributes"),r("img","htmlAttributes"),r("figure","htmlFigureAttributes"),r("a","htmlLinkAttributes")})),t.stop())}))}}function Eo(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}class Co extends t.Plugin{static get requires(){return[po]}static get pluginName(){return"MediaEmbedElementSupport"}init(){const t=this.editor;if(!t.plugins.has("MediaEmbed")||t.config.get("mediaEmbed.previewsInData"))return;const e=t.model.schema,r=t.conversion,o=this.editor.plugins.get(po),n=this.editor.plugins.get(He),i=t.config.get("mediaEmbed.elementName");n.registerBlockElement({model:"media",view:i}),o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("media"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on(`register:${i}`,((t,n)=>{"media"===n.model&&(e.extend("media",{allowAttributes:["htmlAttributes","htmlFigureAttributes"]}),r.for("upcast").add(function(t,e){return t=>{t.on(`element:${e}`,r,{priority:"low"})};function r(e,r,o){function n(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}n(r.viewItem,"htmlAttributes")}}(o,i)),r.for("dataDowncast").add(function(t){return e=>{function r(t,r){e.on(`attribute:${r}:media`,((e,r,o)=>{if(!o.consumable.consume(r.item,e.name))return;const{attributeOldValue:n,attributeNewValue:i}=r,s=o.mapper.toViewElement(r.item),l=function(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}(o.writer,s,t);Gr(o.writer,n,i,l)}))}r(t,"htmlAttributes"),r("figure","htmlFigureAttributes")}}(i)),t.stop())}))}}class Fo extends t.Plugin{static get requires(){return[po]}static get pluginName(){return"ScriptElementSupport"}init(){const t=this.editor.plugins.get(po);t.on("register:script",((e,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;n.register("htmlScript",r.modelSchema),n.extend("htmlScript",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),o.data.registerRawContentMatcher({name:"script"}),i.for("upcast").elementToElement({view:"script",model:Qr(r)}),i.for("upcast").add(to(r,t)),i.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>Xr("script",t,e)}),i.for("downcast").add(eo(r)),e.stop()}))}}class $o extends t.Plugin{static get requires(){return[po]}static get pluginName(){return"TableElementSupport"}init(){const t=this.editor;if(!t.plugins.has("TableEditing"))return;const e=t.model.schema,r=t.conversion,o=t.plugins.get(po);o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("table"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on("register:table",((t,n)=>{"table"===n.model&&(e.extend("table",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:table",((e,r,o)=>{const n=r.viewItem;i(n,"htmlAttributes");for(const t of n.getChildren())t.is("element","thead")&&i(t,"htmlTheadAttributes"),t.is("element","tbody")&&i(t,"htmlTbodyAttributes");function i(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}}),{priority:"low"})}}(o)),r.for("downcast").add((t=>{function e(e,r){t.on(`attribute:${r}:table`,((t,r,o)=>{if(!o.consumable.consume(r.item,t.name))return;const n=o.mapper.toViewElement(r.item),i=function(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}(o.writer,n,e);Kr(o.writer,r.attributeNewValue,i)}))}e("table","htmlAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes")})),t.stop())}))}}class xo extends t.Plugin{static get requires(){return[po]}static get pluginName(){return"StyleElementSupport"}init(){const t=this.editor.plugins.get(po);t.on("register:style",((e,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;n.register("htmlStyle",r.modelSchema),n.extend("htmlStyle",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),o.data.registerRawContentMatcher({name:"style"}),i.for("upcast").elementToElement({view:"style",model:Qr(r)}),i.for("upcast").add(to(r,t)),i.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>Xr("style",t,e)}),i.for("downcast").add(eo(r)),e.stop()}))}}const Io=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const Po=function(t){return this.__data__.has(t)};function Bo(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new bt;++el))return!1;var a=i.get(t),u=i.get(e);if(a&&u)return a==e&&u==t;var m=-1,d=!0,h=2&r?new To:void 0;for(i.set(t,e),i.set(e,t);++m{["ul","ol","li"].includes(n.view)&&(t.stop(),e.checkAttribute("$block","htmlListAttributes")||(e.extend("$block",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),e.extend("$blockObject",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),e.extend("$container",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),r.for("upcast").add((t=>{t.on("element:ul",tn("htmlListAttributes",o),{priority:"low"}),t.on("element:ol",tn("htmlListAttributes",o),{priority:"low"}),t.on("element:li",tn("htmlLiAttributes",o),{priority:"low"})}))))})),n.on("postFixer",((t,{listNodes:e,writer:r})=>{const o=[];for(const{node:n,previous:i}of e){if(!i)continue;const e=n.getAttribute("listIndent"),s=i.getAttribute("listIndent");let l=null;if(e>s?o[s]=i:e{t.model.change((t=>{for(const e of r)t.setAttribute("htmlListAttributes",{},e)}))}))}}function tn(t,e){return(r,o,n)=>{const i=o.viewItem;o.modelRange||Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor));const s=e.processViewAttributes(i,n);for(const e of o.modelRange.getItems({shallow:!0}))e.hasAttribute("listItemId")&&(e.hasAttribute(t)||n.writer.setAttribute(t,s||{},e))}}class en extends t.Plugin{static get requires(){return[po,He]}static get pluginName(){return"CustomElementSupport"}init(){const t=this.editor.plugins.get(po),e=this.editor.plugins.get(He);t.on("register:$customElement",((r,o)=>{r.stop();const n=this.editor,i=n.model.schema,s=n.conversion,l=n.editing.view.domConverter.unsafeElements,c=n.data.htmlProcessor.domConverter.preElements;i.register(o.model,o.modelSchema),i.extend(o.model,{allowAttributes:["htmlElementName","htmlAttributes","htmlContent"],isContent:!0}),s.for("upcast").elementToElement({view:/.*/,model:(r,i)=>{if("$comment"==r.name)return;if(!function(t){try{document.createElement(t)}catch(t){return!1}return!0}(r.name))return;if(e.getDefinitionsForView(r.name).size)return;l.includes(r.name)||l.push(r.name),c.includes(r.name)||c.push(r.name);const s=i.writer.createElement(o.model,{htmlElementName:r.name}),a=t.processViewAttributes(r,i);a&&i.writer.setAttribute("htmlAttributes",a,s);const u=new ze.UpcastWriter(r.document).createDocumentFragment(r),m=n.data.processor.toData(u);i.writer.setAttribute("htmlContent",m,s);for(const{item:t}of n.editing.view.createRangeIn(r))i.consumable.consume(t,{name:!0});return s},converterPriority:"low"}),s.for("editingDowncast").elementToElement({model:{name:o.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),o=e.createRawElement(r);return t.hasAttribute("htmlAttributes")&&Kr(e,t.getAttribute("htmlAttributes"),o),o}}),s.for("dataDowncast").elementToElement({model:{name:o.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),o=t.getAttribute("htmlContent"),n=e.createRawElement(r,null,((t,e)=>{e.setContentOf(t,o);const r=t.firstChild;for(r.remove();r.firstChild;)t.appendChild(r.firstChild)}));return t.hasAttribute("htmlAttributes")&&Kr(e,t.getAttribute("htmlAttributes"),n),n}})}))}}class rn extends t.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get requires(){return[po,_o,So,Oo,ko,Co,Fo,$o,xo,Yo,en]}init(){const t=this.editor,e=t.plugins.get(po);e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(t){const e=this.editor.plugins.get("DataSchema"),r=Array.from(e.getDefinitionsForView(t,!1));return r&&r.length&&r[0].isInline&&!r[0].isObject?r[0].model:"htmlAttributes"}addModelHtmlClass(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of on(n,o,i))nn(t,s,i,"classes",(t=>{for(const o of(0,e.toArray)(r))t.add(o)}))}))}removeModelHtmlClass(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of on(n,o,i))nn(t,s,i,"classes",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}setModelHtmlAttributes(t,e,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change((t=>{for(const i of on(o,r,n))nn(t,i,n,"attributes",(t=>{for(const[r,o]of Object.entries(e))t.set(r,o)}))}))}removeModelHtmlAttributes(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of on(n,o,i))nn(t,s,i,"attributes",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}setModelHtmlStyles(t,e,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change((t=>{for(const i of on(o,r,n))nn(t,i,n,"styles",(t=>{for(const[r,o]of Object.entries(e))t.set(r,o)}))}))}removeModelHtmlStyles(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of on(n,o,i))nn(t,s,i,"styles",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}}function*on(t,e,r){if(e.is("documentSelection")&&e.isCollapsed)t.schema.checkAttributeInSelection(e,r)&&(yield e);else for(const o of function(t,e,r){return e.is("node")||e.is("$text")||e.is("$textProxy")?t.schema.checkAttribute(e,r)?[t.createRangeOn(e)]:[]:t.schema.getValidRanges(t.createSelection(e).getRanges(),r)}(t,e,r))yield*o.getItems({shallow:!0})}function nn(t,e,r,o,n){const i=e.getAttribute(r),s={};for(const t of["attributes","styles","classes"])if(t!=o)i&&i[t]&&(s[t]=i[t]);else{const e="classes"==t?new Set(i&&i[t]||[]):new Map(Object.entries(i&&i[t]||{}));n(e),e.size&&(s[t]="classes"==t?Array.from(e):Object.fromEntries(e))}Object.keys(s).length?e.is("documentSelection")?t.setSelectionAttribute(r,s):t.setAttribute(r,s,e):i&&(e.is("documentSelection")?t.removeSelectionAttribute(r):t.removeAttribute(r,e))}class sn extends t.Plugin{static get pluginName(){return"HtmlComment"}init(){const t=this.editor;t.data.processor.skipComments=!1,t.model.schema.addAttributeCheck(((t,e)=>{if(t.endsWith("$root")&&e.startsWith("$comment"))return!0})),t.conversion.for("upcast").elementToMarker({view:"$comment",model:(t,{writer:r})=>{const o=this.editor.model.document.getRoot(),n=t.getCustomProperty("$rawContent"),i=`$comment:${(0,e.uid)()}`;return r.setAttribute(i,n,o),i}}),t.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:e})=>{const r=this.editor.model.document.getRoot(),o=t.markerName,n=r.getAttribute(o),i=e.createUIElement("$comment");return e.setCustomProperty("$rawContent",n,i),i}}),t.model.document.registerPostFixer((e=>{const r=t.model.document.getRoot(),o=t.model.document.differ.getChangedMarkers().filter((t=>t.name.startsWith("$comment"))).filter((t=>{const e=t.data.newRange;return e&&"$graveyard"===e.root.rootName}));if(0===o.length)return!1;for(const t of o)e.removeMarker(t.name),e.removeAttribute(t.name,r);return!0})),t.data.on("set",(()=>{for(const e of t.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(e.name)}),{priority:"high"}),t.model.on("deleteContent",((e,[r])=>{for(const e of r.getRanges()){const r=t.model.schema.getLimitElement(e),o=t.model.createPositionAt(r,0),n=t.model.createPositionAt(r,"end");let i;i=o.isTouching(e.start)&&n.isTouching(e.end)?this.getHtmlCommentsInRange(t.model.createRange(o,n)):this.getHtmlCommentsInRange(e,{skipBoundaries:!0});for(const t of i)this.removeHtmlComment(t)}}),{priority:"high"})}createHtmlComment(t,r){const o=(0,e.uid)(),n=this.editor.model,i=n.document.getRoot(),s=`$comment:${o}`;return n.change((e=>{const o=e.createRange(t);return e.addMarker(s,{usingOperation:!0,affectsData:!0,range:o}),e.setAttribute(s,r,i),s}))}removeHtmlComment(t){const e=this.editor,r=e.model.document.getRoot(),o=e.model.markers.get(t);return!!o&&(e.model.change((e=>{e.removeMarker(o),e.removeAttribute(t,r)})),!0)}getHtmlCommentData(t){const e=this.editor,r=e.model.markers.get(t),o=e.model.document.getRoot();return r?{content:o.getAttribute(t),position:r.getStart()}:null}getHtmlCommentsInRange(t,{skipBoundaries:e=!1}={}){const r=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter((e=>function(t,e){const o=t.getRange().start;return(o.isAfter(e.start)||r&&o.isEqual(e.start))&&(o.isBefore(e.end)||r&&o.isEqual(e.end))}(e,t))).map((t=>t.name))}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=o})(); \ No newline at end of file + */(()=>{var t={142:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var o=r(609),n=r.n(o)()((function(t){return t[1]}));n.push([t.id,":root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}",""]);const i=n},609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,o){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(o)for(var i=0;i{"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),s=[];function l(t){for(var e=-1,r=0;r{t.exports=r(79)("./src/core.js")},492:(t,e,r)=>{t.exports=r(79)("./src/engine.js")},209:(t,e,r)=>{t.exports=r(79)("./src/utils.js")},995:(t,e,r)=>{t.exports=r(79)("./src/widget.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={id:o,exports:{}};return t[o](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nc=void 0;var o={};(()=>{"use strict";r.r(o),r.d(o,{DataFilter:()=>nn,DataSchema:()=>or,FullPage:()=>fi,GeneralHtmlSupport:()=>ai,HtmlComment:()=>di,HtmlPageDataProcessor:()=>hi});var t=r(704),e=r(209);const n=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:"$text",allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}}],i=[{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{copyOnEnter:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],isInline:!0}}];const s=function(){this.__data__=[],this.size=0};const l=function(t,e){return t===e||t!=t&&e!=e};const c=function(t,e){for(var r=t.length;r--;)if(l(t[r][0],e))return r;return-1};var a=Array.prototype.splice;const u=function(t){var e=this.__data__,r=c(e,t);return!(r<0)&&(r==e.length-1?e.pop():a.call(e,r,1),--this.size,!0)};const m=function(t){var e=this.__data__,r=c(e,t);return r<0?void 0:e[r][1]};const d=function(t){return c(this.__data__,t)>-1};const h=function(t,e){var r=this.__data__,o=c(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this};function f(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=re};const ne=function(t){return null!=t&&oe(t.length)&&!N(t)};const ie=function(t){return Kt(t)&&ne(t)};const se=function(){return!1};var le="object"==typeof exports&&exports&&!exports.nodeType&&exports,ce=le&&"object"==typeof module&&module&&!module.nodeType&&module,ae=ce&&ce.exports===le?j.Buffer:void 0;const ue=(ae?ae.isBuffer:void 0)||se;var me="[object Object]",de=Function.prototype,he=Object.prototype,fe=de.toString,be=he.hasOwnProperty,pe=fe.call(Object);const ge=function(t){if(!Kt(t)||T(t)!=me)return!1;var e=Ut(t);if(null===e)return!0;var r=be.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&fe.call(r)==pe};var ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve["[object Arguments]"]=ve["[object Array]"]=ve["[object ArrayBuffer]"]=ve["[object Boolean]"]=ve["[object DataView]"]=ve["[object Date]"]=ve["[object Error]"]=ve["[object Function]"]=ve["[object Map]"]=ve["[object Number]"]=ve["[object Object]"]=ve["[object RegExp]"]=ve["[object Set]"]=ve["[object String]"]=ve["[object WeakMap]"]=!1;const we=function(t){return Kt(t)&&oe(t.length)&&!!ve[T(t)]};const ye=function(t){return function(e){return t(e)}};var Ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,je=Ae&&"object"==typeof module&&module&&!module.nodeType&&module,_e=je&&je.exports===Ae&&y.process;const Se=function(){try{var t=je&&je.require&&je.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch(t){}}();var Ee=Se&&Se.isTypedArray;const ke=Ee?ye(Ee):we;const Oe=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var Ce=Object.prototype.hasOwnProperty;const $e=function(t,e,r){var o=t[e];Ce.call(t,e)&&l(o,r)&&(void 0!==r||e in t)||$t(t,e,r)};const Pe=function(t,e,r,o){var n=!r;r||(r={});for(var i=-1,s=e.length;++i-1&&t%1==0&&t0){if(++e>=Ze)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Xe);const tr=function(t,e){return Ye(Ge(t,e,Ue),t+"")};const er=function(t,e,r){if(!B(r))return!1;var o=typeof e;return!!("number"==o?ne(r)&&Te(e,r.length):"string"==o&&e in r)&&l(r[e],t)};const rr=function(t){return tr((function(e,r){var o=-1,n=r.length,i=n>1?r[n-1]:void 0,s=n>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(n--,i):void 0,s&&er(r[0],r[1],s)&&(i=n<3?void 0:i,n=1),e=Object(e);++oe.view&&function(t,e){if("string"==typeof t)return t===e;if(t instanceof RegExp)return t.test(e);return!1}(t,e.view)))}*_getReferences(t){const{modelSchema:r}=this._definitions.get(t);if(!r)return;const o=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"];for(const n of o)for(const o of(0,e.toArray)(r[n]||[])){const e=this._definitions.get(o);o!==t&&e&&(yield*this._getReferences(e.model),yield e)}}_extendDefinition(t){const e=this._definitions.get(t.model),r=rr({},e,t,((t,e)=>Array.isArray(t)?t.concat(e):void 0));this._definitions.set(t.model,r)}}var nr=r(492),ir=r(995);const sr=function(t,e){for(var r=-1,o=null==t?0:t.length;++rr.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function No(t,{view:e,isInline:r}){const o=t.t;return(t,{writer:n})=>{const i=o("HTML object"),s=Vo(e,t,n),l=t.getAttribute("htmlAttributes");n.addClass("html-object-embed__content",s),l&&Ro(n,l,s);const c=n.createContainerElement(r?"span":"div",{class:"html-object-embed","data-html-object-embed-label":i},s);return(0,ir.toWidget)(c,n,{widgetLabel:i})}}function Vo(t,e,r){return r.createRawElement(t,null,((t,r)=>{r.setContentOf(t,e.getAttribute("htmlContent"))}))}function Ho({priority:t,view:e}){return(r,o)=>{if(!r)return;const{writer:n}=o,i=n.createAttributeElement(e,null,{priority:t});return Ro(n,r,i),i}}function zo({view:t},e){return r=>{r.on(`element:${t}`,((t,r,o)=>{if(!r.modelRange||r.modelRange.isCollapsed)return;const n=e.processViewAttributes(r.viewItem,o);n&&o.writer.setAttribute("htmlAttributes",n,r.modelRange)}),{priority:"low"})}}function Uo({model:t}){return e=>{e.on(`attribute:htmlAttributes:${t}`,((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e;Do(r.writer,o,n,r.mapper.toViewElement(e.item))}))}}const Wo=function(t,e){for(var r=-1,o=null==t?0:t.length,n=Array(o);++r-1;)l!==t&&Qo.call(l,c,1),Qo.call(t,c,1);return t};const Yo=tr((function(t,e){return t&&t.length&&e&&e.length?Jo(t,e):t}));var tn=r(62),en=r.n(tn),rn=r(142),on={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};en()(rn.Z,on);rn.Z.locals;class nn extends t.Plugin{constructor(t){super(t),this._dataSchema=t.plugins.get("DataSchema"),this._allowedAttributes=new nr.Matcher,this._disallowedAttributes=new nr.Matcher,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerModelPostFixer()}static get pluginName(){return"DataFilter"}static get requires(){return[or,ir.Widget]}loadAllowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=un(e);this.allowElement(t),r.forEach((t=>this.allowAttributes(t)))}}loadDisallowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=un(e);0==r.length?this.disallowElement(t):r.forEach((t=>this.disallowAttributes(t)))}}allowElement(t){for(const r of this._dataSchema.getDefinitionsForView(t,!0))this._allowedElements.has(r)||(this._allowedElements.add(r),this._dataInitialized&&this.editor.data.once("set",(()=>{this._fireRegisterEvent(r)}),{priority:e.priorities.get("highest")+1}),this._coupledAttributes=null)}disallowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!1))this._disallowedElements.add(e.view)}allowAttributes(t){this._allowedAttributes.add(t)}disallowAttributes(t){this._disallowedAttributes.add(t)}processViewAttributes(t,e){return sn(t,e,this._disallowedAttributes),sn(t,e,this._allowedAttributes)}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const t of this._allowedElements)this._fireRegisterEvent(t)}),{priority:e.priorities.get("highest")+1})}_registerElementHandlers(){this.on("register",((t,r)=>{const o=this.editor.model.schema;if(r.isObject&&!o.isRegistered(r.model))this._registerObjectElement(r);else if(r.isBlock)this._registerBlockElement(r);else{if(!r.isInline)throw new e.CKEditorError("data-filter-invalid-definition",null,r);this._registerInlineElement(r)}t.stop()}),{priority:"lowest"})}_registerModelPostFixer(){const t=this.editor.model;t.document.registerPostFixer((e=>{const r=t.document.differ.getChanges();let o=!1;const n=this._getCoupledAttributesMap();for(const t of r){if("attribute"!=t.type||null!==t.attributeNewValue)continue;const r=n.get(t.attributeKey);if(r)for(const{item:n}of t.range.getWalker({shallow:!0}))for(const t of r)n.hasAttribute(t)&&(e.removeAttribute(t,n),o=!0)}return o}))}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const t of this._allowedElements)if(t.coupledAttribute&&t.model){const e=this._coupledAttributes.get(t.coupledAttribute);e?e.push(t.model):this._coupledAttributes.set(t.coupledAttribute,[t.model])}}_fireRegisterEvent(t){t.view&&this._disallowedElements.has(t.view)||this.fire(t.view?`register:${t.view}`:"register",t)}_registerObjectElement(t){const r=this.editor,o=r.model.schema,n=r.conversion,{view:i,model:s}=t;o.register(s,t.modelSchema),i&&(o.extend(t.model,{allowAttributes:["htmlAttributes","htmlContent"]}),r.data.registerRawContentMatcher({name:i}),n.for("upcast").elementToElement({view:i,model:Lo(t),converterPriority:e.priorities.get("low")+1}),n.for("upcast").add(zo(t,this)),n.for("editingDowncast").elementToStructure({model:{name:s,attributes:["htmlAttributes"]},view:No(r,t)}),n.for("dataDowncast").elementToElement({model:s,view:(t,{writer:e})=>Vo(i,t,e)}),n.for("dataDowncast").add(Uo(t)))}_registerBlockElement(t){const r=this.editor,o=r.model.schema,n=r.conversion,{view:i,model:s}=t;if(!o.isRegistered(t.model)){if(o.register(t.model,t.modelSchema),!i)return;n.for("upcast").elementToElement({model:s,view:i,converterPriority:e.priorities.get("low")+1}),n.for("downcast").elementToElement({model:s,view:i})}i&&(o.extend(t.model,{allowAttributes:"htmlAttributes"}),n.for("upcast").add(zo(t,this)),n.for("downcast").add(Uo(t)))}_registerInlineElement(t){const e=this.editor,r=e.model.schema,o=e.conversion,n=t.model;r.extend("$text",{allowAttributes:n}),t.attributeProperties&&r.setAttributeProperties(n,t.attributeProperties),o.for("upcast").add(function({view:t,model:e},r){return o=>{o.on(`element:${t}`,((t,o,n)=>{let i=r.processViewAttributes(o.viewItem,n);if(i||n.consumable.test(o.viewItem,{name:!0})){i=i||{},n.consumable.consume(o.viewItem,{name:!0}),o.modelRange||(o=Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor)));for(const t of o.modelRange.getItems())if(n.schema.checkAttribute(t,e)){const r=Mo(i,t.getAttribute(e)||{});n.writer.setAttribute(e,r,t)}}}),{priority:"low"})}}(t,this)),o.for("downcast").attributeToElement({model:n,view:Ho(t)})}}function sn(t,e,r){const o=function(t,{consumable:e},r){const o=r.matchAll(t)||[],n=[];for(const r of o)ln(e,t,r),delete r.match.name,e.consume(t,r.match),n.push(r);return n}(t,e,r),{attributes:n,styles:i,classes:s}=function(t){const e={attributes:new Set,classes:new Set,styles:new Set};for(const r of t)for(const t in e){(r.match[t]||[]).forEach((r=>e[t].add(r)))}return e}(o),l={};if(n.size)for(const t of n)mn(t)||n.delete(t);return n.size&&(l.attributes=cn(n,(e=>t.getAttribute(e)))),i.size&&(l.styles=cn(i,(e=>t.getStyle(e)))),s.size&&(l.classes=Array.from(s)),Object.keys(l).length?l:null}function ln(t,e,r){for(const o of["attributes","classes","styles"]){const n=r.match[o];if(n)for(const r of Array.from(n))t.test(e,{[o]:[r]})||Yo(n,r)}}function cn(t,e){const r={};for(const o of t){void 0!==e(o)&&(r[o]=e(o))}return r}function an(t,e){const{name:r}=t;return ge(t[e])?Object.entries(t[e]).map((([t,o])=>({name:r,[e]:{[t]:o}}))):Array.isArray(t[e])?t[e].map((t=>({name:r,[e]:[t]}))):[t]}function un(t){const{name:e,attributes:r,classes:o,styles:n}=t,i=[];return r&&i.push(...an({name:e,attributes:r},"attributes")),o&&i.push(...an({name:e,classes:o},"classes")),n&&i.push(...an({name:e,styles:n},"styles")),i}function mn(t){try{document.createAttribute(t)}catch(t){return!1}return!0}class dn extends t.Plugin{static get requires(){return[nn]}static get pluginName(){return"CodeBlockElementSupport"}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const t=this.editor.plugins.get(nn);t.on("register:pre",((e,r)=>{if("codeBlock"!==r.model)return;const o=this.editor,n=o.model.schema,i=o.conversion;n.extend("codeBlock",{allowAttributes:["htmlAttributes","htmlContentAttributes"]}),i.for("upcast").add(function(t){return e=>{e.on("element:code",((e,r,o)=>{const n=r.viewItem,i=n.parent;function s(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}i&&i.is("element","pre")&&(s(i,"htmlAttributes"),s(n,"htmlContentAttributes"))}),{priority:"low"})}}(t)),i.for("downcast").add((t=>{t.on("attribute:htmlAttributes:codeBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item).parent;Do(r.writer,o,n,i)})),t.on("attribute:htmlContentAttributes:codeBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item);Do(r.writer,o,n,i)}))})),e.stop()}))}}class hn extends t.Plugin{static get requires(){return[nn]}static get pluginName(){return"DualContentModelElementSupport"}init(){this.editor.plugins.get(nn).on("register",((t,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;if(!r.paragraphLikeModel)return;if(n.isRegistered(r.model)||n.isRegistered(r.paragraphLikeModel))return;const s={model:r.paragraphLikeModel,view:r.view};n.register(r.model,r.modelSchema),n.register(s.model,{inheritAllFrom:"$block"}),i.for("upcast").elementToElement({view:r.view,model:(t,{writer:e})=>this._hasBlockContent(t)?e.createElement(r.model):e.createElement(s.model),converterPriority:e.priorities.get("low")+1}),i.for("downcast").elementToElement({view:r.view,model:r.model}),this._addAttributeConversion(r),i.for("downcast").elementToElement({view:s.view,model:s.model}),this._addAttributeConversion(s),t.stop()}))}_hasBlockContent(t){const e=this.editor.editing.view,r=e.domConverter.blockElements;for(const o of e.createRangeIn(t).getItems())if(o.is("element")&&r.includes(o.name))return!0;return!1}_addAttributeConversion(t){const e=this.editor,r=e.conversion,o=e.plugins.get(nn);e.model.schema.extend(t.model,{allowAttributes:"htmlAttributes"}),r.for("upcast").add(zo(t,o)),r.for("downcast").add(Uo(t))}}class fn extends t.Plugin{static get requires(){return[or]}static get pluginName(){return"HeadingElementSupport"}init(){const t=this.editor;if(!t.plugins.has("HeadingEditing"))return;const e=t.plugins.get(or),r=t.config.get("heading.options"),o=[];for(const t of r)"model"in t&&"view"in t&&(e.registerBlockElement({view:t.view,model:t.model}),o.push(t.model));e.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:o}})}}class bn extends t.Plugin{static get requires(){return[nn]}static get pluginName(){return"ImageElementSupport"}init(){const t=this.editor;if(!t.plugins.has("ImageInlineEditing")&&!t.plugins.has("ImageBlockEditing"))return;const e=t.model.schema,r=t.conversion,o=t.plugins.get(nn);o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("image"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on("register:img",((t,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["htmlA","htmlAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:img",((e,r,o)=>{if(!r.modelRange)return;const n=r.viewItem,i=n.parent;function s(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}function l(t){r.modelRange&&r.modelRange.getContainedElement().is("element","imageBlock")&&s(t,"htmlLinkAttributes")}s(n,"htmlAttributes"),i.is("element","a")&&l(i)}),{priority:"low"})}}(o)),r.for("downcast").add((t=>{function e(e){t.on(`attribute:${e}:imageInline`,((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item);Do(r.writer,o,n,i)}),{priority:"low"})}function r(e,r){t.on(`attribute:${r}:imageBlock`,((t,r,o)=>{if(!o.consumable.test(r.item,t.name))return;const{attributeOldValue:n,attributeNewValue:i}=r,s=o.mapper.toViewElement(r.item),l=pn(o.writer,s,e);l&&(Do(o.writer,n,i,l),o.consumable.consume(r.item,t.name))}),{priority:"low"}),"a"===e&&t.on("attribute:linkHref:imageBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock"))return;const o=r.mapper.toViewElement(e.item),n=pn(r.writer,o,"a");Ro(r.writer,e.item.getAttribute("htmlLinkAttributes"),n)}),{priority:"low"})}e("htmlAttributes"),r("img","htmlAttributes"),r("figure","htmlFigureAttributes"),r("a","htmlLinkAttributes")})),t.stop())}))}}function pn(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}class gn extends t.Plugin{static get requires(){return[nn]}static get pluginName(){return"MediaEmbedElementSupport"}init(){const t=this.editor;if(!t.plugins.has("MediaEmbed")||t.config.get("mediaEmbed.previewsInData"))return;const e=t.model.schema,r=t.conversion,o=this.editor.plugins.get(nn),n=this.editor.plugins.get(or),i=t.config.get("mediaEmbed.elementName");n.registerBlockElement({model:"media",view:i}),o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("media"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on(`register:${i}`,((t,n)=>{"media"===n.model&&(e.extend("media",{allowAttributes:["htmlAttributes","htmlFigureAttributes"]}),r.for("upcast").add(function(t,e){return t=>{t.on(`element:${e}`,r,{priority:"low"})};function r(e,r,o){function n(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}n(r.viewItem,"htmlAttributes")}}(o,i)),r.for("dataDowncast").add(function(t){return e=>{function r(t,r){e.on(`attribute:${r}:media`,((e,r,o)=>{if(!o.consumable.consume(r.item,e.name))return;const{attributeOldValue:n,attributeNewValue:i}=r,s=o.mapper.toViewElement(r.item),l=function(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}(o.writer,s,t);Do(o.writer,n,i,l)}))}r(t,"htmlAttributes"),r("figure","htmlFigureAttributes")}}(i)),t.stop())}))}}class vn extends t.Plugin{static get requires(){return[nn]}static get pluginName(){return"ScriptElementSupport"}init(){const t=this.editor.plugins.get(nn);t.on("register:script",((e,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;n.register("htmlScript",r.modelSchema),n.extend("htmlScript",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),o.data.registerRawContentMatcher({name:"script"}),i.for("upcast").elementToElement({view:"script",model:Lo(r)}),i.for("upcast").add(zo(r,t)),i.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>Vo("script",t,e)}),i.for("downcast").add(Uo(r)),e.stop()}))}}class wn extends t.Plugin{static get requires(){return[nn]}static get pluginName(){return"TableElementSupport"}init(){const t=this.editor;if(!t.plugins.has("TableEditing"))return;const e=t.model.schema,r=t.conversion,o=t.plugins.get(nn);o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("table"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on("register:table",((t,n)=>{"table"===n.model&&(e.extend("table",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:table",((e,r,o)=>{const n=r.viewItem;i(n,"htmlAttributes");for(const t of n.getChildren())t.is("element","thead")&&i(t,"htmlTheadAttributes"),t.is("element","tbody")&&i(t,"htmlTbodyAttributes");function i(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}}),{priority:"low"})}}(o)),r.for("downcast").add((t=>{function e(e,r){t.on(`attribute:${r}:table`,((t,r,o)=>{if(!o.consumable.consume(r.item,t.name))return;const n=o.mapper.toViewElement(r.item),i=function(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}(o.writer,n,e);Ro(o.writer,r.attributeNewValue,i)}))}e("table","htmlAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes")})),t.stop())}))}}class yn extends t.Plugin{static get requires(){return[nn]}static get pluginName(){return"StyleElementSupport"}init(){const t=this.editor.plugins.get(nn);t.on("register:style",((e,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;n.register("htmlStyle",r.modelSchema),n.extend("htmlStyle",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),o.data.registerRawContentMatcher({name:"style"}),i.for("upcast").elementToElement({view:"style",model:Lo(r)}),i.for("upcast").add(zo(r,t)),i.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>Vo("style",t,e)}),i.for("downcast").add(Uo(r)),e.stop()}))}}var An="__lodash_hash_undefined__";const jn=function(t){return this.__data__.set(t,An),this};const _n=function(t){return this.__data__.has(t)};function Sn(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new _t;++el))return!1;var a=i.get(t),u=i.get(e);if(a&&u)return a==e&&u==t;var m=-1,d=!0,h=r&$n?new En:void 0;for(i.set(t,e),i.set(e,t);++m{["ul","ol","li"].includes(n.view)&&(t.stop(),e.checkAttribute("$block","htmlListAttributes")||(e.extend("$block",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),e.extend("$blockObject",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),e.extend("$container",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),r.for("upcast").add((t=>{t.on("element:ul",li("htmlListAttributes",o),{priority:"low"}),t.on("element:ol",li("htmlListAttributes",o),{priority:"low"}),t.on("element:li",li("htmlLiAttributes",o),{priority:"low"})}))))})),n.on("postFixer",((t,{listNodes:e,writer:r})=>{const o=[];for(const{node:n,previous:i}of e){if(!i)continue;const e=n.getAttribute("listIndent"),s=i.getAttribute("listIndent");let l=null;if(e>s?o[s]=i:e{t.model.change((t=>{for(const e of r)t.setAttribute("htmlListAttributes",{},e)}))}))}}function li(t,e){return(r,o,n)=>{const i=o.viewItem;o.modelRange||Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor));const s=e.processViewAttributes(i,n);for(const e of o.modelRange.getItems({shallow:!0}))e.hasAttribute("listItemId")&&(e.hasAttribute(t)||n.writer.setAttribute(t,s||{},e))}}class ci extends t.Plugin{static get requires(){return[nn,or]}static get pluginName(){return"CustomElementSupport"}init(){const t=this.editor.plugins.get(nn),e=this.editor.plugins.get(or);t.on("register:$customElement",((r,o)=>{r.stop();const n=this.editor,i=n.model.schema,s=n.conversion,l=n.editing.view.domConverter.unsafeElements,c=n.data.htmlProcessor.domConverter.preElements;i.register(o.model,o.modelSchema),i.extend(o.model,{allowAttributes:["htmlElementName","htmlAttributes","htmlContent"],isContent:!0}),s.for("upcast").elementToElement({view:/.*/,model:(r,i)=>{if("$comment"==r.name)return;if(!function(t){try{document.createElement(t)}catch(t){return!1}return!0}(r.name))return;if(e.getDefinitionsForView(r.name).size)return;l.includes(r.name)||l.push(r.name),c.includes(r.name)||c.push(r.name);const s=i.writer.createElement(o.model,{htmlElementName:r.name}),a=t.processViewAttributes(r,i);a&&i.writer.setAttribute("htmlAttributes",a,s);const u=new nr.UpcastWriter(r.document).createDocumentFragment(r),m=n.data.processor.toData(u);i.writer.setAttribute("htmlContent",m,s);for(const{item:t}of n.editing.view.createRangeIn(r))i.consumable.consume(t,{name:!0});return s},converterPriority:"low"}),s.for("editingDowncast").elementToElement({model:{name:o.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),o=e.createRawElement(r);return t.hasAttribute("htmlAttributes")&&Ro(e,t.getAttribute("htmlAttributes"),o),o}}),s.for("dataDowncast").elementToElement({model:{name:o.model,attributes:["htmlElementName","htmlAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),o=t.getAttribute("htmlContent"),n=e.createRawElement(r,null,((t,e)=>{e.setContentOf(t,o);const r=t.firstChild;for(r.remove();r.firstChild;)t.appendChild(r.firstChild)}));return t.hasAttribute("htmlAttributes")&&Ro(e,t.getAttribute("htmlAttributes"),n),n}})}))}}class ai extends t.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get requires(){return[nn,dn,hn,fn,bn,gn,vn,wn,yn,si,ci]}init(){const t=this.editor,e=t.plugins.get(nn);e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(t){const e=this.editor.plugins.get("DataSchema"),r=Array.from(e.getDefinitionsForView(t,!1));return r&&r.length&&r[0].isInline&&!r[0].isObject?r[0].model:"htmlAttributes"}addModelHtmlClass(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of ui(n,o,i))mi(t,s,i,"classes",(t=>{for(const o of(0,e.toArray)(r))t.add(o)}))}))}removeModelHtmlClass(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of ui(n,o,i))mi(t,s,i,"classes",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}setModelHtmlAttributes(t,e,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change((t=>{for(const i of ui(o,r,n))mi(t,i,n,"attributes",(t=>{for(const[r,o]of Object.entries(e))t.set(r,o)}))}))}removeModelHtmlAttributes(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of ui(n,o,i))mi(t,s,i,"attributes",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}setModelHtmlStyles(t,e,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change((t=>{for(const i of ui(o,r,n))mi(t,i,n,"styles",(t=>{for(const[r,o]of Object.entries(e))t.set(r,o)}))}))}removeModelHtmlStyles(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of ui(n,o,i))mi(t,s,i,"styles",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}}function*ui(t,e,r){if(e.is("documentSelection")&&e.isCollapsed)t.schema.checkAttributeInSelection(e,r)&&(yield e);else for(const o of function(t,e,r){return e.is("node")||e.is("$text")||e.is("$textProxy")?t.schema.checkAttribute(e,r)?[t.createRangeOn(e)]:[]:t.schema.getValidRanges(t.createSelection(e).getRanges(),r)}(t,e,r))yield*o.getItems({shallow:!0})}function mi(t,e,r,o,n){const i=e.getAttribute(r),s={};for(const t of["attributes","styles","classes"])if(t!=o)i&&i[t]&&(s[t]=i[t]);else{const e="classes"==t?new Set(i&&i[t]||[]):new Map(Object.entries(i&&i[t]||{}));n(e),e.size&&(s[t]="classes"==t?Array.from(e):Object.fromEntries(e))}Object.keys(s).length?e.is("documentSelection")?t.setSelectionAttribute(r,s):t.setAttribute(r,s,e):i&&(e.is("documentSelection")?t.removeSelectionAttribute(r):t.removeAttribute(r,e))}class di extends t.Plugin{static get pluginName(){return"HtmlComment"}init(){const t=this.editor;t.data.processor.skipComments=!1,t.model.schema.addAttributeCheck(((t,e)=>{if(t.endsWith("$root")&&e.startsWith("$comment"))return!0})),t.conversion.for("upcast").elementToMarker({view:"$comment",model:(t,{writer:r})=>{const o=this.editor.model.document.getRoot(),n=t.getCustomProperty("$rawContent"),i=`$comment:${(0,e.uid)()}`;return r.setAttribute(i,n,o),i}}),t.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:e})=>{const r=this.editor.model.document.getRoot(),o=t.markerName,n=r.getAttribute(o),i=e.createUIElement("$comment");return e.setCustomProperty("$rawContent",n,i),i}}),t.model.document.registerPostFixer((e=>{const r=t.model.document.getRoot(),o=t.model.document.differ.getChangedMarkers().filter((t=>t.name.startsWith("$comment"))).filter((t=>{const e=t.data.newRange;return e&&"$graveyard"===e.root.rootName}));if(0===o.length)return!1;for(const t of o)e.removeMarker(t.name),e.removeAttribute(t.name,r);return!0})),t.data.on("set",(()=>{for(const e of t.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(e.name)}),{priority:"high"}),t.model.on("deleteContent",((e,[r])=>{for(const e of r.getRanges()){const r=t.model.schema.getLimitElement(e),o=t.model.createPositionAt(r,0),n=t.model.createPositionAt(r,"end");let i;i=o.isTouching(e.start)&&n.isTouching(e.end)?this.getHtmlCommentsInRange(t.model.createRange(o,n)):this.getHtmlCommentsInRange(e,{skipBoundaries:!0});for(const t of i)this.removeHtmlComment(t)}}),{priority:"high"})}createHtmlComment(t,r){const o=(0,e.uid)(),n=this.editor.model,i=n.document.getRoot(),s=`$comment:${o}`;return n.change((e=>{const o=e.createRange(t);return e.addMarker(s,{usingOperation:!0,affectsData:!0,range:o}),e.setAttribute(s,r,i),s}))}removeHtmlComment(t){const e=this.editor,r=e.model.document.getRoot(),o=e.model.markers.get(t);return!!o&&(e.model.change((e=>{e.removeMarker(o),e.removeAttribute(t,r)})),!0)}getHtmlCommentData(t){const e=this.editor,r=e.model.markers.get(t),o=e.model.document.getRoot();return r?{content:o.getAttribute(t),position:r.getStart()}:null}getHtmlCommentsInRange(t,{skipBoundaries:e=!1}={}){const r=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter((e=>function(t,e){const o=t.getRange().start;return(o.isAfter(e.start)||r&&o.isEqual(e.start))&&(o.isBefore(e.end)||r&&o.isEqual(e.end))}(e,t))).map((t=>t.name))}}class hi extends nr.HtmlDataProcessor{toView(t){if(!t.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i))return super.toView(t);let e="",r="";t=(t=t.replace(/]*>/i,(t=>(e=t,"")))).replace(/<\?xml\s[^?]*\?>/i,(t=>(r=t,"")));const o=this._toDom(t),n=this.domConverter.domToView(o,{skipComments:this.skipComments}),i=new nr.UpcastWriter(n.document);return i.setCustomProperty("$fullPageDocument",o.ownerDocument.documentElement.outerHTML,n),e&&i.setCustomProperty("$fullPageDocType",e,n),r&&i.setCustomProperty("$fullPageXmlDeclaration",r,n),n}toData(t){let e=super.toData(t);const r=t.getCustomProperty("$fullPageDocument"),o=t.getCustomProperty("$fullPageDocType"),n=t.getCustomProperty("$fullPageXmlDeclaration");return r&&(e=r.replace(/<\/body\s*>/,e+"$&"),o&&(e=o+"\n"+e),n&&(e=n+"\n"+e)),e}}class fi extends t.Plugin{static get pluginName(){return"FullPage"}init(){const t=this.editor,e=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration"];t.data.processor=new hi(t.data.viewDocument),t.model.schema.extend("$root",{allowAttributes:e}),t.data.on("toModel",((r,[o])=>{const n=t.model.document.getRoot();t.model.change((t=>{for(const r of e){const e=o.getCustomProperty(r);e&&t.setAttribute(r,e,n)}}))}),{priority:"low"}),t.data.on("toView",((t,[r])=>{if(!r.is("rootElement"))return;const o=r,n=t.return;if(!o.hasAttribute("$fullPageDocument"))return;const i=new nr.UpcastWriter(n.document);for(const t of e){const e=o.getAttribute(t);e&&i.setCustomProperty(t,e,n)}}),{priority:"low"}),t.data.on("set",(()=>{const r=t.model.document.getRoot();t.model.change((t=>{for(const o of e)r.hasAttribute(o)&&t.removeAttribute(o,r)}))}),{priority:"high"}),t.data.on("get",((t,e)=>{e[0]||(e[0]={}),e[0].trim=!1}),{priority:"high"})}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=o})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/image/image.js b/core/assets/vendor/ckeditor5/image/image.js index ae1efb18fa7..aef2af482ce 100644 --- a/core/assets/vendor/ckeditor5/image/image.js +++ b/core/assets/vendor/ckeditor5/image/image.js @@ -1,5 +1,5 @@ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Break text":"Break text","Caption for image: %0":"Caption for image: %0","Caption for the image":"Caption for the image","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Enter image caption":"Enter image caption","Full size image":"Full size image","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line",Insert:"Insert","Insert image":"Insert image","Insert image via URL":"Insert image via URL","Left aligned image":"Left aligned image",Original:"Original","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Right aligned image":"Right aligned image","Side image":"Side image","Text alternative":"Text alternative",Update:"Update","Update image URL":"Update image URL","Upload failed":"Upload failed","Wrap text":"Wrap text"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var e={540:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}",""]);const a=o},560:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-color-image-caption-background);caption-side:bottom;color:var(--ck-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;word-break:break-word}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}",""]);const a=o},91:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck.ck-image-insert__panel{padding:var(--ck-spacing-large)}.ck.ck-image-insert__ck-finder-button{border:1px solid #ccc;border-radius:var(--ck-border-radius);display:block;margin:var(--ck-spacing-standard) auto;width:100%}.ck.ck-splitbutton>.ck-file-dialog-button.ck-button{border:none;margin:0;padding:0}",""]);const a=o},439:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck.ck-image-insert-form:focus{outline:none}.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-image-insert-form__action-row{margin-top:var(--ck-spacing-standard)}.ck.ck-form__row.ck-image-insert-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-image-insert-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row.ck-image-insert-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}",""]);const a=o},601:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[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}",""]);const a=o},29:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.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)}.ck-content .image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-inline-image-style-spacing);margin-top:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}",""]);const a=o},948:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.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:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@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%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}',""]);const a=o},467:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}',""]);const a=o},271:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const a=o},168:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".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%}}",""]);const a=o},764:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck-vertical-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}',""]);const a=o},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var a=0;a{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},a=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),s=[];function r(e){for(var t=-1,i=0;i{e.exports=i(79)("./src/clipboard.js")},704:(e,t,i)=>{e.exports=i(79)("./src/core.js")},492:(e,t,i)=>{e.exports=i(79)("./src/engine.js")},181:(e,t,i)=>{e.exports=i(79)("./src/typing.js")},273:(e,t,i)=>{e.exports=i(79)("./src/ui.js")},254:(e,t,i)=>{e.exports=i(79)("./src/undo.js")},448:(e,t,i)=>{e.exports=i(79)("./src/upload.js")},209:(e,t,i)=>{e.exports=i(79)("./src/utils.js")},995:(e,t,i)=>{e.exports=i(79)("./src/widget.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,exports:{}};return e[n](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{AutoImage:()=>h,Image:()=>j,ImageCaption:()=>K,ImageCaptionEditing:()=>q,ImageCaptionUtils:()=>M,ImageEditing:()=>R,ImageInsert:()=>xe,ImageInsertUI:()=>_e,ImageResize:()=>Oe,ImageResizeButtons:()=>Te,ImageResizeEditing:()=>Se,ImageResizeHandles:()=>Re,ImageStyle:()=>st,ImageStyleEditing:()=>Qe,ImageStyleUI:()=>it,ImageTextAlternative:()=>A,ImageTextAlternativeEditing:()=>b,ImageTextAlternativeUI:()=>S,ImageToolbar:()=>rt,ImageUpload:()=>he,ImageUploadEditing:()=>ue,ImageUploadProgress:()=>se,ImageUploadUI:()=>Y,PictureEditing:()=>lt});var e=i(704),t=i(945),o=i(492),a=i(254),s=i(181),r=i(209),l=i(995);function c(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot()])}function g(e,t){const i=e.plugins.get("ImageUtils"),n=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>{if(!i.isInlineImageView(e))return null;if(!n)return o(e);return("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:o(e)};function o(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function d(e,t){const i=(0,r.first)(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}class m extends e.Plugin{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null){const n=this.editor,o=n.model,a=o.document.selection;i=u(n,t||a,i),e={...Object.fromEntries(a.getAttributes()),...e};for(const t in e)o.schema.checkAttribute(i,t)||delete e[t];return o.change((n=>{const a=n.createElement(i,e);return o.insertObject(a,t,null,{setSelection:"on",findOptimalPosition:!t&&"imageInline"!=i}),a.parent?a:null}))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let n=t.parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){const i=u(e,t);if("imageBlock"==i){const i=function(e,t){const i=(0,l.findOptimalInsertionRange)(e,t),n=i.start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every((e=>!e.is("element","imageBlock")))}(e)}toImageWidget(e,t,i){t.setCustomProperty("image",!0,e);return(0,l.toWidget)(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&(0,l.isWidget)(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}}function u(e,t,i){const n=e.model.schema,o=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===o?"imageInline":"block"===o?"imageBlock":t.is("selection")?d(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const p=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class h extends e.Plugin{static get requires(){return[t.Clipboard,m,a.Undo,s.Delete]}static get pluginName(){return"AutoImage"}constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document;this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(()=>{const e=t.selection.getFirstRange(),i=o.LivePosition.fromPosition(e.start);i.stickiness="toPrevious";const n=o.LivePosition.fromPosition(e.end);n.stickiness="toNext",t.once("change:data",(()=>{this._embedImageBetweenPositions(i,n),i.detach(),n.detach()}),{priority:"high"})})),e.commands.get("undo").on("execute",(()=>{this._timeoutId&&(r.global.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedImageBetweenPositions(e,t){const i=this.editor,n=new o.LiveRange(e,t),a=n.getWalker({ignoreElementEnd:!0}),s=Object.fromEntries(i.model.document.selection.getAttributes()),l=this.editor.plugins.get("ImageUtils");let c="";for(const e of a)e.item.is("$textProxy")&&(c+=e.item.data);c=c.trim(),c.match(p)?(this._positionToInsert=o.LivePosition.fromPosition(e),this._timeoutId=r.global.window.setTimeout((()=>{i.commands.get("insertImage").isEnabled?(i.model.change((e=>{let t;this._timeoutId=null,e.remove(n),n.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert.toPosition()),l.insertImage({...s,src:c},t),this._positionToInsert.detach(),this._positionToInsert=null})),i.plugins.get("Delete").requestUndoOnBackspace()):n.detach()}),100)):n.detach()}}class f extends e.Command{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n=t.model,o=i.getClosestSelectedImageElement(n.document.selection);n.change((t=>{t.setAttribute("alt",e.newValue,o)}))}}class b extends e.Plugin{static get requires(){return[m]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new f(this.editor))}}var k=i(273),w=i(62),I=i.n(w),v=i(168),y={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(v.Z,y);v.Z.locals;var _=i(764),E={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(_.Z,E);_.Z.locals;class x extends k.View{constructor(t){super(t);const i=this.locale.t;this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(i("Save"),e.icons.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),e.icons.cancel,"ck-button-cancel","cancel"),this._focusables=new k.ViewCollection,this._focusCycler=new k.FocusCycler({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","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),(0,k.injectCssTransitionDisabler)(this)}render(){super.render(),this.keystrokes.listenTo(this.element),(0,k.submitHandler)({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,i,n){const o=new k.ButtonView(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createLabeledInputView(){const e=this.locale.t,t=new k.LabeledFieldView(this.locale,k.createLabeledInputText);return t.label=e("Text alternative"),t}}function C(e){const t=e.editing.view,i=k.BalloonPanelView.defaultPositions,n=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class S extends e.Plugin{static get requires(){return[k.ContextualBalloon]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,i=t.t;t.ui.componentFactory.add("imageTextAlternative",(n=>{const o=t.commands.get("imageTextAlternative"),a=new k.ButtonView(n);return a.set({label:i("Change image text alternative"),icon:e.icons.lowVision,tooltip:!0}),a.bind("isEnabled").to(o,"isEnabled"),a.bind("isOn").to(o,"value",(e=>!!e)),this.listenTo(a,"execute",(()=>{this._showForm()})),a}))}_createForm(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new x(e.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),this.listenTo(e.ui,"update",(()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const i=C(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),(0,k.clickOutsideHandler)({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:C(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class A extends e.Plugin{static get requires(){return[b,S]}static get pluginName(){return"ImageTextAlternative"}}function T(e,t){return e=>{e.on(`attribute:srcset:${t}`,i)};function i(t,i,n){if(!n.consumable.consume(i.item,t.name))return;const o=n.writer,a=n.mapper.toViewElement(i.item),s=e.findViewImgElement(a);if(null===i.attributeNewValue){const e=i.attributeOldValue;e.data&&(o.removeAttribute("srcset",s),o.removeAttribute("sizes",s),e.width&&o.removeAttribute("width",s))}else{const e=i.attributeNewValue;e.data&&(o.setAttribute("srcset",e.data,s),o.setAttribute("sizes","100vw",s),e.width&&o.setAttribute("width",e.width,s))}}}function B(e,t,i){return e=>{e.on(`attribute:${i}:${t}`,n)};function n(t,i,n){if(!n.consumable.consume(i.item,t.name))return;const o=n.writer,a=n.mapper.toViewElement(i.item),s=e.findViewImgElement(a);o.setAttribute(i.attributeKey,i.attributeNewValue||"",s)}}class V extends o.Observer{observe(e){this.listenTo(e,"load",((e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)}),{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class U extends e.Command{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&(0,r.logWarning)("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&(0,r.logWarning)("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=(0,r.toArray)(e.source),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const a=i.getSelectedElement();if("string"==typeof e&&(e={src:e}),t&&a&&n.isImage(a)){const t=this.editor.model.createPositionAfter(a);n.insertImage({...e,...o},t)}else n.insertImage({...e,...o})}))}}class R extends e.Plugin{static get requires(){return[m]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(V),t.for("upcast").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")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}});const i=new U(e);e.commands.add("insertImage",i),e.commands.add("imageInsert",i)}}class z extends e.Command{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,i=e.plugins.get("ImageUtils"),n=i.getClosestSelectedImageElement(t.document.selection),o=Object.fromEntries(n.getAttributes());return o.src||o.uploadId?t.change((e=>{const a=Array.from(t.markers).filter((e=>e.getRange().containsItem(n))),s=i.insertImage(o,t.createSelection(n,"on"),this._modelElementName);if(!s)return null;const r=e.createRangeOn(s);for(const t of a){const i=t.getRange(),n="$graveyard"!=i.root.rootName?i.getJoined(r,!0):r;e.updateMarker(t,{range:n})}return{oldElement:n,newElement:s}})):null}}class P extends e.Plugin{static get requires(){return[R,m,t.ClipboardPipeline]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new z(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>c(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>n.toImageWidget(c(i),i,t("image widget"))}),i.for("downcast").add(B(n,"imageBlock","src")).add(B(n,"imageBlock","alt")).add(T(n,"imageBlock")),i.for("upcast").elementToElement({view:g(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)}).add(function(e){return e=>{e.on("element:figure",t)};function t(t,i,n){if(!n.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const o=e.findViewImgElement(i.viewItem);if(!o||!n.consumable.test(o,{name:!0}))return;n.consumable.consume(i.viewItem,{name:!0,classes:"image"});const a=n.convertItem(o,i.modelCursor),s=(0,r.first)(a.modelRange.getItems());s?(n.convertChildren(i.viewItem,s),n.updateConversionResult(s,i)):n.consumable.revert(i.viewItem,{name:!0,classes:"image"})}}(n))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",((a,s)=>{const r=Array.from(s.content.getChildren());let l;if(!r.every(n.isInlineImageView))return;l=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const c=t.createSelection(l);if("imageBlock"===d(t.schema,c)){const e=new o.UpcastWriter(i.document),t=r.map((t=>e.createElement("figure",{class:"image"},t)));s.content=e.createDocumentFragment(t)}}))}}var O=i(540),N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(O.Z,N);O.Z.locals;class F extends e.Plugin{static get requires(){return[P,l.Widget,A]}static get pluginName(){return"ImageBlock"}}class L extends e.Plugin{static get requires(){return[R,m,t.ClipboardPipeline]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck(((e,t)=>{if(e.endsWith("caption")&&"imageInline"===t.name)return!1})),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new z(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:i})=>n.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(B(n,"imageInline","src")).add(B(n,"imageInline","alt")).add(T(n,"imageInline")),i.for("upcast").elementToElement({view:g(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",((a,s)=>{const r=Array.from(s.content.getChildren());let l;if(!r.every(n.isBlockImageView))return;l=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const c=t.createSelection(l);if("imageInline"===d(t.schema,c)){const e=new o.UpcastWriter(i.document),t=r.map((t=>1===t.childCount?(Array.from(t.getAttributes()).forEach((i=>e.setAttribute(...i,n.findViewImgElement(t)))),t.getChild(0)):t));s.content=e.createDocumentFragment(t)}}))}}class D extends e.Plugin{static get requires(){return[L,l.Widget,A]}static get pluginName(){return"ImageInline"}}class j extends e.Plugin{static get requires(){return[F,D]}static get pluginName(){return"Image"}}class M extends e.Plugin{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[m]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return"figcaption"==e.name&&t.isBlockImageView(e.parent)?{name:!0}:null}}class W extends e.Command{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils");if(!e.plugins.has(P))return this.isEnabled=!1,void(this.value=!1);const i=e.model.document.selection,n=i.getSelectedElement();if(!n){const e=t.getCaptionFromModelSelection(i);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(n),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(n):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change((e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)}))}_showImageCaption(e,t){const i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageCaptionEditing");let o=i.getSelectedElement();const a=n._getSavedCaption(o);this.editor.plugins.get("ImageUtils").isInlineImage(o)&&(this.editor.execute("imageTypeBlock"),o=i.getSelectedElement());const s=a||e.createElement("caption");e.append(s,o),t&&e.setSelection(s,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,n=t.plugins.get("ImageCaptionEditing"),o=t.plugins.get("ImageCaptionUtils");let a,s=i.getSelectedElement();s?a=o.getCaptionFromImageModelElement(s):(a=o.getCaptionFromModelSelection(i),s=a.parent),n._saveCaption(s,a),e.setSelection(s,"on"),e.remove(a)}}class q extends e.Plugin{static get requires(){return[m,M]}static get pluginName(){return"ImageCaptionEditing"}constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new W(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),a=e.t;e.conversion.for("upcast").elementToElement({view:e=>n.matchImageCaptionViewElement(e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>i.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:n})=>{if(!i.isBlockImage(e.parent))return null;const s=n.createEditableElement("figcaption");n.setCustomProperty("imageCaption",!0,s),(0,o.enablePlaceholder)({view:t,element:s,text:a("Enter image caption"),keepOnFocus:!0});const r=e.parent.getAttribute("alt"),c=r?a("Caption for image: %0",[r]):a("Caption for the image");return(0,l.toWidgetEditable)(s,n,{label:c})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),n=e.commands.get("imageTypeInline"),o=e.commands.get("imageTypeBlock"),a=e=>{if(!e.return)return;const{oldElement:n,newElement:o}=e.return;if(!n)return;if(t.isBlockImage(n)){const e=i.getCaptionFromImageModelElement(n);if(e)return void this._saveCaption(o,e)}const a=this._getSavedCaption(n);a&&this._saveCaption(o,a)};n&&this.listenTo(n,"execute",a,{priority:"low"}),o&&this.listenTo(o,"execute",a,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?o.Element.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",(()=>{const o=t.document.differ.getChanges();for(const t of o){if("alt"!==t.attributeKey)continue;const o=t.range.start.nodeAfter;if(i.isBlockImage(o)){const t=n.getCaptionFromImageModelElement(o);if(!t)return;e.editing.reconvertItem(t)}}}))}}class Z extends e.Plugin{static get requires(){return[M]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor,i=t.editing.view,n=t.plugins.get("ImageCaptionUtils"),o=t.t;t.ui.componentFactory.add("toggleImageCaption",(a=>{const s=t.commands.get("toggleImageCaption"),r=new k.ButtonView(a);return r.set({icon:e.icons.caption,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.bind("label").to(s,"value",(e=>o(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(r,"execute",(()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:!0});const e=n.getCaptionFromModelSelection(t.model.document.selection);if(e){const n=t.editing.mapper.toViewElement(e);i.scrollToTheSelection(),i.change((e=>{e.addClass("image__caption_highlighted",n)}))}t.editing.view.focus()})),r}))}}var $=i(560),H={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()($.Z,H);$.Z.locals;class K extends e.Plugin{static get requires(){return[q,Z]}static get pluginName(){return"ImageCaption"}}var G=i(448);function J(e){const t=e.map((e=>e.replace("+","\\+")));return new RegExp(`^image\\/(${t.join("|")})$`)}function Q(e){return new Promise(((t,i)=>{const n=e.getAttribute("src");fetch(n).then((e=>e.blob())).then((e=>{const i=X(e,n),o=i.replace("image/",""),a=new File([e],`image.${o}`,{type:i});t(a)})).catch((e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise(((t,i)=>{const n=r.global.document.createElement("img");n.addEventListener("load",(()=>{const e=r.global.document.createElement("canvas");e.width=n.width,e.height=n.height;e.getContext("2d").drawImage(n,0,0),e.toBlob((e=>e?t(e):i()))})),n.addEventListener("error",(()=>i())),n.src=e}))}(e).then((t=>{const i=X(t,e),n=i.replace("image/","");return new File([t],`image.${n}`,{type:i})}))}(n).then(t).catch(i):i(e)))}))}function X(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Y extends e.Plugin{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,i=t.t,n=n=>{const o=new G.FileDialogButtonView(n),a=t.commands.get("uploadImage"),s=t.config.get("image.upload.types"),r=J(s);return o.set({acceptedType:s.map((e=>`image/${e}`)).join(","),allowMultipleFiles:!0}),o.buttonView.set({label:i("Insert image"),icon:e.icons.image,tooltip:!0}),o.buttonView.bind("isEnabled").to(a),o.on("done",((e,i)=>{const n=Array.from(i).filter((e=>r.test(e.type)));n.length&&(t.execute("uploadImage",{file:n}),t.editing.view.focus())})),o};t.ui.componentFactory.add("uploadImage",n),t.ui.componentFactory.add("imageUpload",n)}}var ee=i(271),te={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(ee.Z,te);ee.Z.locals;var ie=i(948),ne={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(ie.Z,ne);ie.Z.locals;var oe=i(467),ae={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(oe.Z,ae);oe.Z.locals;class se extends e.Plugin{static get pluginName(){return"ImageUploadProgress"}constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",((...e)=>this.uploadStatusChange(...e))),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",((...e)=>this.uploadStatusChange(...e)))}uploadStatusChange(e,t,i){const n=this.editor,o=t.item,a=o.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const s=n.plugins.get("ImageUtils"),r=n.plugins.get(G.FileRepository),l=a?t.attributeNewValue:null,c=this.placeholder,g=n.editing.mapper.toViewElement(o),d=i.writer;if("reading"==l)return re(g,d),void le(s,c,g,d);if("uploading"==l){const e=r.loaders.get(a);return re(g,d),void(e?(ce(g,d),function(e,t,i,n){const o=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),o),i.on("change:uploadedPercent",((e,t,i)=>{n.change((e=>{e.setStyle("width",i+"%",o)}))}))}(g,d,e,n.editing.view),function(e,t,i,n){if(n.data){const o=e.findViewImgElement(t);i.setAttribute("src",n.data,o)}}(s,g,d,e)):le(s,c,g,d))}"complete"==l&&r.loaders.get(a)&&function(e,t,i){const n=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),n),setTimeout((()=>{i.change((e=>e.remove(e.createRangeOn(n))))}),3e3)}(g,d,n.editing.view),function(e,t){de(e,t,"progressBar")}(g,d),ce(g,d),function(e,t){t.removeClass("ck-appear",e)}(g,d)}}function re(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function le(e,t,i,n){i.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",i);const o=e.findViewImgElement(i);o.getAttribute("src")!==t&&n.setAttribute("src",t,o),ge(i,"placeholder")||n.insert(n.createPositionAfter(o),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function ce(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),de(e,t,"placeholder")}function ge(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function de(e,t,i){const n=ge(e,i);n&&t.remove(t.createRangeOn(n))}class me extends e.Command{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=(0,r.toArray)(e.file),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const a=i.getSelectedElement();if(t&&a&&n.isImage(a)){const t=this.editor.model.createPositionAfter(a);this._uploadImage(e,o,t)}else this._uploadImage(e,o)}))}_uploadImage(e,t,i){const n=this.editor,o=n.plugins.get(G.FileRepository).createLoader(e),a=n.plugins.get("ImageUtils");o&&a.insertImage({...t,uploadId:o.id},i)}}class ue extends e.Plugin{static get requires(){return[G.FileRepository,k.Notification,t.ClipboardPipeline,m]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,i=e.conversion,n=e.plugins.get(G.FileRepository),a=e.plugins.get("ImageUtils"),s=J(e.config.get("image.upload.types")),r=new me(e);e.commands.add("uploadImage",r),e.commands.add("imageUpload",r),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,i)=>{if(n=i.dataTransfer,Array.from(n.types).includes("text/html")&&""!==n.getData("text/html"))return;var n;const o=Array.from(i.dataTransfer.files).filter((e=>!!e&&s.test(e.type)));o.length&&(t.stop(),e.model.change((t=>{i.targetRanges&&t.setSelection(i.targetRanges.map((t=>e.editing.mapper.toModelRange(t)))),e.model.enqueueChange((()=>{e.execute("uploadImage",{file:o})}))})))})),this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",((t,i)=>{const s=Array.from(e.editing.view.createRangeIn(i.content)).filter((e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src"))&&(t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||t.getAttribute("src").match(/^blob:/g))}(a,e.item)&&!e.item.getAttribute("uploadProcessed"))).map((e=>({promise:Q(e.item),imageElement:e.item})));if(!s.length)return;const r=new o.UpcastWriter(e.editing.view.document);for(const e of s){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=n.createLoader(e.promise);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 i=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),o=new Set;for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter,a="$graveyard"==t.position.root.rootName;for(const t of pe(e,i)){const e=t.getAttribute("uploadId");if(!e)continue;const i=n.loaders.get(e);i&&(a?o.has(e)||i.abort():(o.add(e),this._uploadImageElements.set(e,t),"idle"==i.status&&this._readAndUpload(i)))}}})),this.on("uploadComplete",((e,{imageElement:t,data:i})=>{const n=i.urls?i.urls:i;this.editor.model.change((e=>{e.setAttribute("src",n.default,t),this._parseAndSetSrcsetAttributeOnImage(n,t,e)}))}),{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,i=t.model,n=t.locale.t,o=t.plugins.get(G.FileRepository),a=t.plugins.get(k.Notification),s=t.plugins.get("ImageUtils"),l=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},(t=>{t.setAttribute("uploadStatus","reading",l.get(e.id))})),e.read().then((()=>{const n=e.upload(),o=l.get(e.id);if(r.env.isSafari){const e=t.editing.mapper.toViewElement(o),i=s.findViewImgElement(e);t.editing.view.once("render",(()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const n=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=n}))}return i.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","uploading",o)})),n})).then((t=>{i.enqueueChange({isUndoable:!1},(i=>{const n=l.get(e.id);i.setAttribute("uploadStatus","complete",n),this.fire("uploadComplete",{data:t,imageElement:n})})),c()})).catch((t=>{if("error"!==e.status&&"aborted"!==e.status)throw t;"error"==e.status&&t&&a.showWarning(t,{title:n("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},(t=>{t.remove(l.get(e.id))})),c()}));function c(){i.enqueueChange({isUndoable:!1},(t=>{const i=l.get(e.id);t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i),l.delete(e.id)})),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const o=Object.keys(e).filter((e=>{const t=parseInt(e,10);if(!isNaN(t))return n=Math.max(n,t),!0})).map((t=>`${e[t]} ${t}w`)).join(", ");""!=o&&i.setAttribute("srcset",{data:o,width:n},t)}}function pe(e,t){const i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter((e=>i.isImage(e.item))).map((e=>e.item))}class he extends e.Plugin{static get pluginName(){return"ImageUpload"}static get requires(){return[ue,Y,se]}}var fe=i(439),be={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(fe.Z,be);fe.Z.locals;class ke extends k.View{constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",t.class||null),this.children=this.createCollection(),t.children&&t.children.forEach((e=>this.children.add(e))),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__row",i.to("class")],role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}var we=i(91),Ie={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(we.Z,Ie);we.Z.locals;class ve extends k.View{constructor(e,t){super(e);const{insertButtonView:i,cancelButtonView:n}=this._createActionButtons(e);if(this.insertButtonView=i,this.cancelButtonView=n,this.set("imageURLInputValue",""),this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this._focusables=new k.ViewCollection,this._focusCycler=new k.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.set("_integrations",new r.Collection),t)for(const[e,i]of Object.entries(t))"insertImageViaUrl"===e&&(i.fieldView.bind("value").to(this,"imageURLInputValue",(e=>e||"")),i.fieldView.on("input",(()=>{this.imageURLInputValue=i.fieldView.element.value.trim()}))),i.name=e,this._integrations.add(i);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:"-1"},children:[...this._integrations,new ke(e,{children:[this.insertButtonView,this.cancelButtonView],class:"ck-image-insert-form__action-row"})]})}render(){super.render(),(0,k.submitHandler)({view:this});const e=[...this._integrations,this.insertButtonView,this.cancelButtonView];e.forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t),this.listenTo(e[0].element,"selectstart",((e,t)=>{t.stopPropagation()}),{priority:"high"})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}getIntegration(e){return this._integrations.find((t=>t.name===e))}_createActionButtons(t){const i=t.t,n=new k.ButtonView(t),o=new k.ButtonView(t);return n.set({label:i("Insert"),icon:e.icons.check,class:"ck-button-save",type:"submit",withText:!0,isEnabled:this.imageURLInputValue}),o.set({label:i("Cancel"),icon:e.icons.cancel,class:"ck-button-cancel",withText:!0}),n.bind("isEnabled").to(this,"imageURLInputValue",(e=>!!e)),n.delegate("execute").to(this,"submit"),o.delegate("execute").to(this,"cancel"),{insertButtonView:n,cancelButtonView:o}}focus(){this._focusCycler.focusFirst()}}function ye(e){const t=e.t,i=new k.LabeledFieldView(e,k.createLabeledInputText);return i.set({label:t("Insert image via URL")}),i.fieldView.placeholder="https://example.com/image.png",i}class _e extends e.Plugin{static get pluginName(){return"ImageInsertUI"}init(){const e=this.editor,t=e=>this._createDropdownView(e);e.ui.componentFactory.add("insertImage",t),e.ui.componentFactory.add("imageInsert",t)}_createDropdownView(t){const i=this.editor,n=t.t,o=i.commands.get("uploadImage"),a=i.commands.get("insertImage");this.dropdownView=(0,k.createDropdown)(t,o?k.SplitButtonView:void 0);const s=this.dropdownView.buttonView,r=this.dropdownView.panelView;if(s.set({label:n("Insert image"),icon:e.icons.image,tooltip:!0}),r.extendTemplate({attributes:{class:"ck-image-insert__panel"}}),o){const e=this.dropdownView.buttonView;e.actionView=i.ui.componentFactory.create("uploadImage"),e.actionView.extendTemplate({attributes:{class:"ck ck-button ck-splitbutton__action"}})}return this._setUpDropdown(o||a)}_setUpDropdown(e){const t=this.editor,i=t.t,n=new ve(t.locale,function(e){const t=e.config.get("image.insert.integrations"),i=e.plugins.get("ImageInsertUI"),n={insertImageViaUrl:ye(e.locale)};if(!t)return n;if(t.find((e=>"openCKFinder"===e))&&e.ui.componentFactory.has("ckfinder")){const t=e.ui.componentFactory.create("ckfinder");t.set({withText:!0,class:"ck-image-insert__ck-finder-button"}),t.delegate("execute").to(i,"cancel"),n.openCKFinder=t}return t.reduce(((t,i)=>(n[i]?t[i]=n[i]:e.ui.componentFactory.has(i)&&(t[i]=e.ui.componentFactory.create(i)),t)),{})}(t)),o=n.insertButtonView,a=n.getIntegration("insertImageViaUrl"),s=this.dropdownView,r=s.panelView,l=this.editor.plugins.get("ImageUtils");function c(){t.editing.view.focus(),s.isOpen=!1}return s.bind("isEnabled").to(e),s.once("change:isOpen",(()=>{r.children.add(n)})),s.on("change:isOpen",(()=>{const e=t.model.document.selection.getSelectedElement();s.isOpen&&(l.isImage(e)?(n.imageURLInputValue=e.getAttribute("src"),o.label=i("Update"),a.label=i("Update image URL")):(n.imageURLInputValue="",o.label=i("Insert"),a.label=i("Insert image via URL")))}),{priority:"low"}),n.delegate("submit","cancel").to(s),this.delegate("cancel").to(s),s.on("submit",(()=>{c(),function(){const e=t.model.document.selection.getSelectedElement();l.isImage(e)?t.model.change((t=>{t.setAttribute("src",n.imageURLInputValue,e),t.removeAttribute("srcset",e),t.removeAttribute("sizes",e)})):t.execute("insertImage",{source:n.imageURLInputValue})}()})),s.on("cancel",(()=>{c()})),s}}class Ee extends e.Plugin{static get pluginName(){return"ImageInsertViaUrl"}static get requires(){return[_e]}}class xe extends e.Plugin{static get pluginName(){return"ImageInsert"}static get requires(){return[he,Ee,_e]}}class Ce extends e.Command{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils").getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},n&&i.change((t=>{t.setAttribute("width",e.width,n)}))}}class Se extends e.Plugin{static get requires(){return[m]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Ce(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(e){const t=this.editor;t.conversion.for("downcast").add((t=>t.on(`attribute:width:${e}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,o=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(n.setStyle("width",t.attributeNewValue,o),n.addClass("image_resized",o)):(n.removeStyle("width",o),n.removeClass("image_resized",o))})))),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}const Ae={small:e.icons.objectSizeSmall,medium:e.icons.objectSizeMedium,large:e.icons.objectSizeLarge,original:e.icons.objectSizeFull};class Te extends e.Plugin{static get requires(){return[Se]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:i,value:n,icon:o}=e,a=n?n+this._resizeUnit:null;t.ui.componentFactory.add(i,(i=>{const n=new k.ButtonView(i),s=t.commands.get("resizeImage"),l=this._getOptionLabelValue(e,!0);if(!Ae[o])throw new r.CKEditorError("imageresizebuttons-missing-icon",t,e);return n.set({label:l,icon:Ae[o],tooltip:l,isToggleable:!0}),n.bind("isEnabled").to(this),n.bind("isOn").to(s,"value",Be(a)),this.listenTo(n,"execute",(()=>{t.execute("resizeImage",{width:a})})),n}))}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,n=e.find((e=>!e.value)),o=o=>{const a=t.commands.get("resizeImage"),s=(0,k.createDropdown)(o,k.DropdownButtonView),r=s.buttonView;return r.set({tooltip:i("Resize image"),commandValue:n.value,icon:Ae.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button"}),r.bind("label").to(a,"value",(e=>e&&e.width?e.width:this._getOptionLabelValue(n))),s.bind("isOn").to(a),s.bind("isEnabled").to(this),(0,k.addListToDropdown)(s,this._getResizeDropdownListItemDefinitions(e,a)),s.listView.ariaLabel=i("Image resize list"),this.listenTo(s,"execute",(e=>{t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus()})),s};t.ui.componentFactory.add("resizeImage",o),t.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(e,t){const i=this.editor.t;return e.label?e.label:t?e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const i=new r.Collection;return e.map((e=>{const n=e.value?e.value+this._resizeUnit:null,o={type:"button",model:new k.Model({commandName:"resizeImage",commandValue:n,label:this._getOptionLabelValue(e),withText:!0,icon:null})};o.model.bind("isOn").to(t,"value",Be(n)),i.add(o)})),i}}function Be(e){return t=>null===e&&t===e||t&&t.width===e}const Ve=/(image|image-inline)/,Ue="image_resized";class Re extends e.Plugin{static get requires(){return[l.WidgetResize]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view;t.addObserver(V),this.listenTo(t.document,"imageLoaded",((i,n)=>{if(!n.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const o=e.editing.view.domConverter,a=o.domToView(n.target).findAncestor({classes:Ve});let s=this.editor.plugins.get(l.WidgetResize).getResizerByViewElement(a);if(s)return void s.redraw();const r=e.editing.mapper,c=r.toModelElement(a);s=e.plugins.get(l.WidgetResize).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:c,viewElement:a,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>o.mapViewToDom(r.toViewElement(c.parent)),isCentered(){const e=c.getAttribute("imageStyle");return!e||"block"==e||"alignCenter"==e},onCommit(i){t.change((e=>{e.removeClass(Ue,a)})),e.execute("resizeImage",{width:i})}}),s.on("updateSize",(()=>{a.hasClass(Ue)||t.change((e=>{e.addClass(Ue,a)}))})),s.bind("isEnabled").to(this)}))}}var ze=i(601),Pe={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(ze.Z,Pe);ze.Z.locals;class Oe extends e.Plugin{static get requires(){return[Se,Re,Te]}static get pluginName(){return"ImageResize"}}class Ne extends e.Command{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map((e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]})))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils");i.change((t=>{const o=e.value;let a=n.getClosestSelectedImageElement(i.document.selection);o&&this.shouldConvertImageType(o,a)&&(this.editor.execute(n.isBlockImage(a)?"imageTypeInline":"imageTypeBlock"),a=n.getClosestSelectedImageElement(i.document.selection)),!o||this._styles.get(o).isDefault?t.removeAttribute("imageStyle",a):t.setAttribute("imageStyle",o,a)}))}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const{objectFullWidth:Fe,objectInline:Le,objectLeft:De,objectRight:je,objectCenter:Me,objectBlockLeft:We,objectBlockRight:qe}=e.icons,Ze={get inline(){return{name:"inline",title:"In line",icon:Le,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:De,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:We,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:Me,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:je,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:qe,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:Me,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:je,modelElements:["imageBlock"],className:"image-style-side"}}},$e={full:Fe,left:We,right:qe,center:Me,inlineLeft:De,inlineRight:je,inline:Le},He=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function Ke(e){(0,r.logWarning)("image-style-configuration-definition-invalid",e)}const Ge={normalizeStyles:function(e){return(e.configuredStyles.options||[]).map((e=>function(e){e="string"==typeof e?Ze[e]?{...Ze[e]}:{name:e}:function(e,t){const i={...t};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)||(i[n]=e[n]);return i}(Ze[e.name],e);"string"==typeof e.icon&&(e.icon=$e[e.icon]||e.icon);return e}(e))).filter((t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:n,name:o}=e;if(!(n&&n.length&&o))return Ke({style:e}),!1;{const o=[t?"imageBlock":null,i?"imageInline":null];if(!n.some((e=>o.includes(e))))return(0,r.logWarning)("image-style-missing-dependency",{style:e,missingPlugins:n.map((e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing"))}),!1}return!0}(t,e)))},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...He]:[]},warnInvalidStyle:Ke,DEFAULT_OPTIONS:Ze,DEFAULT_ICONS:$e,DEFAULT_DROPDOWN_DEFINITIONS:He};function Je(e,t){for(const i of t)if(i.name===e)return i}class Qe extends e.Plugin{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[m]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=Ge,i=this.editor,n=i.plugins.has("ImageBlockEditing"),o=i.plugins.has("ImageInlineEditing");i.config.define("image.styles",t(n,o)),this.normalizedStyles=e({configuredStyles:i.config.get("image.styles"),isBlockPluginLoaded:n,isInlinePluginLoaded:o}),this._setupConversion(n,o),this._setupPostFixer(),i.commands.add("imageStyle",new Ne(i,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,n=i.model.schema,o=(a=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=Je(t.attributeNewValue,a),o=Je(t.attributeOldValue,a),s=i.mapper.toViewElement(t.item),r=i.writer;o&&r.removeClass(o.className,s),n&&r.addClass(n.className,s)});var a;const s=function(e){const t={imageInline:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageInline"))),imageBlock:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageBlock")))};return(e,i,n)=>{if(!i.modelRange)return;const o=i.viewItem,a=(0,r.first)(i.modelRange.getItems());if(a&&n.schema.checkAttribute(a,"imageStyle"))for(const e of t[a.name])n.consumable.consume(o,{classes:e.className})&&n.writer.setAttribute("imageStyle",e.name,a)}}(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",o),i.data.downcastDispatcher.on("attribute:imageStyle",o),e&&(n.extend("imageBlock",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(n.extend("imageInline",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(m),n=new Map(this.normalizedStyles.map((e=>[e.name,e])));t.registerPostFixer((e=>{let o=!1;for(const a of t.differ.getChanges())if("insert"==a.type||"attribute"==a.type&&"imageStyle"==a.attributeKey){let t="insert"==a.type?a.position.nodeAfter:a.range.start.nodeAfter;if(t&&t.is("element","paragraph")&&t.childCount>0&&(t=t.getChild(0)),!i.isImage(t))continue;const s=t.getAttribute("imageStyle");if(!s)continue;const r=n.get(s);r&&r.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),o=!0)}return o}))}}const Xe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Ye=function(e){return e};var et=i(29),tt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(et.Z,tt);et.Z.locals;class it extends e.Plugin{static get requires(){return[Qe]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"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.plugins,t=this.editor.config.get("image.toolbar")||[],i=nt(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of i)this._createButton(e);const n=nt([...t.filter(Xe),...Ge.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const e of n)this._createDropdown(e,i)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,(n=>{let o;const{defaultItem:a,items:s,title:r}=e,l=s.filter((e=>t.find((({name:t})=>ot(t)===e)))).map((e=>{const t=i.create(e);return e===a&&(o=t),t}));s.length!==l.length&&Ge.warnInvalidStyle({dropdown:e});const c=(0,k.createDropdown)(n,k.SplitButtonView),g=c.buttonView,d=g.arrowView;return(0,k.addToolbarToDropdown)(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),g.set({label:at(r,o.label),class:null,tooltip:!0}),d.unbind("label"),d.set({label:r}),g.bind("icon").toMany(l,"isOn",((...e)=>{const t=e.findIndex(Ye);return t<0?o.icon:l[t].icon})),g.bind("label").toMany(l,"isOn",((...e)=>{const t=e.findIndex(Ye);return at(r,t<0?o.label:l[t].label)})),g.bind("isOn").toMany(l,"isOn",((...e)=>e.some(Ye))),g.bind("class").toMany(l,"isOn",((...e)=>e.some(Ye)?"ck-splitbutton_flatten":null)),g.on("execute",(()=>{l.some((({isOn:e})=>e))?c.isOpen=!c.isOpen:o.fire("execute")})),c.bind("isEnabled").toMany(l,"isEnabled",((...e)=>e.some(Ye))),this.listenTo(c,"execute",(()=>{this.editor.editing.view.focus()})),c}))}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(ot(t),(i=>{const n=this.editor.commands.get("imageStyle"),o=new k.ButtonView(i);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value",(e=>e===t)),o.on("execute",this._executeCommand.bind(this,t)),o}))}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function nt(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function ot(e){return`imageStyle:${e}`}function at(e,t){return(e?e+": ":"")+t}class st extends e.Plugin{static get requires(){return[Qe,it]}static get pluginName(){return"ImageStyle"}}class rt extends e.Plugin{static get requires(){return[l.WidgetToolbarRepository,m]}static get pluginName(){return"ImageToolbar"}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(l.WidgetToolbarRepository),n=e.plugins.get("ImageUtils");var o;i.register("image",{ariaLabel:t("Image toolbar"),items:(o=e.config.get("image.toolbar")||[],o.map((e=>Xe(e)?e.name:e))),getRelatedElement:e=>n.getClosestSelectedImageWidget(e)})}}class lt extends e.Plugin{static get requires(){return[R,m]}static get pluginName(){return"PictureEditing"}afterInit(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.model.schema.extend("imageBlock",{allowAttributes:["sources"]}),e.plugins.has("ImageInlineEditing")&&e.model.schema.extend("imageInline",{allowAttributes:["sources"]}),this._setupConversion(),this._setupImageUploadEditingIntegration()}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("upcast").add(function(e){const t=["srcset","media","type","sizes"];return e=>{e.on("element:picture",i)};function i(i,n,o){const a=n.viewItem;if(!o.consumable.test(a,{name:!0}))return;const s=new Map;for(const e of a.getChildren())if(e.is("element","source")){const i={};for(const n of t)e.hasAttribute(n)&&o.consumable.test(e,{attributes:n})&&(i[n]=e.getAttribute(n));Object.keys(i).length&&s.set(e,i)}const l=e.findViewImgElement(a);if(!l)return;let c=n.modelCursor.parent;if(!c.is("element","imageBlock")){const e=o.convertItem(l,n.modelCursor);n.modelRange=e.modelRange,n.modelCursor=e.modelCursor,c=(0,r.first)(e.modelRange.getItems())}o.consumable.consume(a,{name:!0});for(const[e,t]of s)o.consumable.consume(e,{attributes:Object.keys(t)});s.size&&o.writer.setAttribute("sources",Array.from(s.values()),c),o.convertChildren(a,c)}}(i)),t.for("downcast").add(function(e){return e=>{e.on("attribute:sources:imageBlock",t),e.on("attribute:sources:imageInline",t)};function t(t,i,n){if(!n.consumable.consume(i.item,t.name))return;const o=n.writer,a=n.mapper.toViewElement(i.item),s=e.findViewImgElement(a);if(i.attributeNewValue&&i.attributeNewValue.length){const e=o.createContainerElement("picture",null,i.attributeNewValue.map((e=>o.createEmptyElement("source",e)))),t=[];let n=s.parent;for(;n&&n.is("attributeElement");){const e=n.parent;o.unwrap(o.createRangeOn(s),n),t.unshift(n),n=e}o.insert(o.createPositionBefore(s),e),o.move(o.createRangeOn(s),o.createPositionAt(e,"end"));for(const i of t)o.wrap(o.createRangeOn(e),i)}else if(s.parent.is("element","picture")){const e=s.parent;o.move(o.createRangeOn(s),o.createPositionBefore(e)),o.remove(e)}}}(i))}_setupImageUploadEditingIntegration(){const e=this.editor;e.plugins.has("ImageUploadEditing")&&this.listenTo(e.plugins.get("ImageUploadEditing"),"uploadComplete",((t,{imageElement:i,data:n})=>{const o=n.sources;o&&e.model.change((e=>{e.setAttributes({sources:o},i)}))}))}}})(),(window.CKEditor5=window.CKEditor5||{}).image=n})(); \ No newline at end of file + */(()=>{var e={540:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}",""]);const a=o},560:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-color-image-caption-background);caption-side:bottom;color:var(--ck-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;word-break:break-word}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}",""]);const a=o},91:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck.ck-image-insert__panel{padding:var(--ck-spacing-large)}.ck.ck-image-insert__ck-finder-button{border:1px solid #ccc;border-radius:var(--ck-border-radius);display:block;margin:var(--ck-spacing-standard) auto;width:100%}.ck.ck-splitbutton>.ck-file-dialog-button.ck-button{border:none;margin:0;padding:0}",""]);const a=o},439:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck.ck-image-insert-form:focus{outline:none}.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-image-insert-form__action-row{margin-top:var(--ck-spacing-standard)}.ck.ck-form__row.ck-image-insert-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-image-insert-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row.ck-image-insert-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}",""]);const a=o},601:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[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}",""]);const a=o},29:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.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)}.ck-content .image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-inline-image-style-spacing);margin-top:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}",""]);const a=o},948:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.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:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@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%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}',""]);const a=o},467:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}',""]);const a=o},271:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const a=o},168:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".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%}}",""]);const a=o},764:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck-vertical-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}',""]);const a=o},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var a=0;a{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},a=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),s=[];function r(e){for(var t=-1,i=0;i{e.exports=i(79)("./src/clipboard.js")},704:(e,t,i)=>{e.exports=i(79)("./src/core.js")},492:(e,t,i)=>{e.exports=i(79)("./src/engine.js")},181:(e,t,i)=>{e.exports=i(79)("./src/typing.js")},273:(e,t,i)=>{e.exports=i(79)("./src/ui.js")},254:(e,t,i)=>{e.exports=i(79)("./src/undo.js")},448:(e,t,i)=>{e.exports=i(79)("./src/upload.js")},209:(e,t,i)=>{e.exports=i(79)("./src/utils.js")},995:(e,t,i)=>{e.exports=i(79)("./src/widget.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,exports:{}};return e[n](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{AutoImage:()=>h,Image:()=>M,ImageCaption:()=>G,ImageCaptionEditing:()=>Z,ImageCaptionUtils:()=>W,ImageEditing:()=>z,ImageInsert:()=>Ce,ImageInsertUI:()=>Ee,ImageResize:()=>Ne,ImageResizeButtons:()=>Be,ImageResizeEditing:()=>Ae,ImageResizeHandles:()=>ze,ImageStyle:()=>rt,ImageStyleEditing:()=>Xe,ImageStyleUI:()=>nt,ImageTextAlternative:()=>A,ImageTextAlternativeEditing:()=>b,ImageTextAlternativeUI:()=>S,ImageToolbar:()=>lt,ImageUpload:()=>fe,ImageUploadEditing:()=>pe,ImageUploadProgress:()=>re,ImageUploadUI:()=>ee,PictureEditing:()=>ct});var e=i(704),t=i(945),o=i(492),a=i(254),s=i(181),r=i(209),l=i(995);function c(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot()])}function g(e,t){const i=e.plugins.get("ImageUtils"),n=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>{if(!i.isInlineImageView(e))return null;if(!n)return o(e);return("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:o(e)};function o(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function d(e,t){const i=(0,r.first)(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}class m extends e.Plugin{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null){const n=this.editor,o=n.model,a=o.document.selection;i=u(n,t||a,i),e={...Object.fromEntries(a.getAttributes()),...e};for(const t in e)o.schema.checkAttribute(i,t)||delete e[t];return o.change((n=>{const a=n.createElement(i,e);return o.insertObject(a,t,null,{setSelection:"on",findOptimalPosition:!t&&"imageInline"!=i}),a.parent?a:null}))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let n=t.parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){const i=u(e,t);if("imageBlock"==i){const i=function(e,t){const i=(0,l.findOptimalInsertionRange)(e,t),n=i.start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every((e=>!e.is("element","imageBlock")))}(e)}toImageWidget(e,t,i){t.setCustomProperty("image",!0,e);return(0,l.toWidget)(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&(0,l.isWidget)(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}}function u(e,t,i){const n=e.model.schema,o=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===o?"imageInline":"block"===o?"imageBlock":t.is("selection")?d(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const p=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class h extends e.Plugin{static get requires(){return[t.Clipboard,m,a.Undo,s.Delete]}static get pluginName(){return"AutoImage"}constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document;this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(()=>{const e=t.selection.getFirstRange(),i=o.LivePosition.fromPosition(e.start);i.stickiness="toPrevious";const n=o.LivePosition.fromPosition(e.end);n.stickiness="toNext",t.once("change:data",(()=>{this._embedImageBetweenPositions(i,n),i.detach(),n.detach()}),{priority:"high"})})),e.commands.get("undo").on("execute",(()=>{this._timeoutId&&(r.global.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedImageBetweenPositions(e,t){const i=this.editor,n=new o.LiveRange(e,t),a=n.getWalker({ignoreElementEnd:!0}),s=Object.fromEntries(i.model.document.selection.getAttributes()),l=this.editor.plugins.get("ImageUtils");let c="";for(const e of a)e.item.is("$textProxy")&&(c+=e.item.data);c=c.trim(),c.match(p)?(this._positionToInsert=o.LivePosition.fromPosition(e),this._timeoutId=r.global.window.setTimeout((()=>{i.commands.get("insertImage").isEnabled?(i.model.change((e=>{let t;this._timeoutId=null,e.remove(n),n.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert.toPosition()),l.insertImage({...s,src:c},t),this._positionToInsert.detach(),this._positionToInsert=null})),i.plugins.get("Delete").requestUndoOnBackspace()):n.detach()}),100)):n.detach()}}class f extends e.Command{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n=t.model,o=i.getClosestSelectedImageElement(n.document.selection);n.change((t=>{t.setAttribute("alt",e.newValue,o)}))}}class b extends e.Plugin{static get requires(){return[m]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new f(this.editor))}}var k=i(273),w=i(62),I=i.n(w),v=i(168),y={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(v.Z,y);v.Z.locals;var _=i(764),E={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(_.Z,E);_.Z.locals;class x extends k.View{constructor(t){super(t);const i=this.locale.t;this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(i("Save"),e.icons.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),e.icons.cancel,"ck-button-cancel","cancel"),this._focusables=new k.ViewCollection,this._focusCycler=new k.FocusCycler({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","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),(0,k.injectCssTransitionDisabler)(this)}render(){super.render(),this.keystrokes.listenTo(this.element),(0,k.submitHandler)({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,i,n){const o=new k.ButtonView(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createLabeledInputView(){const e=this.locale.t,t=new k.LabeledFieldView(this.locale,k.createLabeledInputText);return t.label=e("Text alternative"),t}}function C(e){const t=e.editing.view,i=k.BalloonPanelView.defaultPositions,n=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class S extends e.Plugin{static get requires(){return[k.ContextualBalloon]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const t=this.editor,i=t.t;t.ui.componentFactory.add("imageTextAlternative",(n=>{const o=t.commands.get("imageTextAlternative"),a=new k.ButtonView(n);return a.set({label:i("Change image text alternative"),icon:e.icons.lowVision,tooltip:!0}),a.bind("isEnabled").to(o,"isEnabled"),a.bind("isOn").to(o,"value",(e=>!!e)),this.listenTo(a,"execute",(()=>{this._showForm()})),a}))}_createForm(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new x(e.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),this.listenTo(e.ui,"update",(()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const i=C(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),(0,k.clickOutsideHandler)({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:C(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class A extends e.Plugin{static get requires(){return[b,S]}static get pluginName(){return"ImageTextAlternative"}}function T(e,t){return e=>{e.on(`attribute:srcset:${t}`,i)};function i(t,i,n){if(!n.consumable.consume(i.item,t.name))return;const o=n.writer,a=n.mapper.toViewElement(i.item),s=e.findViewImgElement(a);if(null===i.attributeNewValue){const e=i.attributeOldValue;e.data&&(o.removeAttribute("srcset",s),o.removeAttribute("sizes",s),e.width&&o.removeAttribute("width",s))}else{const e=i.attributeNewValue;e.data&&(o.setAttribute("srcset",e.data,s),o.setAttribute("sizes","100vw",s),e.width&&o.setAttribute("width",e.width,s))}}}function B(e,t,i){return e=>{e.on(`attribute:${i}:${t}`,n)};function n(t,i,n){if(!n.consumable.consume(i.item,t.name))return;const o=n.writer,a=n.mapper.toViewElement(i.item),s=e.findViewImgElement(a);o.setAttribute(i.attributeKey,i.attributeNewValue||"",s)}}class V extends o.Observer{observe(e){this.listenTo(e,"load",((e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)}),{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class U extends e.Command{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&(0,r.logWarning)("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&(0,r.logWarning)("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=(0,r.toArray)(e.source),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const a=i.getSelectedElement();if("string"==typeof e&&(e={src:e}),t&&a&&n.isImage(a)){const t=this.editor.model.createPositionAfter(a);n.insertImage({...e,...o},t)}else n.insertImage({...e,...o})}))}}class R extends e.Command{refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement();this.editor.model.change((i=>{i.setAttribute("src",e.source,t),i.removeAttribute("srcset",t),i.removeAttribute("sizes",t)}))}}class z extends e.Plugin{static get requires(){return[m]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(V),t.for("upcast").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")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}});const i=new U(e),n=new R(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",n),e.commands.add("imageInsert",i)}}class P extends e.Command{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,i=e.plugins.get("ImageUtils"),n=i.getClosestSelectedImageElement(t.document.selection),o=Object.fromEntries(n.getAttributes());return o.src||o.uploadId?t.change((e=>{const a=Array.from(t.markers).filter((e=>e.getRange().containsItem(n))),s=i.insertImage(o,t.createSelection(n,"on"),this._modelElementName);if(!s)return null;const r=e.createRangeOn(s);for(const t of a){const i=t.getRange(),n="$graveyard"!=i.root.rootName?i.getJoined(r,!0):r;e.updateMarker(t,{range:n})}return{oldElement:n,newElement:s}})):null}}class O extends e.Plugin{static get requires(){return[z,m,t.ClipboardPipeline]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new P(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>c(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>n.toImageWidget(c(i),i,t("image widget"))}),i.for("downcast").add(B(n,"imageBlock","src")).add(B(n,"imageBlock","alt")).add(T(n,"imageBlock")),i.for("upcast").elementToElement({view:g(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)}).add(function(e){return e=>{e.on("element:figure",t)};function t(t,i,n){if(!n.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const o=e.findViewImgElement(i.viewItem);if(!o||!n.consumable.test(o,{name:!0}))return;n.consumable.consume(i.viewItem,{name:!0,classes:"image"});const a=n.convertItem(o,i.modelCursor),s=(0,r.first)(a.modelRange.getItems());s?(n.convertChildren(i.viewItem,s),n.updateConversionResult(s,i)):n.consumable.revert(i.viewItem,{name:!0,classes:"image"})}}(n))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",((a,s)=>{const r=Array.from(s.content.getChildren());let l;if(!r.every(n.isInlineImageView))return;l=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const c=t.createSelection(l);if("imageBlock"===d(t.schema,c)){const e=new o.UpcastWriter(i.document),t=r.map((t=>e.createElement("figure",{class:"image"},t)));s.content=e.createDocumentFragment(t)}}))}}var N=i(540),F={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(N.Z,F);N.Z.locals;class L extends e.Plugin{static get requires(){return[O,l.Widget,A]}static get pluginName(){return"ImageBlock"}}class D extends e.Plugin{static get requires(){return[z,m,t.ClipboardPipeline]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck(((e,t)=>{if(e.endsWith("caption")&&"imageInline"===t.name)return!1})),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new P(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:i})=>n.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(B(n,"imageInline","src")).add(B(n,"imageInline","alt")).add(T(n,"imageInline")),i.for("upcast").elementToElement({view:g(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",((a,s)=>{const r=Array.from(s.content.getChildren());let l;if(!r.every(n.isBlockImageView))return;l=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const c=t.createSelection(l);if("imageInline"===d(t.schema,c)){const e=new o.UpcastWriter(i.document),t=r.map((t=>1===t.childCount?(Array.from(t.getAttributes()).forEach((i=>e.setAttribute(...i,n.findViewImgElement(t)))),t.getChild(0)):t));s.content=e.createDocumentFragment(t)}}))}}class j extends e.Plugin{static get requires(){return[D,l.Widget,A]}static get pluginName(){return"ImageInline"}}class M extends e.Plugin{static get requires(){return[L,j]}static get pluginName(){return"Image"}}class W extends e.Plugin{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[m]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return"figcaption"==e.name&&t.isBlockImageView(e.parent)?{name:!0}:null}}class q extends e.Command{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils");if(!e.plugins.has(O))return this.isEnabled=!1,void(this.value=!1);const i=e.model.document.selection,n=i.getSelectedElement();if(!n){const e=t.getCaptionFromModelSelection(i);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(n),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(n):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change((e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)}))}_showImageCaption(e,t){const i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageCaptionEditing");let o=i.getSelectedElement();const a=n._getSavedCaption(o);this.editor.plugins.get("ImageUtils").isInlineImage(o)&&(this.editor.execute("imageTypeBlock"),o=i.getSelectedElement());const s=a||e.createElement("caption");e.append(s,o),t&&e.setSelection(s,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,n=t.plugins.get("ImageCaptionEditing"),o=t.plugins.get("ImageCaptionUtils");let a,s=i.getSelectedElement();s?a=o.getCaptionFromImageModelElement(s):(a=o.getCaptionFromModelSelection(i),s=a.parent),n._saveCaption(s,a),e.setSelection(s,"on"),e.remove(a)}}class Z extends e.Plugin{static get requires(){return[m,W]}static get pluginName(){return"ImageCaptionEditing"}constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new q(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),a=e.t;e.conversion.for("upcast").elementToElement({view:e=>n.matchImageCaptionViewElement(e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>i.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:n})=>{if(!i.isBlockImage(e.parent))return null;const s=n.createEditableElement("figcaption");n.setCustomProperty("imageCaption",!0,s),(0,o.enablePlaceholder)({view:t,element:s,text:a("Enter image caption"),keepOnFocus:!0});const r=e.parent.getAttribute("alt"),c=r?a("Caption for image: %0",[r]):a("Caption for the image");return(0,l.toWidgetEditable)(s,n,{label:c})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),n=e.commands.get("imageTypeInline"),o=e.commands.get("imageTypeBlock"),a=e=>{if(!e.return)return;const{oldElement:n,newElement:o}=e.return;if(!n)return;if(t.isBlockImage(n)){const e=i.getCaptionFromImageModelElement(n);if(e)return void this._saveCaption(o,e)}const a=this._getSavedCaption(n);a&&this._saveCaption(o,a)};n&&this.listenTo(n,"execute",a,{priority:"low"}),o&&this.listenTo(o,"execute",a,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?o.Element.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",(()=>{const o=t.document.differ.getChanges();for(const t of o){if("alt"!==t.attributeKey)continue;const o=t.range.start.nodeAfter;if(i.isBlockImage(o)){const t=n.getCaptionFromImageModelElement(o);if(!t)return;e.editing.reconvertItem(t)}}}))}}class $ extends e.Plugin{static get requires(){return[W]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor,i=t.editing.view,n=t.plugins.get("ImageCaptionUtils"),o=t.t;t.ui.componentFactory.add("toggleImageCaption",(a=>{const s=t.commands.get("toggleImageCaption"),r=new k.ButtonView(a);return r.set({icon:e.icons.caption,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.bind("label").to(s,"value",(e=>o(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(r,"execute",(()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:!0});const e=n.getCaptionFromModelSelection(t.model.document.selection);if(e){const n=t.editing.mapper.toViewElement(e);i.scrollToTheSelection(),i.change((e=>{e.addClass("image__caption_highlighted",n)}))}t.editing.view.focus()})),r}))}}var H=i(560),K={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(H.Z,K);H.Z.locals;class G extends e.Plugin{static get requires(){return[Z,$]}static get pluginName(){return"ImageCaption"}}var J=i(448);function Q(e){const t=e.map((e=>e.replace("+","\\+")));return new RegExp(`^image\\/(${t.join("|")})$`)}function X(e){return new Promise(((t,i)=>{const n=e.getAttribute("src");fetch(n).then((e=>e.blob())).then((e=>{const i=Y(e,n),o=i.replace("image/",""),a=new File([e],`image.${o}`,{type:i});t(a)})).catch((e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise(((t,i)=>{const n=r.global.document.createElement("img");n.addEventListener("load",(()=>{const e=r.global.document.createElement("canvas");e.width=n.width,e.height=n.height;e.getContext("2d").drawImage(n,0,0),e.toBlob((e=>e?t(e):i()))})),n.addEventListener("error",(()=>i())),n.src=e}))}(e).then((t=>{const i=Y(t,e),n=i.replace("image/","");return new File([t],`image.${n}`,{type:i})}))}(n).then(t).catch(i):i(e)))}))}function Y(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class ee extends e.Plugin{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,i=t.t,n=n=>{const o=new J.FileDialogButtonView(n),a=t.commands.get("uploadImage"),s=t.config.get("image.upload.types"),r=Q(s);return o.set({acceptedType:s.map((e=>`image/${e}`)).join(","),allowMultipleFiles:!0}),o.buttonView.set({label:i("Insert image"),icon:e.icons.image,tooltip:!0}),o.buttonView.bind("isEnabled").to(a),o.on("done",((e,i)=>{const n=Array.from(i).filter((e=>r.test(e.type)));n.length&&(t.execute("uploadImage",{file:n}),t.editing.view.focus())})),o};t.ui.componentFactory.add("uploadImage",n),t.ui.componentFactory.add("imageUpload",n)}}var te=i(271),ie={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(te.Z,ie);te.Z.locals;var ne=i(948),oe={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(ne.Z,oe);ne.Z.locals;var ae=i(467),se={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(ae.Z,se);ae.Z.locals;class re extends e.Plugin{static get pluginName(){return"ImageUploadProgress"}constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",((...e)=>this.uploadStatusChange(...e))),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",((...e)=>this.uploadStatusChange(...e)))}uploadStatusChange(e,t,i){const n=this.editor,o=t.item,a=o.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const s=n.plugins.get("ImageUtils"),r=n.plugins.get(J.FileRepository),l=a?t.attributeNewValue:null,c=this.placeholder,g=n.editing.mapper.toViewElement(o),d=i.writer;if("reading"==l)return le(g,d),void ce(s,c,g,d);if("uploading"==l){const e=r.loaders.get(a);return le(g,d),void(e?(ge(g,d),function(e,t,i,n){const o=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),o),i.on("change:uploadedPercent",((e,t,i)=>{n.change((e=>{e.setStyle("width",i+"%",o)}))}))}(g,d,e,n.editing.view),function(e,t,i,n){if(n.data){const o=e.findViewImgElement(t);i.setAttribute("src",n.data,o)}}(s,g,d,e)):ce(s,c,g,d))}"complete"==l&&r.loaders.get(a)&&function(e,t,i){const n=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),n),setTimeout((()=>{i.change((e=>e.remove(e.createRangeOn(n))))}),3e3)}(g,d,n.editing.view),function(e,t){me(e,t,"progressBar")}(g,d),ge(g,d),function(e,t){t.removeClass("ck-appear",e)}(g,d)}}function le(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function ce(e,t,i,n){i.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",i);const o=e.findViewImgElement(i);o.getAttribute("src")!==t&&n.setAttribute("src",t,o),de(i,"placeholder")||n.insert(n.createPositionAfter(o),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function ge(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),me(e,t,"placeholder")}function de(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function me(e,t,i){const n=de(e,i);n&&t.remove(t.createRangeOn(n))}class ue extends e.Command{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=(0,r.toArray)(e.file),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const a=i.getSelectedElement();if(t&&a&&n.isImage(a)){const t=this.editor.model.createPositionAfter(a);this._uploadImage(e,o,t)}else this._uploadImage(e,o)}))}_uploadImage(e,t,i){const n=this.editor,o=n.plugins.get(J.FileRepository).createLoader(e),a=n.plugins.get("ImageUtils");o&&a.insertImage({...t,uploadId:o.id},i)}}class pe extends e.Plugin{static get requires(){return[J.FileRepository,k.Notification,t.ClipboardPipeline,m]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,i=e.conversion,n=e.plugins.get(J.FileRepository),a=e.plugins.get("ImageUtils"),s=Q(e.config.get("image.upload.types")),r=new ue(e);e.commands.add("uploadImage",r),e.commands.add("imageUpload",r),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,i)=>{if(n=i.dataTransfer,Array.from(n.types).includes("text/html")&&""!==n.getData("text/html"))return;var n;const o=Array.from(i.dataTransfer.files).filter((e=>!!e&&s.test(e.type)));o.length&&(t.stop(),e.model.change((t=>{i.targetRanges&&t.setSelection(i.targetRanges.map((t=>e.editing.mapper.toModelRange(t)))),e.model.enqueueChange((()=>{e.execute("uploadImage",{file:o})}))})))})),this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",((t,i)=>{const s=Array.from(e.editing.view.createRangeIn(i.content)).filter((e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src"))&&(t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||t.getAttribute("src").match(/^blob:/g))}(a,e.item)&&!e.item.getAttribute("uploadProcessed"))).map((e=>({promise:X(e.item),imageElement:e.item})));if(!s.length)return;const r=new o.UpcastWriter(e.editing.view.document);for(const e of s){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=n.createLoader(e.promise);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 i=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),o=new Set;for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter,a="$graveyard"==t.position.root.rootName;for(const t of he(e,i)){const e=t.getAttribute("uploadId");if(!e)continue;const i=n.loaders.get(e);i&&(a?o.has(e)||i.abort():(o.add(e),this._uploadImageElements.set(e,t),"idle"==i.status&&this._readAndUpload(i)))}}})),this.on("uploadComplete",((e,{imageElement:t,data:i})=>{const n=i.urls?i.urls:i;this.editor.model.change((e=>{e.setAttribute("src",n.default,t),this._parseAndSetSrcsetAttributeOnImage(n,t,e)}))}),{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,i=t.model,n=t.locale.t,o=t.plugins.get(J.FileRepository),a=t.plugins.get(k.Notification),s=t.plugins.get("ImageUtils"),l=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},(t=>{t.setAttribute("uploadStatus","reading",l.get(e.id))})),e.read().then((()=>{const n=e.upload(),o=l.get(e.id);if(r.env.isSafari){const e=t.editing.mapper.toViewElement(o),i=s.findViewImgElement(e);t.editing.view.once("render",(()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const n=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=n}))}return i.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","uploading",o)})),n})).then((t=>{i.enqueueChange({isUndoable:!1},(i=>{const n=l.get(e.id);i.setAttribute("uploadStatus","complete",n),this.fire("uploadComplete",{data:t,imageElement:n})})),c()})).catch((t=>{if("error"!==e.status&&"aborted"!==e.status)throw t;"error"==e.status&&t&&a.showWarning(t,{title:n("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},(t=>{t.remove(l.get(e.id))})),c()}));function c(){i.enqueueChange({isUndoable:!1},(t=>{const i=l.get(e.id);t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i),l.delete(e.id)})),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const o=Object.keys(e).filter((e=>{const t=parseInt(e,10);if(!isNaN(t))return n=Math.max(n,t),!0})).map((t=>`${e[t]} ${t}w`)).join(", ");""!=o&&i.setAttribute("srcset",{data:o,width:n},t)}}function he(e,t){const i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter((e=>i.isImage(e.item))).map((e=>e.item))}class fe extends e.Plugin{static get pluginName(){return"ImageUpload"}static get requires(){return[pe,ee,re]}}var be=i(439),ke={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(be.Z,ke);be.Z.locals;class we extends k.View{constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",t.class||null),this.children=this.createCollection(),t.children&&t.children.forEach((e=>this.children.add(e))),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__row",i.to("class")],role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}var Ie=i(91),ve={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(Ie.Z,ve);Ie.Z.locals;class ye extends k.View{constructor(e,t){super(e);const{insertButtonView:i,cancelButtonView:n}=this._createActionButtons(e);if(this.insertButtonView=i,this.cancelButtonView=n,this.set("imageURLInputValue",""),this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this._focusables=new k.ViewCollection,this._focusCycler=new k.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.set("_integrations",new r.Collection),t)for(const[e,i]of Object.entries(t))"insertImageViaUrl"===e&&(i.fieldView.bind("value").to(this,"imageURLInputValue",(e=>e||"")),i.fieldView.on("input",(()=>{this.imageURLInputValue=i.fieldView.element.value.trim()}))),i.name=e,this._integrations.add(i);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:"-1"},children:[...this._integrations,new we(e,{children:[this.insertButtonView,this.cancelButtonView],class:"ck-image-insert-form__action-row"})]})}render(){super.render(),(0,k.submitHandler)({view:this});const e=[...this._integrations,this.insertButtonView,this.cancelButtonView];e.forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t),this.listenTo(e[0].element,"selectstart",((e,t)=>{t.stopPropagation()}),{priority:"high"})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}getIntegration(e){return this._integrations.find((t=>t.name===e))}_createActionButtons(t){const i=t.t,n=new k.ButtonView(t),o=new k.ButtonView(t);return n.set({label:i("Insert"),icon:e.icons.check,class:"ck-button-save",type:"submit",withText:!0,isEnabled:this.imageURLInputValue}),o.set({label:i("Cancel"),icon:e.icons.cancel,class:"ck-button-cancel",withText:!0}),n.bind("isEnabled").to(this,"imageURLInputValue",(e=>!!e)),n.delegate("execute").to(this,"submit"),o.delegate("execute").to(this,"cancel"),{insertButtonView:n,cancelButtonView:o}}focus(){this._focusCycler.focusFirst()}}function _e(e){const t=e.t,i=new k.LabeledFieldView(e,k.createLabeledInputText);return i.set({label:t("Insert image via URL")}),i.fieldView.placeholder="https://example.com/image.png",i}class Ee extends e.Plugin{static get pluginName(){return"ImageInsertUI"}init(){const e=this.editor,t=e=>this._createDropdownView(e);e.ui.componentFactory.add("insertImage",t),e.ui.componentFactory.add("imageInsert",t)}_createDropdownView(t){const i=this.editor,n=t.t,o=i.commands.get("uploadImage"),a=i.commands.get("insertImage");this.dropdownView=(0,k.createDropdown)(t,o?k.SplitButtonView:void 0);const s=this.dropdownView.buttonView,r=this.dropdownView.panelView;if(s.set({label:n("Insert image"),icon:e.icons.image,tooltip:!0}),r.extendTemplate({attributes:{class:"ck-image-insert__panel"}}),o){const e=this.dropdownView.buttonView;e.actionView=i.ui.componentFactory.create("uploadImage"),e.actionView.extendTemplate({attributes:{class:"ck ck-button ck-splitbutton__action"}})}return this._setUpDropdown(o||a)}_setUpDropdown(e){const t=this.editor,i=t.t,n=this.dropdownView,o=n.panelView,a=this.editor.plugins.get("ImageUtils"),s=t.commands.get("replaceImageSource");let r;function l(){t.editing.view.focus(),n.isOpen=!1}return n.bind("isEnabled").to(e),n.once("change:isOpen",(()=>{r=new ye(t.locale,function(e){const t=e.config.get("image.insert.integrations"),i=e.plugins.get("ImageInsertUI"),n={insertImageViaUrl:_e(e.locale)};if(!t)return n;if(t.find((e=>"openCKFinder"===e))&&e.ui.componentFactory.has("ckfinder")){const t=e.ui.componentFactory.create("ckfinder");t.set({withText:!0,class:"ck-image-insert__ck-finder-button"}),t.delegate("execute").to(i,"cancel"),n.openCKFinder=t}return t.reduce(((t,i)=>(n[i]?t[i]=n[i]:e.ui.componentFactory.has(i)&&(t[i]=e.ui.componentFactory.create(i)),t)),{})}(t)),r.delegate("submit","cancel").to(n),o.children.add(r)})),n.on("change:isOpen",(()=>{const e=t.model.document.selection.getSelectedElement(),o=r.insertButtonView,l=r.getIntegration("insertImageViaUrl");n.isOpen&&(a.isImage(e)?(r.imageURLInputValue=s.value,o.label=i("Update"),l.label=i("Update image URL")):(r.imageURLInputValue="",o.label=i("Insert"),l.label=i("Insert image via URL")))}),{priority:"low"}),this.delegate("cancel").to(n),n.on("submit",(()=>{l(),function(){const e=t.model.document.selection.getSelectedElement();a.isImage(e)?t.execute("replaceImageSource",{source:r.imageURLInputValue}):t.execute("insertImage",{source:r.imageURLInputValue})}()})),n.on("cancel",(()=>{l()})),n}}class xe extends e.Plugin{static get pluginName(){return"ImageInsertViaUrl"}static get requires(){return[Ee]}}class Ce extends e.Plugin{static get pluginName(){return"ImageInsert"}static get requires(){return[fe,xe,Ee]}}class Se extends e.Command{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils").getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},n&&i.change((t=>{t.setAttribute("width",e.width,n)}))}}class Ae extends e.Plugin{static get requires(){return[m]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Se(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(e){const t=this.editor;t.conversion.for("downcast").add((t=>t.on(`attribute:width:${e}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,o=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(n.setStyle("width",t.attributeNewValue,o),n.addClass("image_resized",o)):(n.removeStyle("width",o),n.removeClass("image_resized",o))})))),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}const Te={small:e.icons.objectSizeSmall,medium:e.icons.objectSizeMedium,large:e.icons.objectSizeLarge,original:e.icons.objectSizeFull};class Be extends e.Plugin{static get requires(){return[Ae]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:i,value:n,icon:o}=e,a=n?n+this._resizeUnit:null;t.ui.componentFactory.add(i,(i=>{const n=new k.ButtonView(i),s=t.commands.get("resizeImage"),l=this._getOptionLabelValue(e,!0);if(!Te[o])throw new r.CKEditorError("imageresizebuttons-missing-icon",t,e);return n.set({label:l,icon:Te[o],tooltip:l,isToggleable:!0}),n.bind("isEnabled").to(this),n.bind("isOn").to(s,"value",Ve(a)),this.listenTo(n,"execute",(()=>{t.execute("resizeImage",{width:a})})),n}))}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,n=e.find((e=>!e.value)),o=o=>{const a=t.commands.get("resizeImage"),s=(0,k.createDropdown)(o,k.DropdownButtonView),r=s.buttonView;return r.set({tooltip:i("Resize image"),commandValue:n.value,icon:Te.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button"}),r.bind("label").to(a,"value",(e=>e&&e.width?e.width:this._getOptionLabelValue(n))),s.bind("isOn").to(a),s.bind("isEnabled").to(this),(0,k.addListToDropdown)(s,(()=>this._getResizeDropdownListItemDefinitions(e,a)),{ariaLabel:i("Image resize list")}),this.listenTo(s,"execute",(e=>{t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus()})),s};t.ui.componentFactory.add("resizeImage",o),t.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(e,t){const i=this.editor.t;return e.label?e.label:t?e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const i=new r.Collection;return e.map((e=>{const n=e.value?e.value+this._resizeUnit:null,o={type:"button",model:new k.Model({commandName:"resizeImage",commandValue:n,label:this._getOptionLabelValue(e),withText:!0,icon:null})};o.model.bind("isOn").to(t,"value",Ve(n)),i.add(o)})),i}}function Ve(e){return t=>null===e&&t===e||t&&t.width===e}const Ue=/(image|image-inline)/,Re="image_resized";class ze extends e.Plugin{static get requires(){return[l.WidgetResize]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view;t.addObserver(V),this.listenTo(t.document,"imageLoaded",((i,n)=>{if(!n.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const o=e.editing.view.domConverter,a=o.domToView(n.target).findAncestor({classes:Ue});let s=this.editor.plugins.get(l.WidgetResize).getResizerByViewElement(a);if(s)return void s.redraw();const r=e.editing.mapper,c=r.toModelElement(a);s=e.plugins.get(l.WidgetResize).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:c,viewElement:a,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>o.mapViewToDom(r.toViewElement(c.parent)),isCentered(){const e=c.getAttribute("imageStyle");return!e||"block"==e||"alignCenter"==e},onCommit(i){t.change((e=>{e.removeClass(Re,a)})),e.execute("resizeImage",{width:i})}}),s.on("updateSize",(()=>{a.hasClass(Re)||t.change((e=>{e.addClass(Re,a)}))})),s.bind("isEnabled").to(this)}))}}var Pe=i(601),Oe={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(Pe.Z,Oe);Pe.Z.locals;class Ne extends e.Plugin{static get requires(){return[Ae,ze,Be]}static get pluginName(){return"ImageResize"}}class Fe extends e.Command{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map((e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]})))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils");i.change((t=>{const o=e.value;let a=n.getClosestSelectedImageElement(i.document.selection);o&&this.shouldConvertImageType(o,a)&&(this.editor.execute(n.isBlockImage(a)?"imageTypeInline":"imageTypeBlock"),a=n.getClosestSelectedImageElement(i.document.selection)),!o||this._styles.get(o).isDefault?t.removeAttribute("imageStyle",a):t.setAttribute("imageStyle",o,a)}))}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const{objectFullWidth:Le,objectInline:De,objectLeft:je,objectRight:Me,objectCenter:We,objectBlockLeft:qe,objectBlockRight:Ze}=e.icons,$e={get inline(){return{name:"inline",title:"In line",icon:De,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:je,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:qe,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:We,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Me,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Ze,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:We,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:Me,modelElements:["imageBlock"],className:"image-style-side"}}},He={full:Le,left:qe,right:Ze,center:We,inlineLeft:je,inlineRight:Me,inline:De},Ke=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function Ge(e){(0,r.logWarning)("image-style-configuration-definition-invalid",e)}const Je={normalizeStyles:function(e){return(e.configuredStyles.options||[]).map((e=>function(e){e="string"==typeof e?$e[e]?{...$e[e]}:{name:e}:function(e,t){const i={...t};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)||(i[n]=e[n]);return i}($e[e.name],e);"string"==typeof e.icon&&(e.icon=He[e.icon]||e.icon);return e}(e))).filter((t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:n,name:o}=e;if(!(n&&n.length&&o))return Ge({style:e}),!1;{const o=[t?"imageBlock":null,i?"imageInline":null];if(!n.some((e=>o.includes(e))))return(0,r.logWarning)("image-style-missing-dependency",{style:e,missingPlugins:n.map((e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing"))}),!1}return!0}(t,e)))},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...Ke]:[]},warnInvalidStyle:Ge,DEFAULT_OPTIONS:$e,DEFAULT_ICONS:He,DEFAULT_DROPDOWN_DEFINITIONS:Ke};function Qe(e,t){for(const i of t)if(i.name===e)return i}class Xe extends e.Plugin{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[m]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=Je,i=this.editor,n=i.plugins.has("ImageBlockEditing"),o=i.plugins.has("ImageInlineEditing");i.config.define("image.styles",t(n,o)),this.normalizedStyles=e({configuredStyles:i.config.get("image.styles"),isBlockPluginLoaded:n,isInlinePluginLoaded:o}),this._setupConversion(n,o),this._setupPostFixer(),i.commands.add("imageStyle",new Fe(i,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,n=i.model.schema,o=(a=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=Qe(t.attributeNewValue,a),o=Qe(t.attributeOldValue,a),s=i.mapper.toViewElement(t.item),r=i.writer;o&&r.removeClass(o.className,s),n&&r.addClass(n.className,s)});var a;const s=function(e){const t={imageInline:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageInline"))),imageBlock:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageBlock")))};return(e,i,n)=>{if(!i.modelRange)return;const o=i.viewItem,a=(0,r.first)(i.modelRange.getItems());if(a&&n.schema.checkAttribute(a,"imageStyle"))for(const e of t[a.name])n.consumable.consume(o,{classes:e.className})&&n.writer.setAttribute("imageStyle",e.name,a)}}(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",o),i.data.downcastDispatcher.on("attribute:imageStyle",o),e&&(n.extend("imageBlock",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(n.extend("imageInline",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(m),n=new Map(this.normalizedStyles.map((e=>[e.name,e])));t.registerPostFixer((e=>{let o=!1;for(const a of t.differ.getChanges())if("insert"==a.type||"attribute"==a.type&&"imageStyle"==a.attributeKey){let t="insert"==a.type?a.position.nodeAfter:a.range.start.nodeAfter;if(t&&t.is("element","paragraph")&&t.childCount>0&&(t=t.getChild(0)),!i.isImage(t))continue;const s=t.getAttribute("imageStyle");if(!s)continue;const r=n.get(s);r&&r.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),o=!0)}return o}))}}const Ye=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const et=function(e){return e};var tt=i(29),it={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};I()(tt.Z,it);tt.Z.locals;class nt extends e.Plugin{static get requires(){return[Xe]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"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.plugins,t=this.editor.config.get("image.toolbar")||[],i=ot(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of i)this._createButton(e);const n=ot([...t.filter(Ye),...Je.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const e of n)this._createDropdown(e,i)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,(n=>{let o;const{defaultItem:a,items:s,title:r}=e,l=s.filter((e=>t.find((({name:t})=>at(t)===e)))).map((e=>{const t=i.create(e);return e===a&&(o=t),t}));s.length!==l.length&&Je.warnInvalidStyle({dropdown:e});const c=(0,k.createDropdown)(n,k.SplitButtonView),g=c.buttonView,d=g.arrowView;return(0,k.addToolbarToDropdown)(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),g.set({label:st(r,o.label),class:null,tooltip:!0}),d.unbind("label"),d.set({label:r}),g.bind("icon").toMany(l,"isOn",((...e)=>{const t=e.findIndex(et);return t<0?o.icon:l[t].icon})),g.bind("label").toMany(l,"isOn",((...e)=>{const t=e.findIndex(et);return st(r,t<0?o.label:l[t].label)})),g.bind("isOn").toMany(l,"isOn",((...e)=>e.some(et))),g.bind("class").toMany(l,"isOn",((...e)=>e.some(et)?"ck-splitbutton_flatten":null)),g.on("execute",(()=>{l.some((({isOn:e})=>e))?c.isOpen=!c.isOpen:o.fire("execute")})),c.bind("isEnabled").toMany(l,"isEnabled",((...e)=>e.some(et))),this.listenTo(c,"execute",(()=>{this.editor.editing.view.focus()})),c}))}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(at(t),(i=>{const n=this.editor.commands.get("imageStyle"),o=new k.ButtonView(i);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value",(e=>e===t)),o.on("execute",this._executeCommand.bind(this,t)),o}))}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function ot(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function at(e){return`imageStyle:${e}`}function st(e,t){return(e?e+": ":"")+t}class rt extends e.Plugin{static get requires(){return[Xe,nt]}static get pluginName(){return"ImageStyle"}}class lt extends e.Plugin{static get requires(){return[l.WidgetToolbarRepository,m]}static get pluginName(){return"ImageToolbar"}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(l.WidgetToolbarRepository),n=e.plugins.get("ImageUtils");var o;i.register("image",{ariaLabel:t("Image toolbar"),items:(o=e.config.get("image.toolbar")||[],o.map((e=>Ye(e)?e.name:e))),getRelatedElement:e=>n.getClosestSelectedImageWidget(e)})}}class ct extends e.Plugin{static get requires(){return[z,m]}static get pluginName(){return"PictureEditing"}afterInit(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.model.schema.extend("imageBlock",{allowAttributes:["sources"]}),e.plugins.has("ImageInlineEditing")&&e.model.schema.extend("imageInline",{allowAttributes:["sources"]}),this._setupConversion(),this._setupImageUploadEditingIntegration()}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("upcast").add(function(e){const t=["srcset","media","type","sizes"];return e=>{e.on("element:picture",i)};function i(i,n,o){const a=n.viewItem;if(!o.consumable.test(a,{name:!0}))return;const s=new Map;for(const e of a.getChildren())if(e.is("element","source")){const i={};for(const n of t)e.hasAttribute(n)&&o.consumable.test(e,{attributes:n})&&(i[n]=e.getAttribute(n));Object.keys(i).length&&s.set(e,i)}const l=e.findViewImgElement(a);if(!l)return;let c=n.modelCursor.parent;if(!c.is("element","imageBlock")){const e=o.convertItem(l,n.modelCursor);n.modelRange=e.modelRange,n.modelCursor=e.modelCursor,c=(0,r.first)(e.modelRange.getItems())}o.consumable.consume(a,{name:!0});for(const[e,t]of s)o.consumable.consume(e,{attributes:Object.keys(t)});s.size&&o.writer.setAttribute("sources",Array.from(s.values()),c),o.convertChildren(a,c)}}(i)),t.for("downcast").add(function(e){return e=>{e.on("attribute:sources:imageBlock",t),e.on("attribute:sources:imageInline",t)};function t(t,i,n){if(!n.consumable.consume(i.item,t.name))return;const o=n.writer,a=n.mapper.toViewElement(i.item),s=e.findViewImgElement(a);if(i.attributeNewValue&&i.attributeNewValue.length){const e=o.createContainerElement("picture",null,i.attributeNewValue.map((e=>o.createEmptyElement("source",e)))),t=[];let n=s.parent;for(;n&&n.is("attributeElement");){const e=n.parent;o.unwrap(o.createRangeOn(s),n),t.unshift(n),n=e}o.insert(o.createPositionBefore(s),e),o.move(o.createRangeOn(s),o.createPositionAt(e,"end"));for(const i of t)o.wrap(o.createRangeOn(e),i)}else if(s.parent.is("element","picture")){const e=s.parent;o.move(o.createRangeOn(s),o.createPositionBefore(e)),o.remove(e)}}}(i))}_setupImageUploadEditingIntegration(){const e=this.editor;e.plugins.has("ImageUploadEditing")&&this.listenTo(e.plugins.get("ImageUploadEditing"),"uploadComplete",((t,{imageElement:i,data:n})=>{const o=n.sources;o&&e.model.change((e=>{e.setAttributes({sources:o},i)}))}))}}})(),(window.CKEditor5=window.CKEditor5||{}).image=n})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/image/translations/sr-latn.js b/core/assets/vendor/ckeditor5/image/translations/sr-latn.js index b8501eee39c..af4656c62f6 100644 --- a/core/assets/vendor/ckeditor5/image/translations/sr-latn.js +++ b/core/assets/vendor/ckeditor5/image/translations/sr-latn.js @@ -1 +1 @@ -!function(e){const i=e["sr-latn"]=e["sr-latn"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Break text":"Prelom teksta","Caption for image: %0":"","Caption for the image":"","Centered image":"Slika u sredini","Change image text alternative":"Izmena alternativnog teksta","Enter image caption":"Odredi tekst ispod slike","Full size image":"Slika u punoj veličini","Image resize list":"Lista veličine slike","Image toolbar":"Slika traka sa alatkama","image widget":"modul sa slikom","In line":"U redu",Insert:"Ubaci","Insert image":"Dodaj sliku","Insert image via URL":"Ubaci sliku preko URL-a","Left aligned image":"Leva slika",Original:"Original","Resize image":"Promenite veličinu slike","Resize image to %0":"Promenite veličinu slike na% 0","Resize image to the original size":"Promenite veličinu slike do originalne veličine","Right aligned image":"Desna slika","Side image":"Bočna slika","Text alternative":"Alternativni tekst",Update:"Ažuriraj","Update image URL":"Ažuriraj URL slike","Upload failed":"Postavljanje neuspešno","Wrap text":"Prelomiti tekst"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file +!function(i){const e=i["sr-latn"]=i["sr-latn"]||{};e.dictionary=Object.assign(e.dictionary||{},{"Break text":"Prelom teksta","Caption for image: %0":"Natpis za sliku:%0","Caption for the image":"Natpis za sliku","Centered image":"Slika u sredini","Change image text alternative":"Izmena alternativnog teksta","Enter image caption":"Odredi tekst ispod slike","Full size image":"Slika u punoj veličini","Image resize list":"Lista veličine slike","Image toolbar":"Slika traka sa alatkama","image widget":"modul sa slikom","In line":"U redu",Insert:"Ubaci","Insert image":"Dodaj sliku","Insert image via URL":"Ubaci sliku preko URL-a","Left aligned image":"Leva slika",Original:"Original","Resize image":"Promenite veličinu slike","Resize image to %0":"Promenite veličinu slike na% 0","Resize image to the original size":"Promenite veličinu slike do originalne veličine","Right aligned image":"Desna slika","Side image":"Bočna slika","Text alternative":"Alternativni tekst",Update:"Ažuriraj","Update image URL":"Ažuriraj URL slike","Upload failed":"Postavljanje neuspešno","Wrap text":"Prelomiti tekst"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/image/translations/sr.js b/core/assets/vendor/ckeditor5/image/translations/sr.js index e2f325925af..a15ce51f4a8 100644 --- a/core/assets/vendor/ckeditor5/image/translations/sr.js +++ b/core/assets/vendor/ckeditor5/image/translations/sr.js @@ -1 +1 @@ -!function(e){const i=e.sr=e.sr||{};i.dictionary=Object.assign(i.dictionary||{},{"Break text":"Прелом текста","Caption for image: %0":"Natpis za sliku: %0","Caption for the image":"Natpis za ovu sliku","Centered image":"Слика у средини","Change image text alternative":"Измена алтернативног текста","Enter image caption":"Одреди текст испод слике","Full size image":"Слика у пуној величини","Image resize list":"Листа величине слике","Image toolbar":"Слика трака са алтакама","image widget":"модул са сликом","In line":"У реду",Insert:"Убаци","Insert image":"Додај слику","Insert image via URL":"Убаци слику преко УРЛ-а","Left aligned image":"Лева слика",Original:"Оригинал","Resize image":"Промените величину слике","Resize image to %0":"Промените величину слике на% 0","Resize image to the original size":"Промените величину слике до оригиналне величине","Right aligned image":"Десна слика","Side image":"Бочна слика","Text alternative":"Алтернативни текст",Update:"Ажурирај","Update image URL":"Ажурирај УРЛ слике","Upload failed":"Постављање неуспешно","Wrap text":"Преломити текст"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file +!function(e){const i=e.sr=e.sr||{};i.dictionary=Object.assign(i.dictionary||{},{"Break text":"Прелом текста","Caption for image: %0":"Натпис за слику: %0","Caption for the image":"Натпис за слику","Centered image":"Слика у средини","Change image text alternative":"Измена алтернативног текста","Enter image caption":"Одреди текст испод слике","Full size image":"Слика у пуној величини","Image resize list":"Листа величине слике","Image toolbar":"Слика трака са алтакама","image widget":"модул са сликом","In line":"У реду",Insert:"Убаци","Insert image":"Додај слику","Insert image via URL":"Убаци слику преко УРЛ-а","Left aligned image":"Лева слика",Original:"Оригинал","Resize image":"Промените величину слике","Resize image to %0":"Промените величину слике на% 0","Resize image to the original size":"Промените величину слике до оригиналне величине","Right aligned image":"Десна слика","Side image":"Бочна слика","Text alternative":"Алтернативни текст",Update:"Ажурирај","Update image URL":"Ажурирај УРЛ слике","Upload failed":"Постављање неуспешно","Wrap text":"Преломити текст"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/indent/indent.js b/core/assets/vendor/ckeditor5/indent/indent.js index b9f70dcddbd..1ab11e53124 100644 --- a/core/assets/vendor/ckeditor5/indent/indent.js +++ b/core/assets/vendor/ckeditor5/indent/indent.js @@ -1,5 +1,5 @@ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Decrease indent":"Decrease indent","Increase indent":"Increase indent"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */(()=>{var t={704:(t,e,n)=>{t.exports=n(79)("./src/core.js")},492:(t,e,n)=>{t.exports=n(79)("./src/engine.js")},273:(t,e,n)=>{t.exports=n(79)("./src/ui.js")},209:(t,e,n)=>{t.exports=n(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s),n.d(s,{Indent:()=>a,IndentBlock:()=>f,IndentEditing:()=>e,IndentUI:()=>d});var t=n(704);class e extends t.Plugin{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new t.MultiCommand(e)),e.commands.add("outdent",new t.MultiCommand(e))}}var i=n(273);const o='',r='';class d extends t.Plugin{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,s="ltr"==e.uiLanguageDirection?o:r,i="ltr"==e.uiLanguageDirection?r:o;this._defineButton("indent",n("Increase indent"),s),this._defineButton("outdent",n("Decrease indent"),i)}_defineButton(t,e,n){const s=this.editor;s.ui.componentFactory.add(t,(o=>{const r=s.commands.get(t),d=new i.ButtonView(o);return d.set({label:e,icon:n,tooltip:!0}),d.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(d,"execute",(()=>{s.execute(t),s.editing.view.focus()})),d}))}}class a extends t.Plugin{static get pluginName(){return"Indent"}static get requires(){return[e,d]}}var c=n(492),l=n(209);class u extends t.Command{constructor(t,e){super(t),this._indentBehavior=e}refresh(){const t=this.editor.model,e=(0,l.first)(t.document.selection.getSelectedBlocks());e&&t.schema.checkAttribute(e,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const t=this.editor.model,e=function(t){const e=t.document.selection,n=t.schema;return Array.from(e.getSelectedBlocks()).filter((t=>n.checkAttribute(t,"blockIndent")))}(t);t.change((t=>{for(const n of e){const e=n.getAttribute("blockIndent"),s=this._indentBehavior.getNextIndent(e);s?t.setAttribute("blockIndent",s,n):t.removeAttribute("blockIndent",n)}}))}}class h{constructor(t){this.isForward="forward"===t.direction,this.offset=t.offset,this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||0);return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||0);if(!(!t||t.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const n=e+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class g{constructor(t){this.isForward="forward"===t.direction,this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);return this.isForward?e=0}getNextIndent(t){const e=this.classes.indexOf(t),n=this.isForward?1:-1;return this.classes[e+n]}}const m=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class f extends t.Plugin{constructor(t){super(t),t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const t=this.editor,e=t.config.get("indentBlock"),n=!e.classes||!e.classes.length,s=Object.assign({direction:"forward"},e),i=Object.assign({direction:"backward"},e);n?(t.data.addStyleProcessorRules(c.addMarginRules),this._setupConversionUsingOffset(t.conversion),t.commands.add("indentBlock",new u(t,new h(s))),t.commands.add("outdentBlock",new u(t,new h(i)))):(this._setupConversionUsingClasses(e.classes),t.commands.add("indentBlock",new u(t,new g(s))),t.commands.add("outdentBlock",new u(t,new g(i))))}afterInit(){const t=this.editor,e=t.model.schema,n=t.commands.get("indent"),s=t.commands.get("outdent"),i=t.config.get("heading.options");(i&&i.map((t=>t.model))||m).forEach((t=>{e.isRegistered(t)&&e.extend(t,{allowAttributes:"blockIndent"})})),e.setAttributeProperties("blockIndent",{isFormatting:!0}),n.registerChildCommand(t.commands.get("indentBlock")),s.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion,e="rtl"===this.editor.locale.contentLanguageDirection?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>t.getStyle(e)}}),t.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const n of t)e.model.values.push(n),e.view[n]={key:"class",value:[n]};this.editor.conversion.attributeToAttribute(e)}}})(),(window.CKEditor5=window.CKEditor5||{}).indent=s})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/language/language.js b/core/assets/vendor/ckeditor5/language/language.js index cd515c3af4a..21b8185a3cc 100644 --- a/core/assets/vendor/ckeditor5/language/language.js +++ b/core/assets/vendor/ckeditor5/language/language.js @@ -1,5 +1,5 @@ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Choose language":"Choose language",Language:"Language","Remove language":"Remove language"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var e={176:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var a=n(609),r=n.n(a)()((function(e){return e[1]}));r.push([e.id,".ck-content span[lang]{font-style:italic}",""]);const o=r},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,a){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(a)for(var o=0;o{"use strict";var a,r=function(){return void 0===a&&(a=Boolean(window&&document&&document.all&&!window.atob)),a},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function s(e){for(var t=-1,n=0;n{e.exports=n(79)("./src/core.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},209:(e,t,n)=>{e.exports=n(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var o=t[a]={id:a,exports:{}};return e[a](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var a={};(()=>{"use strict";n.r(a),n.d(a,{TextPartLanguage:()=>f,TextPartLanguageEditing:()=>i,TextPartLanguageUI:()=>g});var e=n(704),t=n(209);function r(e,n){return`${e}:${n=n||(0,t.getLanguageDirection)(e)}`}class o extends e.Command{refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"language")}execute({languageCode:e,textDirection:t}={}){const n=this.editor.model,a=n.document.selection,o=!!e&&r(e,t);n.change((e=>{if(a.isCollapsed)o?e.setSelectionAttribute("language",o):e.removeSelectionAttribute("language");else{const t=n.schema.getValidRanges(a.getRanges(),"language");for(const n of t)o?e.setAttribute("language",o,n):e.removeAttribute("language",n)}}))}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.getAttribute("language")||!1;for(const e of n.getRanges())for(const n of e.getItems())if(t.checkAttribute(n,"language"))return n.getAttribute("language")||!1;return!1}}class i extends e.Plugin{static get pluginName(){return"TextPartLanguageEditing"}constructor(e){super(e),e.config.define("language",{textPartLanguage:[{title:"Arabic",languageCode:"ar"},{title:"French",languageCode:"fr"},{title:"Spanish",languageCode:"es"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"language"}),e.model.schema.setAttributeProperties("language",{copyOnEnter:!0}),this._defineConverters(),e.commands.add("textPartLanguage",new o(e))}_defineConverters(){const e=this.editor.conversion;e.for("upcast").elementToAttribute({model:{key:"language",value:e=>r(e.getAttribute("lang"),e.getAttribute("dir"))},view:{name:"span",attributes:{lang:/[\s\S]+/}}}),e.for("downcast").attributeToElement({model:"language",view:(e,{writer:t},n)=>{if(!e)return;if(!n.item.is("$textProxy")&&!n.item.is("documentSelection"))return;const{languageCode:a,textDirection:r}=function(e){const[t,n]=e.split(":");return{languageCode:t,textDirection:n}}(e);return t.createAttributeElement("span",{lang:a,dir:r})}})}}var s=n(273),u=n(62),l=n.n(u),c=n(176),d={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};l()(c.Z,d);c.Z.locals;class g extends e.Plugin{static get pluginName(){return"TextPartLanguageUI"}init(){const e=this.editor,n=e.t,a=e.config.get("language.textPartLanguage"),o=n("Choose language"),i=n("Remove language"),u=n("Language");e.ui.componentFactory.add("textPartLanguage",(n=>{const l=new t.Collection,c={},d=e.commands.get("textPartLanguage");l.add({type:"button",model:new s.Model({label:i,languageCode:!1,withText:!0})}),l.add({type:"separator"});for(const e of a){const t={type:"button",model:new s.Model({label:e.title,languageCode:e.languageCode,textDirection:e.textDirection,withText:!0})},n=r(e.languageCode,e.textDirection);t.model.bind("isOn").to(d,"value",(e=>e===n)),l.add(t),c[n]=e.title}const g=(0,s.createDropdown)(n);return(0,s.addListToDropdown)(g,l),g.buttonView.set({isOn:!1,withText:!0,tooltip:u}),g.extendTemplate({attributes:{class:["ck-text-fragment-language-dropdown"]}}),g.bind("isEnabled").to(d,"isEnabled"),g.buttonView.bind("label").to(d,"value",(e=>c[e]||o)),this.listenTo(g,"execute",(t=>{d.execute({languageCode:t.source.languageCode,textDirection:t.source.textDirection}),e.editing.view.focus()})),g}))}}class f extends e.Plugin{static get requires(){return[i,g]}static get pluginName(){return"TextPartLanguage"}}})(),(window.CKEditor5=window.CKEditor5||{}).language=a})(); \ No newline at end of file + */(()=>{var e={176:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var a=n(609),r=n.n(a)()((function(e){return e[1]}));r.push([e.id,".ck-content span[lang]{font-style:italic}",""]);const o=r},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,a){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(a)for(var o=0;o{"use strict";var a,r=function(){return void 0===a&&(a=Boolean(window&&document&&document.all&&!window.atob)),a},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function s(e){for(var t=-1,n=0;n{e.exports=n(79)("./src/core.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},209:(e,t,n)=>{e.exports=n(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var o=t[a]={id:a,exports:{}};return e[a](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var a={};(()=>{"use strict";n.r(a),n.d(a,{TextPartLanguage:()=>f,TextPartLanguageEditing:()=>i,TextPartLanguageUI:()=>g});var e=n(704),t=n(209);function r(e,n){return`${e}:${n=n||(0,t.getLanguageDirection)(e)}`}class o extends e.Command{refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"language")}execute({languageCode:e,textDirection:t}={}){const n=this.editor.model,a=n.document.selection,o=!!e&&r(e,t);n.change((e=>{if(a.isCollapsed)o?e.setSelectionAttribute("language",o):e.removeSelectionAttribute("language");else{const t=n.schema.getValidRanges(a.getRanges(),"language");for(const n of t)o?e.setAttribute("language",o,n):e.removeAttribute("language",n)}}))}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.getAttribute("language")||!1;for(const e of n.getRanges())for(const n of e.getItems())if(t.checkAttribute(n,"language"))return n.getAttribute("language")||!1;return!1}}class i extends e.Plugin{static get pluginName(){return"TextPartLanguageEditing"}constructor(e){super(e),e.config.define("language",{textPartLanguage:[{title:"Arabic",languageCode:"ar"},{title:"French",languageCode:"fr"},{title:"Spanish",languageCode:"es"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"language"}),e.model.schema.setAttributeProperties("language",{copyOnEnter:!0}),this._defineConverters(),e.commands.add("textPartLanguage",new o(e))}_defineConverters(){const e=this.editor.conversion;e.for("upcast").elementToAttribute({model:{key:"language",value:e=>r(e.getAttribute("lang"),e.getAttribute("dir"))},view:{name:"span",attributes:{lang:/[\s\S]+/}}}),e.for("downcast").attributeToElement({model:"language",view:(e,{writer:t},n)=>{if(!e)return;if(!n.item.is("$textProxy")&&!n.item.is("documentSelection"))return;const{languageCode:a,textDirection:r}=function(e){const[t,n]=e.split(":");return{languageCode:t,textDirection:n}}(e);return t.createAttributeElement("span",{lang:a,dir:r})}})}}var s=n(273),u=n(62),l=n.n(u),c=n(176),d={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};l()(c.Z,d);c.Z.locals;class g extends e.Plugin{static get pluginName(){return"TextPartLanguageUI"}init(){const e=this.editor,n=e.t,a=e.config.get("language.textPartLanguage"),o=n("Choose language"),i=n("Remove language"),u=n("Language");e.ui.componentFactory.add("textPartLanguage",(n=>{const l=new t.Collection,c={},d=e.commands.get("textPartLanguage");l.add({type:"button",model:new s.Model({label:i,languageCode:!1,withText:!0})}),l.add({type:"separator"});for(const e of a){const t={type:"button",model:new s.Model({label:e.title,languageCode:e.languageCode,textDirection:e.textDirection,withText:!0})},n=r(e.languageCode,e.textDirection);t.model.bind("isOn").to(d,"value",(e=>e===n)),l.add(t),c[n]=e.title}const g=(0,s.createDropdown)(n);return(0,s.addListToDropdown)(g,l),g.buttonView.set({isOn:!1,withText:!0,tooltip:u}),g.extendTemplate({attributes:{class:["ck-text-fragment-language-dropdown"]}}),g.bind("isEnabled").to(d,"isEnabled"),g.buttonView.bind("label").to(d,"value",(e=>e&&c[e]||o)),this.listenTo(g,"execute",(t=>{d.execute({languageCode:t.source.languageCode,textDirection:t.source.textDirection}),e.editing.view.focus()})),g}))}}class f extends e.Plugin{static get requires(){return[i,g]}static get pluginName(){return"TextPartLanguage"}}})(),(window.CKEditor5=window.CKEditor5||{}).language=a})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/link/link.js b/core/assets/vendor/ckeditor5/link/link.js index 7b9236bebef..7b328056755 100644 --- a/core/assets/vendor/ckeditor5/link/link.js +++ b/core/assets/vendor/ckeditor5/link/link.js @@ -1,5 +1,5 @@ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{Downloadable:"Downloadable","Edit link":"Edit link",Link:"Link","Link image":"Link image","Link URL":"Link URL","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab","This link has no URL":"This link has no URL",Unlink:"Unlink"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var e={23:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}",""]);const s=o},952:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".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 .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{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.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}[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 .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{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}",""]);const s=o},871:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".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_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 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{border-radius:0;margin:0;padding:var(--ck-spacing-standard);width:50%}.ck.ck-link-form_layout-vertical>.ck-button:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form_layout-vertical>.ck-button,[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:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}",""]);const s=o},269:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{background-color:rgba(0,0,0,.4);background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+");background-position:50%;background-repeat:no-repeat;background-size:14px;border-radius:100%;content:"";height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));overflow:hidden;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}',""]);const s=o},764:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck-vertical-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}',""]);const s=o},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var s=0;s{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},s=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),r=[];function a(e){for(var t=-1,i=0;i{e.exports=i(79)("./src/clipboard.js")},704:(e,t,i)=>{e.exports=i(79)("./src/core.js")},492:(e,t,i)=>{e.exports=i(79)("./src/engine.js")},181:(e,t,i)=>{e.exports=i(79)("./src/typing.js")},273:(e,t,i)=>{e.exports=i(79)("./src/ui.js")},209:(e,t,i)=>{e.exports=i(79)("./src/utils.js")},995:(e,t,i)=>{e.exports=i(79)("./src/widget.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{AutoLink:()=>Me,Link:()=>Be,LinkEditing:()=>fe,LinkImage:()=>Re,LinkImageEditing:()=>Ne,LinkImageUI:()=>Ue,LinkUI:()=>Le});var e=i(704),t=i(492),o=i(181),s=i(945),r=i(209);class a{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach((e=>this._definitions.add(e))):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",((e,t,i)=>{if(!i.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!i.schema.isInline(t.item))return;const n=i.writer,o=n.document.selection;for(const e of this._definitions){const s=n.createAttributeElement("a",e.attributes,{priority:5});e.classes&&n.addClass(e.classes,s);for(const t in e.styles)n.setStyle(t,e.styles[t],s);n.setCustomProperty("link",!0,s),e.callback(t.attributeNewValue)?t.item.is("selection")?n.wrap(o.getFirstRange(),s):n.wrap(i.mapper.toViewRange(t.range),s):n.unwrap(i.mapper.toViewRange(t.range),s)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",((e,t,{writer:i,mapper:n})=>{const o=n.toViewElement(t.item),s=Array.from(o.getChildren()).find((e=>"a"===e.name));for(const e of this._definitions){const n=(0,r.toMap)(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of n)"class"===e?i.addClass(t,s):i.setAttribute(e,t,s);e.classes&&i.addClass(e.classes,s);for(const t in e.styles)i.setStyle(t,e.styles[t],s)}else{for(const[e,t]of n)"class"===e?i.removeClass(t,s):i.removeAttribute(e,s);e.classes&&i.removeClass(e.classes,s);for(const t in e.styles)i.removeStyle(t,s)}}}))}}}const c=function(e,t,i){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(i=i>o?o:i)<0&&(i+=o),o=t>i?0:i-t>>>0,t>>>=0;for(var s=Array(o);++n=n?e:c(e,t,i)};var u=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const d=function(e){return u.test(e)};const k=function(e){return e.split("")};var h="\\ud800-\\udfff",f="["+h+"]",m="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",g="\\ud83c[\\udffb-\\udfff]",b="[^"+h+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",w="[\\ud800-\\udbff][\\udc00-\\udfff]",v="(?:"+m+"|"+g+")"+"?",_="[\\ufe0e\\ufe0f]?",y=_+v+("(?:\\u200d(?:"+[b,p,w].join("|")+")"+_+v+")*"),A="(?:"+[b+m+"?",m,p,w,f].join("|")+")",x=RegExp(g+"(?="+g+")|"+A+y,"g");const I=function(e){return e.match(x)||[]};const S=function(e){return d(e)?I(e):k(e)};const T="object"==typeof global&&global&&global.Object===Object&&global;var V="object"==typeof self&&self&&self.Object===Object&&self;const E=(T||V||Function("return this")()).Symbol;const L=function(e,t){for(var i=-1,n=null==e?0:e.length,o=Array(n);++i{if(n.isCollapsed){const c=n.getFirstPosition();if(n.hasAttribute("linkHref")){const r=(0,o.findAttributeRange)(c,"linkHref",n.getAttribute("linkHref"),i);t.setAttribute("linkHref",e,r),s.forEach((e=>{t.setAttribute(e,!0,r)})),a.forEach((e=>{t.removeAttribute(e,r)})),t.setSelection(t.createPositionAfter(r.end.nodeBefore))}else if(""!==e){const o=(0,r.toMap)(n.getAttributes());o.set("linkHref",e),s.forEach((e=>{o.set(e,!0)}));const{end:a}=i.insertContent(t.createText(e,o),c);t.setSelection(a)}["linkHref",...s,...a].forEach((e=>{t.removeSelectionAttribute(e)}))}else{const o=i.schema.getValidRanges(n.getRanges(),"linkHref"),r=[];for(const e of n.getSelectedBlocks())i.schema.checkAttribute(e,"linkHref")&&r.push(t.createRangeOn(e));const c=r.slice();for(const e of o)this._isRangeToUpdate(e,r)&&c.push(e);for(const i of c)t.setAttribute("linkHref",e,i),s.forEach((e=>{t.setAttribute(e,!0,i)})),a.forEach((e=>{t.removeAttribute(e,i)}))}}))}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,n=i.getSelectedElement();return te(n,t.schema)?n.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}}class re extends e.Command{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();te(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,n=e.commands.get("link");t.change((e=>{const s=i.isCollapsed?[(0,o.findAttributeRange)(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of s)if(e.removeAttribute("linkHref",t),n)for(const i of n.manualDecorators)e.removeAttribute(i.id,t)}))}}class ae{constructor({id:e,label:t,attributes:i,classes:n,styles:o,defaultValue:s}){this.id=e,this.set("value"),this.defaultValue=s,this.label=t,this.attributes=i,this.classes=n,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}(0,r.mix)(ae,r.ObservableMixin);var ce=i(62),le=i.n(ce),ue=i(23),de={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};le()(ue.Z,de);ue.Z.locals;const ke="automatic",he=/^(https?:)?\/\//;class fe extends e.Plugin{static get pluginName(){return"LinkEditing"}static get requires(){return[o.TwoStepCaretMovement,o.Input,s.ClipboardPipeline]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:X}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>X(ee(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new se(e)),e.commands.add("unlink",new re(e));const t=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach((e=>(e.label&&i[e.label]&&(e.label=i[e.label]),e))),t}(e.t,function(e){const t=[];if(e)for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${Q(i)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter((e=>e.mode===ke))),this._enableManualDecorators(t.filter((e=>"manual"===e.mode)));e.plugins.get(o.TwoStepCaretMovement).registerAttribute("linkHref"),(0,o.inlineHighlight)(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:ke,callback:e=>he.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(e),i.length&&t.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach((e=>{t.model.schema.extend("$text",{allowAttributes:e.id}),e=new ae(e),i.add(e),t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,{writer:i,schema:n},{item:o})=>{if((o.is("selection")||n.isInline(o))&&t){const t=i.createAttributeElement("a",e.attributes,{priority:5});e.classes&&i.addClass(e.classes,t);for(const n in e.styles)i.setStyle(n,e.styles[n],t);return i.setCustomProperty("link",!0,t),t}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...e._createPattern()},model:{key:e.id}})}))}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",((e,t)=>{if(!(r.env.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let i=t.domTarget;if("a"!=i.tagName.toLowerCase()&&(i=i.closest("a")),!i)return;const n=i.getAttribute("href");n&&(e.stop(),t.preventDefault(),oe(n))}),{context:"$capture"}),this.listenTo(t,"keydown",((t,i)=>{const n=e.commands.get("link").value;n&&i.keyCode===r.keyCodes.enter&&i.altKey&&(t.stop(),oe(n))}))}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",(()=>{const i=t.anchor.nodeBefore,n=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&i&&i.hasAttribute("linkHref")&&(n&&n.hasAttribute("linkHref")||e.change((t=>{me(t,be(e.schema))})))}),{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,i=e.model;e.editing.view.addObserver(t.MouseObserver);let n=!1;this.listenTo(e.editing.view.document,"mousedown",(()=>{n=!0})),this.listenTo(e.editing.view.document,"selectionChange",(()=>{if(!n)return;n=!1;const e=i.document.selection;if(!e.isCollapsed)return;if(!e.hasAttribute("linkHref"))return;const t=e.getFirstPosition(),s=(0,o.findAttributeRange)(t,"linkHref",e.getAttribute("linkHref"),i);(t.isTouching(s.start)||t.isTouching(s.end))&&i.change((e=>{me(e,be(i.schema))}))}))}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let i,n;this.listenTo(t.document,"delete",(()=>{n=!0}),{priority:"high"}),this.listenTo(e.model,"deleteContent",(()=>{const t=e.model.document.selection;t.isCollapsed||(n?n=!1:ge(e)&&function(e){const t=e.document.selection,i=t.getFirstPosition(),n=t.getLastPosition(),s=i.nodeAfter;if(!s)return!1;if(!s.is("$text"))return!1;if(!s.hasAttribute("linkHref"))return!1;const r=n.textNode||n.nodeBefore;if(s===r)return!0;return(0,o.findAttributeRange)(i,"linkHref",s.getAttribute("linkHref"),e).containsRange(e.createRange(i,n),!0)}(e.model)&&(i=t.getAttributes()))}),{priority:"high"}),this.listenTo(e.model,"insertContent",((t,[o])=>{n=!1,ge(e)&&i&&(e.model.change((e=>{for(const[t,n]of i)e.setAttribute(t,n,o)})),i=null)}),{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,i=t.document.selection,n=e.editing.view;let s=!1,r=!1;this.listenTo(n.document,"delete",((e,t)=>{r="backward"===t.direction}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{s=!1;const e=i.getFirstPosition(),n=i.getAttribute("linkHref");if(!n)return;const r=(0,o.findAttributeRange)(e,"linkHref",n,t);s=r.containsPosition(e)||r.end.isEqual(e)}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{r&&(r=!1,s||e.model.enqueueChange((e=>{me(e,be(t.schema))})))}),{priority:"low"})}}function me(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}function ge(e){return e.model.change((e=>e.batch)).isTyping}function be(e){return e.getDefinition("$text").allowAttributes.filter((e=>e.startsWith("link")))}var pe=i(273),we=i(995),ve=i(764),_e={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};le()(ve.Z,_e);ve.Z.locals;var ye=i(871),Ae={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};le()(ye.Z,Ae);ye.Z.locals;class xe extends pe.View{constructor(t,i){super(t);const n=t.t;this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),e.icons.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),e.icons.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(i),this.children=this._createFormChildren(i.manualDecorators),this._focusables=new pe.ViewCollection,this._focusCycler=new pe.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form","ck-responsive-form"];i.manualDecorators.length&&o.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children}),(0,pe.injectCssTransitionDisabler)(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((e,t)=>(e[t.name]=t.isOn,e)),{})}render(){super.render(),(0,pe.submitHandler)({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new pe.LabeledFieldView(this.locale,pe.createLabeledInputText);return t.label=e("Link URL"),t}_createButton(e,t,i,n){const o=new pe.ButtonView(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const n=new pe.SwitchButtonView(this.locale);n.set({name:i.id,label:i.label,withText:!0}),n.bind("isOn").toMany([i,e],"value",((e,t)=>void 0===t&&void 0===e?i.defaultValue:e)),n.on("execute",(()=>{i.set("value",!n.isOn)})),t.add(n)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new pe.View;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)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}var Ie=i(952),Se={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};le()(Ie.Z,Se);Ie.Z.locals;class Te extends pe.View{constructor(t){super(t);const i=t.t;this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(i("Unlink"),'',"unlink"),this.editButtonView=this._createButton(i("Edit link"),e.icons.pencil,"edit"),this.set("href"),this._focusables=new pe.ViewCollection,this._focusCycler=new pe.FocusCycler({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","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const n=new pe.ButtonView(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.delegate("execute").to(this,i),n}_createPreviewButton(){const e=new pe.ButtonView(this.locale),t=this.bindTemplate,i=this.t;return e.set({withText:!0,tooltip:i("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",(e=>e&&ee(e))),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",(e=>e||i("This link has no URL"))),e.bind("isEnabled").to(this,"href",(e=>!!e)),e.template.tag="a",e.template.eventListeners={},e}}const Ve='',Ee="link-ui";class Le extends e.Plugin{static get requires(){return[pe.ContextualBalloon]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(t.ClickObserver),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(pe.ContextualBalloon),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:Ee,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Ee,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new Te(e.locale),i=e.commands.get("link"),n=e.commands.get("unlink");return t.bind("href").to(i,"value"),t.editButtonView.bind("isEnabled").to(i),t.unlinkButtonView.bind("isEnabled").to(n),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(J,((e,t)=>{this._addFormView(),t()})),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),i=e.config.get("link.defaultProtocol"),n=new xe(e.locale,t);return n.urlInputView.fieldView.bind("value").to(t,"value"),n.urlInputView.bind("isReadOnly").to(t,"isEnabled",(e=>!e)),n.saveButtonView.bind("isEnabled").to(t),this.listenTo(n,"submit",(()=>{const{value:t}=n.urlInputView.fieldView.element,o=ie(t,i);e.execute("link",o,n.getDecoratorSwitchesState()),this._closeFormView()})),this.listenTo(n,"cancel",(()=>{this._closeFormView()})),n.keystrokes.set("Esc",((e,t)=>{this._closeFormView(),t()})),n}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),i=e.t;e.keystrokes.set(J,((e,i)=>{i(),t.isEnabled&&this._showUI(!0)})),e.ui.componentFactory.add("link",(e=>{const n=new pe.ButtonView(e);return n.isEnabled=!0,n.label=i("Link"),n.icon=Ve,n.keystroke=J,n.tooltip=!0,n.isToggleable=!0,n.bind("isEnabled").to(t,"isEnabled"),n.bind("isOn").to(t,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>this._showUI(!0))),n}))}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),this.editor.keystrokes.set("Tab",((e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((e,t)=>{this._isUIVisible&&(this._hideUI(),t())})),(0,pe.clickOutsideHandler)({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),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,t=e.editing.view.document;let i=this._getSelectedLinkElement(),n=s();const o=()=>{const e=this._getSelectedLinkElement(),t=s();i&&!e||!i&&t!==n?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,n=t};function s(){return t.selection.focus.getAncestors().reverse().find((e=>e.is("element")))}this.listenTo(e.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(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,i=e.document;let n=null;if(t.markers.has(Ee)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(Ee)),i=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));n=e.domConverter.viewRangeToDom(i)}else n=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(i.selection.getFirstRange())};return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&(0,we.isWidget)(i))return Ce(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),n=Ce(i.start),o=Ce(i.end);return n&&n==o&&e.createRangeIn(n).getTrimmed().isEqual(i)?n:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(Ee))t.updateMarker(Ee,{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(Ee,{usingOperation:!1,affectsData:!1,range:t.createRange(n,i.end)})}else t.addMarker(Ee,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Ee)&&e.change((e=>{e.removeMarker(Ee)}))}}function Ce(e){return e.getAncestors().find((e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t}))}const De=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Me extends e.Plugin{static get requires(){return[o.Delete]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new o.TextWatcher(e.model,(e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=je(e.substr(0,e.length-1));return t?{url:t}:void 0}));t.on("matched:data",((t,i)=>{const{batch:n,range:o,url:s}=i;if(!n.isTyping)return;const r=o.end.getShiftedBy(-1),a=r.getShiftedBy(-s.length),c=e.model.createRange(a,r);this._applyAutoLink(s,c)})),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const i=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)}))}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition(),i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)}))}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:n}=(0,o.getLastTextLine)(e,t),s=je(i);if(s){const e=t.createRange(n.end.getShiftedBy(-s.length),n.end);this._applyAutoLink(s,e)}}_applyAutoLink(e,t){const i=this.editor.model,n=ie(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&ne(n)&&!function(e){const t=e.start.nodeAfter;return t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(n,t)}_persistAutoLink(e,t){const i=this.editor.model,n=this.editor.plugins.get("Delete");i.enqueueChange((o=>{o.setAttribute("linkHref",e,t),i.enqueueChange((()=>{n.requestUndoOnBackspace()}))}))}}function je(e){const t=De.exec(e);return t?t[2]:null}class Be extends e.Plugin{static get requires(){return[fe,Le,Me]}static get pluginName(){return"Link"}}class Ne extends e.Plugin{static get requires(){return["ImageEditing","ImageUtils",fe]}static get pluginName(){return"LinkImageEditing"}init(){const e=this.editor,t=e.model.schema;e.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["linkHref"]}),e.conversion.for("upcast").add(function(e){const t=e.plugins.has("ImageInlineEditing"),i=e.plugins.get("ImageUtils");return e=>{e.on("element:a",((e,n,o)=>{const s=n.viewItem,r=i.findViewImgElement(s);if(!r)return;const a=r.findAncestor((e=>i.isBlockImageView(e)));if(t&&!a)return;const c={attributes:["href"]};if(!o.consumable.consume(s,c))return;const l=s.getAttribute("href");if(!l)return;let u=n.modelCursor.parent;if(!u.is("element","imageBlock")){const e=o.convertItem(r,n.modelCursor);n.modelRange=e.modelRange,n.modelCursor=e.modelCursor,u=n.modelCursor.nodeBefore}u&&u.is("element","imageBlock")&&o.writer.setAttribute("linkHref",l,u)}),{priority:"high"})}}(e)),e.conversion.for("downcast").add(function(e){const t=e.plugins.get("ImageUtils");return e=>{e.on("attribute:linkHref:imageBlock",((e,i,n)=>{if(!n.consumable.consume(i.item,e.name))return;const o=n.mapper.toViewElement(i.item),s=n.writer,r=Array.from(o.getChildren()).find((e=>"a"===e.name)),a=t.findViewImgElement(o),c=a.parent.is("element","picture")?a.parent:a;if(r)i.attributeNewValue?s.setAttribute("href",i.attributeNewValue,r):(s.move(s.createRangeOn(c),s.createPositionAt(o,0)),s.remove(r));else{const e=s.createContainerElement("a",{href:i.attributeNewValue});s.insert(s.createPositionAt(o,0),e),s.move(s.createRangeOn(c),s.createPositionAt(e,0))}}),{priority:"high"})}}(e)),this._enableAutomaticDecorators(),this._enableManualDecorators()}_enableAutomaticDecorators(){const e=this.editor,t=e.commands.get("link").automaticDecorators;t.length&&e.conversion.for("downcast").add(t.getDispatcherForLinkedImage())}_enableManualDecorators(){const e=this.editor,t=e.commands.get("link");for(const i of t.manualDecorators)e.plugins.has("ImageBlockEditing")&&e.model.schema.extend("imageBlock",{allowAttributes:i.id}),e.plugins.has("ImageInlineEditing")&&e.model.schema.extend("imageInline",{allowAttributes:i.id}),e.conversion.for("downcast").add(Oe(i)),e.conversion.for("upcast").add(He(e,i))}}function Oe(e){return t=>{t.on(`attribute:${e.id}:imageBlock`,((t,i,n)=>{const o=n.mapper.toViewElement(i.item),s=Array.from(o.getChildren()).find((e=>"a"===e.name));if(s){for(const[t,i]of(0,r.toMap)(e.attributes))n.writer.setAttribute(t,i,s);e.classes&&n.writer.addClass(e.classes,s);for(const t in e.styles)n.writer.setStyle(t,e.styles[t],s)}}))}}function He(e,i){const n=e.plugins.has("ImageInlineEditing"),o=e.plugins.get("ImageUtils");return e=>{e.on("element:a",((e,s,r)=>{const a=s.viewItem,c=o.findViewImgElement(a);if(!c)return;const l=c.findAncestor((e=>o.isBlockImageView(e)));if(n&&!l)return;const u=new t.Matcher(i._createPattern()).match(a);if(!u)return;if(!r.consumable.consume(a,u.match))return;const d=s.modelCursor.nodeBefore||s.modelCursor.parent;r.writer.setAttribute(i.id,!0,d)}),{priority:"high"})}}class Ue extends e.Plugin{static get requires(){return[fe,Le,"ImageBlockEditing"]}static get pluginName(){return"LinkImageUI"}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",((t,i)=>{this._isSelectedLinkedImage(e.model.document.selection)&&(i.preventDefault(),t.stop())}),{priority:"high"}),this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("linkImage",(i=>{const n=new pe.ButtonView(i),o=e.plugins.get("LinkUI"),s=e.commands.get("link");return n.set({isEnabled:!0,label:t("Link image"),icon:Ve,keystroke:J,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(s,"isEnabled"),n.bind("isOn").to(s,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>{this._isSelectedLinkedImage(e.model.document.selection)?o._addActionsView():o._showUI(!0)})),n}))}_isSelectedLinkedImage(e){const t=e.getSelectedElement();return this.editor.plugins.get("ImageUtils").isImage(t)&&t.hasAttribute("linkHref")}}var Pe=i(269),Fe={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};le()(Pe.Z,Fe);Pe.Z.locals;class Re extends e.Plugin{static get requires(){return[Ne,Ue]}static get pluginName(){return"LinkImage"}}})(),(window.CKEditor5=window.CKEditor5||{}).link=n})(); \ No newline at end of file + */(()=>{var e={23:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}",""]);const s=o},952:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".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 .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{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.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}[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 .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{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}",""]);const s=o},871:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".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_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 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{border-radius:0;margin:0;padding:var(--ck-spacing-standard);width:50%}.ck.ck-link-form_layout-vertical>.ck-button:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form_layout-vertical>.ck-button,[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:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}",""]);const s=o},269:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{background-color:rgba(0,0,0,.4);background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+");background-position:50%;background-repeat:no-repeat;background-size:14px;border-radius:100%;content:"";height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));overflow:hidden;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}',""]);const s=o},764:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(609),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,'.ck-vertical-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}',""]);const s=o},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var s=0;s{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},s=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),r=[];function a(e){for(var t=-1,i=0;i{e.exports=i(79)("./src/clipboard.js")},704:(e,t,i)=>{e.exports=i(79)("./src/core.js")},492:(e,t,i)=>{e.exports=i(79)("./src/engine.js")},181:(e,t,i)=>{e.exports=i(79)("./src/typing.js")},273:(e,t,i)=>{e.exports=i(79)("./src/ui.js")},209:(e,t,i)=>{e.exports=i(79)("./src/utils.js")},995:(e,t,i)=>{e.exports=i(79)("./src/widget.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{AutoLink:()=>Pe,Link:()=>Fe,LinkEditing:()=>pe,LinkImage:()=>$e,LinkImageEditing:()=>Re,LinkImageUI:()=>qe,LinkUI:()=>je});var e=i(704),t=i(492),o=i(181),s=i(945),r=i(209);class a{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach((e=>this._definitions.add(e))):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",((e,t,i)=>{if(!i.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!i.schema.isInline(t.item))return;const n=i.writer,o=n.document.selection;for(const e of this._definitions){const s=n.createAttributeElement("a",e.attributes,{priority:5});e.classes&&n.addClass(e.classes,s);for(const t in e.styles)n.setStyle(t,e.styles[t],s);n.setCustomProperty("link",!0,s),e.callback(t.attributeNewValue)?t.item.is("selection")?n.wrap(o.getFirstRange(),s):n.wrap(i.mapper.toViewRange(t.range),s):n.unwrap(i.mapper.toViewRange(t.range),s)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",((e,t,{writer:i,mapper:n})=>{const o=n.toViewElement(t.item),s=Array.from(o.getChildren()).find((e=>"a"===e.name));for(const e of this._definitions){const n=(0,r.toMap)(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of n)"class"===e?i.addClass(t,s):i.setAttribute(e,t,s);e.classes&&i.addClass(e.classes,s);for(const t in e.styles)i.setStyle(t,e.styles[t],s)}else{for(const[e,t]of n)"class"===e?i.removeClass(t,s):i.removeAttribute(e,s);e.classes&&i.removeClass(e.classes,s);for(const t in e.styles)i.removeStyle(t,s)}}}))}}}const c=function(e,t,i){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(i=i>o?o:i)<0&&(i+=o),o=t>i?0:i-t>>>0,t>>>=0;for(var s=Array(o);++n=n?e:c(e,t,i)};var u=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const d=function(e){return u.test(e)};const k=function(e){return e.split("")};var h="\\ud800-\\udfff",f="["+h+"]",m="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",g="\\ud83c[\\udffb-\\udfff]",b="[^"+h+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",w="[\\ud800-\\udbff][\\udc00-\\udfff]",v="(?:"+m+"|"+g+")"+"?",_="[\\ufe0e\\ufe0f]?",y=_+v+("(?:\\u200d(?:"+[b,p,w].join("|")+")"+_+v+")*"),A="(?:"+[b+m+"?",m,p,w,f].join("|")+")",x=RegExp(g+"(?="+g+")|"+A+y,"g");const I=function(e){return e.match(x)||[]};const V=function(e){return d(e)?I(e):k(e)};const S="object"==typeof global&&global&&global.Object===Object&&global;var T="object"==typeof self&&self&&self.Object===Object&&self;const E=(S||T||Function("return this")()).Symbol;const L=function(e,t){for(var i=-1,n=null==e?0:e.length,o=Array(n);++i{if(n.isCollapsed){const c=n.getFirstPosition();if(n.hasAttribute("linkHref")){const r=(0,o.findAttributeRange)(c,"linkHref",n.getAttribute("linkHref"),i);t.setAttribute("linkHref",e,r),s.forEach((e=>{t.setAttribute(e,!0,r)})),a.forEach((e=>{t.removeAttribute(e,r)})),t.setSelection(t.createPositionAfter(r.end.nodeBefore))}else if(""!==e){const o=(0,r.toMap)(n.getAttributes());o.set("linkHref",e),s.forEach((e=>{o.set(e,!0)}));const{end:a}=i.insertContent(t.createText(e,o),c);t.setSelection(a)}["linkHref",...s,...a].forEach((e=>{t.removeSelectionAttribute(e)}))}else{const o=i.schema.getValidRanges(n.getRanges(),"linkHref"),r=[];for(const e of n.getSelectedBlocks())i.schema.checkAttribute(e,"linkHref")&&r.push(t.createRangeOn(e));const c=r.slice();for(const e of o)this._isRangeToUpdate(e,r)&&c.push(e);for(const i of c)t.setAttribute("linkHref",e,i),s.forEach((e=>{t.setAttribute(e,!0,i)})),a.forEach((e=>{t.removeAttribute(e,i)}))}}))}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,n=i.getSelectedElement();return se(n,t.schema)?n.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}}class ue extends e.Command{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();se(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,n=e.commands.get("link");t.change((e=>{const s=i.isCollapsed?[(0,o.findAttributeRange)(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of s)if(e.removeAttribute("linkHref",t),n)for(const i of n.manualDecorators)e.removeAttribute(i.id,t)}))}}class de{constructor({id:e,label:t,attributes:i,classes:n,styles:o,defaultValue:s}){this.id=e,this.set("value"),this.defaultValue=s,this.label=t,this.attributes=i,this.classes=n,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}(0,r.mix)(de,r.ObservableMixin);var ke=i(62),he=i.n(ke),fe=i(23),me={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};he()(fe.Z,me);fe.Z.locals;const ge="automatic",be=/^(https?:)?\/\//;class pe extends e.Plugin{static get pluginName(){return"LinkEditing"}static get requires(){return[o.TwoStepCaretMovement,o.Input,s.ClipboardPipeline]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:ne}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>ne(oe(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new le(e)),e.commands.add("unlink",new ue(e));const t=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach((e=>(e.label&&i[e.label]&&(e.label=i[e.label]),e))),t}(e.t,function(e){const t=[];if(e)for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${G(i)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter((e=>e.mode===ge))),this._enableManualDecorators(t.filter((e=>"manual"===e.mode)));e.plugins.get(o.TwoStepCaretMovement).registerAttribute("linkHref"),(0,o.inlineHighlight)(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:ge,callback:e=>be.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(e),i.length&&t.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach((e=>{t.model.schema.extend("$text",{allowAttributes:e.id}),e=new de(e),i.add(e),t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,{writer:i,schema:n},{item:o})=>{if((o.is("selection")||n.isInline(o))&&t){const t=i.createAttributeElement("a",e.attributes,{priority:5});e.classes&&i.addClass(e.classes,t);for(const n in e.styles)i.setStyle(n,e.styles[n],t);return i.setCustomProperty("link",!0,t),t}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...e._createPattern()},model:{key:e.id}})}))}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",((e,t)=>{if(!(r.env.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let i=t.domTarget;if("a"!=i.tagName.toLowerCase()&&(i=i.closest("a")),!i)return;const n=i.getAttribute("href");n&&(e.stop(),t.preventDefault(),ce(n))}),{context:"$capture"}),this.listenTo(t,"keydown",((t,i)=>{const n=e.commands.get("link").value;n&&i.keyCode===r.keyCodes.enter&&i.altKey&&(t.stop(),ce(n))}))}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",(()=>{const i=t.anchor.nodeBefore,n=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&i&&i.hasAttribute("linkHref")&&(n&&n.hasAttribute("linkHref")||e.change((t=>{we(t,_e(e.schema))})))}),{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,i=e.model;e.editing.view.addObserver(t.MouseObserver);let n=!1;this.listenTo(e.editing.view.document,"mousedown",(()=>{n=!0})),this.listenTo(e.editing.view.document,"selectionChange",(()=>{if(!n)return;n=!1;const e=i.document.selection;if(!e.isCollapsed)return;if(!e.hasAttribute("linkHref"))return;const t=e.getFirstPosition(),s=(0,o.findAttributeRange)(t,"linkHref",e.getAttribute("linkHref"),i);(t.isTouching(s.start)||t.isTouching(s.end))&&i.change((e=>{we(e,_e(i.schema))}))}))}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let i,n;this.listenTo(t.document,"delete",(()=>{n=!0}),{priority:"high"}),this.listenTo(e.model,"deleteContent",(()=>{const t=e.model.document.selection;t.isCollapsed||(n?n=!1:ve(e)&&function(e){const t=e.document.selection,i=t.getFirstPosition(),n=t.getLastPosition(),s=i.nodeAfter;if(!s)return!1;if(!s.is("$text"))return!1;if(!s.hasAttribute("linkHref"))return!1;const r=n.textNode||n.nodeBefore;if(s===r)return!0;return(0,o.findAttributeRange)(i,"linkHref",s.getAttribute("linkHref"),e).containsRange(e.createRange(i,n),!0)}(e.model)&&(i=t.getAttributes()))}),{priority:"high"}),this.listenTo(e.model,"insertContent",((t,[o])=>{n=!1,ve(e)&&i&&(e.model.change((e=>{for(const[t,n]of i)e.setAttribute(t,n,o)})),i=null)}),{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,i=t.document.selection,n=e.editing.view;let s=!1,r=!1;this.listenTo(n.document,"delete",((e,t)=>{r="backward"===t.direction}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{s=!1;const e=i.getFirstPosition(),n=i.getAttribute("linkHref");if(!n)return;const r=(0,o.findAttributeRange)(e,"linkHref",n,t);s=r.containsPosition(e)||r.end.isEqual(e)}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{r&&(r=!1,s||e.model.enqueueChange((e=>{we(e,_e(t.schema))})))}),{priority:"low"})}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",((e,n)=>{t.change((e=>{const t=e.createRangeIn(n.content);for(const n of t.getItems())if(n.hasAttribute("linkHref")){const t=re(n.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,n)}}))}))}}function we(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}function ve(e){return e.model.change((e=>e.batch)).isTyping}function _e(e){return e.getDefinition("$text").allowAttributes.filter((e=>e.startsWith("link")))}var ye=i(273),Ae=i(995),xe=i(764),Ie={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};he()(xe.Z,Ie);xe.Z.locals;var Ve=i(871),Se={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};he()(Ve.Z,Se);Ve.Z.locals;class Te extends ye.View{constructor(t,i){super(t);const n=t.t;this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),e.icons.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),e.icons.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(i),this.children=this._createFormChildren(i.manualDecorators),this._focusables=new ye.ViewCollection,this._focusCycler=new ye.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form","ck-responsive-form"];i.manualDecorators.length&&o.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children}),(0,ye.injectCssTransitionDisabler)(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((e,t)=>(e[t.name]=t.isOn,e)),{})}render(){super.render(),(0,ye.submitHandler)({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new ye.LabeledFieldView(this.locale,ye.createLabeledInputText);return t.label=e("Link URL"),t}_createButton(e,t,i,n){const o=new ye.ButtonView(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const n=new ye.SwitchButtonView(this.locale);n.set({name:i.id,label:i.label,withText:!0}),n.bind("isOn").toMany([i,e],"value",((e,t)=>void 0===t&&void 0===e?i.defaultValue:e)),n.on("execute",(()=>{i.set("value",!n.isOn)})),t.add(n)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new ye.View;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)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}var Ee=i(952),Le={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};he()(Ee.Z,Le);Ee.Z.locals;class Ce extends ye.View{constructor(t){super(t);const i=t.t;this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(i("Unlink"),'',"unlink"),this.editButtonView=this._createButton(i("Edit link"),e.icons.pencil,"edit"),this.set("href"),this._focusables=new ye.ViewCollection,this._focusCycler=new ye.FocusCycler({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","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const n=new ye.ButtonView(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.delegate("execute").to(this,i),n}_createPreviewButton(){const e=new ye.ButtonView(this.locale),t=this.bindTemplate,i=this.t;return e.set({withText:!0,tooltip:i("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",(e=>e&&oe(e))),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",(e=>e||i("This link has no URL"))),e.bind("isEnabled").to(this,"href",(e=>!!e)),e.template.tag="a",e.template.eventListeners={},e}}const De='',Me="link-ui";class je extends e.Plugin{static get requires(){return[ye.ContextualBalloon]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(t.ClickObserver),this.actionsView=null,this.formView=null,this._balloon=e.plugins.get(ye.ContextualBalloon),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:Me,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Me,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new Ce(e.locale),i=e.commands.get("link"),n=e.commands.get("unlink");return t.bind("href").to(i,"value"),t.editButtonView.bind("isEnabled").to(i),t.unlinkButtonView.bind("isEnabled").to(n),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(ie,((e,t)=>{this._addFormView(),t()})),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),i=e.config.get("link.defaultProtocol"),n=new Te(e.locale,t);return n.urlInputView.fieldView.bind("value").to(t,"value"),n.urlInputView.bind("isReadOnly").to(t,"isEnabled",(e=>!e)),n.saveButtonView.bind("isEnabled").to(t),this.listenTo(n,"submit",(()=>{const{value:t}=n.urlInputView.fieldView.element,o=re(t,i);e.execute("link",o,n.getDecoratorSwitchesState()),this._closeFormView()})),this.listenTo(n,"cancel",(()=>{this._closeFormView()})),n.keystrokes.set("Esc",((e,t)=>{this._closeFormView(),t()})),n}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),i=e.t;e.ui.componentFactory.add("link",(e=>{const n=new ye.ButtonView(e);return n.isEnabled=!0,n.label=i("Link"),n.icon=De,n.keystroke=ie,n.tooltip=!0,n.isToggleable=!0,n.bind("isEnabled").to(t,"isEnabled"),n.bind("isOn").to(t,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>this._showUI(!0))),n}))}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),e.keystrokes.set(ie,((t,i)=>{i(),e.commands.get("link").isEnabled&&this._showUI(!0)}))}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",((e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((e,t)=>{this._isUIVisible&&(this._hideUI(),t())})),(0,ye.clickOutsideHandler)({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),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,t=e.editing.view.document;let i=this._getSelectedLinkElement(),n=s();const o=()=>{const e=this._getSelectedLinkElement(),t=s();i&&!e||!i&&t!==n?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,n=t};function s(){return t.selection.focus.getAncestors().reverse().find((e=>e.is("element")))}this.listenTo(e.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(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,i=e.document;let n=null;if(t.markers.has(Me)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(Me)),i=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));n=e.domConverter.viewRangeToDom(i)}else n=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(i.selection.getFirstRange())};return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&(0,Ae.isWidget)(i))return Be(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),n=Be(i.start),o=Be(i.end);return n&&n==o&&e.createRangeIn(n).getTrimmed().isEqual(i)?n:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(Me))t.updateMarker(Me,{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(Me,{usingOperation:!1,affectsData:!1,range:t.createRange(n,i.end)})}else t.addMarker(Me,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Me)&&e.change((e=>{e.removeMarker(Me)}))}}function Be(e){return e.getAncestors().find((e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t}))}const Ne=4,He=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i"),Oe=2;class Pe extends e.Plugin{static get requires(){return[o.Delete]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new o.TextWatcher(e.model,(e=>{if(!function(e){return e.length>Ne&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=Ue(e.substr(0,e.length-1));return t?{url:t}:void 0}));t.on("matched:data",((t,i)=>{const{batch:n,range:o,url:s}=i;if(!n.isTyping)return;const r=o.end.getShiftedBy(-1),a=r.getShiftedBy(-s.length),c=e.model.createRange(a,r);this._applyAutoLink(s,c)})),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const i=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)}))}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition(),i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)}))}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:n}=(0,o.getLastTextLine)(e,t),s=Ue(i);if(s){const e=t.createRange(n.end.getShiftedBy(-s.length),n.end);this._applyAutoLink(s,e)}}_applyAutoLink(e,t){const i=this.editor.model,n=re(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&ae(n)&&!function(e){const t=e.start.nodeAfter;return t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(n,t)}_persistAutoLink(e,t){const i=this.editor.model,n=this.editor.plugins.get("Delete");i.enqueueChange((o=>{o.setAttribute("linkHref",e,t),i.enqueueChange((()=>{n.requestUndoOnBackspace()}))}))}}function Ue(e){const t=He.exec(e);return t?t[Oe]:null}class Fe extends e.Plugin{static get requires(){return[pe,je,Pe]}static get pluginName(){return"Link"}}class Re extends e.Plugin{static get requires(){return["ImageEditing","ImageUtils",pe]}static get pluginName(){return"LinkImageEditing"}init(){const e=this.editor,t=e.model.schema;e.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["linkHref"]}),e.conversion.for("upcast").add(function(e){const t=e.plugins.has("ImageInlineEditing"),i=e.plugins.get("ImageUtils");return e=>{e.on("element:a",((e,n,o)=>{const s=n.viewItem,r=i.findViewImgElement(s);if(!r)return;const a=r.findAncestor((e=>i.isBlockImageView(e)));if(t&&!a)return;const c={attributes:["href"]};if(!o.consumable.consume(s,c))return;const l=s.getAttribute("href");if(!l)return;let u=n.modelCursor.parent;if(!u.is("element","imageBlock")){const e=o.convertItem(r,n.modelCursor);n.modelRange=e.modelRange,n.modelCursor=e.modelCursor,u=n.modelCursor.nodeBefore}u&&u.is("element","imageBlock")&&o.writer.setAttribute("linkHref",l,u)}),{priority:"high"})}}(e)),e.conversion.for("downcast").add(function(e){const t=e.plugins.get("ImageUtils");return e=>{e.on("attribute:linkHref:imageBlock",((e,i,n)=>{if(!n.consumable.consume(i.item,e.name))return;const o=n.mapper.toViewElement(i.item),s=n.writer,r=Array.from(o.getChildren()).find((e=>"a"===e.name)),a=t.findViewImgElement(o),c=a.parent.is("element","picture")?a.parent:a;if(r)i.attributeNewValue?s.setAttribute("href",i.attributeNewValue,r):(s.move(s.createRangeOn(c),s.createPositionAt(o,0)),s.remove(r));else{const e=s.createContainerElement("a",{href:i.attributeNewValue});s.insert(s.createPositionAt(o,0),e),s.move(s.createRangeOn(c),s.createPositionAt(e,0))}}),{priority:"high"})}}(e)),this._enableAutomaticDecorators(),this._enableManualDecorators()}_enableAutomaticDecorators(){const e=this.editor,t=e.commands.get("link").automaticDecorators;t.length&&e.conversion.for("downcast").add(t.getDispatcherForLinkedImage())}_enableManualDecorators(){const e=this.editor,t=e.commands.get("link");for(const i of t.manualDecorators)e.plugins.has("ImageBlockEditing")&&e.model.schema.extend("imageBlock",{allowAttributes:i.id}),e.plugins.has("ImageInlineEditing")&&e.model.schema.extend("imageInline",{allowAttributes:i.id}),e.conversion.for("downcast").add(ze(i)),e.conversion.for("upcast").add(Ze(e,i))}}function ze(e){return t=>{t.on(`attribute:${e.id}:imageBlock`,((t,i,n)=>{const o=n.mapper.toViewElement(i.item),s=Array.from(o.getChildren()).find((e=>"a"===e.name));if(s){for(const[t,i]of(0,r.toMap)(e.attributes))n.writer.setAttribute(t,i,s);e.classes&&n.writer.addClass(e.classes,s);for(const t in e.styles)n.writer.setStyle(t,e.styles[t],s)}}))}}function Ze(e,i){const n=e.plugins.has("ImageInlineEditing"),o=e.plugins.get("ImageUtils");return e=>{e.on("element:a",((e,s,r)=>{const a=s.viewItem,c=o.findViewImgElement(a);if(!c)return;const l=c.findAncestor((e=>o.isBlockImageView(e)));if(n&&!l)return;const u=new t.Matcher(i._createPattern()).match(a);if(!u)return;if(!r.consumable.consume(a,u.match))return;const d=s.modelCursor.nodeBefore||s.modelCursor.parent;r.writer.setAttribute(i.id,!0,d)}),{priority:"high"})}}class qe extends e.Plugin{static get requires(){return[pe,je,"ImageBlockEditing"]}static get pluginName(){return"LinkImageUI"}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",((t,i)=>{this._isSelectedLinkedImage(e.model.document.selection)&&(i.preventDefault(),t.stop())}),{priority:"high"}),this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("linkImage",(i=>{const n=new ye.ButtonView(i),o=e.plugins.get("LinkUI"),s=e.commands.get("link");return n.set({isEnabled:!0,label:t("Link image"),icon:De,keystroke:ie,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(s,"isEnabled"),n.bind("isOn").to(s,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>{this._isSelectedLinkedImage(e.model.document.selection)?o._addActionsView():o._showUI(!0)})),n}))}_isSelectedLinkedImage(e){const t=e.getSelectedElement();return this.editor.plugins.get("ImageUtils").isImage(t)&&t.hasAttribute("linkHref")}}var Ke=i(269),Qe={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};he()(Ke.Z,Qe);Ke.Z.locals;class $e extends e.Plugin{static get requires(){return[Re,qe]}static get pluginName(){return"LinkImage"}}})(),(window.CKEditor5=window.CKEditor5||{}).link=n})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/list/list.js b/core/assets/vendor/ckeditor5/list/list.js index c994aea4757..112a0690a71 100644 --- a/core/assets/vendor/ckeditor5/list/list.js +++ b/core/assets/vendor/ckeditor5/list/list.js @@ -1,5 +1,5 @@ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Circle:"Circle",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero",Disc:"Disc","List properties":"List properties","Lower-latin":"Lower-latin","Lower–roman":"Lower–roman","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","Reversed order":"Reversed order",Square:"Square","Start at":"Start at","Start index must be greater than 0.":"Start index must be greater than 0.","To-do List":"To-do List","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower–latin list style":"Toggle the lower–latin list style","Toggle the lower–roman list style":"Toggle the lower–roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper–latin list style":"Toggle the upper–latin list style","Toggle the upper–roman list style":"Toggle the upper–roman list style","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var t={389:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(609),s=i.n(n)()((function(t){return t[1]}));s.push([t.id,".ck.ck-collapsible.ck-collapsible_collapsed>.ck-collapsible__children{display:none}:root{--ck-collapsible-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-collapsible>.ck.ck-button{border-radius:0;color:inherit;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-large);width:100%}.ck.ck-collapsible>.ck.ck-button:focus{background:transparent}.ck.ck-collapsible>.ck.ck-button:active,.ck.ck-collapsible>.ck.ck-button:hover:not(:focus),.ck.ck-collapsible>.ck.ck-button:not(:focus){background:transparent;border-color:transparent;box-shadow:none}.ck.ck-collapsible>.ck.ck-button>.ck-icon{margin-right:var(--ck-spacing-medium);width:var(--ck-collapsible-arrow-size)}.ck.ck-collapsible>.ck-collapsible__children{padding:0 var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}",""]);const r=s},78:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(609),s=i.n(n)()((function(t){return t[1]}));s.push([t.id,".ck-editor__editable .ck-list-bogus-paragraph{display:block}",""]);const r=s},543:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(609),s=i.n(n)()((function(t){return t[1]}));s.push([t.id,".ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}",""]);const r=s},657:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(609),s=i.n(n)()((function(t){return t[1]}));s.push([t.id,".ck.ck-list-styles-list{display:grid}.ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:circle}.ck-content ul ul{list-style-type:disc}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}",""]);const r=s},250:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(609),s=i.n(n)()((function(t){return t[1]}));s.push([t.id,':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out,background .25s ease-in-out,border .25s ease-in-out;width:100%}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable .todo-list .todo-list__label>input{cursor:pointer}.ck-editor__editable .todo-list .todo-list__label>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}',""]);const r=s},609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var s={};if(n)for(var r=0;r{"use strict";var n,s=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),o=[];function l(t){for(var e=-1,i=0;i{t.exports=i(79)("./src/core.js")},492:(t,e,i)=>{t.exports=i(79)("./src/engine.js")},331:(t,e,i)=>{t.exports=i(79)("./src/enter.js")},181:(t,e,i)=>{t.exports=i(79)("./src/typing.js")},273:(t,e,i)=>{t.exports=i(79)("./src/ui.js")},209:(t,e,i)=>{t.exports=i(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={id:n,exports:{}};return t[n](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{DocumentList:()=>ft,DocumentListEditing:()=>Y,DocumentListProperties:()=>Ht,DocumentListPropertiesEditing:()=>Vt,DocumentListPropertiesUtils:()=>Ct,DocumentListUtils:()=>E,List:()=>ae,ListEditing:()=>oe,ListProperties:()=>ve,ListPropertiesEditing:()=>pe,ListPropertiesUI:()=>Ot,ListUI:()=>ht,ListUtils:()=>Zt,TodoList:()=>Ee,TodoListEditing:()=>_e,TodoListUI:()=>Ce});var t=i(704),e=i(331),s=i(181),r=i(209);class o{constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward="forward"==e.direction,this._includeSelf=!!e.includeSelf,this._sameAttributes=(0,r.toArray)(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){const i=new this(t,e)[Symbol.iterator]();return(0,r.first)(i)}*[Symbol.iterator](){const t=[];for(const{node:e}of l(this._getStartNode(),this._isForward?"forward":"backward")){const i=e.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some((t=>e.getAttribute(t)!==this._startElement.getAttribute(t))))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*l(t,e="forward"){const i="forward"==e;let n=null;for(;d(t);)yield{node:t,previous:n},n=t,t=i?t.nextSibling:t.previousSibling}class a{constructor(t){this._listHead=t}[Symbol.iterator](){return l(this._listHead,"forward")}}class c{static next(){return(0,r.uid)()}}function d(t){return!!t&&t.is("element")&&t.hasAttribute("listItemId")}function u(t,e={}){return[...m(t,{...e,direction:"backward"}),...m(t,{...e,direction:"forward"})]}function m(t,e={}){const i="forward"==e.direction,n=Array.from(new o(t,{...e,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?n:n.reverse()}function p(t){const e=new o(t,{sameIndent:!0,sameAttributes:"listType"}),i=new o(t,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward"});return[...Array.from(e).reverse(),...i]}function h(t){return!o.first(t,{sameIndent:!0,sameAttributes:"listItemId"})}function f(t){return!o.first(t,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function g(t,e={}){t=(0,r.toArray)(t);const i=!1!==e.withNested,n=new Set;for(const e of t)for(const t of u(e,{higherIndent:i}))n.add(t);return k(n)}function b(t){t=(0,r.toArray)(t);const e=new Set;for(const i of t)for(const t of p(i))e.add(t);return k(e)}function y(t,e){const i=m(t,{direction:"forward"}),n=c.next();for(const t of i)e.setAttribute("listItemId",n,t);return i}function v(t,e,i){const n={};for(const[t,i]of e.getAttributes())t.startsWith("list")&&(n[t]=i);const s=m(t,{direction:"forward"});for(const t of s)i.setAttributes(n,t);return s}function w(t,e,{expand:i,indentBy:n=1}={}){t=(0,r.toArray)(t);const s=i?g(t):t;for(const t of s){const i=t.getAttribute("listIndent")+n;i<0?A(t,e):e.setAttribute("listIndent",i,t)}return s}function A(t,e){t=(0,r.toArray)(t);for(const i of t)for(const t of i.getAttributeKeys())t.startsWith("list")&&e.removeAttribute(t,i);return t}function I(t){if(!t.length)return!1;const e=t[0].getAttribute("listItemId");return!!e&&!t.some((t=>t.getAttribute("listItemId")!=e))}function k(t){return Array.from(t).filter((t=>"$graveyard"!==t.root.rootName)).sort(((t,e)=>t.index-e.index))}function x(t){const e=t.document.selection.getSelectedElement();return e&&t.schema.isObject(e)&&t.schema.isBlock(e)?e:null}function T(t,e,i){return m(e,{direction:"forward"}).pop().index>t.index?v(t,e,i):[]}class S extends t.Command{constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=_(t.document.selection);t.change((t=>{const i=[];I(e)&&!h(e[0])?("forward"==this._direction&&i.push(...w(e,t)),i.push(...y(e[0],t))):"forward"==this._direction?i.push(...w(e,t,{expand:!0})):i.push(...function(t,e){const i=g(t=(0,r.toArray)(t)),n=new Set,s=Math.min(...i.map((t=>t.getAttribute("listIndent")))),l=new Map;for(const t of i)l.set(t,o.first(t,{lowerIndent:!0}));for(const t of i){if(n.has(t))continue;n.add(t);const i=t.getAttribute("listIndent")-1;if(i<0)A(t,e);else{if(t.getAttribute("listIndent")==s){const i=T(t,l.get(t),e);for(const t of i)n.add(t);if(i.length)continue}e.setAttribute("listIndent",i,t)}}return k(n)}(e,t));for(const e of i){if(!e.hasAttribute("listType"))continue;const i=o.first(e,{sameIndent:!0});i&&t.setAttribute("listType",i.getAttribute("listType"),e)}this._fireAfterExecute(i)}))}_fireAfterExecute(t){this.fire("afterExecute",k(new Set(t)))}_checkEnabled(){let t=_(this.editor.model.document.selection),e=t[0];if(!e)return!1;if("backward"==this._direction)return!0;if(I(t)&&!h(t[0]))return!0;t=g(t),e=t[0];const i=o.first(e,{sameIndent:!0});return!!i&&i.getAttribute("listType")==e.getAttribute("listType")}}function _(t){const e=Array.from(t.getSelectedBlocks()),i=e.findIndex((t=>!d(t)));return-1!=i&&(e.length=i),e}class C extends t.Command{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=x(e),s=Array.from(i.selection.getSelectedBlocks()).filter((t=>e.schema.checkAttribute(t,"listType"))),r=void 0!==t.forceValue?!t.forceValue:this.value;e.change((t=>{if(r){const e=s[s.length-1],i=m(e,{direction:"forward"}),n=[];i.length>1&&n.push(...y(i[1],t)),n.push(...A(s,t)),n.push(...function(t,e){const i=[];let n=Number.POSITIVE_INFINITY;for(const{node:s}of l(t.nextSibling,"forward")){const t=s.getAttribute("listIndent");if(0==t)break;t{const{firstElement:r,lastElement:l}=this._getMergeSubjectElements(i,t),a=r.getAttribute("listIndent")||0,c=l.getAttribute("listIndent"),d=l.getAttribute("listItemId");if(a!=c){const t=(u=l,Array.from(new o(u,{direction:"forward",higherIndent:!0})));n.push(...w([l,...t],s,{indentBy:a-c,expand:a{const e=y(this._getStartBlock(),t);this._fireAfterExecute(e)}))}_fireAfterExecute(t){this.fire("afterExecute",k(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&d(e)&&!h(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?t:t.nextSibling}}class E extends t.Plugin{static get pluginName(){return"DocumentListUtils"}expandListBlocksToCompleteList(t){return b(t)}isFirstBlockOfListItem(t){return h(t)}isListItemBlock(t){return d(t)}}function P(t){return t.is("element","ol")||t.is("element","ul")}function z(t){return t.is("element","li")}function B(t){let e=0,i=t.parent;for(;i;){if(z(i))e++;else{const t=i.previousSibling;t&&z(t)&&e++}i=i.parent}return e}function N(t,e,i,n=F(i,e)){return t.createAttributeElement(D(i),null,{priority:2*e/100-100,id:n})}function M(t,e,i){return t.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:i})}function D(t){return"numbered"==t?"ol":"ul"}function F(t,e){return`list-${t}-${e}`}function O(t,e){const i=t.nodeBefore;if(d(i)){let t=i;for(const{node:i}of l(t,"backward"))if(t=i,e.has(t))return;e.set(i,t)}else{const i=t.nodeAfter;d(i)&&e.set(i,i)}}var R=i(492);function H(){return(t,e,i)=>{if(!i.consumable.test(e.viewItem,{name:!0}))return;const n=new R.UpcastWriter(e.viewItem.document);for(const t of Array.from(e.viewItem.getChildren()))z(t)||P(t)||n.remove(t)}}function U(t,e,i){const n=function(t){return(e,i)=>{const n=[];for(const i of t)e.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((t=>!1!==i.test(e,t)))&&(n.forEach((t=>i.consume(e,t))),!0)}}(t);return(s,r,l)=>{const{writer:a,mapper:c,consumable:d}=l,u=r.item;if(!t.includes(r.attributeKey))return;if(!n(u,d))return;const m=function(t,e,i){const n=i.createRangeOn(t),s=e.toViewRange(n).getTrimmed();return s.getContainedElement()}(u,c,i);!function(t,e){let i=t.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const n=i.parent;e.unwrap(e.createRangeOn(t),i),i=n}}(m,a),function(t,e,i,n){if(!t.hasAttribute("listIndent"))return;const s=t.getAttribute("listIndent");let r=t;for(let t=s;t>=0;t--){const s=M(n,t,r.getAttribute("listItemId")),l=N(n,t,r.getAttribute("listType"));for(const t of i)r.hasAttribute(t.attributeName)&&t.setAttributeOnDowncast(n,r.getAttribute(t.attributeName),"list"==t.scope?l:s);if(e=n.wrap(e,s),e=n.wrap(e,l),0==t)break;if(r=o.first(r,{lowerIndent:!0}),!r)break}}(u,a.createRangeOn(m),e,a)}}function j(t,{dataPipeline:e}={}){return(i,{writer:n})=>{if(!q(i,t))return;const s=n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});return e&&n.setCustomProperty("dataPipeline:transparentRendering",!0,s),s}}function q(t,e,i=u(t)){if(!d(t))return!1;for(const i of t.getAttributeKeys())if(!i.startsWith("selection:")&&!e.includes(i))return!1;return i.length<2}var K=i(62),Z=i.n(K),$=i(78),W={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()($.Z,W);$.Z.locals;const G=["listType","listIndent","listItemId"];class Y extends t.Plugin{static get pluginName(){return"DocumentListEditing"}static get requires(){return[e.Enter,s.Delete,E]}constructor(t){super(t),this._downcastStrategies=[]}init(){const t=this.editor,e=t.model;if(t.plugins.has("ListEditing"))throw new r.CKEditorError("document-list-feature-conflict",this,{conflictPlugin:"ListEditing"});e.schema.extend("$container",{allowAttributes:G}),e.schema.extend("$block",{allowAttributes:G}),e.schema.extend("$blockObject",{allowAttributes:G});for(const t of G)e.schema.setAttributeProperties(t,{copyOnReplace:!0});t.commands.add("numberedList",new C(t,"numbered")),t.commands.add("bulletedList",new C(t,"bulleted")),t.commands.add("indentList",new S(t,"forward")),t.commands.add("outdentList",new S(t,"backward")),t.commands.add("mergeListItemBackward",new L(t,"backward")),t.commands.add("mergeListItemForward",new L(t,"forward")),t.commands.add("splitListItemBefore",new V(t,"before")),t.commands.add("splitListItemAfter",new V(t,"after")),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}_getListAttributeNames(){return[...G,...this._downcastStrategies.map((t=>t.attributeName))]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),i=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",((n,s)=>{const r=t.model.document.selection;x(t.model)||t.model.change((()=>{const l=r.getFirstPosition();if(r.isCollapsed&&"backward"==s.direction){if(!l.isAtStart)return;const i=l.parent;if(!d(i))return;if(o.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:J(t.model,"backward")})}else f(i)||t.execute("splitListItemAfter"),t.execute("outdentList");s.preventDefault(),n.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd)return;if(!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:J(t.model,"forward")}),s.preventDefault(),n.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,i=t.commands,n=i.get("enter");this.listenTo(t.editing.view.document,"enter",((i,n)=>{const s=e.document,r=s.selection.getFirstPosition().parent;if(s.selection.isCollapsed&&d(r)&&r.isEmpty&&!n.isSoft){const e=h(r),s=f(r);e&&s?(t.execute("outdentList"),n.preventDefault(),i.stop()):e&&!s?(t.execute("splitListItemAfter"),n.preventDefault(),i.stop()):s&&(t.execute("splitListItemBefore"),n.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(n,"afterExecute",(()=>{const e=i.get("splitListItemBefore");if(e.refresh(),!e.isEnabled)return;2===u(t.model.document.selection.getLastPosition().parent).length&&e.execute()}))}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",((e,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(t.execute(n),i.stopPropagation(),i.preventDefault(),e.stop())}),{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,i=this._getListAttributeNames();t.conversion.for("upcast").elementToElement({view:"li",model:"paragraph"}).add((t=>{t.on("element:li",((t,e,i)=>{const{writer:n,schema:s}=i;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter((t=>s.checkAttribute(t,"listItemId")));if(!r.length)return;const o={listItemId:c.next(),listIndent:B(e.viewItem),listType:e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted"};for(const t of r)d(t)||n.setAttributes(o,t);r.length>1&&r[1].getAttribute("listItemId")!=o.listItemId&&i.keepEmptyElement(r[0])})),t.on("element:ul",H(),{priority:"high"}),t.on("element:ol",H(),{priority:"high"})})),t.conversion.for("editingDowncast").elementToElement({model:"paragraph",view:j(i),converterPriority:"high"}),t.conversion.for("dataDowncast").elementToElement({model:"paragraph",view:j(i,{dataPipeline:!0}),converterPriority:"high"}),t.conversion.for("downcast").add((t=>{t.on("attribute",U(i,this._downcastStrategies,e))})),this.listenTo(e.document,"change:data",function(t,e,i,n){return()=>{const n=t.document.differ.getChanges(),o=[],l=new Map,a=new Set;for(const t of n)if("insert"==t.type&&"$text"!=t.name)O(t.position,l),t.attributes.has("listItemId")?a.add(t.position.nodeAfter):O(t.position.getShiftedBy(t.length),l);else if("remove"==t.type&&t.attributes.has("listItemId"))O(t.position,l);else if("attribute"==t.type){const e=t.range.start.nodeAfter;i.includes(t.attributeKey)?(O(t.range.start,l),null===t.attributeNewValue?(O(t.range.start.getShiftedBy(1),l),r(e)&&o.push(e)):a.add(e)):d(e)&&r(e)&&o.push(e)}for(const t of l.values())o.push(...s(t,a));for(const t of new Set(o))e.reconvertItem(t)};function s(t,e){const n=[],s=new Set,a=[];for(const{node:c,previous:d}of l(t,"forward")){if(s.has(c))continue;const t=c.getAttribute("listIndent");d&&ti.includes(t))));const l=m(c,{direction:"forward"});for(const t of l)s.add(t),(r(t,l)||o(t,a,e))&&n.push(t)}return n}function r(t,n){if(!t.is("element","paragraph"))return!1;const s=e.mapper.toViewElement(t);if(!s)return!1;const r=q(t,i,n);return!(!r||!s.is("element","p"))||!(r||!s.is("element","span"))}function o(t,i,s){if(s.has(t))return!1;const r=e.mapper.toViewElement(t);let o=i.length-1;for(let t=r.parent;!t.is("editableElement");t=t.parent){const e=z(t),s=P(t);if(!s&&!e)continue;const r="checkAttributes:"+(e?"item":"list");if(n.fire(r,{viewElement:t,modelAttributes:i[o]}))break;if(s&&(o--,o<0))return!1}return!0}}(e,t.editing,i,this)),this.on("checkAttributes:item",((t,{viewElement:e,modelAttributes:i})=>{e.id!=i.listItemId&&(t.return=!0,t.stop())})),this.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:i})=>{e.name==D(i.listType)&&e.id==F(i.listType,i.listIndent)||(t.return=!0,t.stop())}))}_setupModelPostFixing(){const t=this.editor.model,e=this._getListAttributeNames();t.document.registerPostFixer((i=>function(t,e,i,n){const s=t.document.differ.getChanges(),r=new Map;let o=!1;for(const n of s)if("insert"==n.type&&"$text"!=n.name){const s=n.position.nodeAfter;if(!t.schema.checkAttribute(s,"listItemId"))for(const t of Array.from(s.getAttributeKeys()))i.includes(t)&&(e.removeAttribute(t,s),o=!0);O(n.position,r),n.attributes.has("listItemId")||O(n.position.getShiftedBy(n.length),r);for(const{item:e,previousPosition:i}of t.createRangeIn(s))d(e)&&O(i,r)}else"remove"==n.type?O(n.position,r):"attribute"==n.type&&i.includes(n.attributeKey)&&(O(n.range.start,r),null===n.attributeNewValue&&O(n.range.start.getShiftedBy(1),r));const l=new Set;for(const t of r.values())o=n.fire("postFixer",{listNodes:new a(t),listHead:t,writer:e,seenIds:l})||o;return o}(t,i,e,this))),this.on("postFixer",((t,{listNodes:e,writer:i})=>{t.return=function(t,e){let i=0,n=-1,s=null,r=!1;for(const{node:o}of t){const t=o.getAttribute("listIndent");if(t>i){let l;null===s?(s=t-i,l=i):(s>t&&(s=t),l=t-s),l>n+1&&(l=n+1),e.setAttribute("listIndent",l,o),r=!0,n=l}else s=null,i=t+1,n=t}return r}(e,i)||t.return}),{priority:"high"}),this.on("postFixer",((t,{listNodes:e,writer:i,seenIds:n})=>{t.return=function(t,e,i){const n=new Set;let s=!1;for(const{node:r}of t){if(n.has(r))continue;let t=r.getAttribute("listType"),o=r.getAttribute("listItemId");e.has(o)&&(o=c.next()),e.add(o);for(const e of m(r,{direction:"forward"}))n.add(e),e.getAttribute("listType")!=t&&(o=c.next(),t=e.getAttribute("listType")),e.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,e),s=!0)}return s}(e,n,i)||t.return}),{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model;this.listenTo(t,"insertContent",function(t){return(e,[i,n])=>{const s=i.is("documentFragment")?i.getChild(0):i;if(!d(s))return;let r;r=n?t.createSelection(n):t.document.selection;const o=r.getFirstPosition();let a=null;if(d(o.parent)?a=o.parent:d(o.nodeBefore)&&(a=o.nodeBefore),!a)return;const c=a.getAttribute("listIndent")-s.getAttribute("listIndent");c<=0||t.change((t=>{for(const{node:e}of l(s,"forward"))t.setAttribute("listIndent",e.getAttribute("listIndent")+c,e)}))}}(t),{priority:"high"}),this.listenTo(t,"getSelectedContent",((e,[i])=>{I(Array.from(i.getSelectedBlocks()))&&t.change((t=>A(Array.from(e.return.getChildren()),t)))}))}}function J(t,e){const i=t.document.selection;if(!i.isCollapsed)return!x(t);if("forward"===e)return!0;const n=i.getFirstPosition().parent,s=n.previousSibling;return!t.schema.isObject(s)&&(!!s.isEmpty||I([n,s]))}var Q=i(273);function X(t,e){const i=e.mapper,n=e.writer,s="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=ut,e}(n),o=n.createContainerElement(s,null);return n.insert(n.createPositionAt(o,0),r),i.bindElements(t,r),r}function tt(t,e,i,n){const s=e.parent,r=i.mapper,o=i.writer;let l=r.toViewPosition(n.createPositionBefore(t));const a=nt(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),c=t.previousSibling;if(a&&a.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(a);l=o.breakContainer(o.createPositionAfter(t))}else if(c&&"listItem"==c.name){l=r.toViewPosition(n.createPositionAt(c,"end"));const t=r.findMappedViewAncestor(l),e=rt(t);l=e?o.createPositionBefore(e):o.createPositionAt(t,"end")}else l=r.toViewPosition(n.createPositionBefore(t));if(l=it(l),o.insert(l,s),c&&"listItem"==c.name){const t=r.toViewElement(c),i=o.createRange(o.createPositionAt(t,0),l).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const n=o.breakContainer(o.createPositionBefore(t.item)),s=t.item.parent,r=o.createPositionAt(e,"end");et(o,r.nodeBefore,r.nodeAfter),o.move(o.createRangeOn(s),r),i.position=n}}else{const i=s.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let n=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;n=e}n&&(o.breakContainer(o.createPositionAfter(n)),o.move(o.createRangeOn(n.parent),o.createPositionAt(e,"end")))}}et(o,s,s.nextSibling),et(o,s.previousSibling,s)}function et(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function it(t){return t.getLastMatchingPosition((t=>t.item.is("uiElement")))}function nt(t,e){const i=!!e.sameIndent,n=!!e.smallerIndent,s=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&s==t||n&&s>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function st(t,e,i,n){t.ui.componentFactory.add(e,(s=>{const r=t.commands.get(e),o=new Q.ButtonView(s);return o.set({label:i,icon:n,tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",(()=>{t.execute(e),t.editing.view.focus()})),o}))}function rt(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}function ot(t,e){const i=[],n=t.parent,s={ignoreElementEnd:!1,startPosition:t,shallow:!0,direction:e},r=n.getAttribute("listIndent"),o=[...new R.TreeWalker(s)].filter((t=>t.item.is("element"))).map((t=>t.item));for(const t of o){if(!t.is("element","listItem"))break;if(t.getAttribute("listIndent")r)){if(t.getAttribute("listType")!==n.getAttribute("listType"))break;if(t.getAttribute("listStyle")!==n.getAttribute("listStyle"))break;if(t.getAttribute("listReversed")!==n.getAttribute("listReversed"))break;if(t.getAttribute("listStart")!==n.getAttribute("listStart"))break;"backward"===e?i.unshift(t):i.push(t)}}return i}function lt(t){let e=[...t.document.selection.getSelectedBlocks()].filter((t=>t.is("element","listItem"))).map((e=>{const i=t.change((t=>t.createPositionAt(e,0)));return[...ot(i,"backward"),...ot(i,"forward")]})).flat();return e=[...new Set(e)],e}const at=["disc","circle","square"],ct=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function dt(t){return at.includes(t)?"bulleted":ct.includes(t)?"numbered":null}function ut(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:R.getFillerOffset.call(this)}const mt='',pt='';class ht extends t.Plugin{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;st(this.editor,"numberedList",t("Numbered List"),mt),st(this.editor,"bulletedList",t("Bulleted List"),pt)}}class ft extends t.Plugin{static get requires(){return[Y,ht]}static get pluginName(){return"DocumentList"}}class gt extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=e.document;let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>d(t)&&"numbered"==t.getAttribute("listType")));n=b(n),e.change((e=>{for(const i of n)e.setAttribute("listStart",t.startIndex>=0?t.startIndex:1,i)}))}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return e&&d(e)&&"numbered"==e.getAttribute("listType")?e.getAttribute("listStart"):null}}const bt={},yt={},vt={},wt=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:t,typeAttribute:e,listType:i}of wt)bt[t]=i,yt[t]=e,e&&(vt[e]=t);function At(){return wt.map((t=>t.listStyle))}function It(t){return bt[t]||null}function kt(t){return vt[t]||null}function xt(t){return yt[t]||null}class Tt extends t.Command{constructor(t,e,i){super(t),this._defaultType=e,this._supportedTypes=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document;e.change((e=>{this._tryToConvertItemsToList(t);let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>t.hasAttribute("listType")));if(n.length){n=b(n);for(const i of n)e.setAttribute("listStyle",t.type||this._defaultType,i)}}))}isStyleTypeSupported(t){return!this._supportedTypes||this._supportedTypes.includes(t)}_getValue(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());return d(t)?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=It(t.type);if(!e)return;const i=this.editor,n=e+"List";i.commands.get(n).value||i.execute(n)}}class St extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=e.document;let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>d(t)&&"numbered"==t.getAttribute("listType")));n=b(n),e.change((e=>{for(const i of n)e.setAttribute("listReversed",!!t.reversed,i)}))}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return d(e)&&"numbered"==e.getAttribute("listType")?e.getAttribute("listReversed"):null}}function _t(t){return(e,i,n)=>{const{writer:s,schema:r,consumable:o}=n;if(!1===o.test(i.viewItem,t.viewConsumables))return;i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor));let l=!1;for(const e of i.modelRange.getItems({shallow:!0}))r.checkAttribute(e,t.attributeName)&&t.appliesToListItem(e)&&(e.hasAttribute(t.attributeName)||(s.setAttribute(t.attributeName,t.getAttributeOnUpcast(i.viewItem),e),l=!0));l&&o.consume(i.viewItem,t.viewConsumables)}}class Ct extends t.Plugin{static get pluginName(){return"DocumentListPropertiesUtils"}getAllSupportedStyleTypes(){return At()}getListTypeFromListStyleType(t){return It(t)}getListStyleTypeFromTypeAttribute(t){return kt(t)}getTypeAttributeFromListStyleType(t){return xt(t)}}const Lt="default";class Vt extends t.Plugin{static get requires(){return[Y,Ct]}static get pluginName(){return"DocumentListPropertiesEditing"}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,e=t.model,i=t.plugins.get(Y),n=function(t){const e=[];if(t.styles){const i="object"==typeof t.styles&&t.styles.useAttribute;e.push({attributeName:"listStyle",defaultValue:Lt,viewConsumables:{styles:"list-style-type"},addCommand(t){let e=At();i&&(e=e.filter((t=>!!xt(t)))),t.commands.add("listStyle",new Tt(t,Lt,e))},appliesToListItem:()=>!0,hasValidAttribute(t){if(!t.hasAttribute("listStyle"))return!1;const e=t.getAttribute("listStyle");return e==Lt||It(e)==t.getAttribute("listType")},setAttributeOnDowncast(t,e,n){if(e&&e!==Lt){if(!i)return void t.setStyle("list-style-type",e,n);{const i=xt(e);if(i)return void t.setAttribute("type",i,n)}}t.removeStyle("list-style-type",n),t.removeAttribute("type",n)},getAttributeOnUpcast(t){const e=t.getStyle("list-style-type");if(e)return e;const i=t.getAttribute("type");return i?kt(i):Lt}})}t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(t){t.commands.add("listReversed",new St(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listReversed")},setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(t){t.commands.add("listStart",new gt(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listStart")},setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));for(const s of n)s.addCommand(t),e.schema.extend("$container",{allowAttributes:s.attributeName}),e.schema.extend("$block",{allowAttributes:s.attributeName}),e.schema.extend("$blockObject",{allowAttributes:s.attributeName}),i.registerDowncastStrategy({scope:"list",attributeName:s.attributeName,setAttributeOnDowncast(t,e,i){s.setAttributeOnDowncast(t,e,i)}});t.conversion.for("upcast").add((t=>{for(const e of n)t.on("element:ol",_t(e)),t.on("element:ul",_t(e))})),i.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:i})=>{for(const s of n)s.getAttributeOnUpcast(e)!=i[s.attributeName]&&(t.return=!0,t.stop())})),this.listenTo(t.commands.get("indentList"),"afterExecute",((t,i)=>{e.change((t=>{for(const e of i)for(const i of n)i.appliesToListItem(e)&&t.setAttribute(i.attributeName,i.defaultValue,e)}))})),i.on("postFixer",((t,{listNodes:e,writer:i})=>{for(const{node:s}of e)for(const e of n)e.hasValidAttribute(s)||(e.appliesToListItem(s)?i.setAttribute(e.attributeName,e.defaultValue,s):i.removeAttribute(e.attributeName,s),t.return=!0)})),i.on("postFixer",((t,{listNodes:e,writer:i})=>{const s=[];for(const{node:r,previous:o}of e){if(!o)continue;const e=r.getAttribute("listIndent"),l=o.getAttribute("listIndent");let a=null;if(e>l?s[l]=o:e'}),t.extendTemplate({attributes:{"aria-expanded":e.to("isOn",(t=>String(t)))}}),t.bind("label").to(this),t.bind("isOn").to(this,"isCollapsed",(t=>!t)),t.on("execute",(()=>{this.isCollapsed=!this.isCollapsed})),t}}var Bt=i(543),Nt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()(Bt.Z,Nt);Bt.Z.locals;class Mt extends Q.View{constructor(t,{enabledProperties:e,styleButtonViews:i,styleGridAriaLabel:n}){super(t);const s=["ck","ck-list-properties"];this.children=this.createCollection(),this.stylesView=null,this.additionalPropertiesCollapsibleView=null,this.startIndexFieldView=null,this.reversedSwitchButtonView=null,this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this.focusables=new Q.ViewCollection,this.focusCycler=new Q.FocusCycler({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),e.styles?(this.stylesView=this._createStylesView(i,n),this.children.add(this.stylesView)):s.push("ck-list-properties_without-styles"),(e.startIndex||e.reversed)&&(this._addNumberedListPropertyViews(e,i),s.push("ck-list-properties_with-numbered-properties")),this.setTemplate({tag:"div",attributes:{class:s},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element),(this.startIndexFieldView||this.reversedSwitchButtonView)&&(this.focusables.add(this.children.last.buttonView),this.focusTracker.add(this.children.last.buttonView.element));for(const t of this.stylesView.children)this.stylesView.focusTracker.add(t.element);(0,Q.addKeyboardHandlingForGrid)({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>r.global.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView),this.focusTracker.add(this.startIndexFieldView.element),this.listenTo(this.startIndexFieldView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"});const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}this.reversedSwitchButtonView&&(this.focusables.add(this.reversedSwitchButtonView),this.focusTracker.add(this.reversedSwitchButtonView.element)),this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createStylesView(t,e){const i=new Q.View(this.locale);return i.children=i.createCollection(this.locale),i.children.addMany(t),i.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-list-styles-list"]},children:i.children}),i.children.delegate("execute").to(this),i.focus=function(){this.children.first.focus()},i.focusTracker=new r.FocusTracker,i.keystrokes=new r.KeystrokeHandler,i.render(),i.keystrokes.listenTo(i.element),i}_addNumberedListPropertyViews(t){const e=this.locale.t,i=[];t.startIndex&&(this.startIndexFieldView=this._createStartIndexField(),i.push(this.startIndexFieldView)),t.reversed&&(this.reversedSwitchButtonView=this._createReversedSwitchButton(),i.push(this.reversedSwitchButtonView)),t.styles?(this.additionalPropertiesCollapsibleView=new zt(this.locale,i),this.additionalPropertiesCollapsibleView.set({label:e("List properties"),isCollapsed:!0}),this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(i,"isEnabled",((...t)=>t.some((t=>t)))),this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",((t,e,i)=>{i||(this.additionalPropertiesCollapsibleView.isCollapsed=!0)})),this.children.add(this.additionalPropertiesCollapsibleView)):this.children.addMany(i)}_createStartIndexField(){const t=this.locale.t,e=new Q.LabeledFieldView(this.locale,Q.createLabeledInputNumber);return e.set({label:t("Start at"),class:"ck-numbered-list-properties__start-index"}),e.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"}),e.fieldView.on("input",(()=>{const i=e.fieldView.element,n=i.valueAsNumber;Number.isNaN(n)||(i.checkValidity()?this.fire("listStart",{startIndex:n}):e.errorText=t("Start index must be greater than 0."))})),e}_createReversedSwitchButton(){const t=this.locale.t,e=new Q.SwitchButtonView(this.locale);return e.set({withText:!0,label:t("Reversed order"),class:"ck-numbered-list-properties__reversed-order"}),e.delegate("execute").to(this,"listReversed"),e}}var Dt=i(657),Ft={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()(Dt.Z,Ft);Dt.Z.locals;class Ot extends t.Plugin{static get pluginName(){return"ListPropertiesUI"}init(){const t=this.editor,e=t.locale.t,i=t.config.get("list.properties");i.styles&&t.ui.componentFactory.add("bulletedList",Rt({editor:t,parentCommandName:"bulletedList",buttonLabel:e("Bulleted List"),buttonIcon:pt,styleGridAriaLabel:e("Bulleted list styles toolbar"),styleDefinitions:[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:''},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:''},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:''}]})),(i.styles||i.startIndex||i.reversed)&&t.ui.componentFactory.add("numberedList",Rt({editor:t,parentCommandName:"numberedList",buttonLabel:e("Numbered List"),buttonIcon:mt,styleGridAriaLabel:e("Numbered list styles toolbar"),styleDefinitions:[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:''},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:''},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:''},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:''},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:''},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:''}]}))}}function Rt({editor:t,parentCommandName:e,buttonLabel:i,buttonIcon:n,styleGridAriaLabel:s,styleDefinitions:r}){const o=t.commands.get(e);return l=>{const a=(0,Q.createDropdown)(l,Q.SplitButtonView),c=a.buttonView;a.bind("isEnabled").to(o),a.class="ck-list-styles-dropdown",c.on("execute",(()=>{t.execute(e),t.editing.view.focus()})),c.set({label:i,icon:n,tooltip:!0,isToggleable:!0}),c.bind("isOn").to(o,"value",(t=>!!t));const d=function({editor:t,dropdownView:e,parentCommandName:i,styleDefinitions:n,styleGridAriaLabel:s}){const r=t.locale,o=t.config.get("list.properties");let l;"numberedList"!=i&&(o.startIndex=!1,o.reversed=!1);if(o.styles){const e=t.commands.get("listStyle"),s=function({editor:t,listStyleCommand:e,parentCommandName:i}){const n=t.locale,s=t.commands.get(i);return({label:i,type:r,icon:o,tooltip:l})=>{const a=new Q.ButtonView(n);return a.set({label:i,icon:o,tooltip:l}),e.on("change:value",(()=>{a.isOn=e.value===r})),a.on("execute",(()=>{s.value?e.value!==r?t.execute("listStyle",{type:r}):t.execute("listStyle",{type:e._defaultType}):t.model.change((()=>{t.execute("listStyle",{type:r})}))})),a}}({editor:t,parentCommandName:i,listStyleCommand:e}),r="function"==typeof e.isStyleTypeSupported?t=>e.isStyleTypeSupported(t.type):()=>!0;l=n.filter(r).map(s)}const a=new Mt(r,{styleGridAriaLabel:s,enabledProperties:o,styleButtonViews:l});o.styles&&(0,Q.focusChildOnDropdownOpen)(e,(()=>a.stylesView.children.find((t=>t.isOn))));if(o.startIndex){const e=t.commands.get("listStart");a.startIndexFieldView.bind("isEnabled").to(e),a.startIndexFieldView.fieldView.bind("value").to(e),a.on("listStart",((e,i)=>t.execute("listStart",i)))}if(o.reversed){const e=t.commands.get("listReversed");a.reversedSwitchButtonView.bind("isEnabled").to(e),a.reversedSwitchButtonView.bind("isOn").to(e,"value"),a.on("listReversed",(()=>{const i=e.value;t.execute("listReversed",{reversed:!i})}))}return a.delegate("execute").to(e),a}({editor:t,dropdownView:a,parentCommandName:e,styleGridAriaLabel:s,styleDefinitions:r});return a.panelView.children.add(d),a.on("execute",(()=>{t.editing.view.focus()})),a}}class Ht extends t.Plugin{static get requires(){return[Vt,Ot]}static get pluginName(){return"DocumentListProperties"}}class Ut extends t.Command{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=Array.from(i.selection.getSelectedBlocks()).filter((t=>qt(t,e.schema))),s=void 0!==t.forceValue?!t.forceValue:this.value;e.change((t=>{if(s){let e=n[n.length-1].nextSibling,i=Number.POSITIVE_INFINITY,s=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t=i;)r>s.getAttribute("listIndent")&&(r=s.getAttribute("listIndent")),s.getAttribute("listIndent")==r&&t[e?"unshift":"push"](s),s=s[e?"previousSibling":"nextSibling"]}}function qt(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class Kt extends t.Command{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change((t=>{const e=i[i.length-1];let n=e.nextSibling;for(;n&&"listItem"==n.name&&n.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(n),n=n.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)}))}_checkEnabled(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let n=t.previousSibling;for(;n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=e;){if(n.getAttribute("listIndent")==e)return n.getAttribute("listType")==i;n=n.previousSibling}return!1}return!0}}class Zt extends t.Plugin{static get pluginName(){return"ListUtils"}getListTypeFromListStyleType(t){return dt(t)}getSelectedListItems(t){return lt(t)}getSiblingNodes(t,e){return ot(t,e)}}function $t(t){return(e,i,n)=>{const s=n.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent"))return;s.consume(i.item,"insert"),s.consume(i.item,"attribute:listType"),s.consume(i.item,"attribute:listIndent");const r=i.item;tt(r,X(r,n),n,t)}}function Wt(t,e,i){if(!i.consumable.test(e.item,t.name))return;const n=i.mapper.toViewElement(e.item),s=i.writer;s.breakContainer(s.createPositionBefore(n)),s.breakContainer(s.createPositionAfter(n));const r=n.parent,o="numbered"==e.attributeNewValue?"ol":"ul";s.rename(o,r)}function Gt(t,e,i){i.consumable.consume(e.item,t.name);const n=i.mapper.toViewElement(e.item).parent,s=i.writer;et(s,n,n.nextSibling),et(s,n.previousSibling,n)}function Yt(t,e,i){if(i.consumable.test(e.item,t.name)&&"listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const n=i.writer,s=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=n.breakContainer(t),"li"==t.parent.name);){const e=t,i=n.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=n.remove(n.createRange(e,i));s.push(t)}t=n.createPositionAfter(t.parent)}if(s.length>0){for(let e=0;e0){const e=et(n,i,i.nextSibling);e&&e.parent==i&&t.offset--}}et(n,t.nodeBefore,t.nodeAfter)}}}function Jt(t,e,i){const n=i.mapper.toViewPosition(e.position),s=n.nodeBefore,r=n.nodeAfter;et(i.writer,s,r)}function Qt(t,e,i){if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,n=t.createElement("listItem"),s=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",s,n);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,n),!i.safeInsert(n,e.modelCursor))return;const o=function(t,e,i){const{writer:n,schema:s}=i;let r=n.createPositionAfter(t);for(const o of e)if("ul"==o.name||"ol"==o.name)r=i.convertItem(o,r).modelCursor;else{const e=i.convertItem(o,n.createPositionAt(t,"end")),l=e.modelRange.start.nodeAfter;l&&l.is("element")&&!s.checkChild(t,l.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:ne(e.modelCursor),r=n.createPositionAfter(t))}return r}(n,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,o),i.updateConversionResult(n,e)}}function Xt(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||re(e))&&e._remove()}}}function te(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1;for(const e of t)i&&!re(e)&&e._remove(),re(e)&&(i=!0)}}function ee(t){return(e,i)=>{if(i.isPhantom)return;const n=i.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const e=i.mapper.toViewElement(n),s=e.getAncestors().find(re),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==s){i.viewPosition=t.nextPosition;break}}}}}function ie(t,[e,i,n]){let s,r=e.is("documentFragment")?e.getChild(0):e;if(s=i?this.createSelection(i,n):this.document.selection,r&&r.is("element","listItem")){const t=s.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;r&&r.is("element","listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+t),r=r.nextSibling}}}function ne(t){const e=new R.TreeWalker({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function se(t,e,i,n,s,r){const o=nt(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),l=s.mapper,a=s.writer,c=o?o.getAttribute("listIndent"):null;let d;if(o)if(c==t){const t=l.toViewElement(o).parent;d=a.createPositionAfter(t)}else{const t=r.createPositionAt(o,"end");d=l.toViewPosition(t)}else d=i;d=it(d);for(const t of[...n.getChildren()])re(t)&&(d=a.move(a.createRangeOn(t),d).end,et(a,t,t.nextSibling),et(a,t.previousSibling,t))}function re(t){return t.is("element","ol")||t.is("element","ul")}class oe extends t.Plugin{static get pluginName(){return"ListEditing"}static get requires(){return[e.Enter,s.Delete,Zt]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var n;t.model.document.registerPostFixer((e=>function(t,e){const i=t.document.differ.getChanges(),n=new Map;let s=!1;for(const n of i)if("insert"==n.type&&"listItem"==n.name)r(n.position);else if("insert"==n.type&&"listItem"!=n.name){if("$text"!=n.name){const i=n.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),s=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),s=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),s=!0),i.hasAttribute("listReversed")&&(e.removeAttribute("listReversed",i),s=!0),i.hasAttribute("listStart")&&(e.removeAttribute("listStart",i),s=!0);for(const e of Array.from(t.createRangeIn(i)).filter((t=>t.item.is("element","listItem"))))r(e.previousPosition)}r(n.position.getShiftedBy(n.length))}else"remove"==n.type&&"listItem"==n.name?r(n.position):("attribute"==n.type&&"listIndent"==n.attributeKey||"attribute"==n.type&&"listType"==n.attributeKey)&&r(n.range.start);for(const t of n.values())o(t),l(t);return s;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(n.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,n.has(t))return;n.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&n.set(e,e)}}function o(t){let i=0,n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>i){let o;null===n?(n=r-i,o=i):(n>r&&(n=r),o=r-n),e.setAttribute("listIndent",o,t),s=!0}else n=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function l(t){let i=[],n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(n&&n.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const n=i[r];t.getAttribute("listType")!=n&&(e.setAttribute("listType",n,t),s=!0)}else i[r]=t.getAttribute("listType");n=t,t=t.nextSibling}}}(t.model,e))),i.mapper.registerViewToModelLength("li",le),e.mapper.registerViewToModelLength("li",le),i.mapper.on("modelToViewPosition",ee(i.view)),i.mapper.on("viewToModelPosition",(n=t.model,(t,e)=>{const i=e.viewPosition,s=i.parent,r=e.mapper;if("ul"==s.name||"ol"==s.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),s=r.getModelLength(i.nodeBefore);e.modelPosition=n.createPositionBefore(t).getShiftedBy(s)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=n.createPositionBefore(t)}t.stop()}else if("li"==s.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const o=r.toModelElement(s);let l=1,a=i.nodeBefore;for(;a&&re(a);)l+=r.getModelLength(a),a=a.previousSibling;e.modelPosition=n.createPositionBefore(o).getShiftedBy(l),t.stop()}})),e.mapper.on("modelToViewPosition",ee(i.view)),t.conversion.for("editingDowncast").add((e=>{e.on("insert",Yt,{priority:"high"}),e.on("insert:listItem",$t(t.model)),e.on("attribute:listType:listItem",Wt,{priority:"high"}),e.on("attribute:listType:listItem",Gt,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,"attribute:listIndent"))return;const s=n.mapper.toViewElement(i.item),r=n.writer;r.breakContainer(r.createPositionBefore(s)),r.breakContainer(r.createPositionAfter(s));const o=s.parent,l=o.previousSibling,a=r.createRangeOn(o);r.remove(a),l&&l.nextSibling&&et(r,l,l.nextSibling),se(i.attributeOldValue+1,i.range.start,a.start,s,n,t),tt(i.item,s,n,t);for(const t of i.item.getChildren())n.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,n)=>{const s=n.mapper.toViewPosition(i.position).getLastMatchingPosition((t=>!t.item.is("element","li"))).nodeAfter,r=n.writer;r.breakContainer(r.createPositionBefore(s)),r.breakContainer(r.createPositionAfter(s));const o=s.parent,l=o.previousSibling,a=r.createRangeOn(o),c=r.remove(a);l&&l.nextSibling&&et(r,l,l.nextSibling),se(n.mapper.toModelElement(s).getAttribute("listIndent")+1,i.position,a.start,s,n,t);for(const t of r.createRangeIn(c).getItems())n.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",Jt,{priority:"low"})})),t.conversion.for("dataDowncast").add((e=>{e.on("insert",Yt,{priority:"high"}),e.on("insert:listItem",$t(t.model))})),t.conversion.for("upcast").add((t=>{t.on("element:ul",Xt,{priority:"high"}),t.on("element:ol",Xt,{priority:"high"}),t.on("element:li",te,{priority:"high"}),t.on("element:li",Qt)})),t.model.on("insertContent",ie,{priority:"high"}),t.commands.add("numberedList",new Ut(t,"numbered")),t.commands.add("bulletedList",new Ut(t,"bulleted")),t.commands.add("indentList",new Kt(t,"forward")),t.commands.add("outdentList",new Kt(t,"backward"));const s=i.view.document;this.listenTo(s,"enter",((t,e)=>{const i=this.editor.model.document,n=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==n.name&&n.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(s,"delete",((t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const n=i.getFirstPosition();if(!n.isAtStart)return;const s=n.parent;if("listItem"!==s.name)return;s.previousSibling&&"listItem"===s.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(t.editing.view.document,"tab",((e,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(t.execute(n),i.stopPropagation(),i.preventDefault(),e.stop())}),{context:"li"})}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function le(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=le(t);return e}class ae extends t.Plugin{static get requires(){return[oe,ht]}static get pluginName(){return"List"}}class ce extends t.Command{constructor(t,e){super(t),this._defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);const e=this.editor.model,i=lt(e);i.length&&e.change((e=>{for(const n of i)e.setAttribute("listStyle",t.type||this._defaultType,n)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=dt(t.type);if(!e)return;const i=this.editor,n=e+"List";i.commands.get(n).value||i.execute(n)}}class de extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=lt(e).filter((t=>"numbered"==t.getAttribute("listType")));e.change((e=>{for(const n of i)e.setAttribute("listReversed",!!t.reversed,n)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listReversed"):null}}class ue extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=lt(e).filter((t=>"numbered"==t.getAttribute("listType")));e.change((e=>{for(const n of i)e.setAttribute("listStart",t.startIndex>=0?t.startIndex:1,n)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listStart"):null}}const me="default";class pe extends t.Plugin{static get requires(){return[oe]}static get pluginName(){return"ListPropertiesEditing"}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,e=t.model,i=function(t){const e=[];t.styles&&e.push({attributeName:"listStyle",defaultValue:me,addCommand(t){t.commands.add("listStyle",new ce(t,me))},appliesToListItem:()=>!0,setAttributeOnDowncast(t,e,i){e&&e!==me?t.setStyle("list-style-type",e,i):t.removeStyle("list-style-type",i)},getAttributeOnUpcast:t=>t.getStyle("list-style-type")||me});t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,addCommand(t){t.commands.add("listReversed",new de(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,addCommand(t){t.commands.add("listStart",new ue(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));e.schema.extend("listItem",{allowAttributes:i.map((t=>t.attributeName))});for(const e of i)e.addCommand(t);var n;this.listenTo(t.commands.get("indentList"),"_executeCleanup",function(t,e){return(i,n)=>{const s=n[0],r=s.getAttribute("listIndent"),o=n.filter((t=>t.getAttribute("listIndent")===r));let l=null;s.previousSibling.getAttribute("listIndent")+1!==r&&(l=nt(s.previousSibling,{sameIndent:!0,direction:"backward",listIndent:r})),t.model.change((t=>{for(const i of o)for(const n of e)if(n.appliesToListItem(i)){const e=null==l?n.defaultValue:l.getAttribute(n.attributeName);t.setAttribute(n.attributeName,e,i)}}))}}(t,i)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",function(t,e){return(i,n)=>{if(!(n=n.reverse().filter((t=>t.is("element","listItem")))).length)return;const s=n[0].getAttribute("listIndent"),r=n[0].getAttribute("listType");let o=n[0].previousSibling;if(o.is("element","listItem"))for(;o.getAttribute("listIndent")!==s;)o=o.previousSibling;else o=null;o||(o=n[n.length-1].nextSibling),o&&o.is("element","listItem")&&o.getAttribute("listType")===r&&t.model.change((t=>{const i=n.filter((t=>t.getAttribute("listIndent")===s));for(const n of i)for(const i of e)if(i.appliesToListItem(n)){const e=i.attributeName,s=o.getAttribute(e);t.setAttribute(e,s,n)}}))}}(t,i)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",ge(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",ge(t)),e.document.registerPostFixer(function(t,e){return i=>{let n=!1;const s=be(t.model.document.differ.getChanges()).filter((t=>"todo"!==t.getAttribute("listType")));if(!s.length)return n;let r=s[s.length-1].nextSibling;if((!r||!r.is("element","listItem"))&&(r=s[0].previousSibling,r)){const t=s[0].getAttribute("listIndent");for(;r.is("element","listItem")&&r.getAttribute("listIndent")!==t&&(r=r.previousSibling,r););}for(const t of e){const e=t.attributeName;for(const o of s)if(t.appliesToListItem(o))if(o.hasAttribute(e)){const s=o.previousSibling;fe(s,o,t.attributeName)&&(i.setAttribute(e,s.getAttribute(e),o),n=!0)}else he(r,o,t)?i.setAttribute(e,r.getAttribute(e),o):i.setAttribute(e,t.defaultValue,o),n=!0;else i.removeAttribute(e,o)}return n}}(t,i)),t.conversion.for("upcast").add((n=i,t=>{t.on("element:li",((t,e,i)=>{const s=e.viewItem.parent,r=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;for(const t of n)if(t.appliesToListItem(r)){const e=t.getAttributeOnUpcast(s);i.writer.setAttribute(t.attributeName,e,r)}}),{priority:"low"})})),t.conversion.for("downcast").add(function(t){return i=>{for(const n of t)i.on(`attribute:${n.attributeName}:listItem`,((t,i,s)=>{const r=s.writer,o=i.item,l=nt(o.previousSibling,{sameIndent:!0,listIndent:o.getAttribute("listIndent"),direction:"backward"}),a=s.mapper.toViewElement(o);e(o,l)||r.breakContainer(r.createPositionBefore(a)),n.setAttributeOnDowncast(r,i.attributeNewValue,a.parent)}),{priority:"low"})};function e(t,e){return e&&t.getAttribute("listType")===e.getAttribute("listType")&&t.getAttribute("listIndent")===e.getAttribute("listIndent")&&t.getAttribute("listStyle")===e.getAttribute("listStyle")&&t.getAttribute("listReversed")===e.getAttribute("listReversed")&&t.getAttribute("listStart")===e.getAttribute("listStart")}}(i)),this._mergeListAttributesWhileMergingLists(i)}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(function(t){return e=>{const i=be(t.model.document.differ.getChanges()).filter((t=>"todo"===t.getAttribute("listType")&&(t.hasAttribute("listStyle")||t.hasAttribute("listReversed")||t.hasAttribute("listStart"))));if(!i.length)return!1;for(const t of i)e.removeAttribute("listStyle",t),e.removeAttribute("listReversed",t),e.removeAttribute("listStart",t);return!0}}(t))}_mergeListAttributesWhileMergingLists(t){const e=this.editor.model;let i;this.listenTo(e,"deleteContent",((t,[e])=>{const n=e.getFirstPosition(),s=e.getLastPosition();if(n.parent===s.parent)return;if(!n.parent.is("element","listItem"))return;const r=s.parent.nextSibling;if(!r||!r.is("element","listItem"))return;const o=nt(n.parent,{sameIndent:!0,listIndent:r.getAttribute("listIndent")});o&&o.getAttribute("listType")===r.getAttribute("listType")&&(i=o)}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{i&&(e.change((e=>{const n=nt(i.nextSibling,{sameIndent:!0,listIndent:i.getAttribute("listIndent"),direction:"forward"});if(!n)return void(i=null);const s=[n,...ot(e.createPositionAt(n,0),"forward")];for(const n of s)for(const s of t)if(s.appliesToListItem(n)){const t=s.attributeName,r=i.getAttribute(t);e.setAttribute(t,r,n)}})),i=null)}),{priority:"low"})}}function he(t,e,i){if(!t)return!1;const n=t.getAttribute(i.attributeName);return!!n&&(n!=i.defaultValue&&t.getAttribute("listType")===e.getAttribute("listType"))}function fe(t,e,i){if(!t||!t.is("element","listItem"))return!1;if(e.getAttribute("listType")!==t.getAttribute("listType"))return!1;const n=t.getAttribute("listIndent");if(n<1||n!==e.getAttribute("listIndent"))return!1;const s=t.getAttribute(i);return!(!s||s===e.getAttribute(i))}function ge(t){return(e,i)=>{i=i.filter((t=>t.is("element","listItem"))),t.model.change((t=>{for(const e of i)t.removeAttribute("listStyle",e)}))}}function be(t){const e=[];for(const i of t){const t=ye(i);t&&t.is("element","listItem")&&e.push(t)}return e}function ye(t){return"attribute"===t.type?t.range.start.nodeAfter:"insert"===t.type?t.position.nodeAfter:null}class ve extends t.Plugin{static get requires(){return[pe,Ot]}static get pluginName(){return"ListProperties"}}const we="todoListChecked";class Ae extends t.Command{constructor(t){super(t),this._selectedElements=[],this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every((t=>!!t.getAttribute("todoListChecked"))),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),n=i.start.parent,s=[];e.checkAttribute(n,we)&&s.push(n);for(const t of i.getItems())e.checkAttribute(t,we)&&!s.includes(t)&&s.push(t);return s}execute(t={}){this.editor.model.change((e=>{for(const i of this._selectedElements){(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute(we,!0,i):e.removeAttribute(we,i)}}))}}function Ie(t,e,i){const n=e.modelCursor,s=n.parent,r=e.viewItem;if("checkbox"!=r.getAttribute("type")||"listItem"!=s.name||!n.isAtStart)return;if(!i.consumable.consume(r,{name:!0}))return;const o=i.writer;o.setAttribute("listType","todo",s),e.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,s),e.modelRange=o.createRange(n)}function ke(t){return(e,i)=>{const n=i.modelPosition,s=n.parent;if(!s.is("element","listItem")||"todo"!=s.getAttribute("listType"))return;const r=Te(i.mapper.toViewElement(s),t);r&&(i.viewPosition=i.mapper.findPositionIn(r,n.offset))}}function xe(t,e,i,n){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},(function(e){const s=(0,r.createElement)(document,"input",{type:"checkbox",tabindex:-1});i&&s.setAttribute("checked","checked"),s.addEventListener("change",(()=>n(t)));const o=this.toDomElement(e);return o.appendChild(s),o}))}function Te(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("containerElement","span")&&t.item.hasClass("todo-list__label__description"))return t.item}const Se=(0,r.parseKeystroke)("Ctrl+Enter");class _e extends t.Plugin{static get pluginName(){return"TodoListEditing"}static get requires(){return[oe]}init(){const t=this.editor,{editing:e,data:i,model:n}=t;n.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),n.schema.addAttributeCheck(((t,e)=>{const i=t.last;if("todoListChecked"==e&&"listItem"==i.name&&"todo"!=i.getAttribute("listType"))return!1})),t.commands.add("todoList",new Ut(t,"todo"));const s=new Ae(t);var o,l;t.commands.add("checkTodoList",s),t.commands.add("todoListCheck",s),i.downcastDispatcher.on("insert:listItem",function(t){return(e,i,n)=>{const s=n.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent"))return;if("todo"!=i.item.getAttribute("listType"))return;const r=i.item;s.consume(r,"insert"),s.consume(r,"attribute:listType"),s.consume(r,"attribute:listIndent"),s.consume(r,"attribute:todoListChecked");const o=n.writer,l=X(r,n);o.addClass("todo-list",l.parent);const a=o.createContainerElement("label",{class:"todo-list__label"}),c=o.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),d=o.createContainerElement("span",{class:"todo-list__label__description"});r.getAttribute("todoListChecked")&&o.setAttribute("checked","checked",c),o.insert(o.createPositionAt(l,0),a),o.insert(o.createPositionAt(a,0),c),o.insert(o.createPositionAfter(c),d),tt(r,l,n,t)}}(n),{priority:"high"}),i.upcastDispatcher.on("element:input",Ie,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",function(t,e){return(i,n,s)=>{const r=s.consumable;if(!r.test(n.item,"insert")||!r.test(n.item,"attribute:listType")||!r.test(n.item,"attribute:listIndent"))return;if("todo"!=n.item.getAttribute("listType"))return;const o=n.item;r.consume(o,"insert"),r.consume(o,"attribute:listType"),r.consume(o,"attribute:listIndent"),r.consume(o,"attribute:todoListChecked");const l=s.writer,a=X(o,s),c=!!o.getAttribute("todoListChecked"),d=xe(o,l,c,e),u=l.createContainerElement("span",{class:"todo-list__label__description"});l.addClass("todo-list",a.parent),l.insert(l.createPositionAt(a,0),d),l.insert(l.createPositionAfter(d),u),tt(o,a,s,t)}}(n,(t=>this._handleCheckmarkChange(t))),{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",(o=t=>this._handleCheckmarkChange(t),l=e.view,(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const n=i.mapper.toViewElement(e.item),s=i.writer,r=function(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("uiElement","label"))return t.item}(n,l);if("todo"==e.attributeNewValue){const t=!!e.item.getAttribute("todoListChecked"),i=xe(e.item,s,t,o),r=s.createContainerElement("span",{class:"todo-list__label__description"}),l=s.createRangeIn(n),a=rt(n),c=it(l.start),d=a?s.createPositionBefore(a):l.end,u=s.createRange(c,d);s.addClass("todo-list",n.parent),s.move(u,s.createPositionAt(r,0)),s.insert(s.createPositionAt(n,0),i),s.insert(s.createPositionAfter(i),r)}else if("todo"==e.attributeOldValue){const t=Te(n,l);s.removeClass("todo-list",n.parent),s.remove(r),s.move(s.createRangeIn(t),s.createPositionBefore(t)),s.remove(t)}})),e.downcastDispatcher.on("attribute:todoListChecked:listItem",function(t){return(e,i,n)=>{if("todo"!=i.item.getAttribute("listType"))return;if(!n.consumable.consume(i.item,"attribute:todoListChecked"))return;const{mapper:s,writer:r}=n,o=!!i.item.getAttribute("todoListChecked"),l=s.toViewElement(i.item).getChild(0),a=xe(i.item,r,o,t);r.insert(r.createPositionAfter(l),a),r.remove(l)}}((t=>this._handleCheckmarkChange(t)))),e.mapper.on("modelToViewPosition",ke(e.view)),i.mapper.on("modelToViewPosition",ke(e.view)),this.listenTo(e.view.document,"arrowKey",function(t,e){return(i,n)=>{if("left"!=(0,r.getLocalizedArrowKeyCodeDirection)(n.keyCode,e.contentLanguageDirection))return;const s=t.schema,o=t.document.selection;if(!o.isCollapsed)return;const l=o.getFirstPosition(),a=l.parent;if("listItem"===a.name&&"todo"==a.getAttribute("listType")&&l.isAtStart){const e=s.getNearestSelectionRange(t.createPositionBefore(a),"backward");e&&t.change((t=>t.setSelection(e))),n.preventDefault(),n.stopPropagation(),i.stop()}}}(n,t.locale),{context:"li"}),this.listenTo(e.view.document,"keydown",((e,i)=>{(0,r.getCode)(i)===Se&&(t.execute("checkTodoList"),e.stop())}),{priority:"high"});const a=new Set;this.listenTo(n,"applyOperation",((t,e)=>{const i=e[0];if("rename"==i.type&&"listItem"==i.oldName){const t=i.position.nodeAfter;t.hasAttribute("todoListChecked")&&a.add(t)}else if("changeAttribute"==i.type&&"listType"==i.key&&"todo"===i.oldValue)for(const t of i.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&a.add(t)})),n.document.registerPostFixer((t=>{let e=!1;for(const i of a)t.removeAttribute("todoListChecked",i),e=!0;return a.clear(),e}))}_handleCheckmarkChange(t){const e=this.editor,i=e.model,n=Array.from(i.document.selection.getRanges());i.change((i=>{i.setSelection(t,"end"),e.execute("checkTodoList"),i.setSelection(n)}))}}class Ce extends t.Plugin{static get pluginName(){return"TodoListUI"}init(){const t=this.editor.t;st(this.editor,"todoList",t("To-do List"),'')}}var Le=i(250),Ve={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()(Le.Z,Ve);Le.Z.locals;class Ee extends t.Plugin{static get requires(){return[_e,Ce]}static get pluginName(){return"TodoList"}}})(),(window.CKEditor5=window.CKEditor5||{}).list=n})(); \ No newline at end of file + */(()=>{var t={389:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(609),n=i.n(s)()((function(t){return t[1]}));n.push([t.id,".ck.ck-collapsible.ck-collapsible_collapsed>.ck-collapsible__children{display:none}:root{--ck-collapsible-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-collapsible>.ck.ck-button{border-radius:0;color:inherit;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-large);width:100%}.ck.ck-collapsible>.ck.ck-button:focus{background:transparent}.ck.ck-collapsible>.ck.ck-button:active,.ck.ck-collapsible>.ck.ck-button:hover:not(:focus),.ck.ck-collapsible>.ck.ck-button:not(:focus){background:transparent;border-color:transparent;box-shadow:none}.ck.ck-collapsible>.ck.ck-button>.ck-icon{margin-right:var(--ck-spacing-medium);width:var(--ck-collapsible-arrow-size)}.ck.ck-collapsible>.ck-collapsible__children{padding:0 var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}",""]);const r=n},78:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(609),n=i.n(s)()((function(t){return t[1]}));n.push([t.id,".ck-editor__editable .ck-list-bogus-paragraph{display:block}",""]);const r=n},272:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(609),n=i.n(s)()((function(t){return t[1]}));n.push([t.id,".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}",""]);const r=n},543:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(609),n=i.n(s)()((function(t){return t[1]}));n.push([t.id,".ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}",""]);const r=n},657:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(609),n=i.n(s)()((function(t){return t[1]}));n.push([t.id,".ck.ck-list-styles-list{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}",""]);const r=n},250:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(609),n=i.n(s)()((function(t){return t[1]}));n.push([t.id,':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out,background .25s ease-in-out,border .25s ease-in-out;width:100%}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable .todo-list .todo-list__label>input{cursor:pointer}.ck-editor__editable .todo-list .todo-list__label>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}',""]);const r=n},609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,s){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(s)for(var r=0;r{"use strict";var s,n=function(){return void 0===s&&(s=Boolean(window&&document&&document.all&&!window.atob)),s},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),o=[];function l(t){for(var e=-1,i=0;i{t.exports=i(79)("./src/core.js")},492:(t,e,i)=>{t.exports=i(79)("./src/engine.js")},331:(t,e,i)=>{t.exports=i(79)("./src/enter.js")},181:(t,e,i)=>{t.exports=i(79)("./src/typing.js")},273:(t,e,i)=>{t.exports=i(79)("./src/ui.js")},209:(t,e,i)=>{t.exports=i(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={id:s,exports:{}};return t[s](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var s={};(()=>{"use strict";i.r(s),i.d(s,{DocumentList:()=>bt,DocumentListEditing:()=>Q,DocumentListProperties:()=>jt,DocumentListPropertiesEditing:()=>Pt,DocumentListPropertiesUtils:()=>Vt,DocumentListUtils:()=>E,List:()=>de,ListEditing:()=>ae,ListProperties:()=>Ae,ListPropertiesEditing:()=>fe,ListPropertiesUI:()=>Ht,ListUI:()=>gt,ListUtils:()=>Wt,TodoList:()=>ze,TodoListEditing:()=>Le,TodoListUI:()=>Ve});var t=i(704),e=i(181),n=i(331),r=i(209);class o{constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward="forward"==e.direction,this._includeSelf=!!e.includeSelf,this._sameAttributes=(0,r.toArray)(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){const i=new this(t,e)[Symbol.iterator]();return(0,r.first)(i)}*[Symbol.iterator](){const t=[];for(const{node:e}of l(this._getStartNode(),this._isForward?"forward":"backward")){const i=e.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some((t=>e.getAttribute(t)!==this._startElement.getAttribute(t))))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*l(t,e="forward"){const i="forward"==e;let s=null;for(;d(t);)yield{node:t,previous:s},s=t,t=i?t.nextSibling:t.previousSibling}class a{constructor(t){this._listHead=t}[Symbol.iterator](){return l(this._listHead,"forward")}}class c{static next(){return(0,r.uid)()}}function d(t){return!!t&&t.is("element")&&t.hasAttribute("listItemId")}function u(t,e={}){return[...m(t,{...e,direction:"backward"}),...m(t,{...e,direction:"forward"})]}function m(t,e={}){const i="forward"==e.direction,s=Array.from(new o(t,{...e,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?s:s.reverse()}function p(t){const e=new o(t,{sameIndent:!0,sameAttributes:"listType"}),i=new o(t,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward"});return[...Array.from(e).reverse(),...i]}function h(t){return!o.first(t,{sameIndent:!0,sameAttributes:"listItemId"})}function f(t){return!o.first(t,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function g(t,e={}){t=(0,r.toArray)(t);const i=!1!==e.withNested,s=new Set;for(const e of t)for(const t of u(e,{higherIndent:i}))s.add(t);return k(s)}function b(t){t=(0,r.toArray)(t);const e=new Set;for(const i of t)for(const t of p(i))e.add(t);return k(e)}function y(t,e){const i=m(t,{direction:"forward"}),s=c.next();for(const t of i)e.setAttribute("listItemId",s,t);return i}function v(t,e,i){const s={};for(const[t,i]of e.getAttributes())t.startsWith("list")&&(s[t]=i);const n=m(t,{direction:"forward"});for(const t of n)i.setAttributes(s,t);return n}function w(t,e,{expand:i,indentBy:s=1}={}){t=(0,r.toArray)(t);const n=i?g(t):t;for(const t of n){const i=t.getAttribute("listIndent")+s;i<0?A(t,e):e.setAttribute("listIndent",i,t)}return n}function A(t,e){t=(0,r.toArray)(t);for(const i of t)for(const t of i.getAttributeKeys())t.startsWith("list")&&e.removeAttribute(t,i);return t}function I(t){if(!t.length)return!1;const e=t[0].getAttribute("listItemId");return!!e&&!t.some((t=>t.getAttribute("listItemId")!=e))}function k(t){return Array.from(t).filter((t=>"$graveyard"!==t.root.rootName)).sort(((t,e)=>t.index-e.index))}function T(t){const e=t.document.selection.getSelectedElement();return e&&t.schema.isObject(e)&&t.schema.isBlock(e)?e:null}function x(t,e,i){return m(e,{direction:"forward"}).pop().index>t.index?v(t,e,i):[]}class S extends t.Command{constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=_(t.document.selection);t.change((t=>{const i=[];I(e)&&!h(e[0])?("forward"==this._direction&&i.push(...w(e,t)),i.push(...y(e[0],t))):"forward"==this._direction?i.push(...w(e,t,{expand:!0})):i.push(...function(t,e){const i=g(t=(0,r.toArray)(t)),s=new Set,n=Math.min(...i.map((t=>t.getAttribute("listIndent")))),l=new Map;for(const t of i)l.set(t,o.first(t,{lowerIndent:!0}));for(const t of i){if(s.has(t))continue;s.add(t);const i=t.getAttribute("listIndent")-1;if(i<0)A(t,e);else{if(t.getAttribute("listIndent")==n){const i=x(t,l.get(t),e);for(const t of i)s.add(t);if(i.length)continue}e.setAttribute("listIndent",i,t)}}return k(s)}(e,t));for(const e of i){if(!e.hasAttribute("listType"))continue;const i=o.first(e,{sameIndent:!0});i&&t.setAttribute("listType",i.getAttribute("listType"),e)}this._fireAfterExecute(i)}))}_fireAfterExecute(t){this.fire("afterExecute",k(new Set(t)))}_checkEnabled(){let t=_(this.editor.model.document.selection),e=t[0];if(!e)return!1;if("backward"==this._direction)return!0;if(I(t)&&!h(t[0]))return!0;t=g(t),e=t[0];const i=o.first(e,{sameIndent:!0});return!!i&&i.getAttribute("listType")==e.getAttribute("listType")}}function _(t){const e=Array.from(t.getSelectedBlocks()),i=e.findIndex((t=>!d(t)));return-1!=i&&(e.length=i),e}class C extends t.Command{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,s=T(e),n=Array.from(i.selection.getSelectedBlocks()).filter((t=>e.schema.checkAttribute(t,"listType"))),r=void 0!==t.forceValue?!t.forceValue:this.value;e.change((t=>{if(r){const e=n[n.length-1],i=m(e,{direction:"forward"}),s=[];i.length>1&&s.push(...y(i[1],t)),s.push(...A(n,t)),s.push(...function(t,e){const i=[];let s=Number.POSITIVE_INFINITY;for(const{node:n}of l(t.nextSibling,"forward")){const t=n.getAttribute("listIndent");if(0==t)break;t{const{firstElement:r,lastElement:l}=this._getMergeSubjectElements(i,t),a=r.getAttribute("listIndent")||0,c=l.getAttribute("listIndent"),d=l.getAttribute("listItemId");if(a!=c){const t=(u=l,Array.from(new o(u,{direction:"forward",higherIndent:!0})));s.push(...w([l,...t],n,{indentBy:a-c,expand:a{const e=y(this._getStartBlock(),t);this._fireAfterExecute(e)}))}_fireAfterExecute(t){this.fire("afterExecute",k(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&d(e)&&!h(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?t:t.nextSibling}}class E extends t.Plugin{static get pluginName(){return"DocumentListUtils"}expandListBlocksToCompleteList(t){return b(t)}isFirstBlockOfListItem(t){return h(t)}isListItemBlock(t){return d(t)}}var P=i(492);function z(t){return t.is("element","ol")||t.is("element","ul")}function B(t){return t.is("element","li")}function N(t){let e=0,i=t.parent;for(;i;){if(B(i))e++;else{const t=i.previousSibling;t&&B(t)&&e++}i=i.parent}return e}function M(t,e,i,s=O(i,e)){return t.createAttributeElement(F(i),null,{priority:2*e/100-100,id:s})}function D(t,e,i){return t.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:i})}function F(t){return"numbered"==t?"ol":"ul"}function O(t,e){return`list-${t}-${e}`}function R(t,e){const i=t.nodeBefore;if(d(i)){let t=i;for(const{node:i}of l(t,"backward"))if(t=i,e.has(t))return;e.set(i,t)}else{const i=t.nodeAfter;d(i)&&e.set(i,i)}}function H(){return(t,e,i)=>{if(!i.consumable.test(e.viewItem,{name:!0}))return;const s=new P.UpcastWriter(e.viewItem.document);for(const t of Array.from(e.viewItem.getChildren()))B(t)||z(t)||s.remove(t)}}function U(t,e,i){const s=function(t){return(e,i)=>{const s=[];for(const i of t)e.hasAttribute(i)&&s.push(`attribute:${i}`);return!!s.every((t=>!1!==i.test(e,t)))&&(s.forEach((t=>i.consume(e,t))),!0)}}(t);return(n,r,l)=>{const{writer:a,mapper:c,consumable:d}=l,u=r.item;if(!t.includes(r.attributeKey))return;if(!s(u,d))return;const m=function(t,e,i){const s=i.createRangeOn(t),n=e.toViewRange(s).getTrimmed();return n.getContainedElement()}(u,c,i);!function(t,e){let i=t.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const s=i.parent;e.unwrap(e.createRangeOn(t),i),i=s}}(m,a),function(t,e,i,s){if(!t.hasAttribute("listIndent"))return;const n=t.getAttribute("listIndent");let r=t;for(let t=n;t>=0;t--){const n=D(s,t,r.getAttribute("listItemId")),l=M(s,t,r.getAttribute("listType"));for(const t of i)r.hasAttribute(t.attributeName)&&t.setAttributeOnDowncast(s,r.getAttribute(t.attributeName),"list"==t.scope?l:n);if(e=s.wrap(e,n),e=s.wrap(e,l),0==t)break;if(r=o.first(r,{lowerIndent:!0}),!r)break}}(u,a.createRangeOn(m),e,a)}}function j(t,{dataPipeline:e}={}){return(i,{writer:s})=>{if(!q(i,t))return null;if(!e)return s.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const n=s.createContainerElement("p");return s.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}function q(t,e,i=u(t)){if(!d(t))return!1;for(const i of t.getAttributeKeys())if(!i.startsWith("selection:")&&!e.includes(i))return!1;return i.length<2}var K=i(62),Z=i.n(K),$=i(78),W={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()($.Z,W);$.Z.locals;var G=i(272),Y={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()(G.Z,Y);G.Z.locals;const J=["listType","listIndent","listItemId"];class Q extends t.Plugin{constructor(){super(...arguments),this._downcastStrategies=[]}static get pluginName(){return"DocumentListEditing"}static get requires(){return[n.Enter,e.Delete,E]}init(){const t=this.editor,e=t.model;if(t.plugins.has("ListEditing"))throw new r.CKEditorError("document-list-feature-conflict",this,{conflictPlugin:"ListEditing"});e.schema.extend("$container",{allowAttributes:J}),e.schema.extend("$block",{allowAttributes:J}),e.schema.extend("$blockObject",{allowAttributes:J});for(const t of J)e.schema.setAttributeProperties(t,{copyOnReplace:!0});t.commands.add("numberedList",new C(t,"numbered")),t.commands.add("bulletedList",new C(t,"bulleted")),t.commands.add("indentList",new S(t,"forward")),t.commands.add("outdentList",new S(t,"backward")),t.commands.add("mergeListItemBackward",new L(t,"backward")),t.commands.add("mergeListItemForward",new L(t,"forward")),t.commands.add("splitListItemBefore",new V(t,"before")),t.commands.add("splitListItemAfter",new V(t,"after")),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}_getListAttributeNames(){return[...J,...this._downcastStrategies.map((t=>t.attributeName))]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),i=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",((s,n)=>{const r=t.model.document.selection;T(t.model)||t.model.change((()=>{const l=r.getFirstPosition();if(r.isCollapsed&&"backward"==n.direction){if(!l.isAtStart)return;const i=l.parent;if(!d(i))return;if(o.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:X(t.model,"backward")})}else f(i)||t.execute("splitListItemAfter"),t.execute("outdentList");n.preventDefault(),s.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd)return;if(!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:X(t.model,"forward")}),n.preventDefault(),s.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,i=t.commands,s=i.get("enter");this.listenTo(t.editing.view.document,"enter",((i,s)=>{const n=e.document,r=n.selection.getFirstPosition().parent;if(n.selection.isCollapsed&&d(r)&&r.isEmpty&&!s.isSoft){const e=h(r),n=f(r);e&&n?(t.execute("outdentList"),s.preventDefault(),i.stop()):e&&!n?(t.execute("splitListItemAfter"),s.preventDefault(),i.stop()):n&&(t.execute("splitListItemBefore"),s.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(s,"afterExecute",(()=>{const e=i.get("splitListItemBefore");if(e.refresh(),!e.isEnabled)return;2===u(t.model.document.selection.getLastPosition().parent).length&&e.execute()}))}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",((e,i)=>{const s=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(s).isEnabled&&(t.execute(s),i.stopPropagation(),i.preventDefault(),e.stop())}),{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,i=this._getListAttributeNames();t.conversion.for("upcast").elementToElement({view:"li",model:"paragraph"}).add((t=>{t.on("element:li",((t,e,i)=>{const{writer:s,schema:n}=i;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter((t=>n.checkAttribute(t,"listItemId")));if(!r.length)return;const o={listItemId:c.next(),listIndent:N(e.viewItem),listType:e.viewItem.parent&&e.viewItem.parent.is("element","ol")?"numbered":"bulleted"};for(const t of r)d(t)||s.setAttributes(o,t);r.length>1&&r[1].getAttribute("listItemId")!=o.listItemId&&i.keepEmptyElement(r[0])})),t.on("element:ul",H(),{priority:"high"}),t.on("element:ol",H(),{priority:"high"})})),t.conversion.for("editingDowncast").elementToElement({model:"paragraph",view:j(i),converterPriority:"high"}),t.conversion.for("dataDowncast").elementToElement({model:"paragraph",view:j(i,{dataPipeline:!0}),converterPriority:"high"}),t.conversion.for("downcast").add((t=>{t.on("attribute",U(i,this._downcastStrategies,e))})),this.listenTo(e.document,"change:data",function(t,e,i,s){return()=>{const s=t.document.differ.getChanges(),o=[],l=new Map,a=new Set;for(const t of s)if("insert"==t.type&&"$text"!=t.name)R(t.position,l),t.attributes.has("listItemId")?a.add(t.position.nodeAfter):R(t.position.getShiftedBy(t.length),l);else if("remove"==t.type&&t.attributes.has("listItemId"))R(t.position,l);else if("attribute"==t.type){const e=t.range.start.nodeAfter;i.includes(t.attributeKey)?(R(t.range.start,l),null===t.attributeNewValue?(R(t.range.start.getShiftedBy(1),l),r(e)&&o.push(e)):a.add(e)):d(e)&&r(e)&&o.push(e)}for(const t of l.values())o.push(...n(t,a));for(const t of new Set(o))e.reconvertItem(t)};function n(t,e){const s=[],n=new Set,a=[];for(const{node:c,previous:d}of l(t,"forward")){if(n.has(c))continue;const t=c.getAttribute("listIndent");d&&ti.includes(t))));const l=m(c,{direction:"forward"});for(const t of l)n.add(t),(r(t,l)||o(t,a,e))&&s.push(t)}return s}function r(t,s){if(!t.is("element","paragraph"))return!1;const n=e.mapper.toViewElement(t);if(!n)return!1;const r=q(t,i,s);return!(!r||!n.is("element","p"))||!(r||!n.is("element","span"))}function o(t,i,n){if(n.has(t))return!1;const r=e.mapper.toViewElement(t);let o=i.length-1;for(let t=r.parent;!t.is("editableElement");t=t.parent){const e=B(t),n=z(t);if(!n&&!e)continue;const r="checkAttributes:"+(e?"item":"list");if(s.fire(r,{viewElement:t,modelAttributes:i[o]}))break;if(n&&(o--,o<0))return!1}return!0}}(e,t.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",((t,{viewElement:e,modelAttributes:i})=>{e.id!=i.listItemId&&(t.return=!0,t.stop())})),this.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:i})=>{e.name==F(i.listType)&&e.id==O(i.listType,i.listIndent)||(t.return=!0,t.stop())}))}_setupModelPostFixing(){const t=this.editor.model,e=this._getListAttributeNames();t.document.registerPostFixer((i=>function(t,e,i,s){const n=t.document.differ.getChanges(),r=new Map;let o=!1;for(const s of n)if("insert"==s.type&&"$text"!=s.name){const n=s.position.nodeAfter;if(!t.schema.checkAttribute(n,"listItemId"))for(const t of Array.from(n.getAttributeKeys()))i.includes(t)&&(e.removeAttribute(t,n),o=!0);R(s.position,r),s.attributes.has("listItemId")||R(s.position.getShiftedBy(s.length),r);for(const{item:e,previousPosition:i}of t.createRangeIn(n))d(e)&&R(i,r)}else"remove"==s.type?R(s.position,r):"attribute"==s.type&&i.includes(s.attributeKey)&&(R(s.range.start,r),null===s.attributeNewValue&&R(s.range.start.getShiftedBy(1),r));const l=new Set;for(const t of r.values())o=s.fire("postFixer",{listNodes:new a(t),listHead:t,writer:e,seenIds:l})||o;return o}(t,i,e,this))),this.on("postFixer",((t,{listNodes:e,writer:i})=>{t.return=function(t,e){let i=0,s=-1,n=null,r=!1;for(const{node:o}of t){const t=o.getAttribute("listIndent");if(t>i){let l;null===n?(n=t-i,l=i):(n>t&&(n=t),l=t-n),l>s+1&&(l=s+1),e.setAttribute("listIndent",l,o),r=!0,s=l}else n=null,i=t+1,s=t}return r}(e,i)||t.return}),{priority:"high"}),this.on("postFixer",((t,{listNodes:e,writer:i,seenIds:s})=>{t.return=function(t,e,i){const s=new Set;let n=!1;for(const{node:r}of t){if(s.has(r))continue;let t=r.getAttribute("listType"),o=r.getAttribute("listItemId");e.has(o)&&(o=c.next()),e.add(o);for(const e of m(r,{direction:"forward"}))s.add(e),e.getAttribute("listType")!=t&&(o=c.next(),t=e.getAttribute("listType")),e.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,e),n=!0)}return n}(e,s,i)||t.return}),{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model;this.listenTo(t,"insertContent",function(t){return(e,[i,s])=>{const n=i.is("documentFragment")?i.getChild(0):i;if(!d(n))return;let r;r=s?t.createSelection(s):t.document.selection;const o=r.getFirstPosition();let a=null;if(d(o.parent)?a=o.parent:d(o.nodeBefore)&&(a=o.nodeBefore),!a)return;const c=a.getAttribute("listIndent")-n.getAttribute("listIndent");c<=0||t.change((t=>{for(const{node:e}of l(n,"forward"))t.setAttribute("listIndent",e.getAttribute("listIndent")+c,e)}))}}(t),{priority:"high"}),this.listenTo(t,"getSelectedContent",((e,[i])=>{I(Array.from(i.getSelectedBlocks()))&&t.change((t=>A(Array.from(e.return.getChildren()),t)))}))}}function X(t,e){const i=t.document.selection;if(!i.isCollapsed)return!T(t);if("forward"===e)return!0;const s=i.getFirstPosition().parent,n=s.previousSibling;return!t.schema.isObject(n)&&(!!n.isEmpty||I([s,n]))}var tt=i(273);function et(t,e){const i=e.mapper,s=e.writer,n="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=pt,e}(s),o=s.createContainerElement(n,null);return s.insert(s.createPositionAt(o,0),r),i.bindElements(t,r),r}function it(t,e,i,s){const n=e.parent,r=i.mapper,o=i.writer;let l=r.toViewPosition(s.createPositionBefore(t));const a=rt(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),c=t.previousSibling;if(a&&a.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(a);l=o.breakContainer(o.createPositionAfter(t))}else if(c&&"listItem"==c.name){l=r.toViewPosition(s.createPositionAt(c,"end"));const t=r.findMappedViewAncestor(l),e=lt(t);l=e?o.createPositionBefore(e):o.createPositionAt(t,"end")}else l=r.toViewPosition(s.createPositionBefore(t));if(l=nt(l),o.insert(l,n),c&&"listItem"==c.name){const t=r.toViewElement(c),i=o.createRange(o.createPositionAt(t,0),l).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const s=o.breakContainer(o.createPositionBefore(t.item)),n=t.item.parent,r=o.createPositionAt(e,"end");st(o,r.nodeBefore,r.nodeAfter),o.move(o.createRangeOn(n),r),i.position=s}}else{const i=n.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let s=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;s=e}s&&(o.breakContainer(o.createPositionAfter(s)),o.move(o.createRangeOn(s.parent),o.createPositionAt(e,"end")))}}st(o,n,n.nextSibling),st(o,n.previousSibling,n)}function st(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function nt(t){return t.getLastMatchingPosition((t=>t.item.is("uiElement")))}function rt(t,e){const i=!!e.sameIndent,s=!!e.smallerIndent,n=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&n==t||s&&n>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function ot(t,e,i,s){t.ui.componentFactory.add(e,(n=>{const r=t.commands.get(e),o=new tt.ButtonView(n);return o.set({label:i,icon:s,tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",(()=>{t.execute(e),t.editing.view.focus()})),o}))}function lt(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}function at(t,e){const i=[],s=t.parent,n={ignoreElementEnd:!1,startPosition:t,shallow:!0,direction:e},r=s.getAttribute("listIndent"),o=[...new P.TreeWalker(n)].filter((t=>t.item.is("element"))).map((t=>t.item));for(const t of o){if(!t.is("element","listItem"))break;if(t.getAttribute("listIndent")r)){if(t.getAttribute("listType")!==s.getAttribute("listType"))break;if(t.getAttribute("listStyle")!==s.getAttribute("listStyle"))break;if(t.getAttribute("listReversed")!==s.getAttribute("listReversed"))break;if(t.getAttribute("listStart")!==s.getAttribute("listStart"))break;"backward"===e?i.unshift(t):i.push(t)}}return i}function ct(t){let e=[...t.document.selection.getSelectedBlocks()].filter((t=>t.is("element","listItem"))).map((e=>{const i=t.change((t=>t.createPositionAt(e,0)));return[...at(i,"backward"),...at(i,"forward")]})).flat();return e=[...new Set(e)],e}const dt=["disc","circle","square"],ut=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function mt(t){return dt.includes(t)?"bulleted":ut.includes(t)?"numbered":null}function pt(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:P.getFillerOffset.call(this)}const ht='',ft='';class gt extends t.Plugin{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;ot(this.editor,"numberedList",t("Numbered List"),ht),ot(this.editor,"bulletedList",t("Bulleted List"),ft)}}class bt extends t.Plugin{static get requires(){return[Q,gt]}static get pluginName(){return"DocumentList"}}class yt extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){const e=this.editor.model,i=e.document;let s=Array.from(i.selection.getSelectedBlocks()).filter((t=>d(t)&&"numbered"==t.getAttribute("listType")));s=b(s),e.change((e=>{for(const i of s)e.setAttribute("listStart",t>=0?t:1,i)}))}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return e&&d(e)&&"numbered"==e.getAttribute("listType")?e.getAttribute("listStart"):null}}const vt={},wt={},At={},It=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:t,typeAttribute:e,listType:i}of It)vt[t]=i,wt[t]=e,e&&(At[e]=t);function kt(){return It.map((t=>t.listStyle))}function Tt(t){return vt[t]||null}function xt(t){return At[t]||null}function St(t){return wt[t]||null}class _t extends t.Command{constructor(t,e,i){super(t),this.defaultType=e,this._supportedTypes=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document;e.change((e=>{this._tryToConvertItemsToList(t);let s=Array.from(i.selection.getSelectedBlocks()).filter((t=>t.hasAttribute("listType")));if(s.length){s=b(s);for(const i of s)e.setAttribute("listStyle",t.type||this.defaultType,i)}}))}isStyleTypeSupported(t){return!this._supportedTypes||this._supportedTypes.includes(t)}_getValue(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());return d(t)?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=Tt(t.type);if(!e)return;const i=this.editor,s=`${e}List`;i.commands.get(s).value||i.execute(s)}}class Ct extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=e.document;let s=Array.from(i.selection.getSelectedBlocks()).filter((t=>d(t)&&"numbered"==t.getAttribute("listType")));s=b(s),e.change((e=>{for(const i of s)e.setAttribute("listReversed",!!t.reversed,i)}))}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return d(e)&&"numbered"==e.getAttribute("listType")?e.getAttribute("listReversed"):null}}function Lt(t){return(e,i,s)=>{const{writer:n,schema:r,consumable:o}=s;if(!1===o.test(i.viewItem,t.viewConsumables))return;i.modelRange||Object.assign(i,s.convertChildren(i.viewItem,i.modelCursor));let l=!1;for(const e of i.modelRange.getItems({shallow:!0}))r.checkAttribute(e,t.attributeName)&&t.appliesToListItem(e)&&(e.hasAttribute(t.attributeName)||(n.setAttribute(t.attributeName,t.getAttributeOnUpcast(i.viewItem),e),l=!0));l&&o.consume(i.viewItem,t.viewConsumables)}}class Vt extends t.Plugin{static get pluginName(){return"DocumentListPropertiesUtils"}getAllSupportedStyleTypes(){return kt()}getListTypeFromListStyleType(t){return Tt(t)}getListStyleTypeFromTypeAttribute(t){return xt(t)}getTypeAttributeFromListStyleType(t){return St(t)}}const Et="default";class Pt extends t.Plugin{static get requires(){return[Q,Vt]}static get pluginName(){return"DocumentListPropertiesEditing"}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,e=t.model,i=t.plugins.get(Q),s=function(t){const e=[];if(t.styles){const i="object"==typeof t.styles&&t.styles.useAttribute;e.push({attributeName:"listStyle",defaultValue:Et,viewConsumables:{styles:"list-style-type"},addCommand(t){let e=kt();i&&(e=e.filter((t=>!!St(t)))),t.commands.add("listStyle",new _t(t,Et,e))},appliesToListItem:()=>!0,hasValidAttribute(t){if(!t.hasAttribute("listStyle"))return!1;const e=t.getAttribute("listStyle");return e==Et||Tt(e)==t.getAttribute("listType")},setAttributeOnDowncast(t,e,s){if(e&&e!==Et){if(!i)return void t.setStyle("list-style-type",e,s);{const i=St(e);if(i)return void t.setAttribute("type",i,s)}}t.removeStyle("list-style-type",s),t.removeAttribute("type",s)},getAttributeOnUpcast(t){const e=t.getStyle("list-style-type");if(e)return e;const i=t.getAttribute("type");return i?xt(i):Et}})}t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(t){t.commands.add("listReversed",new Ct(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listReversed")},setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(t){t.commands.add("listStart",new yt(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listStart")},setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));for(const n of s)n.addCommand(t),e.schema.extend("$container",{allowAttributes:n.attributeName}),e.schema.extend("$block",{allowAttributes:n.attributeName}),e.schema.extend("$blockObject",{allowAttributes:n.attributeName}),i.registerDowncastStrategy({scope:"list",attributeName:n.attributeName,setAttributeOnDowncast(t,e,i){n.setAttributeOnDowncast(t,e,i)}});t.conversion.for("upcast").add((t=>{for(const e of s)t.on("element:ol",Lt(e)),t.on("element:ul",Lt(e))})),i.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:i})=>{for(const n of s)n.getAttributeOnUpcast(e)!=i[n.attributeName]&&(t.return=!0,t.stop())})),this.listenTo(t.commands.get("indentList"),"afterExecute",((t,i)=>{e.change((t=>{for(const e of i)for(const i of s)i.appliesToListItem(e)&&t.setAttribute(i.attributeName,i.defaultValue,e)}))})),i.on("postFixer",((t,{listNodes:e,writer:i})=>{for(const{node:n}of e)for(const e of s)e.hasValidAttribute(n)||(e.appliesToListItem(n)?i.setAttribute(e.attributeName,e.defaultValue,n):i.removeAttribute(e.attributeName,n),t.return=!0)})),i.on("postFixer",((t,{listNodes:e,writer:i})=>{const n=[];for(const{node:r,previous:o}of e){if(!o)continue;const e=r.getAttribute("listIndent"),l=o.getAttribute("listIndent");let a=null;if(e>l?n[l]=o:e'}),t.extendTemplate({attributes:{"aria-expanded":e.to("isOn",(t=>String(t)))}}),t.bind("label").to(this),t.bind("isOn").to(this,"isCollapsed",(t=>!t)),t.on("execute",(()=>{this.isCollapsed=!this.isCollapsed})),t}}var Mt=i(543),Dt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()(Mt.Z,Dt);Mt.Z.locals;class Ft extends tt.View{constructor(t,{enabledProperties:e,styleButtonViews:i,styleGridAriaLabel:s}){super(t),this.stylesView=null,this.additionalPropertiesCollapsibleView=null,this.startIndexFieldView=null,this.reversedSwitchButtonView=null,this.focusTracker=new r.FocusTracker,this.keystrokes=new r.KeystrokeHandler,this.focusables=new tt.ViewCollection;const n=["ck","ck-list-properties"];this.children=this.createCollection(),this.focusCycler=new tt.FocusCycler({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),e.styles?(this.stylesView=this._createStylesView(i,s),this.children.add(this.stylesView)):n.push("ck-list-properties_without-styles"),(e.startIndex||e.reversed)&&(this._addNumberedListPropertyViews(e),n.push("ck-list-properties_with-numbered-properties")),this.setTemplate({tag:"div",attributes:{class:n},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element),(this.startIndexFieldView||this.reversedSwitchButtonView)&&(this.focusables.add(this.children.last.buttonView),this.focusTracker.add(this.children.last.buttonView.element));for(const t of this.stylesView.children)this.stylesView.focusTracker.add(t.element);(0,tt.addKeyboardHandlingForGrid)({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>r.global.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView),this.focusTracker.add(this.startIndexFieldView.element),this.listenTo(this.startIndexFieldView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"});const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}this.reversedSwitchButtonView&&(this.focusables.add(this.reversedSwitchButtonView),this.focusTracker.add(this.reversedSwitchButtonView.element)),this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createStylesView(t,e){const i=new tt.View(this.locale);return i.children=i.createCollection(),i.children.addMany(t),i.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-list-styles-list"]},children:i.children}),i.children.delegate("execute").to(this),i.focus=function(){this.children.first.focus()},i.focusTracker=new r.FocusTracker,i.keystrokes=new r.KeystrokeHandler,i.render(),i.keystrokes.listenTo(i.element),i}_addNumberedListPropertyViews(t){const e=this.locale.t,i=[];t.startIndex&&(this.startIndexFieldView=this._createStartIndexField(),i.push(this.startIndexFieldView)),t.reversed&&(this.reversedSwitchButtonView=this._createReversedSwitchButton(),i.push(this.reversedSwitchButtonView)),t.styles?(this.additionalPropertiesCollapsibleView=new Nt(this.locale,i),this.additionalPropertiesCollapsibleView.set({label:e("List properties"),isCollapsed:!0}),this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(i,"isEnabled",((...t)=>t.some((t=>t)))),this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",((t,e,i)=>{i||(this.additionalPropertiesCollapsibleView.isCollapsed=!0)})),this.children.add(this.additionalPropertiesCollapsibleView)):this.children.addMany(i)}_createStartIndexField(){const t=this.locale.t,e=new tt.LabeledFieldView(this.locale,tt.createLabeledInputNumber);return e.set({label:t("Start at"),class:"ck-numbered-list-properties__start-index"}),e.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"}),e.fieldView.on("input",(()=>{const i=e.fieldView.element,s=i.valueAsNumber;Number.isNaN(s)||(i.checkValidity()?this.fire("listStart",{startIndex:s}):e.errorText=t("Start index must be greater than 0."))})),e}_createReversedSwitchButton(){const t=this.locale.t,e=new tt.SwitchButtonView(this.locale);return e.set({withText:!0,label:t("Reversed order"),class:"ck-numbered-list-properties__reversed-order"}),e.delegate("execute").to(this,"listReversed"),e}}var Ot=i(657),Rt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()(Ot.Z,Rt);Ot.Z.locals;class Ht extends t.Plugin{static get pluginName(){return"ListPropertiesUI"}init(){const t=this.editor,e=t.locale.t,i=t.config.get("list.properties");i.styles&&t.ui.componentFactory.add("bulletedList",Ut({editor:t,parentCommandName:"bulletedList",buttonLabel:e("Bulleted List"),buttonIcon:ft,styleGridAriaLabel:e("Bulleted list styles toolbar"),styleDefinitions:[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:''},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:''},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:''}]})),(i.styles||i.startIndex||i.reversed)&&t.ui.componentFactory.add("numberedList",Ut({editor:t,parentCommandName:"numberedList",buttonLabel:e("Numbered List"),buttonIcon:ht,styleGridAriaLabel:e("Numbered list styles toolbar"),styleDefinitions:[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:''},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:''},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:''},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:''},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:''},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:''}]}))}}function Ut({editor:t,parentCommandName:e,buttonLabel:i,buttonIcon:s,styleGridAriaLabel:n,styleDefinitions:r}){const o=t.commands.get(e);return l=>{const a=(0,tt.createDropdown)(l,tt.SplitButtonView),c=a.buttonView;return a.bind("isEnabled").to(o),a.class="ck-list-styles-dropdown",c.on("execute",(()=>{t.execute(e),t.editing.view.focus()})),c.set({label:i,icon:s,tooltip:!0,isToggleable:!0}),c.bind("isOn").to(o,"value",(t=>!!t)),a.once("change:isOpen",(()=>{const i=function({editor:t,dropdownView:e,parentCommandName:i,styleDefinitions:s,styleGridAriaLabel:n}){const r=t.locale,o=t.config.get("list.properties");let l=null;"numberedList"!=i&&(o.startIndex=!1,o.reversed=!1);if(o.styles){const e=t.commands.get("listStyle"),n=function({editor:t,listStyleCommand:e,parentCommandName:i}){const s=t.locale,n=t.commands.get(i);return({label:i,type:r,icon:o,tooltip:l})=>{const a=new tt.ButtonView(s);return a.set({label:i,icon:o,tooltip:l}),e.on("change:value",(()=>{a.isOn=e.value===r})),a.on("execute",(()=>{n.value?e.value!==r?t.execute("listStyle",{type:r}):t.execute("listStyle",{type:e.defaultType}):t.model.change((()=>{t.execute("listStyle",{type:r})}))})),a}}({editor:t,parentCommandName:i,listStyleCommand:e}),r="function"==typeof e.isStyleTypeSupported?t=>e.isStyleTypeSupported(t.type):()=>!0;l=s.filter(r).map(n)}const a=new Ft(r,{styleGridAriaLabel:n,enabledProperties:o,styleButtonViews:l});o.styles&&(0,tt.focusChildOnDropdownOpen)(e,(()=>a.stylesView.children.find((t=>t.isOn))));if(o.startIndex){const e=t.commands.get("listStart");a.startIndexFieldView.bind("isEnabled").to(e),a.startIndexFieldView.fieldView.bind("value").to(e),a.on("listStart",((e,i)=>t.execute("listStart",i)))}if(o.reversed){const e=t.commands.get("listReversed");a.reversedSwitchButtonView.bind("isEnabled").to(e),a.reversedSwitchButtonView.bind("isOn").to(e,"value",(t=>!!t)),a.on("listReversed",(()=>{const i=e.value;t.execute("listReversed",{reversed:!i})}))}return a.delegate("execute").to(e),a}({editor:t,dropdownView:a,parentCommandName:e,styleGridAriaLabel:n,styleDefinitions:r});a.panelView.children.add(i)})),a.on("execute",(()=>{t.editing.view.focus()})),a}}class jt extends t.Plugin{static get requires(){return[Pt,Ht]}static get pluginName(){return"DocumentListProperties"}}class qt extends t.Command{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,s=Array.from(i.selection.getSelectedBlocks()).filter((t=>Zt(t,e.schema))),n=void 0!==t.forceValue?!t.forceValue:this.value;e.change((t=>{if(n){let e=s[s.length-1].nextSibling,i=Number.POSITIVE_INFINITY,n=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t=i;)r>n.getAttribute("listIndent")&&(r=n.getAttribute("listIndent")),n.getAttribute("listIndent")==r&&t[e?"unshift":"push"](n),n=n[e?"previousSibling":"nextSibling"]}}function Zt(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class $t extends t.Command{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change((t=>{const e=i[i.length-1];let s=e.nextSibling;for(;s&&"listItem"==s.name&&s.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(s),s=s.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)}))}_checkEnabled(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let s=t.previousSibling;for(;s&&s.is("element","listItem")&&s.getAttribute("listIndent")>=e;){if(s.getAttribute("listIndent")==e)return s.getAttribute("listType")==i;s=s.previousSibling}return!1}return!0}}class Wt extends t.Plugin{static get pluginName(){return"ListUtils"}getListTypeFromListStyleType(t){return mt(t)}getSelectedListItems(t){return ct(t)}getSiblingNodes(t,e){return at(t,e)}}function Gt(t){return(e,i,s)=>{const n=s.consumable;if(!n.test(i.item,"insert")||!n.test(i.item,"attribute:listType")||!n.test(i.item,"attribute:listIndent"))return;n.consume(i.item,"insert"),n.consume(i.item,"attribute:listType"),n.consume(i.item,"attribute:listIndent");const r=i.item;it(r,et(r,s),s,t)}}const Yt=(t,e,i)=>{if(!i.consumable.test(e.item,t.name))return;const s=i.mapper.toViewElement(e.item),n=i.writer;n.breakContainer(n.createPositionBefore(s)),n.breakContainer(n.createPositionAfter(s));const r=s.parent,o="numbered"==e.attributeNewValue?"ol":"ul";n.rename(o,r)},Jt=(t,e,i)=>{i.consumable.consume(e.item,t.name);const s=i.mapper.toViewElement(e.item).parent,n=i.writer;st(n,s,s.nextSibling),st(n,s.previousSibling,s)};const Qt=(t,e,i)=>{if(i.consumable.test(e.item,t.name)&&"listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const s=i.writer,n=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=s.breakContainer(t),"li"==t.parent.name);){const e=t,i=s.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=s.remove(s.createRange(e,i));n.push(t)}t=s.createPositionAfter(t.parent)}if(n.length>0){for(let e=0;e0){const e=st(s,i,i.nextSibling);e&&e.parent==i&&t.offset--}}st(s,t.nodeBefore,t.nodeAfter)}}},Xt=(t,e,i)=>{const s=i.mapper.toViewPosition(e.position),n=s.nodeBefore,r=s.nodeAfter;st(i.writer,n,r)},te=(t,e,i)=>{if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,s=t.createElement("listItem"),n=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",n,s);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,s),!i.safeInsert(s,e.modelCursor))return;const o=function(t,e,i){const{writer:s,schema:n}=i;let r=s.createPositionAfter(t);for(const o of e)if("ul"==o.name||"ol"==o.name)r=i.convertItem(o,r).modelCursor;else{const e=i.convertItem(o,s.createPositionAt(t,"end")),l=e.modelRange.start.nodeAfter;l&&l.is("element")&&!n.checkChild(t,l.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:re(e.modelCursor),r=s.createPositionAfter(t))}return r}(s,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,o),i.updateConversionResult(s,e)}},ee=(t,e,i)=>{if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||le(e))&&e._remove()}}},ie=(t,e,i)=>{if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1;for(const e of t)i&&!le(e)&&e._remove(),le(e)&&(i=!0)}};function se(t){return(e,i)=>{if(i.isPhantom)return;const s=i.modelPosition.nodeBefore;if(s&&s.is("element","listItem")){const e=i.mapper.toViewElement(s),n=e.getAncestors().find(le),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==n){i.viewPosition=t.nextPosition;break}}}}}const ne=function(t,[e,i,s]){const n=this;let r,o=e.is("documentFragment")?e.getChild(0):e;if(r=i?n.createSelection(i,s):n.document.selection,o&&o.is("element","listItem")){const t=r.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;o&&o.is("element","listItem");)o._setAttribute("listIndent",o.getAttribute("listIndent")+t),o=o.nextSibling}}};function re(t){const e=new P.TreeWalker({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function oe(t,e,i,s,n,r){const o=rt(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t}),l=n.mapper,a=n.writer,c=o?o.getAttribute("listIndent"):null;let d;if(o)if(c==t){const t=l.toViewElement(o).parent;d=a.createPositionAfter(t)}else{const t=r.createPositionAt(o,"end");d=l.toViewPosition(t)}else d=i;d=nt(d);for(const t of[...s.getChildren()])le(t)&&(d=a.move(a.createRangeOn(t),d).end,st(a,t,t.nextSibling),st(a,t.previousSibling,t))}function le(t){return t.is("element","ol")||t.is("element","ul")}class ae extends t.Plugin{static get pluginName(){return"ListEditing"}static get requires(){return[n.Enter,e.Delete,Wt]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var s;t.model.document.registerPostFixer((e=>function(t,e){const i=t.document.differ.getChanges(),s=new Map;let n=!1;for(const s of i)if("insert"==s.type&&"listItem"==s.name)r(s.position);else if("insert"==s.type&&"listItem"!=s.name){if("$text"!=s.name){const i=s.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),n=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),n=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),n=!0),i.hasAttribute("listReversed")&&(e.removeAttribute("listReversed",i),n=!0),i.hasAttribute("listStart")&&(e.removeAttribute("listStart",i),n=!0);for(const e of Array.from(t.createRangeIn(i)).filter((t=>t.item.is("element","listItem"))))r(e.previousPosition)}r(s.position.getShiftedBy(s.length))}else"remove"==s.type&&"listItem"==s.name?r(s.position):("attribute"==s.type&&"listIndent"==s.attributeKey||"attribute"==s.type&&"listType"==s.attributeKey)&&r(s.range.start);for(const t of s.values())o(t),l(t);return n;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(s.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,s.has(t))return;s.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&s.set(e,e)}}function o(t){let i=0,s=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>i){let o;null===s?(s=r-i,o=i):(s>r&&(s=r),o=r-s),e.setAttribute("listIndent",o,t),n=!0}else s=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function l(t){let i=[],s=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(s&&s.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const s=i[r];t.getAttribute("listType")!=s&&(e.setAttribute("listType",s,t),n=!0)}else i[r]=t.getAttribute("listType");s=t,t=t.nextSibling}}}(t.model,e))),i.mapper.registerViewToModelLength("li",ce),e.mapper.registerViewToModelLength("li",ce),i.mapper.on("modelToViewPosition",se(i.view)),i.mapper.on("viewToModelPosition",(s=t.model,(t,e)=>{const i=e.viewPosition,n=i.parent,r=e.mapper;if("ul"==n.name||"ol"==n.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),n=r.getModelLength(i.nodeBefore);e.modelPosition=s.createPositionBefore(t).getShiftedBy(n)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=s.createPositionBefore(t)}t.stop()}else if("li"==n.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const o=r.toModelElement(n);let l=1,a=i.nodeBefore;for(;a&&le(a);)l+=r.getModelLength(a),a=a.previousSibling;e.modelPosition=s.createPositionBefore(o).getShiftedBy(l),t.stop()}})),e.mapper.on("modelToViewPosition",se(i.view)),t.conversion.for("editingDowncast").add((e=>{e.on("insert",Qt,{priority:"high"}),e.on("insert:listItem",Gt(t.model)),e.on("attribute:listType:listItem",Yt,{priority:"high"}),e.on("attribute:listType:listItem",Jt,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,s)=>{if(!s.consumable.consume(i.item,"attribute:listIndent"))return;const n=s.mapper.toViewElement(i.item),r=s.writer;r.breakContainer(r.createPositionBefore(n)),r.breakContainer(r.createPositionAfter(n));const o=n.parent,l=o.previousSibling,a=r.createRangeOn(o);r.remove(a),l&&l.nextSibling&&st(r,l,l.nextSibling),oe(i.attributeOldValue+1,i.range.start,a.start,n,s,t),it(i.item,n,s,t);for(const t of i.item.getChildren())s.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,s)=>{const n=s.mapper.toViewPosition(i.position).getLastMatchingPosition((t=>!t.item.is("element","li"))).nodeAfter,r=s.writer;r.breakContainer(r.createPositionBefore(n)),r.breakContainer(r.createPositionAfter(n));const o=n.parent,l=o.previousSibling,a=r.createRangeOn(o),c=r.remove(a);l&&l.nextSibling&&st(r,l,l.nextSibling),oe(s.mapper.toModelElement(n).getAttribute("listIndent")+1,i.position,a.start,n,s,t);for(const t of r.createRangeIn(c).getItems())s.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",Xt,{priority:"low"})})),t.conversion.for("dataDowncast").add((e=>{e.on("insert",Qt,{priority:"high"}),e.on("insert:listItem",Gt(t.model))})),t.conversion.for("upcast").add((t=>{t.on("element:ul",ee,{priority:"high"}),t.on("element:ol",ee,{priority:"high"}),t.on("element:li",ie,{priority:"high"}),t.on("element:li",te)})),t.model.on("insertContent",ne,{priority:"high"}),t.commands.add("numberedList",new qt(t,"numbered")),t.commands.add("bulletedList",new qt(t,"bulleted")),t.commands.add("indentList",new $t(t,"forward")),t.commands.add("outdentList",new $t(t,"backward"));const n=i.view.document;this.listenTo(n,"enter",((t,e)=>{const i=this.editor.model.document,s=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==s.name&&s.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(n,"delete",((t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const s=i.getFirstPosition();if(!s.isAtStart)return;const n=s.parent;if("listItem"!==n.name)return;n.previousSibling&&"listItem"===n.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(t.editing.view.document,"tab",((e,i)=>{const s=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(s).isEnabled&&(t.execute(s),i.stopPropagation(),i.preventDefault(),e.stop())}),{context:"li"})}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function ce(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=ce(t);return e}class de extends t.Plugin{static get requires(){return[ae,gt]}static get pluginName(){return"List"}}class ue extends t.Command{constructor(t,e){super(t),this.defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);const e=this.editor.model,i=ct(e);i.length&&e.change((e=>{for(const s of i)e.setAttribute("listStyle",t.type||this.defaultType,s)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=mt(t.type);if(!e)return;const i=this.editor,s=`${e}List`;i.commands.get(s).value||i.execute(s)}}class me extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=ct(e).filter((t=>"numbered"==t.getAttribute("listType")));e.change((e=>{for(const s of i)e.setAttribute("listReversed",!!t.reversed,s)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listReversed"):null}}class pe extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){const e=this.editor.model,i=ct(e).filter((t=>"numbered"==t.getAttribute("listType")));e.change((e=>{for(const s of i)e.setAttribute("listStart",t>=0?t:1,s)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listStart"):null}}const he="default";class fe extends t.Plugin{static get requires(){return[ae]}static get pluginName(){return"ListPropertiesEditing"}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,e=t.model,i=function(t){const e=[];t.styles&&e.push({attributeName:"listStyle",defaultValue:he,addCommand(t){t.commands.add("listStyle",new ue(t,he))},appliesToListItem:()=>!0,setAttributeOnDowncast(t,e,i){e&&e!==he?t.setStyle("list-style-type",e,i):t.removeStyle("list-style-type",i)},getAttributeOnUpcast:t=>t.getStyle("list-style-type")||he});t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,addCommand(t){t.commands.add("listReversed",new me(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,addCommand(t){t.commands.add("listStart",new pe(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));e.schema.extend("listItem",{allowAttributes:i.map((t=>t.attributeName))});for(const e of i)e.addCommand(t);var s;this.listenTo(t.commands.get("indentList"),"_executeCleanup",function(t,e){return(i,s)=>{const n=s[0],r=n.getAttribute("listIndent"),o=s.filter((t=>t.getAttribute("listIndent")===r));let l=null;n.previousSibling.getAttribute("listIndent")+1!==r&&(l=rt(n.previousSibling,{sameIndent:!0,direction:"backward",listIndent:r})),t.model.change((t=>{for(const i of o)for(const s of e)if(s.appliesToListItem(i)){const e=null==l?s.defaultValue:l.getAttribute(s.attributeName);t.setAttribute(s.attributeName,e,i)}}))}}(t,i)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",function(t,e){return(i,s)=>{if(!(s=s.reverse().filter((t=>t.is("element","listItem")))).length)return;const n=s[0].getAttribute("listIndent"),r=s[0].getAttribute("listType");let o=s[0].previousSibling;if(o.is("element","listItem"))for(;o.getAttribute("listIndent")!==n;)o=o.previousSibling;else o=null;o||(o=s[s.length-1].nextSibling),o&&o.is("element","listItem")&&o.getAttribute("listType")===r&&t.model.change((t=>{const i=s.filter((t=>t.getAttribute("listIndent")===n));for(const s of i)for(const i of e)if(i.appliesToListItem(s)){const e=i.attributeName,n=o.getAttribute(e);t.setAttribute(e,n,s)}}))}}(t,i)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",ye(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",ye(t)),e.document.registerPostFixer(function(t,e){return i=>{let s=!1;const n=ve(t.model.document.differ.getChanges()).filter((t=>"todo"!==t.getAttribute("listType")));if(!n.length)return s;let r=n[n.length-1].nextSibling;if((!r||!r.is("element","listItem"))&&(r=n[0].previousSibling,r)){const t=n[0].getAttribute("listIndent");for(;r.is("element","listItem")&&r.getAttribute("listIndent")!==t&&(r=r.previousSibling,r););}for(const t of e){const e=t.attributeName;for(const o of n)if(t.appliesToListItem(o))if(o.hasAttribute(e)){const n=o.previousSibling;be(n,o,t.attributeName)&&(i.setAttribute(e,n.getAttribute(e),o),s=!0)}else ge(r,o,t)?i.setAttribute(e,r.getAttribute(e),o):i.setAttribute(e,t.defaultValue,o),s=!0;else i.removeAttribute(e,o)}return s}}(t,i)),t.conversion.for("upcast").add((s=i,t=>{t.on("element:li",((t,e,i)=>{const n=e.viewItem.parent,r=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;for(const t of s)if(t.appliesToListItem(r)){const e=t.getAttributeOnUpcast(n);i.writer.setAttribute(t.attributeName,e,r)}}),{priority:"low"})})),t.conversion.for("downcast").add(function(t){return i=>{for(const s of t)i.on(`attribute:${s.attributeName}:listItem`,((t,i,n)=>{const r=n.writer,o=i.item,l=rt(o.previousSibling,{sameIndent:!0,listIndent:o.getAttribute("listIndent"),direction:"backward"}),a=n.mapper.toViewElement(o);e(o,l)||r.breakContainer(r.createPositionBefore(a)),s.setAttributeOnDowncast(r,i.attributeNewValue,a.parent)}),{priority:"low"})};function e(t,e){return e&&t.getAttribute("listType")===e.getAttribute("listType")&&t.getAttribute("listIndent")===e.getAttribute("listIndent")&&t.getAttribute("listStyle")===e.getAttribute("listStyle")&&t.getAttribute("listReversed")===e.getAttribute("listReversed")&&t.getAttribute("listStart")===e.getAttribute("listStart")}}(i)),this._mergeListAttributesWhileMergingLists(i)}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(function(t){return e=>{const i=ve(t.model.document.differ.getChanges()).filter((t=>"todo"===t.getAttribute("listType")&&(t.hasAttribute("listStyle")||t.hasAttribute("listReversed")||t.hasAttribute("listStart"))));if(!i.length)return!1;for(const t of i)e.removeAttribute("listStyle",t),e.removeAttribute("listReversed",t),e.removeAttribute("listStart",t);return!0}}(t))}_mergeListAttributesWhileMergingLists(t){const e=this.editor.model;let i;this.listenTo(e,"deleteContent",((t,[e])=>{const s=e.getFirstPosition(),n=e.getLastPosition();if(s.parent===n.parent)return;if(!s.parent.is("element","listItem"))return;const r=n.parent.nextSibling;if(!r||!r.is("element","listItem"))return;const o=rt(s.parent,{sameIndent:!0,listIndent:r.getAttribute("listIndent")});o&&o.getAttribute("listType")===r.getAttribute("listType")&&(i=o)}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{i&&(e.change((e=>{const s=rt(i.nextSibling,{sameIndent:!0,listIndent:i.getAttribute("listIndent"),direction:"forward"});if(!s)return void(i=null);const n=[s,...at(e.createPositionAt(s,0),"forward")];for(const s of n)for(const n of t)if(n.appliesToListItem(s)){const t=n.attributeName,r=i.getAttribute(t);e.setAttribute(t,r,s)}})),i=null)}),{priority:"low"})}}function ge(t,e,i){if(!t)return!1;const s=t.getAttribute(i.attributeName);return!!s&&(s!=i.defaultValue&&t.getAttribute("listType")===e.getAttribute("listType"))}function be(t,e,i){if(!t||!t.is("element","listItem"))return!1;if(e.getAttribute("listType")!==t.getAttribute("listType"))return!1;const s=t.getAttribute("listIndent");if(s<1||s!==e.getAttribute("listIndent"))return!1;const n=t.getAttribute(i);return!(!n||n===e.getAttribute(i))}function ye(t){return(e,i)=>{i=i.filter((t=>t.is("element","listItem"))),t.model.change((t=>{for(const e of i)t.removeAttribute("listStyle",e)}))}}function ve(t){const e=[];for(const i of t){const t=we(i);t&&t.is("element","listItem")&&e.push(t)}return e}function we(t){return"attribute"===t.type?t.range.start.nodeAfter:"insert"===t.type?t.position.nodeAfter:null}class Ae extends t.Plugin{static get requires(){return[fe,Ht]}static get pluginName(){return"ListProperties"}}const Ie="todoListChecked";class ke extends t.Command{constructor(t){super(t),this._selectedElements=[],this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every((t=>!!t.getAttribute(Ie))),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),s=i.start.parent,n=[];e.checkAttribute(s,Ie)&&n.push(s);for(const t of i.getItems())e.checkAttribute(t,Ie)&&!n.includes(t)&&n.push(t);return n}execute(t={}){this.editor.model.change((e=>{for(const i of this._selectedElements){(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute(Ie,!0,i):e.removeAttribute(Ie,i)}}))}}const Te=(t,e,i)=>{const s=e.modelCursor,n=s.parent,r=e.viewItem;if("checkbox"!=r.getAttribute("type")||"listItem"!=n.name||!s.isAtStart)return;if(!i.consumable.consume(r,{name:!0}))return;const o=i.writer;o.setAttribute("listType","todo",n),e.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,n),e.modelRange=o.createRange(s)};function xe(t){return(e,i)=>{const s=i.modelPosition,n=s.parent;if(!n.is("element","listItem")||"todo"!=n.getAttribute("listType"))return;const r=_e(i.mapper.toViewElement(n),t);r&&(i.viewPosition=i.mapper.findPositionIn(r,s.offset))}}function Se(t,e,i,s){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},(function(e){const n=(0,r.createElement)(document,"input",{type:"checkbox",tabindex:"-1"});i&&n.setAttribute("checked","checked"),n.addEventListener("change",(()=>s(t)));const o=this.toDomElement(e);return o.appendChild(n),o}))}function _e(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("containerElement","span")&&t.item.hasClass("todo-list__label__description"))return t.item}const Ce=(0,r.parseKeystroke)("Ctrl+Enter");class Le extends t.Plugin{static get pluginName(){return"TodoListEditing"}static get requires(){return[ae]}init(){const t=this.editor,{editing:e,data:i,model:s}=t;s.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),s.schema.addAttributeCheck(((t,e)=>{const i=t.last;if("todoListChecked"==e&&"listItem"==i.name&&"todo"!=i.getAttribute("listType"))return!1})),t.commands.add("todoList",new qt(t,"todo"));const n=new ke(t);var o,l;t.commands.add("checkTodoList",n),t.commands.add("todoListCheck",n),i.downcastDispatcher.on("insert:listItem",function(t){return(e,i,s)=>{const n=s.consumable;if(!n.test(i.item,"insert")||!n.test(i.item,"attribute:listType")||!n.test(i.item,"attribute:listIndent"))return;if("todo"!=i.item.getAttribute("listType"))return;const r=i.item;n.consume(r,"insert"),n.consume(r,"attribute:listType"),n.consume(r,"attribute:listIndent"),n.consume(r,"attribute:todoListChecked");const o=s.writer,l=et(r,s);o.addClass("todo-list",l.parent);const a=o.createContainerElement("label",{class:"todo-list__label"}),c=o.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),d=o.createContainerElement("span",{class:"todo-list__label__description"});r.getAttribute("todoListChecked")&&o.setAttribute("checked","checked",c),o.insert(o.createPositionAt(l,0),a),o.insert(o.createPositionAt(a,0),c),o.insert(o.createPositionAfter(c),d),it(r,l,s,t)}}(s),{priority:"high"}),i.upcastDispatcher.on("element:input",Te,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",function(t,e){return(i,s,n)=>{const r=n.consumable;if(!r.test(s.item,"insert")||!r.test(s.item,"attribute:listType")||!r.test(s.item,"attribute:listIndent"))return;if("todo"!=s.item.getAttribute("listType"))return;const o=s.item;r.consume(o,"insert"),r.consume(o,"attribute:listType"),r.consume(o,"attribute:listIndent"),r.consume(o,"attribute:todoListChecked");const l=n.writer,a=et(o,n),c=!!o.getAttribute("todoListChecked"),d=Se(o,l,c,e),u=l.createContainerElement("span",{class:"todo-list__label__description"});l.addClass("todo-list",a.parent),l.insert(l.createPositionAt(a,0),d),l.insert(l.createPositionAfter(d),u),it(o,a,n,t)}}(s,(t=>this._handleCheckmarkChange(t))),{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",(o=t=>this._handleCheckmarkChange(t),l=e.view,(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const s=i.mapper.toViewElement(e.item),n=i.writer,r=function(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("uiElement","label"))return t.item}(s,l);if("todo"==e.attributeNewValue){const t=!!e.item.getAttribute("todoListChecked"),i=Se(e.item,n,t,o),r=n.createContainerElement("span",{class:"todo-list__label__description"}),l=n.createRangeIn(s),a=lt(s),c=nt(l.start),d=a?n.createPositionBefore(a):l.end,u=n.createRange(c,d);n.addClass("todo-list",s.parent),n.move(u,n.createPositionAt(r,0)),n.insert(n.createPositionAt(s,0),i),n.insert(n.createPositionAfter(i),r)}else if("todo"==e.attributeOldValue){const t=_e(s,l);n.removeClass("todo-list",s.parent),n.remove(r),n.move(n.createRangeIn(t),n.createPositionBefore(t)),n.remove(t)}})),e.downcastDispatcher.on("attribute:todoListChecked:listItem",function(t){return(e,i,s)=>{if("todo"!=i.item.getAttribute("listType"))return;if(!s.consumable.consume(i.item,"attribute:todoListChecked"))return;const{mapper:n,writer:r}=s,o=!!i.item.getAttribute("todoListChecked"),l=n.toViewElement(i.item).getChild(0),a=Se(i.item,r,o,t);r.insert(r.createPositionAfter(l),a),r.remove(l)}}((t=>this._handleCheckmarkChange(t)))),e.mapper.on("modelToViewPosition",xe(e.view)),i.mapper.on("modelToViewPosition",xe(e.view)),this.listenTo(e.view.document,"arrowKey",function(t,e){return(i,s)=>{if("left"!=(0,r.getLocalizedArrowKeyCodeDirection)(s.keyCode,e.contentLanguageDirection))return;const n=t.schema,o=t.document.selection;if(!o.isCollapsed)return;const l=o.getFirstPosition(),a=l.parent;if("listItem"===a.name&&"todo"==a.getAttribute("listType")&&l.isAtStart){const e=n.getNearestSelectionRange(t.createPositionBefore(a),"backward");e&&t.change((t=>t.setSelection(e))),s.preventDefault(),s.stopPropagation(),i.stop()}}}(s,t.locale),{context:"li"}),this.listenTo(e.view.document,"keydown",((e,i)=>{(0,r.getCode)(i)===Ce&&(t.execute("checkTodoList"),e.stop())}),{priority:"high"});const a=new Set;this.listenTo(s,"applyOperation",((t,e)=>{const i=e[0];if("rename"==i.type&&"listItem"==i.oldName){const t=i.position.nodeAfter;t.hasAttribute("todoListChecked")&&a.add(t)}else if("changeAttribute"==i.type&&"listType"==i.key&&"todo"===i.oldValue)for(const t of i.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&a.add(t)})),s.document.registerPostFixer((t=>{let e=!1;for(const i of a)t.removeAttribute("todoListChecked",i),e=!0;return a.clear(),e}))}_handleCheckmarkChange(t){const e=this.editor,i=e.model,s=Array.from(i.document.selection.getRanges());i.change((i=>{i.setSelection(t,"end"),e.execute("checkTodoList"),i.setSelection(s)}))}}class Ve extends t.Plugin{static get pluginName(){return"TodoListUI"}init(){const t=this.editor.t;ot(this.editor,"todoList",t("To-do List"),'')}}var Ee=i(250),Pe={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Z()(Ee.Z,Pe);Ee.Z.locals;class ze extends t.Plugin{static get requires(){return[Le,Ve]}static get pluginName(){return"TodoList"}}})(),(window.CKEditor5=window.CKEditor5||{}).list=s})(); \ No newline at end of file diff --git a/core/assets/vendor/ckeditor5/paste-from-office/paste-from-office.js b/core/assets/vendor/ckeditor5/paste-from-office/paste-from-office.js index 8800b1ffd42..636610fd975 100644 --- a/core/assets/vendor/ckeditor5/paste-from-office/paste-from-office.js +++ b/core/assets/vendor/ckeditor5/paste-from-office/paste-from-office.js @@ -1,4 +1,4 @@ /*! - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(()=>{var e={945:(e,t,n)=>{e.exports=n(79)("./src/clipboard.js")},704:(e,t,n)=>{e.exports=n(79)("./src/core.js")},492:(e,t,n)=>{e.exports=n(79)("./src/engine.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{PasteFromOffice:()=>v});var e=n(704),t=n(945),s=n(492);function i(e,t,n,{blockElements:r,inlineObjectElements:s}){let i=n.createPositionAt(e,"forward"==t?"after":"before");return i=i.getLastMatchingPosition((({item:e})=>e.is("element")&&!r.includes(e.name)&&!s.includes(e.name)),{direction:t}),"forward"==t?i.nodeAfter:i.nodeBefore}function o(e,t){return!!e&&e.is("element")&&t.includes(e.name)}function c(e,t){if(!e.childCount)return;const n=new s.UpcastWriter(e.document),r=function(e,t){const n=t.createRangeIn(e),r=new s.Matcher({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),i=[];for(const e of n)if("elementStart"===e.type&&r.match(e.item)){const t=u(e.item);i.push({element:e.item,id:t.id,order:t.order,indent:t.indent})}return i}(e,n);if(!r.length)return;let i=null,o=1;r.forEach(((e,c)=>{const u=function(e,t){if(!e)return!0;if(e.id!==t.id)return t.indent-e.indent!=1;const n=t.element.previousSibling;if(!n)return!0;return r=n,!(r.is("element","ol")||r.is("element","ul"));var r}(r[c-1],e),f=u?null:r[c-1],d=(p=e,(m=f)?p.indent-m.indent:p.indent-1);var m,p;if(u&&(i=null,o=1),!i||0!==d){const r=function(e,t){const n=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),r=/mso-level-number-format:([^;]{0,100});/gi,s=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,i=n.exec(t);let o="decimal",c="ol",a=null;if(i&&i[1]){const t=r.exec(i[1]);if(t&&t[1]&&(o=t[1].trim(),c="bullet"!==o&&"image"!==o?"ol":"ul"),"bullet"===o){const t=function(e){const t=function(e){if(e.getChild(0).is("$text"))return null;for(const t of e.getChildren()){if(!t.is("element","span"))continue;const e=t.getChild(0);return e.is("$text")?e:e.getChild(0)}}(e);if(!t)return null;const n=t._data;if("o"===n)return"circle";if("·"===n)return"disc";if("§"===n)return"square";return null}(e.element);t&&(o=t)}else{const e=s.exec(i[1]);e&&e[1]&&(a=parseInt(e[1]))}}return{type:c,startIndex:a,style:l(o)}}(e,t);if(i){if(e.indent>o){const e=i.getChild(i.childCount-1),t=e.getChild(e.childCount-1);i=a(r,t,n),o+=1}else if(e.indent1&&n.setAttribute("start",e.startIndex,s),s}function u(e){const t={},n=e.getStyle("mso-list");if(n){const e=n.match(/(^|\s{1,100})l(\d+)/i),r=n.match(/\s{0,100}lfo(\d+)/i),s=n.match(/\s{0,100}level(\d+)/i);e&&r&&s&&(t.id=e[2],t.order=r[1],t.indent=s[1])}return t}const f=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class d{constructor(e){this.document=e}isActive(e){return f.test(e)}execute(e){const t=new s.UpcastWriter(this.document),{body:n}=e._parsedData;!function(e,t){for(const n of e.getChildren())if(n.is("element","b")&&"normal"===n.getStyle("font-weight")){const r=e.getChildIndex(n);t.remove(n),t.insertChild(r,n.getChildren(),e)}}(n,t),function(e,t){for(const n of t.createRangeIn(e)){const e=n.item;if(e.is("element","li")){const n=e.getChild(0);n&&n.is("element","p")&&t.unwrapElement(n)}}}(n,t),function(e,t){const n=new s.ViewDocument(t.document.stylesProcessor),r=new s.DomConverter(n,{renderingMode:"data"}),c=r.blockElements,l=r.inlineObjectElements,a=[];for(const n of t.createRangeIn(e)){const e=n.item;if(e.is("element","br")){const n=i(e,"forward",t,{blockElements:c,inlineObjectElements:l}),r=i(e,"backward",t,{blockElements:c,inlineObjectElements:l}),s=o(n,c);(o(r,c)||s)&&a.push(e)}}for(const e of a)e.hasClass("Apple-interchange-newline")?t.remove(e):t.replace(e,t.createElement("p"))}(n,t),e.content=n}}function m(e,t){if(!e.childCount)return;const n=new s.UpcastWriter,r=function(e,t){const n=t.createRangeIn(e),r=new s.Matcher({name:/v:(.+)/}),i=[];for(const e of n){if("elementStart"!=e.type)continue;const t=e.item,n=t.previousSibling&&t.previousSibling.name||null;r.match(t)&&t.getAttribute("o:gfxdata")&&"v:shapetype"!==n&&i.push(e.item.getAttribute("id"))}return i}(e,n);!function(e,t,n){const r=n.createRangeIn(t),i=new s.Matcher({name:"img"}),o=[];for(const t of r)if(i.match(t.item)){const n=t.item,r=n.getAttribute("v:shapes")?n.getAttribute("v:shapes").split(" "):[];r.length&&r.every((t=>e.indexOf(t)>-1))?o.push(n):n.getAttribute("src")||o.push(n)}for(const e of o)n.remove(e)}(r,e,n),function(e,t){const n=t.createRangeIn(e),r=new s.Matcher({name:/v:(.+)/}),i=[];for(const e of n)"elementStart"==e.type&&r.match(e.item)&&i.push(e.item);for(const e of i)t.remove(e)}(e,n);const i=function(e,t){const n=t.createRangeIn(e),r=new s.Matcher({name:"img"}),i=[];for(const e of n)r.match(e.item)&&e.item.getAttribute("src").startsWith("file://")&&i.push(e.item);return i}(e,n);i.length&&function(e,t,n){if(e.length===t.length)for(let r=0;rString.fromCharCode(parseInt(e,16)))).join(""))}const g=//i,h=/xmlns:o="urn:schemas-microsoft-com/i;class y{constructor(e){this.document=e}isActive(e){return g.test(e)||h.test(e)}execute(e){const{body:t,stylesString:n}=e._parsedData;c(t,n),m(t,e.dataTransfer.getData("text/rtf")),e.content=t}}function b(e){return e.replace(/(\s+)<\/span>/g,((e,t)=>1===t.length?" ":Array(t.length+1).join("  ").substr(0,t.length)))}function w(e,t){const n=new DOMParser,r=function(e){return b(b(e)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(e){const t="",n="",r=e.indexOf(t);if(r<0)return e;const s=e.indexOf(n,r+t.length);return e.substring(0,r+t.length)+(s>=0?e.substring(s):"")}(e=e.replace(/