editor.min.js 1.1 MB

12
  1. /*! For license information please see editor.min.js.LICENSE.txt */
  2. !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CKEditor=t():e.CKEditor=t()}(self,(()=>(()=>{var e,t,i={20:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-menu-bar{background:var(--ck-color-base-background);border:1px solid var(--ck-color-toolbar-border);display:flex;flex-wrap:wrap;gap:var(--ck-spacing-small);justify-content:flex-start;padding:var(--ck-spacing-small);width:100%}",""]);const a=s},47:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-list-item-button{border-radius:0;min-height:unset;width:100%}[dir=ltr] .ck.ck-list-item-button{text-align:left}[dir=rtl] .ck.ck-list-item-button{text-align:right}[dir=ltr] .ck.ck-list-item-button.ck-list-item-button_toggleable{padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-list-item-button.ck-list-item-button_toggleable{padding-right:var(--ck-spacing-small)}.ck.ck-list-item-button .ck-list-item-button__check-holder{display:inline-flex;height:.9em;width:.9em}[dir=ltr] .ck.ck-list-item-button .ck-list-item-button__check-holder{margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-list-item-button .ck-list-item-button__check-holder{margin-left:var(--ck-spacing-small)}.ck.ck-list-item-button .ck-list-item-button__check-icon{height:100%}.ck.ck-button.ck-list-item-button{padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2)}.ck.ck-button.ck-list-item-button,.ck.ck-button.ck-list-item-button.ck-on{background:var(--ck-color-list-background);color:var(--ck-color-text)}[dir=ltr] .ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){padding-right:var(--ck-spacing-small)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable):not(.ck-disabled),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled):not(.ck-disabled){color:var(--ck-color-text)}",""]);const a=s},121:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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}@media (forced-colors:active){.ck .ck-placeholder,.ck.ck-placeholder{forced-color-adjust:preserve-parent-color}}.ck .ck-placeholder:before,.ck.ck-placeholder:before{cursor:text}@media (forced-colors:none){.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text)}}@media (forced-colors:active){.ck .ck-placeholder:before,.ck.ck-placeholder:before{font-style:italic;margin-left:1px}}",""]);const a=s},173:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%}.ck.ck-input-color>input.ck.ck-input-text{flex-grow:1;min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button{display:flex}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{overflow:hidden;position:relative}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-input-color>.ck.ck-input-text:focus{z-index:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-left-radius:0;border-top-left-radius:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-left:1px solid transparent}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-right:1px solid transparent}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border:1px solid var(--ck-color-input-border);border-radius:0;height:20px;width:20px}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{background:red;border-radius:2px;height:150%;left:50%;top:-30%;transform:rotate(45deg);transform-origin:50%;width:8%}.ck.ck-input-color .ck.ck-input-color__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);width:100%}.ck.ck-input-color .ck.ck-input-color__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-input-border)}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard);margin-right:0}",""]);const a=s},219:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-image-insert-url{padding:var(--ck-spacing-large) var(--ck-spacing-large) 0;width:400px}.ck.ck-image-insert-url .ck-image-insert-url__action-row{display:grid;grid-template-columns:repeat(2,1fr)}:root{--ck-image-insert-insert-by-url-width:250px}.ck.ck-image-insert-url{--ck-input-width:100%}.ck.ck-image-insert-url .ck-image-insert-url__action-row{grid-column-gap:var(--ck-spacing-large);margin-top:var(--ck-spacing-large)}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-cancel,.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-save{justify-content:center;min-width:auto}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}.ck.ck-image-insert-form>.ck.ck-button{display:block;width:100%}[dir=ltr] .ck.ck-image-insert-form>.ck.ck-button{text-align:left}[dir=rtl] .ck.ck-image-insert-form>.ck.ck-button{text-align:right}.ck.ck-image-insert-form>.ck.ck-collapsible{min-width:var(--ck-image-insert-insert-by-url-width)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:first-child){border-top:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:last-child){border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-image-insert-url{min-width:var(--ck-image-insert-insert-by-url-width);padding:var(--ck-spacing-large)}.ck.ck-image-insert-form:focus{outline:none}",""]);const a=s},278:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},610:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{position:absolute;top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{left:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{right:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view .ck-search__reset{position:absolute;top:50%;transform:translateY(-50%)}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{display:block}.ck.ck-search>.ck-search__results>.ck-search__info:not(.ck-hidden)~*{display:none}:root{--ck-search-field-view-horizontal-spacing:calc(var(--ck-icon-size) + var(--ck-spacing-medium))}.ck.ck-search>.ck-labeled-field-view .ck-input{width:100%}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon{--ck-labeled-field-label-default-position-x:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon>.ck-labeled-field-view__input-wrapper>.ck-icon{opacity:.5;pointer-events:none}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input,[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input:not(.ck-input-text_empty){padding-left:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset{--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset.ck-labeled-field-view_empty{--ck-labeled-field-empty-unfocused-max-width:100% - var(--ck-search-field-view-horizontal-spacing) - var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{background:none;min-height:auto;min-width:auto;opacity:.5;padding:0}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{left:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset:hover{opacity:1}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input:not(.ck-input-text_empty),[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{padding-right:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-search__results{min-width:100%}.ck.ck-search>.ck-search__results>.ck-search__info{padding:var(--ck-spacing-medium) var(--ck-spacing-large);width:100%}.ck.ck-search>.ck-search__results>.ck-search__info *{white-space:normal}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{font-weight:700}.ck.ck-search>.ck-search__results>.ck-search__info>span:last-child{margin-top:var(--ck-spacing-medium)}",""]);const a=s},657:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSlzY2FsZSguOTgwMTIpIj48cmVjdCB3aWR0aD0iNjAuMDk5IiBoZWlnaHQ9IjYwLjA5OSIgeD0iMTc2LjAzMSIgeT0iMjMxLjM5OSIgZmlsbD0iIzM0YTY2OCIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjIzOCIgcnk9IjUuMjM4Ii8+PHBhdGggZmlsbD0iIzVjODhjNSIgZD0ibTIwNi40NzcgMjYwLjktMjguOTg3IDI4Ljk4N2E1LjIyIDUuMjIgMCAwIDAgMy43OCAxLjYxaDQ5LjYyMWMxLjY5NCAwIDMuMTktLjc5OCA0LjE0Ni0yLjAzN3oiLz48cGF0aCBmaWxsPSIjZGQ0YjNlIiBkPSJNMjI2Ljc0MiAyMjIuOTg4Yy05LjI2NiAwLTE2Ljc3NyA3LjE3LTE2Ljc3NyAxNi4wMTQuMDA3IDIuNzYyLjY2MyA1LjQ3NCAyLjA5MyA3Ljg3NS40My43MDMuODMgMS40MDggMS4xOSAyLjEwN3EuNS43NTMuOTUgMS41MDguNTE1LjcxNS45ODggMS40NGMxLjMxIDEuNzY5IDIuNSAzLjUwMiAzLjYzNyA1LjE2OC43OTMgMS4yNzUgMS42ODMgMi42NCAyLjQ2NiAzLjk5IDIuMzYzIDQuMDk0IDQuMDA3IDguMDkyIDQuNiAxMy45MTR2LjAxMmMuMTgyLjQxMi41MTYuNjY2Ljg3OS42NjcuNDAzLS4wMDEuNzY4LS4zMTQuOTMtLjc5OS42MDMtNS43NTYgMi4yMzgtOS43MjkgNC41ODUtMTMuNzk0Ljc4Mi0xLjM1IDEuNjczLTIuNzE1IDIuNDY1LTMuOTkgMS4xMzctMS42NjYgMi4zMjgtMy40IDMuNjM4LTUuMTY5cS40NzMtLjcyMy45ODgtMS40MzkuNDUtLjc1NS45NS0xLjUwOGMuMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIGN4PSIyMjYuNzQyIiBjeT0iMjM5LjAwMiIgZmlsbD0iIzgwMmQyNyIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjgyOCIgcnk9IjUuNTY0Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjlxLS4wMDEtLjU0My0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhxLS4wMDEtLjAwMy0uMDA0LS4wMDVjLTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTVtNC40MyA1LjY2LjAwMy4wMDZ2LS4wMDN6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGZpbGw9IiNjM2MzYzMiIGQ9Im0yMTUuMTg0IDI1MS45MjktNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMiA1LjIgMCAwIDAgLjQ0OS0yLjEyM3YtMzEuMTY1Yy0uNDY5LjY3NS0uOTM0IDEuMzQ5LTEuMzgyIDIuMDA1LS43OTIgMS4yNzUtMS42ODIgMi42NC0yLjQ2NSAzLjk5LTIuMzQ3IDQuMDY1LTMuOTgyIDguMDM4LTQuNTg1IDEzLjc5NC0uMTYyLjQ4NS0uNTI3Ljc5OC0uOTMuNzk5LS4zNjMtLjAwMS0uNjk3LS4yNTUtLjg3OS0uNjY3di0uMDEyYy0uNTkzLTUuODIyLTIuMjM3LTkuODItNC42LTEzLjkxNC0uNzgzLTEuMzUtMS42NzMtMi43MTUtMi40NjYtMy45OS0xLjEzNy0xLjY2Ni0yLjMyNy0zLjQtMy42MzctNS4xNjl6Ii8+PHBhdGggZmlsbD0iI2ZkZGM0ZiIgZD0ibTIxMi45ODMgMjQ4LjQ5NS0zNi45NTIgMzYuOTUzdi44MTJhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYgMTM2IDAgMCAwLTIuNzY0LTMuOSAzOCAzOCAwIDAgMC0uOTg5LTEuNDQgMzUgMzUgMCAwIDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJtMjExLjk5OCAyNjEuMDgzLTYuMTUyIDYuMTUxIDI0LjI2NCAyNC4yNjRoLjc4MWE1LjIyNyA1LjIyNyAwIDAgMCA1LjIzOS01LjIzOHYtMS4wNDV6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4="},734:(e,t,i)=>{const o=i(5659),n=i(8507),r={};Object.keys(o).forEach((e=>{r[e]={},Object.defineProperty(r[e],"channels",{value:o[e].channels}),Object.defineProperty(r[e],"labels",{value:o[e].labels});const t=n(e);Object.keys(t).forEach((i=>{const o=t[i];r[e][i]=function(e){const t=function(...t){const i=t[0];if(null==i)return i;i.length>1&&(t=i);const o=e(t);if("object"==typeof o)for(let e=o.length,t=0;t<e;t++)o[t]=Math.round(o[t]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}(o),r[e][i].raw=function(e){const t=function(...t){const i=t[0];return null==i?i:(i.length>1&&(t=i),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(o)}))})),e.exports=r},786:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,'.ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:"";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{max-width:80px;min-width:80px;width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both;background:var(--ck-color-base-error);border-radius:0;color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}@media (prefers-reduced-motion:reduce){.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:none}}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}',""]);const a=s},892:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,':root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;outline:unset;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}',""]);const a=s},986:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-media-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap;width:400px}.ck.ck-media-form .ck-labeled-field-view{display:inline-block;width:100%}.ck.ck-media-form .ck-label{display:none}.ck.ck-media-form .ck-input{width:100%}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}",""]);const a=s},1240:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck-content img.image_resized{height:auto}.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=s},1263:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}",""]);const a=s},1272:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);border-radius:0;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-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}@media (prefers-reduced-motion:reduce){.ck.ck-input{transition:none}}.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)}@media (prefers-reduced-motion:reduce){.ck.ck-input.ck-error{animation:none}}.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 a=s},1468:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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;height:auto;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{z-index:1}.ck.ck-editor__editable .image.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable .image-inline img{height:auto}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}",""]);const a=s},1487:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},1601:e=>{"use strict";e.exports=function(e){return e[1]}},1674:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-color-selector-focused-cell-background:rgba(158,201,250,.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-selector-focused-cell-background);outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}",""]);const a=s},1760:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-dropdown-menu-menu-item-min-width:18em}.ck.ck-dropdown-menu-list__nested-menu__item{min-width:var(--ck-dropdown-menu-menu-item-min-width)}",""]);const a=s},1834:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{min-width:100%;width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}",""]);const a=s},1836:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-aria-live-announcer{left:-10000px;position:absolute;top:-10000px}.ck.ck-aria-live-region-list{list-style-type:none}",""]);const a=s},1893:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},1928:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}",""]);const a=s},2424:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:calc(var(--ck-z-dialog) + 100);--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-tooltip-text-padding:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);box-shadow:none;padding:0 var(--ck-spacing-medium)}.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.ck-tooltip_multi-line .ck-tooltip__text{display:inline-block;max-width:200px;padding:var(--ck-tooltip-text-padding) 0;white-space:break-spaces}.ck.ck-balloon-panel.ck-tooltip:before{display:none}",""]);const a=s},2515:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content{border:solid var(--ck-color-base-border);border-radius:0;border-width:1px 1px 0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.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-sticky-panel__content.ck-sticky-panel__content_sticky{border-bottom-width:1px}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-menu-bar{border:0;border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-toolbar{border: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 a=s},2524:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck-content .table{display:table;margin:.9em auto}.ck-content .table table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;height:100%;width:100%}.ck-content .table table td,.ck-content .table table th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}.ck-content .table table th{background:rgba(0,0,0,.05);font-weight:700}@media print{.ck-content .table table{height:auto}}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}",""]);const a=s},2833:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button{width:100%}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button{min-height:unset;padding:var(--ck-spacing-small) var(--ck-spacing-medium)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-button__label{line-height:unset;overflow:visible;width:unset}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-icon{display:none}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button{border-radius:0}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{margin-left:var(--ck-spacing-standard);margin-right:calc(var(--ck-spacing-small)*-1);transform:rotate(-90deg)}[dir=rtl] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{left:var(--ck-spacing-standard);margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small);transform:rotate(90deg)}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button.ck-disabled>.ck-menu-bar__menu__button__arrow{opacity:var(--ck-disabled-opacity)}",""]);const a=s},2992:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button{border-radius:0}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container,.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{font-size:var(--ck-icon-font-size)}[dir=ltr] .ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-left:var(--ck-spacing-medium)}",""]);const a=s},3111:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-image-custom-resize-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{display:inline-block}.ck.ck-image-custom-resize-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-image-custom-resize-form{flex-wrap:wrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-image-custom-resize-form .ck-button{flex-basis:50%}}",""]);const a=s},3224:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__header h2.ck-form__header__label{flex-grow:1}:root{--ck-form-header-height:44px}.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)}[dir=ltr] .ck.ck-form__header>.ck-icon{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-form__header>.ck-icon{margin-left:var(--ck-spacing-medium)}.ck.ck-form__header .ck-form__header__label{--ck-font-size-base:15px;font-weight:700}",""]);const a=s},3348:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck-button.ck-dropdown-menu-list__nested-menu__item__button{border-radius:0}.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container,.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}.ck-button.ck-dropdown-menu-list__nested-menu__item__button:focus{border-color:transparent;box-shadow:none}.ck-button.ck-dropdown-menu-list__nested-menu__item__button:focus:not(.ck-on){background:var(--ck-color-button-default-hover-background)}",""]);const a=s},3437:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}@media (prefers-reduced-motion:reduce){.ck .ck-insert-table-dropdown-grid-box{transition:none}}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}",""]);const a=s},3449:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-panel) - 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 a=s},3476:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.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;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:var(--ck-spacing-medium) var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}",""]);const a=s},3537:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,'.ck-content .page-break{align-items:center;clear:both;display:flex;justify-content:center;padding:5px 0;position:relative}.ck-content .page-break:after{border-bottom:2px dashed #c4c4c4;content:"";position:absolute;width:100%}.ck-content .page-break__label{background:#fff;border:1px solid #c4c4c4;border-radius:2px;box-shadow:2px 2px 1px rgba(0,0,0,.15);color:#333;display:block;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;padding:.3em .6em;position:relative;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}.ck-content :has(+.page-break){margin-bottom:0}}',""]);const a=s},3605:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},3617:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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-panel)}.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{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);border-radius:0;min-height:15px}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0}.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 a=s},3644:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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=s},3756:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}",""]);const a=s},3885:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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.image-style-block-align-left,.ck-content .image.image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image.image-style-align-left,.ck-content .image.image-style-align-right{clear:none}.ck-content .image.image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image.image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image.image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image.image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image.image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content p+.image.image-style-align-left,.ck-content p+.image.image-style-align-right,.ck-content p+.image.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=s},3900:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".color-picker-hex-input{width:max-content}.color-picker-hex-input .ck.ck-input{min-width:unset}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;margin:var(--ck-spacing-large) 0 0;width:unset}.ck.ck-color-picker__row .ck.ck-labeled-field-view{padding-top:unset}.ck.ck-color-picker__row .ck.ck-input-text{width:unset}.ck.ck-color-picker__row .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}",""]);const a=s},3986:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;border-radius:0;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.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 .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);border-radius:0;height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.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)}@media (prefers-reduced-motion:reduce){.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{transition:none}}.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 a=s},4245:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},4284:e=>{"use strict";var t,i=(t=[],function(e,i){return t[e]=i,t.filter(Boolean).join("\n")});function o(e,t,o,n){var r;if(o)r="";else{r="",n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,s&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}")}if(e.styleSheet)e.styleSheet.cssText=i(t,r);else{var a=document.createTextNode(r),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(a,l[t]):e.appendChild(a)}}var n={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=n.singletonCounter++,i=n.singleton||(n.singleton=e.insertStyleElement(e));return{update:function(e){o(i,t,!1,e)},remove:function(e){o(i,t,!0,e)}}}},4315:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.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 a=s},4412:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-color-selector-caption-background:#f7f7f7;--ck-color-selector-caption-text:#333;--ck-color-selector-caption-highlighted-background:#fd0}.ck-content .table>figcaption{background-color:var(--ck-color-selector-caption-background);caption-side:top;color:var(--ck-color-selector-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;text-align:center;word-break:break-word}@media (forced-colors:active){.ck-content .table>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .table>figcaption.table__caption_highlighted{animation:ck-table-caption-highlight .6s ease-out}}.ck.ck-editor__editable .table>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}@keyframes ck-table-caption-highlight{0%{background-color:var(--ck-color-selector-caption-highlighted-background)}to{background-color:var(--ck-color-selector-caption-background)}}",""]);const a=s},4417:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},4484:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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:0s,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}@media (prefers-reduced-motion:reduce){.ck-image-upload-complete-icon{animation-duration:0s}.ck-image-upload-complete-icon:after{animation:none;height:.45em;opacity:1;width:.3em}}@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=s},4488:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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{transition:box-shadow .2s ease}@media (forced-colors:none){.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;width:var(--ck-color-grid-tile-size)}.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.ck-color-selector__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.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: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)}}@media (forced-colors:active){.ck.ck-color-grid__tile{height:unset;min-height:unset;min-width:unset;padding:0 var(--ck-spacing-small);width:unset}.ck.ck-color-grid__tile .ck-button__label{display:inline-block}}@media (prefers-reduced-motion:reduce){.ck.ck-color-grid__tile{transition:none}}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.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 .ck.ck-icon{display:block}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}",""]);const a=s},4515:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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{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}.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}',""]);const a=s},4703:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}",""]);const a=s},4749:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-dropdown-menu-list__nested-menu{display:block}",""]);const a=s},4782:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzUuNzUgMCAwIDEtLjIxNy4yMDYgNS4yNTEgNS4yNTEgMCAwIDEtOC41MDMtNS45NTUuNy43IDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NHptNS40OTQtNS4zMzVhLjc1Ljc1IDAgMCAxLS4xMi4yNzRsLTEuMTQ3IDEuNjM5YS43NS43NSAwIDEgMS0xLjIyOC0uODZsLjg2LTEuMjNhMy43NSAzLjc1IDAgMCAwLTYuMTQ0LTQuMzAxbC0uODYgMS4yMjlhLjc1Ljc1IDAgMCAxLTEuMjI5LS44NmwxLjE0OC0xLjY0YS43NS43NSAwIDAgMSAuMjE3LS4yMDYgNS4yNTEgNS4yNTEgMCAwIDEgOC41MDMgNS45NTVtLTQuNTYzLTIuNTMyYS43NS43NSAwIDAgMSAuMTg0IDEuMDQ1bC0zLjE1NSA0LjUwNWEuNzUuNzUgMCAxIDEtMS4yMjktLjg2bDMuMTU1LTQuNTA2YS43NS43NSAwIDAgMSAxLjA0NS0uMTg0Ii8+PC9zdmc+"},4861:(e,t,i)=>{"use strict";i.d(t,{A:()=>k});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r),a=i(4417),l=i.n(a),c=new URL(i(657),i.b),d=new URL(i(9736),i.b),u=new URL(i(6341),i.b),h=new URL(i(7784),i.b),m=s()(n()),g=l()(c),p=l()(d),f=l()(u),b=l()(h);m.push([e.id,`.ck-media__wrapper .ck-media__placeholder{align-items:center;display:flex;flex-direction:column}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{display:block;overflow:hidden}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{background:var(--ck-color-base-foreground);padding:calc(var(--ck-spacing-standard)*3)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{background-position:50%;background-size:cover;height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);min-width:var(--ck-media-embed-placeholder-icon-size)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{height:100%;width:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);font-style:italic;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-height:380px;max-width:300px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(${g})}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(${p})}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(${f})}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(${b})}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}`,""]);const k=m},4868:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach((function(i){e.setAttribute(i,t[i])}))}},4893:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},4944:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-spinner-container{display:block;position:relative}.ck.ck-spinner{left:0;margin:0 auto;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:1}:root{--ck-toolbar-spinner-size:18px}.ck.ck-spinner-container{animation:ck-spinner-rotate 1.5s linear infinite;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@media (prefers-reduced-motion:reduce){.ck.ck-spinner-container{animation-duration:3s}}.ck.ck-spinner{border:2px solid var(--ck-color-text);border-radius:50%;border-top:2px solid transparent;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@keyframes ck-spinner-rotate{to{transform:rotate(1turn)}}",""]);const a=s},5072:e=>{"use strict";var t=[];function i(e){for(var i=-1,o=0;o<t.length;o++)if(t[o].identifier===e){i=o;break}return i}function o(e,o){for(var r={},s=[],a=0;a<e.length;a++){var l=e[a],c=o.base?l[0]+o.base:l[0],d=r[c]||0,u="".concat(c," ").concat(d);r[c]=d+1;var h=i(u),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)t[h].references++,t[h].updater(m);else{var g=n(m,o);o.byIndex=a,t.splice(a,0,{identifier:u,updater:g,references:1})}s.push(u)}return s}function n(e,t){var i=t.domAPI(t);return i.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,n){var r=o(e=e||[],n=n||{});return function(e){e=e||[];for(var s=0;s<r.length;s++){var a=i(r[s]);t[a].references--}for(var l=o(e,n),c=0;c<r.length;c++){var d=i(r[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}r=l}}},5092:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-menu-bar-menu-item-min-width:18em}.ck.ck-menu-bar__menu .ck.ck-menu-bar__menu__item{min-width:var(--ck-menu-bar-menu-item-min-width)}",""]);const a=s},5107:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-menu-bar-menu-max-width:75vw;--ck-menu-bar-nested-menu-horizontal-offset:5px}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{max-width:var(--ck-menu-bar-menu-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw{bottom:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{bottom:auto;top:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{left:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{right:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{left:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en{bottom:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{right:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{bottom:0}:root{--ck-menu-bar-menu-panel-max-width:75vw}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;bottom:0;height:fit-content;max-width:var(--ck-menu-bar-menu-panel-max-width)}.ck-rounded-corners .ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{border-top-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{border-top-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne{border-bottom-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{border-bottom-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel:focus{outline:none}.ck.ck-menu-bar .ck-list-item-button:active,.ck.ck-menu-bar .ck-list-item-button:focus{border-color:transparent;box-shadow:none}.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:active,.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none;position:relative;z-index:2}",""]);const a=s},5212:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highlighted-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}@media (forced-colors:active){.ck-content .image>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:none}}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highlighted-background)}to{background-color:var(--ck-color-image-caption-background)}}",""]);const a=s},5558:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-autocomplete{position:relative}.ck.ck-autocomplete>.ck-search__results{position:absolute;z-index:var(--ck-z-panel)}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{bottom:100%}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{bottom:auto;top:100%}.ck.ck-autocomplete>.ck-search__results{background:var(--ck-color-base-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;max-height:200px;min-width:auto;overflow-y:auto}.ck-rounded-corners .ck.ck-autocomplete>.ck-search__results,.ck.ck-autocomplete>.ck-search__results.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-autocomplete>.ck-search__results{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{border-bottom-left-radius:0;border-bottom-right-radius:0;margin-bottom:-1px}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{border-top-left-radius:0;border-top-right-radius:0;margin-top:-1px}",""]);const a=s},5659:(e,t,i)=>{const o=i(8156),n={};for(const e of Object.keys(o))n[o[e]]=e;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=r;for(const e of Object.keys(r)){if(!("channels"in r[e]))throw new Error("missing channels property: "+e);if(!("labels"in r[e]))throw new Error("missing channel labels property: "+e);if(r[e].labels.length!==r[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:i}=r[e];delete r[e].channels,delete r[e].labels,Object.defineProperty(r[e],"channels",{value:t}),Object.defineProperty(r[e],"labels",{value:i})}r.rgb.hsl=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(t,i,o),r=Math.max(t,i,o),s=r-n;let a,l;r===n?a=0:t===r?a=(i-o)/s:i===r?a=2+(o-t)/s:o===r&&(a=4+(t-i)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(n+r)/2;return l=r===n?0:c<=.5?s/(r+n):s/(2-r-n),[a,100*l,100*c]},r.rgb.hsv=function(e){let t,i,o,n,r;const s=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(s,a,l),d=c-Math.min(s,a,l),u=function(e){return(c-e)/6/d+.5};return 0===d?(n=0,r=0):(r=d/c,t=u(s),i=u(a),o=u(l),s===c?n=o-i:a===c?n=1/3+t-o:l===c&&(n=2/3+i-t),n<0?n+=1:n>1&&(n-=1)),[360*n,100*r,100*c]},r.rgb.hwb=function(e){const t=e[0],i=e[1];let o=e[2];const n=r.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(i,o));return o=1-1/255*Math.max(t,Math.max(i,o)),[n,100*s,100*o]},r.rgb.cmyk=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(1-t,1-i,1-o);return[100*((1-t-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*((1-o-n)/(1-n)||0),100*n]},r.rgb.keyword=function(e){const t=n[e];if(t)return t;let i,r=1/0;for(const t of Object.keys(o)){const n=(a=o[t],((s=e)[0]-a[0])**2+(s[1]-a[1])**2+(s[2]-a[2])**2);n<r&&(r=n,i=t)}var s,a;return i},r.keyword.rgb=function(e){return o[e]},r.rgb.xyz=function(e){let t=e[0]/255,i=e[1]/255,o=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,[100*(.4124*t+.3576*i+.1805*o),100*(.2126*t+.7152*i+.0722*o),100*(.0193*t+.1192*i+.9505*o)]},r.rgb.lab=function(e){const t=r.rgb.xyz(e);let i=t[0],o=t[1],n=t[2];return i/=95.047,o/=100,n/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*o-16,500*(i-o),200*(o-n)]},r.hsl.rgb=function(e){const t=e[0]/360,i=e[1]/100,o=e[2]/100;let n,r,s;if(0===i)return s=255*o,[s,s,s];n=o<.5?o*(1+i):o+i-o*i;const a=2*o-n,l=[0,0,0];for(let e=0;e<3;e++)r=t+1/3*-(e-1),r<0&&r++,r>1&&r--,s=6*r<1?a+6*(n-a)*r:2*r<1?n:3*r<2?a+(n-a)*(2/3-r)*6:a,l[e]=255*s;return l},r.hsl.hsv=function(e){const t=e[0];let i=e[1]/100,o=e[2]/100,n=i;const r=Math.max(o,.01);return o*=2,i*=o<=1?o:2-o,n*=r<=1?r:2-r,[t,100*(0===o?2*n/(r+n):2*i/(o+i)),(o+i)/2*100]},r.hsv.rgb=function(e){const t=e[0]/60,i=e[1]/100;let o=e[2]/100;const n=Math.floor(t)%6,r=t-Math.floor(t),s=255*o*(1-i),a=255*o*(1-i*r),l=255*o*(1-i*(1-r));switch(o*=255,n){case 0:return[o,l,s];case 1:return[a,o,s];case 2:return[s,o,l];case 3:return[s,a,o];case 4:return[l,s,o];case 5:return[o,s,a]}},r.hsv.hsl=function(e){const t=e[0],i=e[1]/100,o=e[2]/100,n=Math.max(o,.01);let r,s;s=(2-i)*o;const a=(2-i)*n;return r=i*n,r/=a<=1?a:2-a,r=r||0,s/=2,[t,100*r,100*s]},r.hwb.rgb=function(e){const t=e[0]/360;let i=e[1]/100,o=e[2]/100;const n=i+o;let r;n>1&&(i/=n,o/=n);const s=Math.floor(6*t),a=1-o;r=6*t-s,1&s&&(r=1-r);const l=i+r*(a-i);let c,d,u;switch(s){default:case 6:case 0:c=a,d=l,u=i;break;case 1:c=l,d=a,u=i;break;case 2:c=i,d=a,u=l;break;case 3:c=i,d=l,u=a;break;case 4:c=l,d=i,u=a;break;case 5:c=a,d=i,u=l}return[255*c,255*d,255*u]},r.cmyk.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,i*(1-n)+n)),255*(1-Math.min(1,o*(1-n)+n))]},r.xyz.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100;let n,r,s;return n=3.2406*t+-1.5372*i+-.4986*o,r=-.9689*t+1.8758*i+.0415*o,s=.0557*t+-.204*i+1.057*o,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n=Math.min(Math.max(0,n),1),r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),[255*n,255*r,255*s]},r.xyz.lab=function(e){let t=e[0],i=e[1],o=e[2];return t/=95.047,i/=100,o/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,[116*i-16,500*(t-i),200*(i-o)]},r.lab.xyz=function(e){let t,i,o;i=(e[0]+16)/116,t=e[1]/500+i,o=i-e[2]/200;const n=i**3,r=t**3,s=o**3;return i=n>.008856?n:(i-16/116)/7.787,t=r>.008856?r:(t-16/116)/7.787,o=s>.008856?s:(o-16/116)/7.787,t*=95.047,i*=100,o*=108.883,[t,i,o]},r.lab.lch=function(e){const t=e[0],i=e[1],o=e[2];let n;return n=360*Math.atan2(o,i)/2/Math.PI,n<0&&(n+=360),[t,Math.sqrt(i*i+o*o),n]},r.lch.lab=function(e){const t=e[0],i=e[1],o=e[2]/360*2*Math.PI;return[t,i*Math.cos(o),i*Math.sin(o)]},r.rgb.ansi16=function(e,t=null){const[i,o,n]=e;let s=null===t?r.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),0===s)return 30;let a=30+(Math.round(n/255)<<2|Math.round(o/255)<<1|Math.round(i/255));return 2===s&&(a+=60),a},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){const t=e[0],i=e[1],o=e[2];return t===i&&i===o?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(o/255*5)},r.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const i=.5*(1+~~(e>50));return[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255]},r.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},r.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},r.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let i=t[0];3===t[0].length&&(i=i.split("").map((e=>e+e)).join(""));const o=parseInt(i,16);return[o>>16&255,o>>8&255,255&o]},r.rgb.hcg=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.max(Math.max(t,i),o),r=Math.min(Math.min(t,i),o),s=n-r;let a,l;return a=s<1?r/(1-s):0,l=s<=0?0:n===t?(i-o)/s%6:n===i?2+(o-t)/s:4+(t-i)/s,l/=6,l%=1,[360*l,100*s,100*a]},r.hsl.hcg=function(e){const t=e[1]/100,i=e[2]/100,o=i<.5?2*t*i:2*t*(1-i);let n=0;return o<1&&(n=(i-.5*o)/(1-o)),[e[0],100*o,100*n]},r.hsv.hcg=function(e){const t=e[1]/100,i=e[2]/100,o=t*i;let n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],100*o,100*n]},r.hcg.rgb=function(e){const t=e[0]/360,i=e[1]/100,o=e[2]/100;if(0===i)return[255*o,255*o,255*o];const n=[0,0,0],r=t%1*6,s=r%1,a=1-s;let l=0;switch(Math.floor(r)){case 0:n[0]=1,n[1]=s,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=s;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=s,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return l=(1-i)*o,[255*(i*n[0]+l),255*(i*n[1]+l),255*(i*n[2]+l)]},r.hcg.hsv=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);let o=0;return i>0&&(o=t/i),[e[0],100*o,100*i]},r.hcg.hsl=function(e){const t=e[1]/100,i=e[2]/100*(1-t)+.5*t;let o=0;return i>0&&i<.5?o=t/(2*i):i>=.5&&i<1&&(o=t/(2*(1-i))),[e[0],100*o,100*i]},r.hcg.hwb=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);return[e[0],100*(i-t),100*(1-i)]},r.hwb.hcg=function(e){const t=e[1]/100,i=1-e[2]/100,o=i-t;let n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],100*o,100*n]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=function(e){return[0,0,e[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(i.length)+i},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},5810:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}[dir=ltr] .ck.ck-button,[dir=ltr] a.ck.ck-button{justify-content:left}[dir=rtl] .ck.ck-button,[dir=rtl] a.ck.ck-button{justify-content:right}.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{-webkit-appearance:none;background:var(--ck-color-button-default-background);border:1px solid transparent;border-radius:0;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: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-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)}@media (prefers-reduced-motion:reduce){.ck.ck-button,a.ck.ck-button{transition:none}}.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;opacity:.5}[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-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-right:var(--ck-spacing-medium)}[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-medium)}.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);color:var(--ck-color-button-on-color)}.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-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);color:var(--ck-color-button-action-text)}.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-bold,a.ck.ck-button-bold{font-weight:700}",""]);const a=s},6021:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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)}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button svg{transition:none}}.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}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button:hover,.ck .ck-widget .ck-widget__type-around__button:hover svg line,.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:none}}.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 a=s},6103:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel{max-height:314px;overflow-y:auto;position:absolute;z-index:calc(var(--ck-z-panel) + 1)}:root{--ck-dropdown-menu-menu-panel-max-width:75vw}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__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;height:fit-content;max-width:var(--ck-dropdown-menu-menu-panel-max-width)}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:after,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:before{display:none}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_es,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_se{border-top-left-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_sw,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_ws{border-top-right-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_en,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_ne{border-bottom-left-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_nw,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_wn{border-bottom-right-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:focus{outline:none}",""]);const a=s},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",o=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),o&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),o&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,o,n,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(o)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&s[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),n&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=n):d[4]="".concat(n)),t.push(d))}},t}},6341:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgdmlld0JveD0iMCAwIDUwNCA1MDQiPjx0aXRsZT5nbHlwaC1sb2dvX01heTIwMTY8L3RpdGxlPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAuMTU5aDUwMy44NDFWNTAzLjk0SDB6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHBhdGggZmlsbD0iI0ZGRiIgZD0iTTI1MS45MjEuMTU5Yy02OC40MTggMC03Ni45OTcuMjktMTAzLjg2NyAxLjUxNi0yNi44MTQgMS4yMjMtNDUuMTI3IDUuNDgyLTYxLjE1MSAxMS43MS0xNi41NjYgNi40MzctMzAuNjE1IDE1LjA1MS00NC42MjEgMjkuMDU2LTE0LjAwNSAxNC4wMDYtMjIuNjE5IDI4LjA1NS0yOS4wNTYgNDQuNjIxLTYuMjI4IDE2LjAyNC0xMC40ODcgMzQuMzM3LTExLjcxIDYxLjE1MUMuMjkgMTc1LjA4MyAwIDE4My42NjIgMCAyNTIuMDhjMCA2OC40MTcuMjkgNzYuOTk2IDEuNTE2IDEwMy44NjYgMS4yMjMgMjYuODE0IDUuNDgyIDQ1LjEyNyAxMS43MSA2MS4xNTEgNi40MzcgMTYuNTY2IDE1LjA1MSAzMC42MTUgMjkuMDU2IDQ0LjYyMSAxNC4wMDYgMTQuMDA1IDI4LjA1NSAyMi42MTkgNDQuNjIxIDI5LjA1NyAxNi4wMjQgNi4yMjcgMzQuMzM3IDEwLjQ4NiA2MS4xNTEgMTEuNzA5IDI2Ljg3IDEuMjI2IDM1LjQ0OSAxLjUxNiAxMDMuODY3IDEuNTE2IDY4LjQxNyAwIDc2Ljk5Ni0uMjkgMTAzLjg2Ni0xLjUxNiAyNi44MTQtMS4yMjMgNDUuMTI3LTUuNDgyIDYxLjE1MS0xMS43MDkgMTYuNTY2LTYuNDM4IDMwLjYxNS0xNS4wNTIgNDQuNjIxLTI5LjA1NyAxNC4wMDUtMTQuMDA2IDIyLjYxOS0yOC4wNTUgMjkuMDU3LTQ0LjYyMSA2LjIyNy0xNi4wMjQgMTAuNDg2LTM0LjMzNyAxMS43MDktNjEuMTUxIDEuMjI2LTI2Ljg3IDEuNTE2LTM1LjQ0OSAxLjUxNi0xMDMuODY2IDAtNjguNDE4LS4yOS03Ni45OTctMS41MTYtMTAzLjg2Ny0xLjIyMy0yNi44MTQtNS40ODItNDUuMTI3LTExLjcwOS02MS4xNTEtNi40MzgtMTYuNTY2LTE1LjA1Mi0zMC42MTUtMjkuMDU3LTQ0LjYyMS0xNC4wMDYtMTQuMDA1LTI4LjA1NS0yMi42MTktNDQuNjIxLTI5LjA1Ni0xNi4wMjQtNi4yMjgtMzQuMzM3LTEwLjQ4Ny02MS4xNTEtMTEuNzFDMzI4LjkxNy40NDkgMzIwLjMzOC4xNTkgMjUxLjkyMS4xNTltMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1czE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NmMzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjZzLTE3LjIwNyAxNC4yNzUtMjguOTY2IDE4Ljg0NWMtOC44NzcgMy40NS0yMi4yMTYgNy41NTQtNDYuNzc4IDguNjc0LTI2LjU2IDEuMjEyLTM0LjUyNyAxLjQ2OS0xMDEuNzk3IDEuNDY5LTY3LjI3MSAwLTc1LjIzNy0uMjU3LTEwMS43OTgtMS40NjktMjQuNTYyLTEuMTItMzcuOTAxLTUuMjI0LTQ2Ljc3OC04LjY3NC0xMS43NTktNC41Ny0yMC4xNTEtMTAuMDI5LTI4Ljk2Ni0xOC44NDVzLTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2NmMtMy40NS04Ljg3Ny03LjU1NC0yMi4yMTYtOC42NzQtNDYuNzc4LTEuMjEyLTI2LjU2NC0xLjQ2OS0zNC41MzItMS40NjktMTAxLjc5NyAwLTY3LjI2Ni4yNTctNzUuMjM0IDEuNDY5LTEwMS43OTggMS4xMi0yNC41NjIgNS4yMjQtMzcuOTAxIDguNjc0LTQ2Ljc3OCA0LjU3LTExLjc1OSAxMC4wMjktMjAuMTUxIDE4Ljg0NS0yOC45NjZzMTcuMjA3LTE0LjI3NSAyOC45NjYtMTguODQ1YzguODc3LTMuNDUgMjIuMjE2LTcuNTU0IDQ2Ljc3OC04LjY3NCAyNi41NjQtMS4yMTIgMzQuNTMyLTEuNDY5IDEwMS43OTgtMS40NjkiIG1hc2s9InVybCgjYikiLz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzNzMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0YzQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzNtMC0yMTMuMzM4Yy03MS40NDcgMC0xMjkuMzY1IDU3LjkxOC0xMjkuMzY1IDEyOS4zNjUgMCA3MS40NDYgNTcuOTE4IDEyOS4zNjQgMTI5LjM2NSAxMjkuMzY0IDcxLjQ0NiAwIDEyOS4zNjQtNTcuOTE4IDEyOS4zNjQtMTI5LjM2NCAwLTcxLjQ0Ny01Ny45MTgtMTI5LjM2NS0xMjkuMzY0LTEyOS4zNjVNNDE2LjYyNyAxMTcuNjA0YzAgMTYuNjk2LTEzLjUzNSAzMC4yMy0zMC4yMzEgMzAuMjMtMTYuNjk1IDAtMzAuMjMtMTMuNTM0LTMwLjIzLTMwLjIzczEzLjUzNS0zMC4yMzEgMzAuMjMtMzAuMjMxYzE2LjY5NiAwIDMwLjIzMSAxMy41MzUgMzAuMjMxIDMwLjIzMSIvPjwvZz48L3N2Zz4="},6355:(e,t,i)=>{"use strict";i.d(t,{A:()=>h});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r),a=i(4417),l=i.n(a),c=new URL(i(4782),i.b),d=s()(n()),u=l()(c);d.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(${u});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 h=d},6356:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}: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}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}.ck.ck-clipboard-drop-target-line:before{border-style:solid;content:"";height:0;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-width)*-.5);width:0}[dir=ltr] .ck.ck-clipboard-drop-target-line:before{border-color:transparent transparent transparent var(--ck-clipboard-drop-target-color);border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height);left:-1px}[dir=rtl] .ck.ck-clipboard-drop-target-line:before{border-color:transparent var(--ck-clipboard-drop-target-color) transparent transparent;border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0;right:-1px}',""]);const a=s},6365:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button{border-radius:0;padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2);width:100%}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button:focus{border-color:transparent;box-shadow:none}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button:focus:not(.ck-on){background:var(--ck-color-button-default-hover-background)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-icon-spacing:not(:has(.ck-button__icon))>.ck-button__label{margin-left:calc(var(--ck-icon-size) - var(--ck-spacing-small))}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-right:calc(var(--ck-spacing-small)*-1);transform:rotate(-90deg)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-left:calc(var(--ck-spacing-small)*-1);transform:rotate(90deg)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-disabled>.ck-dropdown-menu-list__nested-menu__button__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}",""]);const a=s},6533:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-dialog .ck.ck-dialog__actions{display:flex;justify-content:flex-end;padding:var(--ck-spacing-large)}.ck.ck-dialog .ck.ck-dialog__actions>*+*{margin-left:var(--ck-spacing-large)}",""]);const a=s},6580:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-highlighted-text mark{background:var(--ck-color-highlight-background);font-size:inherit;font-weight:inherit;line-height:inherit;vertical-align:initial}",""]);const a=s},6608:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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-panel)}.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-panel) + 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{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;bottom:0;min-width:100%}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0}.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}.ck.ck-dropdown__panel:focus{outline:none}",""]);const a=s},6681:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-menu-bar__menu{display:block;font-size:inherit;position:relative}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level{max-width:100%}",""]);const a=s},6802:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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=s},6808:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);border-radius:0;padding:0 var(--ck-spacing-small)}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar .ck.ck-toolbar__separator{background:var(--ck-color-toolbar-border);height:var(--ck-icon-size);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.ck-toolbar:focus{outline:none}.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 a=s},6888:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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-panel-background)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background)}",""]);const a=s},6912:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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-icon-font-size:.8333350694em}.ck.ck-icon{font-size:var(--ck-icon-font-size);height:var(--ck-icon-size);width:var(--ck-icon-size)}.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 a=s},6926:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},7247:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck-hidden{display:none!important}:root{--ck-z-default:1;--ck-z-panel:calc(var(--ck-z-default) + 999);--ck-z-dialog:9999}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-powered-by-font-size:calc(var(--ck-font-size-base)*7.5/13);--ck-powered-by-line-height:calc(var(--ck-font-size-base)*10/13);--ck-powered-by-letter-spacing:calc(var(--ck-font-size-base)*-0.2/13);--ck-powered-by-padding-vertical:2px;--ck-powered-by-padding-horizontal:4px;--ck-powered-by-text-color:#4f4f4f;--ck-powered-by-border-radius:var(--ck-border-radius);--ck-powered-by-background:#fff;--ck-powered-by-border-color:var(--ck-color-focus-border);--ck-powered-by-svg-width:53;--ck-powered-by-svg-height:10;--ck-powered-by-icon-width:calc(var(--ck-font-size-base)*var(--ck-powered-by-svg-width)/13);--ck-powered-by-icon-height:calc(var(--ck-font-size-base)*var(--ck-powered-by-svg-height)/13)}.ck.ck-balloon-panel.ck-powered-by-balloon{--ck-border-radius:var(--ck-powered-by-border-radius);background:var(--ck-powered-by-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by{line-height:var(--ck-powered-by-line-height)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by a{align-items:center;cursor:pointer;display:flex;filter:grayscale(80%);line-height:var(--ck-powered-by-line-height);opacity:.66;padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{color:var(--ck-powered-by-text-color);cursor:pointer;font-size:var(--ck-powered-by-font-size);font-weight:700;letter-spacing:var(--ck-powered-by-letter-spacing);line-height:normal;margin-right:4px;padding-left:2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{cursor:pointer;display:block;height:var(--ck-powered-by-icon-height);width:var(--ck-powered-by-icon-width)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{filter:grayscale(0);opacity:1}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-powered-by-border-color)}:root{--ck-evaluation-badge-font-size:calc(var(--ck-font-size-base)*7.5/13);--ck-evaluation-badge-line-height:calc(var(--ck-font-size-base)*7.5/13);--ck-evaluation-badge-letter-spacing:calc(var(--ck-font-size-base)*-0.2/13);--ck-evaluation-badge-padding-vertical:2px;--ck-evaluation-badge-padding-horizontal:4px;--ck-evaluation-badge-text-color:#4f4f4f;--ck-evaluation-badge-border-radius:var(--ck-border-radius);--ck-evaluation-badge-background:#fff;--ck-evaluation-badge-border-color:var(--ck-color-focus-border)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon{--ck-border-radius:var(--ck-evaluation-badge-border-radius);background:var(--ck-evaluation-badge-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge{line-height:var(--ck-evaluation-badge-line-height);padding:var(--ck-evaluation-badge-padding-vertical) var(--ck-evaluation-badge-padding-horizontal)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge .ck-evaluation-badge__label{color:var(--ck-evaluation-badge-text-color);display:block;font-size:var(--ck-evaluation-badge-font-size);font-weight:700;letter-spacing:var(--ck-evaluation-badge-letter-spacing);line-height:normal;padding:0 2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-evaluation-badge-border-color)}: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-dialog-background:var(--ck-custom-background);--ck-color-dialog-form-header-border:var(--ck-custom-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-color-light-red:#fcc;--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{background:transparent;border:0;box-sizing:border-box;height:auto;margin:0;padding:0;position:static;text-decoration:none;transition:none;vertical-align:middle;width:auto;word-wrap:break-word}.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 a=s},7642:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-color-selector-column-resizer-hover:var(--ck-color-base-active);--ck-table-column-resizer-width:7px;--ck-table-column-resizer-position-offset:calc(var(--ck-table-column-resizer-width)*-0.5 - 0.5px)}.ck-content .table .ck-table-resized{table-layout:fixed}.ck-content .table table{overflow:hidden}.ck-content .table td,.ck-content .table th{overflow-wrap:break-word;position:relative}.ck.ck-editor__editable .table .ck-table-column-resizer{bottom:0;cursor:col-resize;position:absolute;right:var(--ck-table-column-resizer-position-offset);top:0;user-select:none;width:var(--ck-table-column-resizer-width);z-index:var(--ck-z-default)}.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer,.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer{display:none}.ck.ck-editor__editable .table .ck-table-column-resizer:hover,.ck.ck-editor__editable .table .ck-table-column-resizer__active{background-color:var(--ck-color-selector-column-resizer-hover);bottom:-999999px;opacity:.25;top:-999999px}.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer{left:var(--ck-table-column-resizer-position-offset);right:unset}",""]);const a=s},7659:e=>{"use strict";var t={};e.exports=function(e,i){var o=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(e){i=null}t[e]=i}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(i)}},7693:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck-content .media{clear:both;display:block;margin:.9em 0;min-width:15em}",""]);const a=s},7784:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwME0xNjMuNCAzMDUuNWM4OC43IDAgMTM3LjItNzMuNSAxMzcuMi0xMzcuMiAwLTIuMSAwLTQuMi0uMS02LjIgOS40LTYuOCAxNy42LTE1LjMgMjQuMS0yNS04LjYgMy44LTE3LjkgNi40LTI3LjcgNy42IDEwLTYgMTcuNi0xNS40IDIxLjItMjYuNy05LjMgNS41LTE5LjYgOS41LTMwLjYgMTEuNy04LjgtOS40LTIxLjMtMTUuMi0zNS4yLTE1LjItMjYuNiAwLTQ4LjIgMjEuNi00OC4yIDQ4LjIgMCAzLjguNCA3LjUgMS4zIDExLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40LTQuMSA3LjEtNi41IDE1LjQtNi41IDI0LjIgMCAxNi43IDguNSAzMS41IDIxLjUgNDAuMS03LjktLjItMTUuMy0yLjQtMjEuOC02di42YzAgMjMuNCAxNi42IDQyLjggMzguNyA0Ny4zLTQgMS4xLTguMyAxLjctMTIuNyAxLjctMy4xIDAtNi4xLS4zLTkuMS0uOSA2LjEgMTkuMiAyMy45IDMzLjEgNDUgMzMuNS0xNi41IDEyLjktMzcuMyAyMC42LTU5LjkgMjAuNi0zLjkgMC03LjctLjItMTEuNS0uNyAyMS4xIDEzLjggNDYuNSAyMS44IDczLjcgMjEuOCIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg=="},7817:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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-number,.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=s},7883:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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{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;top:0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0;transform:translate(calc(var(--ck-spacing-medium)*-1),-6px) scale(.75);transform-origin:100% 0}@media (prefers-reduced-motion:reduce){.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transition:none}}.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)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.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):not(.ck-error)>.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}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.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):not(.ck-error)>.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:not(.ck-labeled-field-view_placeholder)>.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):not(.ck-error)>.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.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 a=s},7930:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.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 a=s},8020:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,":root{--ck-accessibility-help-dialog-max-width:600px;--ck-accessibility-help-dialog-max-height:400px;--ck-accessibility-help-dialog-border-color:#ccced1;--ck-accessibility-help-dialog-code-background-color:#ededed;--ck-accessibility-help-dialog-kbd-shadow-color:#9c9c9c}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{border:1px solid transparent;max-height:var(--ck-accessibility-help-dialog-max-height);max-width:var(--ck-accessibility-help-dialog-max-width);overflow:auto;padding:var(--ck-spacing-large);user-select:text}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content *{white-space:normal}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content .ck-label{display:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3{font-size:1.2em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4{font-size:1em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content p,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content table{margin:1em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl{border-bottom:none;border-top:1px solid var(--ck-accessibility-help-dialog-border-color);display:grid;grid-template-columns:2fr 1fr}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{border-bottom:1px solid var(--ck-accessibility-help-dialog-border-color);padding:.4em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{grid-column-start:1}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd{grid-column-start:2;text-align:right}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{background:var(--ck-accessibility-help-dialog-code-background-color);border-radius:2px;display:inline-block;font-size:.9em;line-height:1;padding:.4em;text-align:center;vertical-align:middle}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code{font-family:monospace}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{box-shadow:0 1px 1px var(--ck-accessibility-help-dialog-kbd-shadow-color);margin:0 1px;min-width:1.8em}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd+kbd{margin-left:2px}",""]);const a=s},8034:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:none;opacity:1}}.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=s},8118:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck-textarea{overflow-x:hidden}",""]);const a=s},8156:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8390:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-dialog-overlay{bottom:0;left:0;overscroll-behavior:none;position:fixed;right:0;top:0;user-select:none}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent{animation:none;background:none;pointer-events:none}.ck.ck-dialog{overscroll-behavior:none;position:absolute;width:fit-content}.ck.ck-dialog .ck.ck-form__header{flex-shrink:0}.ck.ck-dialog:not(.ck-dialog_modal) .ck.ck-form__header .ck-form__header__label{cursor:grab}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent .ck.ck-dialog{pointer-events:all}:root{--ck-dialog-overlay-background-color:rgba(0,0,0,.5);--ck-dialog-drop-shadow:0px 0px 6px 2px rgba(0,0,0,.15);--ck-dialog-max-width:100vw;--ck-dialog-max-height:90vh;--ck-color-dialog-background:var(--ck-color-base-background);--ck-color-dialog-form-header-border:var(--ck-color-base-border)}.ck.ck-dialog-overlay{animation:ck-dialog-fade-in .3s;background:var(--ck-dialog-overlay-background-color);z-index:var(--ck-z-dialog)}.ck.ck-dialog{border-radius:0;--ck-drop-shadow:var(--ck-dialog-drop-shadow);background:var(--ck-color-dialog-background);border:1px solid var(--ck-color-base-border);max-height:var(--ck-dialog-max-height);max-width:var(--ck-dialog-max-width);overscroll-behavior:contain}.ck-rounded-corners .ck.ck-dialog,.ck.ck-dialog.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dialog{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-dialog .ck.ck-form__header{border-bottom:1px solid var(--ck-color-dialog-form-header-border)}.ck-dialog-scroll-locked{overflow:hidden}@keyframes ck-dialog-fade-in{0%{background:transparent}to{background:var(--ck-dialog-overlay-background-color)}}",""]);const a=s},8397:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}",""]);const a=s},8424:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},8507:(e,t,i)=>{const o=i(5659);function n(e,t){return function(i){return t(e(i))}}function r(e,t){const i=[t[e].parent,e];let r=o[t[e].parent][e],s=t[e].parent;for(;t[s].parent;)i.unshift(t[s].parent),r=n(o[t[s].parent][s],r),s=t[s].parent;return r.conversion=i,r}e.exports=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(o);for(let i=t.length,o=0;o<i;o++)e[t[o]]={distance:-1,parent:null};return e}(),i=[e];for(t[e].distance=0;i.length;){const e=i.pop(),n=Object.keys(o[e]);for(let o=n.length,r=0;r<o;r++){const o=n[r],s=t[o];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,i.unshift(o))}}return t}(e),i={},n=Object.keys(t);for(let e=n.length,o=0;o<e;o++){const e=n[o];null!==t[e].parent&&(i[e]=r(e,t))}return i}},9025:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-editor__editable img.image_placeholder{background-size:100% 100%}",""]);const a=s},9118:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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{background:var(--ck-color-list-background);border-radius:0;list-style-type:none;padding:var(--ck-spacing-small) 0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list__item{cursor:default;min-width:15em}.ck.ck-list__item>.ck-button:not(.ck-list-item-button){border-radius:0;min-height:unset;padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2);width:100%}[dir=ltr] .ck.ck-list__item>.ck-button:not(.ck-list-item-button){text-align:left}[dir=rtl] .ck.ck-list__item>.ck-button:not(.ck-list-item-button){text-align:right}.ck.ck-list__item>.ck-button:not(.ck-list-item-button) .ck-button__label{line-height:calc(var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button){background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck-list .ck-list__group{padding-top:var(--ck-spacing-medium)}.ck-list .ck-list__group:first-child{padding-top:0}:not(.ck-hidden)~.ck-list .ck-list__group{border-top:1px solid var(--ck-color-base-border)}.ck-list .ck-list__group>.ck-label{font-size:11px;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-large) 0}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;margin:var(--ck-spacing-small) 0;width:100%}",""]);const a=s},9311:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}",""]);const a=s},9392:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-link-form{align-items:flex-start;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:0 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 a=s},9432:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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 a=s},9576:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.push([e.id,".ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{align-items:center;display:flex}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{justify-content:flex-start}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{display:flex;flex-direction:row;justify-content:space-around}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-cancel,.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-save{flex:1}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{width:100%}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-left:var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment label.ck.ck-color-grid__label{font-weight:unset}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker{padding:8px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker{height:100px;min-width:180px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation){border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue){border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius)}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue-pointer),.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation-pointer){height:15px;width:15px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{padding:0 8px 8px}",""]);const a=s},9736:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDI0IiBoZWlnaHQ9IjEwMjQiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjx0aXRsZT5GaWxsIDE8L3RpdGxlPjxwYXRoIGZpbGw9IiNGRkZGRkUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTk2Ny40ODQgMEg1Ni41MTdDMjUuMzA0IDAgMCAyNS4zMDQgMCA1Ni41MTd2OTEwLjk2NkMwIDk5OC42OTQgMjUuMjk3IDEwMjQgNTYuNTIyIDEwMjRINTQ3VjYyOEg0MTRWNDczaDEzM1YzNTkuMDI5YzAtMTMyLjI2MiA4MC43NzMtMjA0LjI4MiAxOTguNzU2LTIwNC4yODIgNTYuNTEzIDAgMTA1LjA4NiA0LjIwOCAxMTkuMjQ0IDYuMDg5VjI5OWwtODEuNjE2LjAzN2MtNjMuOTkzIDAtNzYuMzg0IDMwLjQ5Mi03Ni4zODQgNzUuMjM2VjQ3M2gxNTMuNDg3bC0xOS45ODYgMTU1SDcwN3YzOTZoMjYwLjQ4NGMzMS4yMTMgMCA1Ni41MTYtMjUuMzAzIDU2LjUxNi01Ni41MTZWNTYuNTE1QzEwMjQgMjUuMzAzIDk5OC42OTcgMCA5NjcuNDg0IDAiLz48L3N2Zz4="},9974:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var o=i(1601),n=i.n(o),r=i(6314),s=i.n(r)()(n());s.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)}@media (prefers-reduced-motion:reduce){.ck .ck-widget{transition:none}}.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{box-shadow:var(--ck-inner-shadow),0 0}@media (forced-colors:none){.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)}}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused:not(td,th),.ck .ck-editor__nested-editable:focus:not(td,th){border:var(--ck-focus-ring);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)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{transition:none}}.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)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{transition:none}}.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 a=s}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,exports:{}};return i[e](r,r.exports,n),r.exports}n.m=i,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(i,o){if(1&o&&(i=this(i)),8&o)return i;if("object"==typeof i&&i){if(4&o&&i.__esModule)return i;if(16&o&&"function"==typeof i.then)return i}var r=Object.create(null);n.r(r);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&o&&i;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>i[e]));return s.default=()=>i,n.d(r,s),r},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.b=document.baseURI||self.location.href;var r={};return(()=>{"use strict";let e;n.r(r),n.d(r,{default:()=>eS});try{e={window,document}}catch(t){e={window:{},document:{}}}const t=e;function i(){try{return navigator.userAgent.toLowerCase()}catch(e){return""}}const o=i(),s={isMac:a(o),isWindows:l(o),isGecko:c(o),isSafari:d(o),isiOS:u(o),isAndroid:h(o),isBlink:m(o),get isMediaForcedColors(){return!!t.window.matchMedia&&t.window.matchMedia("(forced-colors: active)").matches},get isMotionReduced(){return!!t.window.matchMedia&&t.window.matchMedia("(prefers-reduced-motion)").matches},features:{isRegExpUnicodePropertySupported:g()}};function a(e){return e.indexOf("macintosh")>-1}function l(e){return e.indexOf("windows")>-1}function c(e){return!!e.match(/gecko\/\d+/)}function d(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}function u(e){return!!e.match(/iphone|ipad/i)||a(e)&&navigator.maxTouchPoints>0}function h(e){return e.indexOf("android")>-1}function m(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function g(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}function p(e,t,i,o){i=i||function(e,t){return e===t};const n=Array.isArray(e)?e:Array.prototype.slice.call(e),r=Array.isArray(t)?t:Array.prototype.slice.call(t),s=function(e,t,i){const o=f(e,t,i);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const n=f(b(e,o),b(t,o),i);return{firstIndex:o,lastIndexOld:e.length-n,lastIndexNew:t.length-n}}(n,r,i),a=o?function(e,t){const{firstIndex:i,lastIndexOld:o,lastIndexNew:n}=e;if(-1===i)return Array(t).fill("equal");let r=[];return i>0&&(r=r.concat(Array(i).fill("equal"))),n-i>0&&(r=r.concat(Array(n-i).fill("insert"))),o-i>0&&(r=r.concat(Array(o-i).fill("delete"))),n<t&&(r=r.concat(Array(t-n).fill("equal"))),r}(s,r.length):function(e,t){const i=[],{firstIndex:o,lastIndexOld:n,lastIndexNew:r}=t;return r-o>0&&i.push({index:o,type:"insert",values:e.slice(o,r)}),n-o>0&&i.push({index:o+(r-o),type:"delete",howMany:n-o}),i}(r,s);return a}function f(e,t,i){for(let o=0;o<Math.max(e.length,t.length);o++)if(void 0===e[o]||void 0===t[o]||!i(e[o],t[o]))return o;return-1}function b(e,t){return e.slice(t).reverse()}function k(e,t,i){i=i||function(e,t){return e===t};const o=e.length,n=t.length;if(o>200||n>200||o+n>300)return k.fastDiff(e,t,i,!0);let r,s;if(n<o){const i=e;e=t,t=i,r="delete",s="insert"}else r="insert",s="delete";const a=e.length,l=t.length,c=l-a,d={},u={};function h(o){const n=(void 0!==u[o-1]?u[o-1]:-1)+1,c=void 0!==u[o+1]?u[o+1]:-1,h=n>c?-1:1;d[o+h]&&(d[o]=d[o+h].slice(0)),d[o]||(d[o]=[]),d[o].push(n>c?r:s);let m=Math.max(n,c),g=m-o;for(;g<a&&m<l&&i(e[g],t[m]);)g++,m++,d[o].push("equal");return m}let m,g=0;do{for(m=-g;m<c;m++)u[m]=h(m);for(m=c+g;m>c;m--)u[m]=h(m);u[c]=h(c),g++}while(u[c]!==l);return d[c].slice(1)}k.fastDiff=p;class _{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const w=new Array(256).fill("").map(((e,t)=>("0"+t.toString(16)).slice(-2)));function v(){const[e,t,i,o]=crypto.getRandomValues(new Uint32Array(4));return"e"+w[255&e]+w[e>>8&255]+w[e>>16&255]+w[e>>24&255]+w[255&t]+w[t>>8&255]+w[t>>16&255]+w[t>>24&255]+w[255&i]+w[i>>8&255]+w[i>>16&255]+w[i>>24&255]+w[255&o]+w[o>>8&255]+w[o>>16&255]+w[o>>24&255]}const y={get(e="normal"){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function x(e,t){const i=y.get(t.priority);let o=0,n=e.length;for(;o<n;){const t=o+n>>1;y.get(e[t].priority)<i?n=t:o=t+1}e.splice(o,0,t)}class A extends Error{constructor(e,t,i){super(function(e,t){const i=new WeakSet;return e+(t?` ${JSON.stringify(t,((e,t)=>{if("object"==typeof t&&null!==t){if(i.has(t))return`[object ${t.constructor.name}]`;i.add(t)}return t}))}`:"")+T(e)}(e,i)),this.name="CKEditorError",this.context=t,this.data=i}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const i=new A(e.message,t);throw i.stack=e.stack,i}}function C(e,t){console.warn(...E(e,t))}function T(e){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-${e}`}function E(e,t){const i=T(e);return t?[e,t,i]:[e,i]}const S=new Date(2025,2,5);if(globalThis.CKEDITOR_VERSION)throw new A("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION="44.3.0";const P=Symbol("listeningTo"),I=Symbol("emitterId"),M=Symbol("delegations"),O=V(Object);function V(e){return e?class extends e{on(e,t,i){this.listenTo(this,e,t,i)}once(e,t,i){let o=!1;this.listenTo(this,e,((e,...i)=>{o||(o=!0,e.off(),t.call(this,e,...i))}),i)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,i,o={}){let n,r;this[P]||(this[P]={});const s=this[P];R(e)||N(e);const a=R(e);(n=s[a])||(n=s[a]={emitter:e,callbacks:{}}),(r=n.callbacks[t])||(r=n.callbacks[t]=[]),r.push(i),function(e,t,i,o,n){t._addEventListener?t._addEventListener(i,o,n):e._addEventListener.call(t,i,o,n)}(this,e,t,i,o)}stopListening(e,t,i){const o=this[P];let n=e&&R(e);const r=o&&n?o[n]:void 0,s=r&&t?r.callbacks[t]:void 0;if(!(!o||e&&!r||t&&!s))if(i)z(this,e,t,i),-1!==s.indexOf(i)&&(1===s.length?delete r.callbacks[t]:z(this,e,t,i));else if(s){for(;i=s.pop();)z(this,e,t,i);delete r.callbacks[t]}else if(r){for(t in r.callbacks)this.stopListening(e,t);delete o[n]}else{for(n in o)this.stopListening(o[n].emitter);delete this[P]}}fire(e,...t){try{const i=e instanceof _?e:new _(this,e),o=i.name;let n=function(e,t){if(!e._events)return null;let i=t;do{const t=e._events[i];if(t&&t.callbacks&&t.callbacks.length)return t.callbacks;const o=i.lastIndexOf(":");i=o>-1?i.substring(0,o):""}while(i);return null}(this,o);if(i.path.push(this),n){n=n.slice();for(let e=0;e<n.length;e++){const r=n[e].callback;if(r.call(this,i,...t),i.off.called&&(delete i.off.called,this._removeEventListener(o,r)),i.stop.called)break}}const r=this[M];if(r){const e=r.get(o),n=r.get("*");e&&L(e,i,t),n&&L(n,i,t)}return i.return}catch(e){A.rethrowUnexpectedError(e,this)}}delegate(...e){return{to:(t,i)=>{this[M]||(this[M]=new Map),e.forEach((e=>{const o=this[M].get(e);o?o.set(t,i):this[M].set(e,new Map([[t,i]]))}))}}}stopDelegating(e,t){if(this[M])if(e)if(t){const i=this[M].get(e);i&&i.delete(t)}else this[M].delete(e);else this[M].clear()}_addEventListener(e,t,i){!function(e,t){const i=B(e);if(i[t])return;let o=t,n=null;const r=[];for(;""!==o&&!i[o];)i[o]={callbacks:[],childEvents:[]},r.push(i[o]),n&&i[o].childEvents.push(n),n=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const e of r)e.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}(this,e);const o=D(this,e),n={callback:t,priority:y.get(i.priority)};for(const e of o)x(e,n)}_removeEventListener(e,t){const i=D(this,e);for(const e of i)for(let i=0;i<e.length;i++)e[i].callback==t&&(e.splice(i,1),i--)}}:O}function N(e,t){e[I]||(e[I]=t||v())}function R(e){return e[I]}function B(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function D(e,t){const i=B(e)[t];if(!i)return[];let o=[i.callbacks];for(let t=0;t<i.childEvents.length;t++){const n=D(e,i.childEvents[t]);o=o.concat(n)}return o}function L(e,t,i){for(let[o,n]of e){n?"function"==typeof n&&(n=n(t.name)):n=t.name;const e=new _(t.source,n);e.path=[...t.path],o.fire(e,...i)}}function z(e,t,i,o){t._removeEventListener?t._removeEventListener(i,o):e._removeEventListener.call(t,i,o)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{V[e]=O.prototype[e]}));const F=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},j=Symbol("observableProperties"),U=Symbol("boundObservables"),H=Symbol("boundProperties"),W=Symbol("decoratedMethods"),$=Symbol("decoratedOriginal"),q=Z(V());function Z(e){return e?class extends e{set(e,t){if(F(e))return void Object.keys(e).forEach((t=>{this.set(t,e[t])}),this);G(this);const i=this[j];if(e in this&&!i.has(e))throw new A("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>i.get(e),set(t){const o=i.get(e);let n=this.fire(`set:${e}`,e,t,o);void 0===n&&(n=t),o===n&&i.has(e)||(i.set(e,n),this.fire(`change:${e}`,e,n,o))}}),this[e]=t}bind(...e){if(!e.length||!Q(e))throw new A("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new A("observable-bind-duplicate-properties",this);G(this);const t=this[H];e.forEach((e=>{if(t.has(e))throw new A("observable-bind-rebind",this)}));const i=new Map;return e.forEach((e=>{const o={property:e,to:[]};t.set(e,o),i.set(e,o)})),{to:K,toMany:Y,_observable:this,_bindProperties:e,_to:[],_bindings:i}}unbind(...e){if(!this[j])return;const t=this[H],i=this[U];if(e.length){if(!Q(e))throw new A("observable-unbind-wrong-properties",this);e.forEach((e=>{const o=t.get(e);o&&(o.to.forEach((([e,t])=>{const n=i.get(e),r=n[t];r.delete(o),r.size||delete n[t],Object.keys(n).length||(i.delete(e),this.stopListening(e,"change"))})),t.delete(e))}))}else i.forEach(((e,t)=>{this.stopListening(t,"change")})),i.clear(),t.clear()}decorate(e){G(this);const t=this[e];if(!t)throw new A("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,((e,i)=>{e.return=t.apply(this,i)})),this[e]=function(...t){return this.fire(e,t)},this[e][$]=t,this[W]||(this[W]=[]),this[W].push(e)}stopListening(e,t,i){if(!e&&this[W]){for(const e of this[W])this[e]=this[e][$];delete this[W]}super.stopListening(e,t,i)}}:q}function G(e){e[j]||(Object.defineProperty(e,j,{value:new Map}),Object.defineProperty(e,U,{value:new Map}),Object.defineProperty(e,H,{value:new Map}))}function K(...e){const t=function(...e){if(!e.length)throw new A("observable-bind-to-parse-error",null);const t={to:[]};let i;return"function"==typeof e[e.length-1]&&(t.callback=e.pop()),e.forEach((e=>{if("string"==typeof e)i.properties.push(e);else{if("object"!=typeof e)throw new A("observable-bind-to-parse-error",null);i={observable:e,properties:[]},t.to.push(i)}})),t}(...e),i=Array.from(this._bindings.keys()),o=i.length;if(!t.callback&&t.to.length>1)throw new A("observable-bind-to-no-callback",this);if(o>1&&t.callback)throw new A("observable-bind-to-extra-callback",this);var n;t.to.forEach((e=>{if(e.properties.length&&e.properties.length!==o)throw new A("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),n=this._observable,this._to.forEach((e=>{const t=n[U];let i;t.get(e.observable)||n.listenTo(e.observable,"change",((o,r)=>{i=t.get(e.observable)[r],i&&i.forEach((e=>{J(n,e.property)}))}))})),function(e){let t;e._bindings.forEach(((i,o)=>{e._to.forEach((n=>{t=n.properties[i.callback?0:e._bindProperties.indexOf(o)],i.to.push([n.observable,t]),function(e,t,i,o){const n=e[U],r=n.get(i),s=r||{};s[o]||(s[o]=new Set),s[o].add(t),r||n.set(i,s)}(e._observable,i,n.observable,t)}))}))}(this),this._bindProperties.forEach((e=>{J(this._observable,e)}))}function Y(e,t,i){if(this._bindings.size>1)throw new A("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const i=e.map((e=>[e,t]));return Array.prototype.concat.apply([],i)}(e,t),i)}function Q(e){return e.every((e=>"string"==typeof e))}function J(e,t){const i=e[H].get(t);let o;i.callback?o=i.callback.apply(e,i.to.map((e=>e[0][e[1]]))):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=o:e.set(t,o)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{Z[e]=q.prototype[e]}));class X{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 ee(e){let t=0;for(const i of e)t++;return t}function te(e,t){const i=Math.min(e.length,t.length);for(let o=0;o<i;o++)if(e[o]!=t[o])return o;return e.length==t.length?"same":e.length<t.length?"prefix":"extension"}function ie(e){return!(!e||!e[Symbol.iterator])}const oe="object"==typeof global&&global&&global.Object===Object&&global;var ne="object"==typeof self&&self&&self.Object===Object&&self;const re=oe||ne||Function("return this")(),se=re.Symbol;var ae=Object.prototype,le=ae.hasOwnProperty,ce=ae.toString,de=se?se.toStringTag:void 0;var ue=Object.prototype.toString;var he=se?se.toStringTag:void 0;const me=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":he&&he in Object(e)?function(e){var t=le.call(e,de),i=e[de];try{e[de]=void 0;var o=!0}catch(e){}var n=ce.call(e);return o&&(t?e[de]=i:delete e[de]),n}(e):function(e){return ue.call(e)}(e)},ge=Array.isArray,pe=function(e){return null!=e&&"object"==typeof e},fe=function(e){return"string"==typeof e||!ge(e)&&pe(e)&&"[object String]"==me(e)};function be(e,t,i={},o=[]){const n=i&&i.xmlns,r=n?e.createElementNS(n,t):e.createElement(t);for(const e in i)r.setAttribute(e,i[e]);!fe(o)&&ie(o)||(o=[o]);for(let t of o)fe(t)&&(t=e.createTextNode(t)),r.appendChild(t);return r}const ke=function(e,t){return function(i){return e(t(i))}},_e=ke(Object.getPrototypeOf,Object);var we=Function.prototype,ve=Object.prototype,ye=we.toString,xe=ve.hasOwnProperty,Ae=ye.call(Object);const Ce=function(e){if(!pe(e)||"[object Object]"!=me(e))return!1;var t=_e(e);if(null===t)return!0;var i=xe.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&ye.call(i)==Ae},Te=function(e,t){return e===t||e!=e&&t!=t},Ee=function(e,t){for(var i=e.length;i--;)if(Te(e[i][0],t))return i;return-1};var Se=Array.prototype.splice;function Pe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}Pe.prototype.clear=function(){this.__data__=[],this.size=0},Pe.prototype.delete=function(e){var t=this.__data__,i=Ee(t,e);return!(i<0||(i==t.length-1?t.pop():Se.call(t,i,1),--this.size,0))},Pe.prototype.get=function(e){var t=this.__data__,i=Ee(t,e);return i<0?void 0:t[i][1]},Pe.prototype.has=function(e){return Ee(this.__data__,e)>-1},Pe.prototype.set=function(e,t){var i=this.__data__,o=Ee(i,e);return o<0?(++this.size,i.push([e,t])):i[o][1]=t,this};const Ie=Pe,Me=function(e){if(!F(e))return!1;var t=me(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Oe=re["__core-js_shared__"];var Ve=function(){var e=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var Ne=Function.prototype.toString;const Re=function(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Be=/^\[object .+?Constructor\]$/,De=Function.prototype,Le=Object.prototype,ze=De.toString,Fe=Le.hasOwnProperty,je=RegExp("^"+ze.call(Fe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ue=function(e){return!(!F(e)||(t=e,Ve&&Ve in t))&&(Me(e)?je:Be).test(Re(e));var t},He=function(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return Ue(i)?i:void 0},We=He(re,"Map"),$e=He(Object,"create");var qe=Object.prototype.hasOwnProperty;var Ze=Object.prototype.hasOwnProperty;function Ge(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}Ge.prototype.clear=function(){this.__data__=$e?$e(null):{},this.size=0},Ge.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ge.prototype.get=function(e){var t=this.__data__;if($e){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return qe.call(t,e)?t[e]:void 0},Ge.prototype.has=function(e){var t=this.__data__;return $e?void 0!==t[e]:Ze.call(t,e)},Ge.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=$e&&void 0===t?"__lodash_hash_undefined__":t,this};const Ke=Ge,Ye=function(e,t){var i,o,n=e.__data__;return("string"==(o=typeof(i=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==i:null===i)?n["string"==typeof t?"string":"hash"]:n.map};function Qe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}Qe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ke,map:new(We||Ie),string:new Ke}},Qe.prototype.delete=function(e){var t=Ye(this,e).delete(e);return this.size-=t?1:0,t},Qe.prototype.get=function(e){return Ye(this,e).get(e)},Qe.prototype.has=function(e){return Ye(this,e).has(e)},Qe.prototype.set=function(e,t){var i=Ye(this,e),o=i.size;return i.set(e,t),this.size+=i.size==o?0:1,this};const Je=Qe;function Xe(e){var t=this.__data__=new Ie(e);this.size=t.size}Xe.prototype.clear=function(){this.__data__=new Ie,this.size=0},Xe.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Xe.prototype.get=function(e){return this.__data__.get(e)},Xe.prototype.has=function(e){return this.__data__.has(e)},Xe.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Ie){var o=i.__data__;if(!We||o.length<199)return o.push([e,t]),this.size=++i.size,this;i=this.__data__=new Je(o)}return i.set(e,t),this.size=i.size,this};const et=Xe,tt=function(){try{var e=He(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),it=function(e,t,i){"__proto__"==t&&tt?tt(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i};var ot=Object.prototype.hasOwnProperty;const nt=function(e,t,i){var o=e[t];ot.call(e,t)&&Te(o,i)&&(void 0!==i||t in e)||it(e,t,i)},rt=function(e,t,i,o){var n=!i;i||(i={});for(var r=-1,s=t.length;++r<s;){var a=t[r],l=o?o(i[a],e[a],a,i,e):void 0;void 0===l&&(l=e[a]),n?it(i,a,l):nt(i,a,l)}return i},st=function(e){return pe(e)&&"[object Arguments]"==me(e)};var at=Object.prototype,lt=at.hasOwnProperty,ct=at.propertyIsEnumerable;const dt=st(function(){return arguments}())?st:function(e){return pe(e)&&lt.call(e,"callee")&&!ct.call(e,"callee")};var ut="object"==typeof exports&&exports&&!exports.nodeType&&exports,ht=ut&&"object"==typeof module&&module&&!module.nodeType&&module,mt=ht&&ht.exports===ut?re.Buffer:void 0;const gt=(mt?mt.isBuffer:void 0)||function(){return!1};var pt=/^(?:0|[1-9]\d*)$/;const ft=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&pt.test(e))&&e>-1&&e%1==0&&e<t},bt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var kt={};kt["[object Float32Array]"]=kt["[object Float64Array]"]=kt["[object Int8Array]"]=kt["[object Int16Array]"]=kt["[object Int32Array]"]=kt["[object Uint8Array]"]=kt["[object Uint8ClampedArray]"]=kt["[object Uint16Array]"]=kt["[object Uint32Array]"]=!0,kt["[object Arguments]"]=kt["[object Array]"]=kt["[object ArrayBuffer]"]=kt["[object Boolean]"]=kt["[object DataView]"]=kt["[object Date]"]=kt["[object Error]"]=kt["[object Function]"]=kt["[object Map]"]=kt["[object Number]"]=kt["[object Object]"]=kt["[object RegExp]"]=kt["[object Set]"]=kt["[object String]"]=kt["[object WeakMap]"]=!1;const _t=function(e){return function(t){return e(t)}};var wt="object"==typeof exports&&exports&&!exports.nodeType&&exports,vt=wt&&"object"==typeof module&&module&&!module.nodeType&&module,yt=vt&&vt.exports===wt&&oe.process;const xt=function(){try{return vt&&vt.require&&vt.require("util").types||yt&&yt.binding&&yt.binding("util")}catch(e){}}();var At=xt&&xt.isTypedArray;const Ct=At?_t(At):function(e){return pe(e)&&bt(e.length)&&!!kt[me(e)]};var Tt=Object.prototype.hasOwnProperty;const Et=function(e,t){var i=ge(e),o=!i&&dt(e),n=!i&&!o&&gt(e),r=!i&&!o&&!n&&Ct(e),s=i||o||n||r,a=s?function(e,t){for(var i=-1,o=Array(e);++i<e;)o[i]=t(i);return o}(e.length,String):[],l=a.length;for(var c in e)!t&&!Tt.call(e,c)||s&&("length"==c||n&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ft(c,l))||a.push(c);return a};var St=Object.prototype;const Pt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||St)},It=ke(Object.keys,Object);var Mt=Object.prototype.hasOwnProperty;const Ot=function(e){return null!=e&&bt(e.length)&&!Me(e)},Vt=function(e){return Ot(e)?Et(e):function(e){if(!Pt(e))return It(e);var t=[];for(var i in Object(e))Mt.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)};var Nt=Object.prototype.hasOwnProperty;const Rt=function(e){if(!F(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Pt(e),i=[];for(var o in e)("constructor"!=o||!t&&Nt.call(e,o))&&i.push(o);return i},Bt=function(e){return Ot(e)?Et(e,!0):Rt(e)};var Dt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Lt=Dt&&"object"==typeof module&&module&&!module.nodeType&&module,zt=Lt&&Lt.exports===Dt?re.Buffer:void 0,Ft=zt?zt.allocUnsafe:void 0;const jt=function(e,t){if(t)return e.slice();var i=e.length,o=Ft?Ft(i):new e.constructor(i);return e.copy(o),o},Ut=function(e,t){var i=-1,o=e.length;for(t||(t=Array(o));++i<o;)t[i]=e[i];return t},Ht=function(){return[]};var Wt=Object.prototype.propertyIsEnumerable,$t=Object.getOwnPropertySymbols;const qt=$t?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var i=-1,o=null==e?0:e.length,n=0,r=[];++i<o;){var s=e[i];t(s,i,e)&&(r[n++]=s)}return r}($t(e),(function(t){return Wt.call(e,t)})))}:Ht,Zt=function(e,t){for(var i=-1,o=t.length,n=e.length;++i<o;)e[n+i]=t[i];return e},Gt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Zt(t,qt(e)),e=_e(e);return t}:Ht,Kt=function(e,t,i){var o=t(e);return ge(e)?o:Zt(o,i(e))},Yt=function(e){return Kt(e,Vt,qt)},Qt=function(e){return Kt(e,Bt,Gt)},Jt=He(re,"DataView"),Xt=He(re,"Promise"),ei=He(re,"Set"),ti=He(re,"WeakMap");var ii="[object Map]",oi="[object Promise]",ni="[object Set]",ri="[object WeakMap]",si="[object DataView]",ai=Re(Jt),li=Re(We),ci=Re(Xt),di=Re(ei),ui=Re(ti),hi=me;(Jt&&hi(new Jt(new ArrayBuffer(1)))!=si||We&&hi(new We)!=ii||Xt&&hi(Xt.resolve())!=oi||ei&&hi(new ei)!=ni||ti&&hi(new ti)!=ri)&&(hi=function(e){var t=me(e),i="[object Object]"==t?e.constructor:void 0,o=i?Re(i):"";if(o)switch(o){case ai:return si;case li:return ii;case ci:return oi;case di:return ni;case ui:return ri}return t});const mi=hi;var gi=Object.prototype.hasOwnProperty;const pi=re.Uint8Array,fi=function(e){var t=new e.constructor(e.byteLength);return new pi(t).set(new pi(e)),t};var bi=/\w*$/;var ki=se?se.prototype:void 0,_i=ki?ki.valueOf:void 0;const wi=function(e,t){var i=t?fi(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)},vi=function(e,t,i){var o,n,r,s=e.constructor;switch(t){case"[object ArrayBuffer]":return fi(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return function(e,t){var i=t?fi(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return wi(e,i);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return(r=new(n=e).constructor(n.source,bi.exec(n))).lastIndex=n.lastIndex,r;case"[object Symbol]":return o=e,_i?Object(_i.call(o)):{}}};var yi=Object.create;const xi=function(){function e(){}return function(t){if(!F(t))return{};if(yi)return yi(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}(),Ai=function(e){return"function"!=typeof e.constructor||Pt(e)?{}:xi(_e(e))};var Ci=xt&&xt.isMap;const Ti=Ci?_t(Ci):function(e){return pe(e)&&"[object Map]"==mi(e)};var Ei=xt&&xt.isSet;const Si=Ei?_t(Ei):function(e){return pe(e)&&"[object Set]"==mi(e)};var Pi="[object Arguments]",Ii="[object Function]",Mi="[object Object]",Oi={};Oi[Pi]=Oi["[object Array]"]=Oi["[object ArrayBuffer]"]=Oi["[object DataView]"]=Oi["[object Boolean]"]=Oi["[object Date]"]=Oi["[object Float32Array]"]=Oi["[object Float64Array]"]=Oi["[object Int8Array]"]=Oi["[object Int16Array]"]=Oi["[object Int32Array]"]=Oi["[object Map]"]=Oi["[object Number]"]=Oi[Mi]=Oi["[object RegExp]"]=Oi["[object Set]"]=Oi["[object String]"]=Oi["[object Symbol]"]=Oi["[object Uint8Array]"]=Oi["[object Uint8ClampedArray]"]=Oi["[object Uint16Array]"]=Oi["[object Uint32Array]"]=!0,Oi["[object Error]"]=Oi[Ii]=Oi["[object WeakMap]"]=!1;const Vi=function e(t,i,o,n,r,s){var a,l=1&i,c=2&i,d=4&i;if(o&&(a=r?o(t,n,r,s):o(t)),void 0!==a)return a;if(!F(t))return t;var u=ge(t);if(u){if(a=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&gi.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(t),!l)return Ut(t,a)}else{var h=mi(t),m=h==Ii||"[object GeneratorFunction]"==h;if(gt(t))return jt(t,l);if(h==Mi||h==Pi||m&&!r){if(a=c||m?{}:Ai(t),!l)return c?function(e,t){return rt(e,Gt(e),t)}(t,function(e,t){return e&&rt(t,Bt(t),e)}(a,t)):function(e,t){return rt(e,qt(e),t)}(t,function(e,t){return e&&rt(t,Vt(t),e)}(a,t))}else{if(!Oi[h])return r?t:{};a=vi(t,h,l)}}s||(s=new et);var g=s.get(t);if(g)return g;s.set(t,a),Si(t)?t.forEach((function(n){a.add(e(n,i,o,n,t,s))})):Ti(t)&&t.forEach((function(n,r){a.set(r,e(n,i,o,r,t,s))}));var p=u?void 0:(d?c?Qt:Yt:c?Bt:Vt)(t);return function(e,t){for(var i=-1,o=null==e?0:e.length;++i<o&&!1!==t(e[i],i,e););}(p||t,(function(n,r){p&&(n=t[r=n]),nt(a,r,e(n,i,o,r,t,s))})),a},Ni=function(e,t){return Vi(e,5,t="function"==typeof t?t:void 0)},Ri=function(e){return pe(e)&&1===e.nodeType&&!Ce(e)};class Bi{constructor(e,t){this._config=Object.create(null),t&&this.define(Di(t)),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}*names(){for(const e of Object.keys(this._config))yield e}_setToTarget(e,t,i,o=!1){if(Ce(t))return void this._setObjectToTarget(e,t,o);const n=t.split(".");t=n.pop();for(const t of n)Ce(e[t])||(e[t]=Object.create(null)),e=e[t];if(Ce(i))return Ce(e[t])||(e[t]=Object.create(null)),e=e[t],void this._setObjectToTarget(e,i,o);o&&void 0!==e[t]||(e[t]=i)}_getFromSource(e,t){const i=t.split(".");t=i.pop();for(const t of i){if(!Ce(e[t])){e=null;break}e=e[t]}return e?Di(e[t]):void 0}_setObjectToTarget(e,t,i){Object.keys(t).forEach((o=>{this._setToTarget(e,o,t[o],i)}))}}function Di(e){return Ni(e,Li)}function Li(e){return Ri(e)||"function"==typeof e?e:void 0}function zi(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}function Fi(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}const ji=Ui(V());function Ui(e){return e?class extends e{listenTo(e,t,i,o={}){if(zi(e)||Fi(e)){const n={capture:!!o.useCapture,passive:!!o.usePassive},r=this._getProxyEmitter(e,n)||new Hi(e,n);this.listenTo(r,t,i,o)}else super.listenTo(e,t,i,o)}stopListening(e,t,i){if(zi(e)||Fi(e)){const o=this._getAllProxyEmitters(e);for(const e of o)this.stopListening(e,t,i)}else super.stopListening(e,t,i)}_getProxyEmitter(e,t){return function(e,t){const i=e[P];return i&&i[t]?i[t].emitter:null}(this,Wi(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))}}:ji}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{Ui[e]=ji.prototype[e]}));class Hi extends(V()){constructor(e,t){super(),N(this,Wi(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,i){this.attach(e),V().prototype._addEventListener.call(this,e,t,i)}_removeEventListener(e,t){V().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 Wi(e,t){let i=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=v())}(e);for(const e of Object.keys(t).sort())t[e]&&(i+="-"+e);return i}function $i(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)}}function qi(e){if(!e.target)return null;const t=e.target.ownerDocument,i=e.clientX,o=e.clientY;let n=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(i,o)?n=t.caretRangeFromPoint(i,o):e.rangeParent&&(n=t.createRange(),n.setStart(e.rangeParent,e.rangeOffset),n.collapse(!0)),n}function Zi(e){return"[object Text]"==Object.prototype.toString.call(e)}function Gi(e){return"[object Range]"==Object.prototype.toString.apply(e)}function Ki(e){return e&&e.parentNode?e.offsetParent===t.document.body?null:e.offsetParent:null}const Yi=["top","right","bottom","left","width","height"];class Qi{constructor(e){const t=Gi(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),eo(e)||t)if(t){const t=Qi.getDomRangeRects(e);Ji(this,Qi.getBoundingRect(t))}else Ji(this,e.getBoundingClientRect());else if(Fi(e)){const{innerWidth:t,innerHeight:i}=e;Ji(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else Ji(this,e)}clone(){return new Qi(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};if(t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0)return null;{const e=new Qi(t);return e._source=this._source,e}}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(Xi(e))return t;let i,o=e,n=e.parentNode||e.commonAncestorContainer;for(;n&&!Xi(n);){const e="visible"===((r=n)instanceof HTMLElement?r.ownerDocument.defaultView.getComputedStyle(r).overflow:"visible");o instanceof HTMLElement&&"absolute"===to(o)&&(i=o);const s=to(n);if(e||i&&("relative"===s&&e||"relative"!==s)){o=n,n=n.parentNode;continue}const a=new Qi(n),l=t.getIntersection(a);if(!l)return null;l.getArea()<t.getArea()&&(t=l),o=n,n=n.parentNode}var r;return t}isEqual(e){for(const t of Yi)if(this[t]!==e[t])return!1;return!0}contains(e){const t=this.getIntersection(e);return!(!t||!t.isEqual(e))}toAbsoluteRect(){const{scrollX:e,scrollY:i}=t.window,o=this.clone().moveBy(e,i);if(eo(o._source)){const e=Ki(o._source);e&&function(e,t){const i=new Qi(t),o=$i(t);let n=0,r=0;n-=i.left,r-=i.top,n+=t.scrollLeft,r+=t.scrollTop,n-=o.left,r-=o.top,e.moveBy(n,r)}(o,e)}return o}excludeScrollbarsAndBorders(){const e=this._source;let t,i,o;if(Fi(e))t=e.innerWidth-e.document.documentElement.clientWidth,i=e.innerHeight-e.document.documentElement.clientHeight,o=e.getComputedStyle(e.document.documentElement).direction;else{const n=$i(e);t=e.offsetWidth-e.clientWidth-n.left-n.right,i=e.offsetHeight-e.clientHeight-n.top-n.bottom,o=e.ownerDocument.defaultView.getComputedStyle(e).direction,this.left+=n.left,this.top+=n.top,this.right-=n.right,this.bottom-=n.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=t,"ltr"===o?this.right-=t:this.left+=t,this.height-=i,this.bottom-=i,this}static getDomRangeRects(e){const t=[],i=Array.from(e.getClientRects());if(i.length)for(const e of i)t.push(new Qi(e));else{let i=e.startContainer;Zi(i)&&(i=i.parentNode);const o=new Qi(i.getBoundingClientRect());o.right=o.left,o.width=0,t.push(o)}return t}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const o of e)i++,t.left=Math.min(t.left,o.left),t.top=Math.min(t.top,o.top),t.right=Math.max(t.right,o.right),t.bottom=Math.max(t.bottom,o.bottom);return 0==i?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new Qi(t))}}function Ji(e,t){for(const i of Yi)e[i]=t[i]}function Xi(e){return!!eo(e)&&e===e.ownerDocument.body}function eo(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"function"==typeof e.getBoundingClientRect}function to(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).position:"static"}class io{constructor(e,t){io._observerInstance||io._createObserver(),this._element=e,this._callback=t,io._addElementCallback(e,t),io._observerInstance.observe(e)}get element(){return this._element}destroy(){io._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){io._elementCallbacks||(io._elementCallbacks=new Map);let i=io._elementCallbacks.get(e);i||(i=new Set,io._elementCallbacks.set(e,i)),i.add(t)}static _deleteElementCallback(e,t){const i=io._getElementCallbacks(e);i&&(i.delete(t),i.size||(io._elementCallbacks.delete(e),io._observerInstance.unobserve(e))),io._elementCallbacks&&!io._elementCallbacks.size&&(io._observerInstance=null,io._elementCallbacks=null)}static _getElementCallbacks(e){return io._elementCallbacks?io._elementCallbacks.get(e):null}static _createObserver(){io._observerInstance=new t.window.ResizeObserver((e=>{for(const t of e){const e=io._getElementCallbacks(t.target);if(e)for(const i of e)i(t)}}))}}io._observerInstance=null,io._elementCallbacks=null;const oo=io;function no(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function ro(e){return t=>t+e}function so(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function ao(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function lo(e){return e&&e.nodeType===Node.COMMENT_NODE}function co(e){return!!e&&(Zi(e)?co(e.parentElement):!!e.getClientRects&&!!e.getClientRects().length)}function uo({element:e,target:i,positions:o,limiter:n,fitInViewport:r,viewportOffsetConfig:s}){Me(i)&&(i=i()),Me(n)&&(n=n());const a=Ki(e),l=function(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const i=new Qi(t.window);return i.top+=e.top,i.height-=e.top,i.bottom-=e.bottom,i.height-=e.bottom,i}(s),c=new Qi(e),d=ho(i,l);let u;if(!d||!l.getIntersection(d))return null;const h={targetRect:d,elementRect:c,positionedElementAncestor:a,viewportRect:l};if(n||r){if(n){const e=ho(n,l);e&&(h.limiterRect=e)}u=function(e,t){const{elementRect:i}=t,o=i.getArea(),n=e.map((e=>new mo(e,t))).filter((e=>!!e.name));let r=0,s=null;for(const e of n){const{limiterIntersectionArea:t,viewportIntersectionArea:i}=e;if(t===o)return e;const n=i**2+t**2;n>r&&(r=n,s=e)}return s}(o,h)}else u=new mo(o[0],h);return u}function ho(e,t){const i=new Qi(e).getVisible();return i?i.getIntersection(t):null}class mo{constructor(e,t){const i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;const{left:o,top:n,name:r,config:s}=i;this.name=r,this.config=s,this._positioningFunctionCoordinates={left:o,top:n},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function go(e){const t=e.parentNode;t&&t.removeChild(e)}function po({window:e,rect:t,alignToTop:i,forceScroll:o,viewportOffset:n}){const r=t.clone().moveBy(0,n.bottom),s=t.clone().moveBy(0,-n.top),a=new Qi(e).excludeScrollbarsAndBorders(),l=i&&o,c=[s,r].every((e=>a.contains(e)));let{scrollX:d,scrollY:u}=e;const h=d,m=u;l?u-=a.top-t.top+n.top:c||(ko(s,a)?u-=a.top-t.top+n.top:bo(r,a)&&(u+=i?t.top-a.top-n.top:t.bottom-a.bottom+n.bottom)),c||(_o(t,a)?d-=a.left-t.left+n.left:wo(t,a)&&(d+=t.right-a.right+n.right)),d==h&&u===m||e.scrollTo(d,u)}function fo({parent:e,getRect:t,alignToTop:i,forceScroll:o,ancestorOffset:n=0,limiterElement:r}){const s=vo(e),a=i&&o;let l,c,d;const u=r||s.document.body;for(;e!=u;)c=t(),l=new Qi(e).excludeScrollbarsAndBorders(),d=l.contains(c),a?e.scrollTop-=l.top-c.top+n:d||(ko(c,l)?e.scrollTop-=l.top-c.top+n:bo(c,l)&&(e.scrollTop+=i?c.top-l.top-n:c.bottom-l.bottom+n)),d||(_o(c,l)?e.scrollLeft-=l.left-c.left+n:wo(c,l)&&(e.scrollLeft+=c.right-l.right+n)),e=e.parentNode}function bo(e,t){return e.bottom>t.bottom}function ko(e,t){return e.top<t.top}function _o(e,t){return e.left<t.left}function wo(e,t){return e.right>t.right}function vo(e){return Gi(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function yo(e){if(Gi(e)){let t=e.commonAncestorContainer;return Zi(t)&&(t=t.parentNode),t}return e.parentNode}function xo(e,t){const i=vo(e),o=new Qi(e);if(i===t)return o;{let e=i;for(;e!=t;){const t=e.frameElement,i=new Qi(t).excludeScrollbarsAndBorders();o.moveBy(i.left,i.top),e=e.parent}}return o}const Ao={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},Co={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},To={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},Eo=Vo(),So=Object.fromEntries(Object.entries(Eo).map((([e,t])=>{let i;return i=t in To?To[t]:e.charAt(0).toUpperCase()+e.slice(1),[t,i]})));function Po(e){let t;if("string"==typeof e){if(t=Eo[e.toLowerCase()],!t)throw new A("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?Eo.alt:0)+(e.ctrlKey?Eo.ctrl:0)+(e.shiftKey?Eo.shift:0)+(e.metaKey?Eo.cmd:0);return t}function Io(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 Po(e.slice(0,-1));const t=Po(e);return(s.isMac||s.isiOS)&&t==Eo.ctrl?Eo.cmd:t}(e):e)).reduce(((e,t)=>t+e),0)}function Mo(e,t){let i=Io(e);const o=t?"Mac"===t:s.isMac||s.isiOS;return Object.entries(o?Ao:Co).reduce(((e,[t,o])=>(i&Eo[t]&&(i&=~Eo[t],e+=o),e)),"")+(i?So[i]:"")}function Oo(e,t){const i="ltr"===t;switch(e){case Eo.arrowleft:return i?"left":"right";case Eo.arrowright:return i?"right":"left";case Eo.arrowup:return"up";case Eo.arrowdown:return"down"}}function Vo(){const e={pageup:33,pagedown:34,end:35,home:36,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;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}function No(e){return Array.isArray(e)?e:[e]}const Ro=function(e,t,i){(void 0!==i&&!Te(e[t],i)||void 0===i&&!(t in e))&&it(e,t,i)},Bo=function(e,t,i){for(var o=-1,n=Object(e),r=i(e),s=r.length;s--;){var a=r[++o];if(!1===t(n[a],a,n))break}return e},Do=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},Lo=function(e,t,i,o,n,r,s){var a,l=Do(e,i),c=Do(t,i),d=s.get(c);if(d)Ro(e,i,d);else{var u=r?r(l,c,i+"",e,t,s):void 0,h=void 0===u;if(h){var m=ge(c),g=!m&&gt(c),p=!m&&!g&&Ct(c);u=c,m||g||p?ge(l)?u=l:pe(a=l)&&Ot(a)?u=Ut(l):g?(h=!1,u=jt(c,!0)):p?(h=!1,u=wi(c,!0)):u=[]:Ce(c)||dt(c)?(u=l,dt(l)?u=function(e){return rt(e,Bt(e))}(l):F(l)&&!Me(l)||(u=Ai(c))):h=!1}h&&(s.set(c,u),n(u,c,o,r,s),s.delete(c)),Ro(e,i,u)}},zo=function e(t,i,o,n,r){t!==i&&Bo(i,(function(s,a){if(r||(r=new et),F(s))Lo(t,i,a,o,e,n,r);else{var l=n?n(Do(t,a),s,a+"",t,i,r):void 0;void 0===l&&(l=s),Ro(t,a,l)}}),Bt)},Fo=function(e){return e};var jo=Math.max;const Uo=tt?function(e,t){return tt(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Fo;var Ho=Date.now;const Wo=function(e){var t=0,i=0;return function(){var o=Ho(),n=16-(o-i);if(i=o,n>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Uo),$o=function(e,t){return Wo(function(e,t,i){return t=jo(void 0===t?e.length-1:t,0),function(){for(var o=arguments,n=-1,r=jo(o.length-t,0),s=Array(r);++n<r;)s[n]=o[t+n];n=-1;for(var a=Array(t+1);++n<t;)a[n]=o[n];return a[t]=i(s),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,a)}}(e,t,Fo),e+"")},qo=function(e){return $o((function(t,i){var o=-1,n=i.length,r=n>1?i[n-1]:void 0,s=n>2?i[2]:void 0;for(r=e.length>3&&"function"==typeof r?(n--,r):void 0,s&&function(e,t,i){if(!F(i))return!1;var o=typeof t;return!!("number"==o?Ot(i)&&ft(t,i.length):"string"==o&&t in i)&&Te(i[t],e)}(i[0],i[1],s)&&(r=n<3?void 0:r,n=1),t=Object(t);++o<n;){var a=i[o];a&&e(t,a,o,r)}return t}))};var Zo=qo((function(e,t,i){zo(e,t,i)}));const Go=Zo;t.window.CKEDITOR_TRANSLATIONS||(t.window.CKEDITOR_TRANSLATIONS={});const Ko=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig"];function Yo(e){return Ko.includes(e)?"rtl":"ltr"}class Qo{constructor({uiLanguage:e="en",contentLanguage:t,translations:i}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Yo(this.uiLanguage),this.contentLanguageDirection=Yo(this.contentLanguage),this.translations=function(e){return Array.isArray(e)?e.reduce(((e,t)=>Go(e,t))):e}(i),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,i=[]){i=No(i),"string"==typeof e&&(e={string:e});const o=e.plural?i[0]:1;return function(e,t){return e.replace(/%(\d+)/g,((e,i)=>i<t.length?t[i]:e))}(function(e,i,o=1,n){if("number"!=typeof o)throw new A("translation-service-quantity-not-a-number",null,{quantity:o});const r=n||t.window.CKEDITOR_TRANSLATIONS,s=function(e){return Object.keys(e).length}(r);1===s&&(e=Object.keys(r)[0]);const a=i.id||i.string;if(0===s||!function(e,t,i){return!!i[e]&&!!i[e].dictionary[t]}(e,a,r))return 1!==o?i.plural:i.string;const l=r[e].dictionary,c=r[e].getPluralForm||(e=>1===e?0:1),d=l[a];return"string"==typeof d?d:d[Number(c(o))]}(this.uiLanguage,e,o,this.translations),i)}}class Jo extends(V()){constructor(e={},t={}){super();const i=ie(e);if(i||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const t of e)this._items.push(t),this._itemMap.set(this._getItemIdBeforeAdding(t),t)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new A("collection-add-item-invalid-index",this);let i=0;for(const o of e){const e=this._getItemIdBeforeAdding(o),n=t+i;this._items.splice(n,0,o),this._itemMap.set(e,o),this.fire("add",o,n),i++}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 A("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,i]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:i}),t}map(e,t){return this._items.map(e,t)}forEach(e,t){this._items.forEach(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 A("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,i=(i,o,n)=>{const r=t._bindToCollection==this,s=t._bindToInternalToExternalMap.get(o);if(r&&s)this._bindToExternalToInternalMap.set(o,s),this._bindToInternalToExternalMap.set(s,o);else{const i=e(o);if(!i)return void this._skippedIndexesFromExternal.push(n);let r=n;for(const e of this._skippedIndexesFromExternal)n>e&&r--;for(const e of t._skippedIndexesFromExternal)r>=e&&r++;this._bindToExternalToInternalMap.set(o,i),this._bindToInternalToExternalMap.set(i,o),this.add(i,r);for(let e=0;e<t._skippedIndexesFromExternal.length;e++)r<=t._skippedIndexesFromExternal[e]&&t._skippedIndexesFromExternal[e]++}};for(const e of t)i(0,e,t.getIndex(e));this.listenTo(t,"add",i),this.listenTo(t,"remove",((e,t,i)=>{const o=this._bindToExternalToInternalMap.get(t);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((e,t)=>(i<t&&e.push(t-1),i>t&&e.push(t),e)),[])}))}_getItemIdBeforeAdding(e){const t=this._idProperty;let i;if(t in e){if(i=e[t],"string"!=typeof i)throw new A("collection-add-invalid-id",this);if(this.get(i))throw new A("collection-add-item-already-exists",this)}else e[t]=i=v();return i}_remove(e){let t,i,o,n=!1;const r=this._idProperty;if("string"==typeof e?(i=e,o=this._itemMap.get(i),n=!o,o&&(t=this._items.indexOf(o))):"number"==typeof e?(t=e,o=this._items[t],n=!o,o&&(i=o[r])):(o=e,i=o[r],t=this._items.indexOf(o),n=-1==t||!this._itemMap.get(i)),n)throw new A("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(s),this.fire("remove",o,t),[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Xo(e){const t=e.next();return t.done?null:t.value}class en extends(Ui(Z())){constructor(){super(),this._elements=new Set,this._externalViews=new Set,this._blurTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(on(e))this._addElement(e);else if(tn(e))this._addView(e);else{if(!e.element)throw new A("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){on(e)?this._removeElement(e):tn(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new A("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",(()=>{const t=this.externalViews.find((t=>function(e,t){return!!nn(e,t)||!!t.focusTracker.externalViews.find((t=>nn(e,t)))}(e,t)));t?this._focus(t.element):this._focus(e)}),{useCapture:!0}),this.listenTo(e,"blur",(()=>{this._blur()}),{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",(()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()})),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){this.elements.find((e=>e.contains(document.activeElement)))||this.externalViews.find((e=>e.focusTracker.isFocused&&!e.focusTracker._blurTimeout))||(this._clearBlurTimeout(),this._blurTimeout=setTimeout((()=>{this.focusedElement=null,this.isFocused=!1}),0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function tn(e){return"focusTracker"in e&&e.focusTracker instanceof en}function on(e){return Ri(e)}function nn(e,t){return!!t.element&&t.element.contains(document.activeElement)&&e.contains(t.element)}class rn{constructor(){this._listener=new(Ui())}listenTo(e){this._listener.listenTo(e,"keydown",((e,t)=>{this._listener.fire("_keydown:"+Po(t),t)}))}set(e,t,i={}){const o=Io(e),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+o,((e,o)=>{i.filter&&!i.filter(o)||(t(o,(()=>{o.preventDefault(),o.stopPropagation(),e.stop()})),e.return=!0)}),{priority:n})}press(e){return!!this._listener.fire("_keydown:"+Po(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function sn(e){return ie(e)?new Map(e):function(e){const t=new Map;for(const i in e)t.set(i,e[i]);return t}(e)}function an(e,t,i){const o=e.length,n=t.length;for(let t=o-1;t>=i;t--)e[t+n]=e[t];for(let o=0;o<n;o++)e[i+o]=t[o]}function ln(e,t){let i;function o(...n){o.cancel(),i=setTimeout((()=>e(...n)),t)}return o.cancel=()=>{clearTimeout(i)},o}function cn(e){try{if(!e.startsWith("ey"))return null;const t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch(e){return null}}function dn(e,t){return!!(i=e.charAt(t-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t));var i}function un(e,t){return!!(i=e.charAt(t))&&1==i.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(i);var i}const hn=gn();function mn(e,t){const i=String(e).matchAll(hn);return Array.from(i).some((e=>e.index<t&&t<e.index+e[0].length))}function gn(){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")}class pn extends Jo{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",((e,t,i)=>{this._renderViewIntoCollectionParent(t,i)})),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("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const o of e)i.delegate(o).to(t);this.on("add",((i,o)=>{for(const i of e)o.delegate(i).to(t)})),this.on("remove",((i,o)=>{for(const i of e)o.stopDelegating(i,t)}))}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}class fn extends(V()){constructor(e){super(),Object.assign(this,Tn(Cn(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("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const i of t.children)On(i)?yield i:Vn(i)&&(yield*e(i))}(this)}static bind(e,t){return{to:(i,o)=>new kn({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o}),if:(i,o,n)=>new _n({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}static extend(e,t){if(e._isRendered)throw new A("template-extend-render",[this,e]);In(e,Tn(Cn(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new A("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(""),wn(this.text)?this._bindToObservable({schema:this.text,updater:yn(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const o in this.attributes){const n=t.getAttribute(o),r=this.attributes[o];i&&(i.attributes[o]=n);const s=Rn(r)?r[0].ns:null;if(wn(r)){const a=Rn(r)?r[0].value:r;i&&Bn(o)&&a.unshift(n),this._bindToObservable({schema:a,updater:xn(t,o,s),data:e})}else if("style"==o&&"string"!=typeof r[0])this._renderStyleAttribute(r[0],e);else{i&&n&&Bn(o)&&r.unshift(n);const e=r.map((e=>e&&e.value||e)).reduce(((e,t)=>e.concat(t)),[]).reduce(Sn,"");Mn(e)||t.setAttributeNS(s,o,e)}}}_renderStyleAttribute(e,t){const i=t.node;for(const o in e){const n=e[o];wn(n)?this._bindToObservable({schema:[n],updater:An(i,o),data:t}):i.style[o]=n}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let n=0;for(const r of this.children)if(Nn(r)){if(!o){r.setParent(t);for(const e of r)i.appendChild(e.element)}}else if(On(r))o||(r.isRendered||r.render(),i.appendChild(r.element));else if(zi(r))i.appendChild(r);else if(o){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),r._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:t})}else i.appendChild(r.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map((i=>{const[o,n]=t.split("@");return i.activateDomEventListener(o,n,e)}));e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const o=i.revertData;vn(e,t,i);const n=e.filter((e=>!Mn(e))).filter((e=>e.observable)).map((o=>o.activateAttributeListener(e,t,i)));o&&o.bindings.push(n)}_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 i=e;for(const e in t.attributes){const o=t.attributes[e];null===o?i.removeAttribute(e):i.setAttribute(e,o)}for(let e=0;e<t.children.length;++e)this._revertTemplateFromNode(i.childNodes[e],t.children[e])}}class bn{constructor(e){this.attribute=e.attribute,this.observable=e.observable,this.emitter=e.emitter,this.callback=e.callback}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){const o=()=>vn(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}}class kn extends bn{constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const o=(e,i)=>{t&&!i.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}}class _n extends bn{constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!Mn(super.getValue(e))&&(this.valueIfTrue||!0)}}function wn(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(wn):e instanceof bn)}function vn(e,t,{node:i}){const o=function(e,t){return e.map((e=>e instanceof bn?e.getValue(t):e))}(e,i);let n;n=1==e.length&&e[0]instanceof _n?o[0]:o.reduce(Sn,""),Mn(n)?t.remove():t.set(n)}function yn(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function xn(e,t,i){return{set(o){e.setAttributeNS(i,t,o)},remove(){e.removeAttributeNS(i,t)}}}function An(e,t){return{set(i){e.style[t]=i},remove(){e.style[t]=null}}}function Cn(e){return Ni(e,(e=>{if(e&&(e instanceof bn||Vn(e)||On(e)||Nn(e)))return e}))}function Tn(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=No(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)En(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=No(e[t].value)),En(e,t)}(e.attributes);const t=[];if(e.children)if(Nn(e.children))t.push(e.children);else for(const i of e.children)Vn(i)||On(i)||zi(i)?t.push(i):t.push(new fn(i));e.children=t}return e}function En(e,t){e[t]=No(e[t])}function Sn(e,t){return Mn(t)?e:Mn(e)?t:`${e} ${t}`}function Pn(e,t){for(const i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function In(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),Pn(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),Pn(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("ui-template-extend-children-mismatch",e);let i=0;for(const o of t.children)In(e.children[i++],o)}}function Mn(e){return!e&&0!==e}function On(e){return e instanceof Kn}function Vn(e){return e instanceof fn}function Nn(e){return e instanceof pn}function Rn(e){return F(e[0])&&e[0].ns}function Bn(e){return"class"==e||"style"==e}var Dn=n(5072),Ln=n.n(Dn),zn=n(4284),Fn=n.n(zn),jn=n(7659),Un=n.n(jn),Hn=n(4868),Wn=n.n(Hn),$n=n(540),qn=n.n($n),Zn=n(7247),Gn={attributes:{"data-cke":!0}};Gn.setAttributes=Wn(),Gn.insert=Un().bind(null,"head"),Gn.domAPI=Fn(),Gn.insertStyleElement=qn(),Ln()(Zn.A,Gn),Zn.A&&Zn.A.locals&&Zn.A.locals;class Kn extends(Ui(Z())){constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Jo,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((t,i)=>{i.locale=e,i.t=e&&e.t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=fn.bind(this,this)}createCollection(e){const t=new pn(e);return this._viewCollections.add(t),t}registerChild(e){ie(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){ie(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new fn(e)}extendTemplate(e){fn.extend(this.template,e)}render(){if(this.isRendered)throw new A("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)}}function Yn({emitter:e,activator:t,callback:i,contextElements:o,listenerOptions:n}){e.listenTo(document,"mousedown",((e,n)=>{if(!t())return;const r="function"==typeof n.composedPath?n.composedPath():[],s="function"==typeof o?o():o;for(const e of s)if(e.contains(n.target)||r.includes(e))return;i()}),n)}function Qn(e){return class extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function Jn({view:e}){e.listenTo(e.element,"submit",((t,i)=>{i.preventDefault(),e.fire("submit")}),{useCapture:!0})}function Xn({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:o,uiLanguageDirection:n}){const r="number"==typeof o?()=>o:o;function s(e){return o=>{const n=i.find((e=>e.element===t.focusedElement)),r=i.getIndex(n),s=e(r,i);i.get(s).focus(),o.stopPropagation(),o.preventDefault()}}function a(e,t){return e===t-1?0:e+1}function l(e,t){return 0===e?t-1:e-1}e.set("arrowright",s(((e,t)=>"rtl"===n?l(e,t.length):a(e,t.length)))),e.set("arrowleft",s(((e,t)=>"rtl"===n?a(e,t.length):l(e,t.length)))),e.set("arrowup",s(((e,t)=>{let i=e-r();return i<0&&(i=e+r()*Math.floor(t.length/r()),i>t.length-1&&(i-=r())),i}))),e.set("arrowdown",s(((e,t)=>{let i=e+r();return i>t.length-1&&(i=e%r()),i})))}class er extends(Z()){constructor(e){super(),this._disableStack=new Set,this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",tr,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",tr),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function tr(e){e.return=!1,e.stop()}class ir extends(Z()){constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()})),this.listenTo(e,"change:isReadOnly",(()=>{this.refresh()})),this.on("set:isEnabled",(t=>{if(!this.affectsData)return;const i=e.model.document.selection,o=!("$graveyard"==i.getFirstPosition().root.rootName)&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!o)&&(t.return=!1,t.stop())}),{priority:"highest"}),this.on("execute",(e=>{this.isEnabled||e.stop()}),{priority:"high"})}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",or,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",or),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function or(e){e.return=!1,e.stop()}class nr extends(V()){constructor(e,t=[],i=[]){super(),this._plugins=new Map,this._context=e,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 i)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 A("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[],i=[]){const o=this,n=this._context;!function e(t,i=new Set){t.forEach((t=>{a(t)&&(i.has(t)||(i.add(t),t.pluginName&&!o._availablePlugins.has(t.pluginName)&&o._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,i)))}))}(e),u(e);const r=[...function e(t,i=new Set){return t.map((e=>a(e)?e:o._availablePlugins.get(e))).reduce(((t,o)=>i.has(o)?t:(i.add(o),o.requires&&(u(o.requires,o),e(o.requires,i).forEach((e=>t.add(e)))),t.add(o))),new Set)}(e.filter((e=>!c(e,t))))];!function(e,t){for(const i of t){if("function"!=typeof i)throw new A("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const t=i.pluginName;if(!t)throw new A("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new A("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const n=o._availablePlugins.get(t);if(!n)throw new A("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const r=e.indexOf(n);if(-1===r){if(o._contextPlugins.has(n))return;throw new A("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(n.requires&&n.requires.length)throw new A("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(r,1,i),o._availablePlugins.set(t,i)}}(r,i);const s=function(e){return e.map((e=>{let t=o._contextPlugins.get(e);return t=t||new e(n),o._add(e,t),t}))}(r);return h(s,"init").then((()=>h(s,"afterInit"))).then((()=>s));function a(e){return"function"==typeof e}function l(e){return a(e)&&!!e.isContextPlugin}function c(e,t){return t.some((t=>t===e||d(e)===t||d(t)===e))}function d(e){return a(e)?e.pluginName||e.name:e}function u(e,i=null){e.map((e=>a(e)?e:o._availablePlugins.get(e)||e)).forEach((e=>{!function(e,t){if(!a(e)){if(t)throw new A("plugincollection-soft-required",n,{missingPlugin:e,requiredBy:d(t)});throw new A("plugincollection-plugin-not-found",n,{plugin:e})}}(e,i),function(e,t){if(l(t)&&!l(e))throw new A("plugincollection-context-required",n,{plugin:d(e),requiredBy:d(t)})}(e,i),function(e,i){if(i&&c(e,t))throw new A("plugincollection-required",n,{plugin:d(e),requiredBy:d(i)})}(e,i)}))}function h(e,t){return e.reduce(((e,i)=>i[t]?o._contextPlugins.has(i)?e:e.then(i[t].bind(i)):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 i=e.pluginName;if(i){if(this._plugins.has(i))throw new A("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}class rr{constructor(e){this._contextOwner=null;const{translations:t,...i}=e||{};this.config=new Bi(i,this.constructor.defaultConfig);const o=this.constructor.builtinPlugins;this.config.define("plugins",o),this.plugins=new nr(this,o);const n=this.config.get("language")||{};this.locale=new Qo({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new Jo}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if("function"!=typeof i)throw new A("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new A("context-initplugins-invalid-plugin",null,{Plugin:i})}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 A("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 i=new this(e);t(i.initPlugins().then((()=>i)))}))}}class sr extends(Z()){constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}const ar=function(e){return"symbol"==typeof e||pe(e)&&"[object Symbol]"==me(e)};var lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cr=/^\w*$/;const dr=function(e,t){if(ge(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!ar(e))||cr.test(e)||!lr.test(e)||null!=t&&e in Object(t)};function ur(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var o=arguments,n=t?t.apply(this,o):o[0],r=i.cache;if(r.has(n))return r.get(n);var s=e.apply(this,o);return i.cache=r.set(n,s)||r,s};return i.cache=new(ur.Cache||Je),i}ur.Cache=Je;const hr=ur;var mr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gr=/\\(\\)?/g,pr=function(e){var t=hr(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(mr,(function(e,i,o,n){t.push(o?n.replace(gr,"$1"):i||e)})),t}));const fr=pr,br=function(e,t){for(var i=-1,o=null==e?0:e.length,n=Array(o);++i<o;)n[i]=t(e[i],i,e);return n};var kr=se?se.prototype:void 0,_r=kr?kr.toString:void 0;const wr=function e(t){if("string"==typeof t)return t;if(ge(t))return br(t,e)+"";if(ar(t))return _r?_r.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i},vr=function(e){return null==e?"":wr(e)},yr=function(e,t){return ge(e)?e:dr(e,t)?[e]:fr(vr(e))},xr=function(e){if("string"==typeof e||ar(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ar=function(e,t){for(var i=0,o=(t=yr(t,e)).length;null!=e&&i<o;)e=e[xr(t[i++])];return i&&i==o?e:void 0},Cr=function(e,t,i){var o=null==e?void 0:Ar(e,t);return void 0===o?i:o},Tr=function(e,t,i){return null==e?e:function(e,t,i,o){if(!F(e))return e;for(var n=-1,r=(t=yr(t,e)).length,s=r-1,a=e;null!=a&&++n<r;){var l=xr(t[n]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(n!=s){var d=a[l];void 0===(c=o?o(d,l,a):void 0)&&(c=F(d)?d:ft(t[n+1])?[]:{})}nt(a,l,c),a=a[l]}return e}(e,t,i)};var Er=n(121),Sr={attributes:{"data-cke":!0}};Sr.setAttributes=Wn(),Sr.insert=Un().bind(null,"head"),Sr.domAPI=Fn(),Sr.insertStyleElement=qn(),Ln()(Er.A,Sr),Er.A&&Er.A.locals&&Er.A.locals;const Pr=new WeakMap;let Ir=!1;function Mr({view:e,element:t,text:i,isDirectHost:o=!0,keepOnFocus:n=!1}){const r=e.document;function s(i){const s={text:i,isDirectHost:o,keepOnFocus:n,hostElement:o?t:null};Pr.get(r).set(t,s),e.change((e=>Or([[t,s]],e)))}Pr.has(r)||(Pr.set(r,new Map),r.registerPostFixer((e=>Or(Pr.get(r),e))),r.on("change:isComposing",(()=>{e.change((e=>Or(Pr.get(r),e)))}),{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",((e,t,i)=>s(i))),t.placeholder?s(t.placeholder):i&&s(i),i&&(Ir||C("enableplaceholder-deprecated-text-option"),Ir=!0)}function Or(e,t){const i=[];let o=!1;for(const[n,r]of e)r.isDirectHost&&(i.push(n),Vr(t,n,r)&&(o=!0));for(const[n,r]of e){if(r.isDirectHost)continue;const e=Nr(n);e&&(i.includes(e)||(r.hostElement=e,Vr(t,n,r)&&(o=!0)))}return o}function Vr(e,t,i){const{text:o,isDirectHost:n,hostElement:r}=i;let s=!1;return r.getAttribute("data-placeholder")!==o&&(e.setAttribute("data-placeholder",o,r),s=!0),(n||1==t.childCount)&&function(e,t){if(!e.isAttached())return!1;if(function(e){for(const t of e.getChildren())if(!t.is("uiElement"))return!0;return!1}(e))return!1;const i=e.document,o=i.selection.anchor;return!(i.isComposing&&o&&o.parent===e||!t&&i.isFocused&&(!o||o.parent===e))}(r,i.keepOnFocus)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,r)&&(s=!0):function(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}(e,r)&&(s=!0),s}function Nr(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}class Rr{is(){throw new Error("is() method is abstract")}}const Br=function(e){return Vi(e,4)};class Dr extends(V(Rr)){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 A("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 i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),o=te(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]<i[o]}}isAfter(e){return this!=e&&this.root===e.root&&!this.isBefore(e)}_remove(){this.parent._removeChildren(this.index)}_fireChange(e,t,i){this.fire(`change:${e}`,t,i),this.parent&&this.parent._fireChange(e,t,i)}toJSON(){const e=Br(this);return delete e.parent,e}}Dr.prototype.is=function(e){return"node"===e||"view:node"===e};class Lr extends Dr{constructor(e,t){super(e),this._textData=t}get data(){return this._textData}get _data(){return this.data}set _data(e){this._fireChange("text",this),this._textData=e}isSimilar(e){return e instanceof Lr&&(this===e||this.data===e.data)}_clone(){return new Lr(this.document,this.data)}}Lr.prototype.is=function(e){return"$text"===e||"view:$text"===e||"text"===e||"view:text"===e||"node"===e||"view:node"===e};class zr extends Rr{constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.data.length)throw new A("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new A("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),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 i=e.includeSelf?this.textNode:this.parent;for(;null!==i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}}zr.prototype.is=function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e};class Fr{constructor(){this._consumables=new Map}add(e,t){let i;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?i=this._consumables.get(e):(i=new jr(e),this._consumables.set(e,i)),i.add(t?Ur(t):e._getConsumables()))}test(e,t){const i=this._consumables.get(e);return void 0===i?null:e.is("$text")||e.is("documentFragment")?i:i.test(Ur(t))}consume(e,t){if(e.is("$text")||e.is("documentFragment"))return!!this.test(e,t)&&(this._consumables.set(e,!1),!0);const i=this._consumables.get(e);return void 0!==i&&i.consume(Ur(t))}revert(e,t){const i=this._consumables.get(e);void 0!==i&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):i.revert(Ur(t)))}static createFrom(e,t){if(t||(t=new Fr),e.is("$text"))t.add(e);else if(e.is("element")||e.is("documentFragment")){t.add(e);for(const i of e.getChildren())Fr.createFrom(i,t)}return t}}class jr{constructor(e){this._canConsumeName=null,this._attributes=new Map,this.element=e}add(e){e.name&&(this._canConsumeName=!0);for(const[t,i]of e.attributes)if(i){let e=this._attributes.get(t);e&&"boolean"!=typeof e||(e=new Map,this._attributes.set(t,e)),e.set(i,!0)}else{if("style"==t||"class"==t)throw new A("viewconsumable-invalid-attribute",this);this._attributes.set(t,!0)}}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const[t,i]of e.attributes){const e=this._attributes.get(t);if(void 0===e)return null;if(!1===e)return!1;if(!0!==e)if(i){const t=e.get(i);if(void 0===t)return null;if(!t)return!1}else for(const t of e.values())if(!t)return!1}return!0}consume(e){if(!this.test(e))return!1;e.name&&(this._canConsumeName=!1);for(const[t,i]of e.attributes){const e=this._attributes.get(t);if("boolean"==typeof e)for(const[e]of this.element._getConsumables(t,i).attributes)this._attributes.set(e,!1);else if(i)for(const[,o]of this.element._getConsumables(t,i).attributes)e.set(o,!1);else for(const t of e.keys())e.set(t,!1)}return!0}revert(e){e.name&&(this._canConsumeName=!0);for(const[t,i]of e.attributes){const e=this._attributes.get(t);if(!1!==e){if(void 0!==e&&!0!==e)if(i)!1===e.get(i)&&e.set(i,!0);else for(const t of e.keys())e.set(t,!0)}else this._attributes.set(t,!0)}}}function Ur(e){const t=[];return"attributes"in e&&e.attributes&&Hr(t,e.attributes),"classes"in e&&e.classes&&Hr(t,e.classes,"class"),"styles"in e&&e.styles&&Hr(t,e.styles,"style"),{name:e.name||!1,attributes:t}}function Hr(e,t,i){if("string"!=typeof t)for(const o of t)Array.isArray(o)?e.push(o):e.push(i?[i,o]:[o]);else e.push(i?[i,t]:[t])}class Wr{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 i=this._isElementMatching(t,e);if(i)return{element:t,pattern:e,match:i}}return null}matchAll(...e){const t=[];for(const i of e)for(const e of this._patterns){const o=this._isElementMatching(i,e);o&&t.push({element:i,pattern:e,match:o})}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}_isElementMatching(e,t){if("function"==typeof t){const i=t(e);return i&&"object"==typeof i?Ur(i):i}const i={};if(t.name&&(i.name=function(e,t){return e instanceof RegExp?!!t.match(e):e===t}(t.name,e.name),!i.name))return null;const o=[];return t.attributes&&!function(e,t,i){let o;return"object"!=typeof e||e instanceof RegExp||Array.isArray(e)?o=["class","style"]:(void 0!==e.style&&C("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&C("matcher-pattern-deprecated-attributes-class-key",e)),t._collectAttributesMatch(qr(e),i,o)}(t.attributes,e,o)||t.classes&&!function(e,t,i){return t._collectAttributesMatch(qr(e,"class"),i)}(t.classes,e,o)||t.styles&&!function(e,t,i){return t._collectAttributesMatch(qr(e,"style"),i)}(t.styles,e,o)?null:(o.length&&(i.attributes=o),i)}}function $r(e,t){return!0===e||e===t||e instanceof RegExp&&!!String(t).match(e)}function qr(e,t){if(Array.isArray(e))return e.map((e=>"object"!=typeof e||e instanceof RegExp?t?[t,e,!0]:[e,!0]:(void 0!==e.key&&void 0!==e.value||C("matcher-pattern-missing-key-or-value",e),t?[t,e.key,e.value]:[e.key,e.value])));if("object"!=typeof e||e instanceof RegExp)return[t?[t,e,!0]:[e,!0]];const i=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&i.push(t?[t,o,e[o]]:[o,e[o]]);return i}const Zr=function(e,t,i){var o=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(i=i>n?n:i)<0&&(i+=n),n=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(n);++o<n;)r[o]=e[o+t];return r},Gr=function(e,t){return null==(e=function(e,t){return t.length<2?e:Ar(e,Zr(t,0,-1))}(e,t=yr(t,e)))||delete e[xr((i=t,o=null==i?0:i.length,o?i[o-1]:void 0))];var i,o},Kr=function(e,t){return null==e||Gr(e,t)};class Yr{constructor(e){this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,this._styles={},this._styleProcessor=e}get isEmpty(){return!Object.entries(this._styles).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const t=function(e){let t=null,i=0,o=0,n=null;const r=new Map;if(""===e)return r;";"!=e.charAt(e.length-1)&&(e+=";");for(let s=0;s<e.length;s++){const a=e.charAt(s);if(null===t)switch(a){case":":n||(n=e.substr(i,s-i),o=s+1);break;case'"':case"'":t=a;break;case";":{const t=e.substr(o,s-o);n&&r.set(n.trim(),t.trim()),n=null,i=s+1;break}}else a===t&&(t=null)}return r}(e);for(const[e,i]of t)this._styleProcessor.toNormalizedForm(e,i,this._styles);return this}has(e){if(this.isEmpty)return!1;const t=this._styleProcessor.getReducedForm(e,this._styles).find((([t])=>t===e));return Array.isArray(t)}set(e,t){if(this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,F(e))for(const[t,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){for(const t of No(e)){this._cachedStyleNames=null,this._cachedExpandedStyleNames=null;const e=Jr(t);Kr(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}}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]&&!F(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){return this.isEmpty?[]:e?(this._cachedExpandedStyleNames=this._cachedExpandedStyleNames||this._styleProcessor.getStyleNames(this._styles),this._cachedExpandedStyleNames):(this._cachedStyleNames=this._cachedStyleNames||this.getStylesEntries().map((([e])=>e)),this._cachedStyleNames)}keys(){return this.getStyleNames()}clear(){this._styles={},this._cachedStyleNames=null,this._cachedExpandedStyleNames=null}isSimilar(e){if(this.size!==e.size)return!1;for(const t of this.getStyleNames())if(!e.has(t)||e.getAsString(t)!==this.getAsString(t))return!1;return!0}getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_clone(){const e=new this.constructor(this._styleProcessor);return e.set(this.getNormalized()),e}_getTokensMatch(e,t){const i=[];for(const o of this.getStyleNames(!0))if($r(e,o)){if(!0===t){i.push(o);continue}$r(t,this.getAsString(o))&&i.push(o)}return i.length?i:void 0}_getConsumables(e){const t=[];if(e){t.push(e);for(const i of this._styleProcessor.getRelatedStyles(e))t.push(i)}else for(const e of this.getStyleNames()){for(const i of this._styleProcessor.getRelatedStyles(e))t.push(i);t.push(e)}return t}_canMergeFrom(e){for(const t of e.getStyleNames())if(this.has(t)&&this.getAsString(t)!==e.getAsString(t))return!1;return!0}_mergeFrom(e){for(const t of e.getStyleNames())this.has(t)||this.set(t,e.getAsString(t))}_isMatching(e){for(const t of e.getStyleNames())if(!this.has(t)||this.getAsString(t)!==e.getAsString(t))return!1;return!0}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const i=t.splice(0,t.length-1).join("."),o=Cr(this._styles,i);o&&!Object.keys(o).length&&this.remove(i)}}class Qr{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(F(t))Xr(i,Jr(e),t);else if(this._normalizers.has(e)){const o=this._normalizers.get(e),{path:n,value:r}=o(t);Xr(i,n,r)}else Xr(i,e,t)}getNormalized(e,t){if(!e)return Go({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const i=this._extractors.get(e);if("string"==typeof i)return Cr(t,i);const o=i(e,t);if(o)return o}return Cr(t,Jr(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);return void 0===i?[]:this._reducers.has(e)?this._reducers.get(e)(i):[[e,i]]}getStyleNames(e){const t=new Set;for(const i of this._consumables.keys()){const o=this.getNormalized(i,e);o&&("object"!=typeof o||Object.keys(o).length)&&t.add(i)}for(const i of Object.keys(e))t.add(i);return Array.from(t)}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 i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function Jr(e){return e.replace("-",".")}function Xr(e,t,i){let o=i;F(i)&&(o=Go({},Cr(e,t),i)),Tr(e,t,o)}class es{constructor(){this._set=new Set}get isEmpty(){return 0==this._set.size}get size(){return this._set.size}has(e){return this._set.has(e)}keys(){return Array.from(this._set.keys())}setTo(e){this.clear();for(const t of e.split(/\s+/))t&&this._set.add(t);return this}set(e){for(const t of No(e))t&&this._set.add(t)}remove(e){for(const t of No(e))this._set.delete(t)}clear(){this._set.clear()}toString(){return Array.from(this._set).join(" ")}isSimilar(e){if(this.size!==e.size)return!1;for(const t of this.keys())if(!e.has(t))return!1;return!0}_clone(){const e=new this.constructor;return e._set=new Set(this._set),e}_getTokensMatch(e){const t=[];if(!0===e){for(const e of this._set.keys())t.push(e);return t}if("string"==typeof e){for(const i of e.split(/\s+/)){if(!this._set.has(i))return;t.push(i)}return t}for(const i of this._set.keys())i.match(e)&&t.push(i);return t.length?t:void 0}_getConsumables(e){return e?[e]:this.keys()}_canMergeFrom(){return!0}_mergeFrom(e){for(const t of e._set.keys())this._set.has(t)||this._set.add(t)}_isMatching(e){for(const t of e._set.keys())if(!this._set.has(t))return!1;return!0}}class ts extends Dr{get _classes(){return this._attrs.get("class")}get _styles(){return this._attrs.get("style")}constructor(e,t,i,o){super(e),this._unsafeAttributesToRender=[],this._customProperties=new Map,this.name=t,this._attrs=this._parseAttributes(i),this._children=[],o&&this._insertChild(0,o)}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&&(yield"class"),this._styles&&(yield"style");for(const e of this._attrs.keys())"class"!=e&&"style"!=e&&(yield e)}*getAttributes(){for(const[e,t]of this._attrs.entries())yield[e,String(t)]}getAttribute(e){return this._attrs.has(e)?String(this._attrs.get(e)):void 0}hasAttribute(e,t){return!!this._attrs.has(e)&&(void 0===t||(os(this.name,e)||is(this.name,e)?this._attrs.get(e).has(t):this._attrs.get(e)===t))}isSimilar(e){if(!(e instanceof ts))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size)return!1;for(const[t,i]of this._attrs){const o=e._attrs.get(t);if(void 0===o)return!1;if("string"==typeof i||"string"==typeof o){if(o!==i)return!1}else if(!i.isSimilar(o))return!1}return!0}hasClass(...e){for(const t of e)if(!this._classes||!this._classes.has(t))return!1;return!0}getClassNames(){const e=this._classes?this._classes.keys():[],t=e[Symbol.iterator]();return Object.assign(e,{next:t.next.bind(t)})}getStyle(e){return this._styles&&this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles&&this._styles.getNormalized(e)}getStyleNames(e){return this._styles?this._styles.getStyleNames(e):[]}hasStyle(...e){for(const t of e)if(!this._styles||!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new Wr(...e);let i=this.parent;for(;i&&!i.is("documentFragment");){if(t.match(i))return i;i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=this._classes?this._classes.keys().sort().join(","):"",t=this._styles&&String(this._styles),i=Array.from(this._attrs).filter((([e])=>"style"!=e&&"class"!=e)).map((e=>`${e[0]}="${e[1]}"`)).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==i?"":` ${i}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,t);return i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._unsafeAttributesToRender=this._unsafeAttributesToRender,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0;const o=function(e,t){if("string"==typeof t)return[new Lr(e,t)];ie(t)||(t=[t]);const i=[];for(const o of t)"string"==typeof o?i.push(new Lr(e,o)):o instanceof zr?i.push(new Lr(e,o.data)):i.push(o);return i}(this.document,t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;i<e+t;i++)this._children[i].parent=null;return this._children.splice(e,t)}_setAttribute(e,t,i=!0){if(this._fireChange("attributes",this),os(this.name,e)||is(this.name,e)){let o=this._attrs.get(e);o||(o=os(this.name,e)?new Yr(this.document.stylesProcessor):new es,this._attrs.set(e,o)),i?o.setTo(String(t)):os(this.name,e)?Array.isArray(t)?o.set(t[0],t[1]):o.set(t):o.set("string"==typeof t?t.split(/\s+/):t)}else this._attrs.set(e,String(t))}_removeAttribute(e,t){if(this._fireChange("attributes",this),void 0!==t&&(os(this.name,e)||is(this.name,e))){const i=this._attrs.get(e);return!!i&&(is(this.name,e)&&"string"==typeof t&&(t=t.split(/\s+/)),i.remove(t),!!i.isEmpty&&this._attrs.delete(e))}return this._attrs.delete(e)}_addClass(e){this._setAttribute("class",e,!1)}_removeClass(e){this._removeAttribute("class",e)}_setStyle(e,t){"string"!=typeof e?this._setAttribute("style",e,!1):this._setAttribute("style",[e,t],!1)}_removeStyle(e){this._removeAttribute("style",e)}_collectAttributesMatch(e,t,i){for(const[o,n,r]of e){let e=!1,s=!1;for(const[a,l]of this._attrs)if(!(i&&i.includes(a)||!$r(o,a)))if(e=!0,"string"==typeof l){if($r(n,l))t.push([a]),s=!0;else if(!(o instanceof RegExp))return!1}else{const e=l._getTokensMatch(n,r||!0);if(e){s=!0;for(const i of e)t.push([a,i])}else if(!(o instanceof RegExp))return!1}if(!e||!s)return!1}return!0}_getConsumables(e,t){const i=[];if(e){const o=this._attrs.get(e);if(void 0!==o)if("string"==typeof o)i.push([e]);else for(const n of o._getConsumables(t))i.push([e,n])}else for(const[e,t]of this._attrs)if("string"==typeof t)i.push([e]);else for(const o of t._getConsumables())i.push([e,o]);return{name:!e,attributes:i}}_canMergeAttributesFrom(e){if(this.name!=e.name)return!1;for(const[t,i]of e._attrs){const e=this._attrs.get(t);if(void 0!==e)if("string"==typeof e||"string"==typeof i){if(e!==i)return!1}else if(!e._canMergeFrom(i))return!1}return!0}_mergeAttributesFrom(e){this._fireChange("attributes",this);for(const[t,i]of e._attrs){const e=this._attrs.get(t);void 0===e||"string"==typeof e||"string"==typeof i?this._setAttribute(t,i):e._mergeFrom(i)}}_canSubtractAttributesOf(e){if(this.name!=e.name)return!1;for(const[t,i]of e._attrs){const e=this._attrs.get(t);if(void 0===e)return!1;if("string"==typeof e||"string"==typeof i){if(e!==i)return!1}else if(!e._isMatching(i))return!1}return!0}_subtractAttributesOf(e){this._fireChange("attributes",this);for(const[t,i]of e._attrs){const e=this._attrs.get(t);"string"==typeof e||"string"==typeof i?this._attrs.delete(t):(e.remove(i.keys()),e.isEmpty&&this._attrs.delete(t))}}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}_parseAttributes(e){const t=sn(e);for(const[e,i]of t)if(null===i)t.delete(e);else if(os(this.name,e)){const o=i instanceof Yr?i._clone():new Yr(this.document.stylesProcessor).setTo(String(i));t.set(e,o)}else if(is(this.name,e)){const o=i instanceof es?i._clone():(new es).setTo(String(i));t.set(e,o)}else"string"!=typeof i&&t.set(e,String(i));return t}}function is(e,t){return"class"==t||"a"==e&&"rel"==t}function os(e,t){return"style"==t}ts.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 ns extends ts{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=rs}}function rs(){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}ns.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 ss extends(Z(ns)){constructor(e,t,i,o){super(e,t,i,o),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("placeholder",void 0),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",(t=>t&&e.selection.editableElement==this)),this.listenTo(e.selection,"change",(()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this}))}destroy(){this.stopListening()}}ss.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 as=Symbol("rootName");class ls extends ss{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(as)}set rootName(e){this._setCustomProperty(as,e)}set _name(e){this.name=e}}ls.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 cs{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new A("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new A("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=ds._createAt(e.startPosition):this._position=ds._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}get position(){return this._position}skip(e){let t,i;do{i=this.position,t=this.next()}while(!t.done&&e(t.value));t.done||(this._position=i)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone()}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let o;if(i&&i.is("view:$text")){if(e.isAtEnd)return this._position=ds._createAfter(i),this._next();o=i.data[e.offset]}else o=i.getChild(e.offset);if("string"==typeof o){let o;o=this.singleCharacters?1:(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset;const n=new zr(i,e.offset,o);return e.offset+=o,this._position=e,this._formatReturnValue("text",n,t,e,o)}if(o&&o.is("view:element")){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}else e=new ds(o,0);return this._position=e,this._formatReturnValue("elementStart",o,t,e,1)}if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new ds(o,0),this._position=e,this._next();let i,n=o.data.length;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new zr(o,0,n),e=ds._createAfter(i)):(i=new zr(o,0,o.data.length),e.offset++),this._position=e,this._formatReturnValue("text",i,t,e,n)}return e=ds._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,t,e)}_previous(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&0===e.offset)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let o;if(i.is("view:$text")){if(e.isAtStart)return this._position=ds._createBefore(i),this._previous();o=i.data[e.offset-1]}else o=i.getChild(e.offset-1);if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-t}e.offset-=o;const n=new zr(i,e.offset,o);return this._position=e,this._formatReturnValue("text",n,t,e,o)}if(o&&o.is("view:element"))return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",o,t,e,1)):(e=new ds(o,o.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,t,e));if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new ds(o,o.data.length),this._position=e,this._previous();let i,n=o.data.length;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new zr(o,t,o.data.length-t),n=i.data.length,e=ds._createBefore(i)}else i=new zr(o,0,o.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",i,t,e,n)}return e=ds._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,t,e,1)}_formatReturnValue(e,t,i,o,n){return t.is("view:$textProxy")&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=ds._createAfter(t.textNode):(o=ds._createAfter(t.textNode),this._position=o)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=ds._createBefore(t.textNode):(o=ds._createBefore(t.textNode),this._position=o))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}}class ds extends Rr{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 ss);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=ds._createAt(this),i=t.offset+e;return t.offset=i<0?0:i,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new cs(t);return i.skip(e),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),i=e.getAncestors();let o=0;for(;t[o]==i[o]&&t[o];)o++;return 0===o?null:t[o-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():[],i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),i.push(e.offset);const o=te(t,i);switch(o){case"prefix":return"before";case"extension":return"after";default:return t[o]<i[o]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new cs(e)}clone(){return new ds(this.parent,this.offset)}static _createAt(e,t){if(e instanceof ds)return new this(e.parent,e.offset);{const i=e;if("end"==t)t=i.is("$text")?i.data.length:i.childCount;else{if("before"==t)return this._createBefore(i);if("after"==t)return this._createAfter(i);if(0!==t&&!t)throw new A("view-createpositionat-offset-required",i)}return new ds(i,t)}}static _createAfter(e){if(e.is("$textProxy"))return new ds(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new A("view-position-after-root",e,{root:e});return new ds(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new ds(e.textNode,e.offsetInText);if(!e.parent)throw new A("view-position-before-root",e,{root:e});return new ds(e.parent,e.index)}}ds.prototype.is=function(e){return"position"===e||"view:position"===e};class us extends Rr{constructor(e,t=null){super(),this.start=e.clone(),this.end=t?t.clone():e.clone()}*[Symbol.iterator](){yield*new cs({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let e=this.start.getLastMatchingPosition(hs,{direction:"backward"}),t=this.end.getLastMatchingPosition(hs);return e.parent.is("$text")&&e.isAtStart&&(e=ds._createBefore(e.parent)),t.parent.is("$text")&&t.isAtEnd&&(t=ds._createAfter(t.parent)),new us(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(hs);if(e.isAfter(this.end)||e.isEqual(this.end))return new us(e,e);let t=this.end.getLastMatchingPosition(hs,{direction:"backward"});const i=e.nodeAfter,o=t.nodeBefore;return i&&i.is("$text")&&(e=new ds(i,0)),o&&o.is("$text")&&(t=new ds(o,o.data.length)),new us(e,t)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const i=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),o=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return i&&o}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new us(this.start,e.start)),this.containsPosition(e.end)&&t.push(new us(e.end,this.end))):t.push(this.clone()),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,i=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(i=e.end),new us(t,i)}return null}getWalker(e={}){return e.boundaries=this,new cs(e)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let e=this.start.nodeAfter,t=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(t=this.end.parent.previousSibling),e&&e.is("element")&&e===t?e:null}clone(){return new us(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new cs(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new cs(e);yield t.position;for(const e of t)yield e.nextPosition}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}static _createFromParentsAndOffsets(e,t,i,o){return new this(new ds(e,t),new ds(i,o))}static _createFromPositionAndShift(e,t){const i=e,o=e.getShiftedBy(t);return t>0?new this(i,o):new this(o,i)}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(ds._createBefore(e),t)}}function hs(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}us.prototype.is=function(e){return"range"===e||"view:range"===e};class ms extends(V(Rr)){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 i=!1;for(const o of e._ranges)if(t.isEqual(o)){i=!0;break}if(!i)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=ee(this.getRanges());if(t!=ee(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let i=!1;for(let o of e.getRanges())if(o=o.getTrimmed(),t.start.isEqual(o.start)&&t.end.isEqual(o.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,i,o]=e;if("object"==typeof i&&(o=i,i=void 0),null===t)this._setRanges([]),this._setFakeOptions(o);else if(t instanceof ms||t instanceof gs)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof us)this._setRanges([t],o&&o.backward),this._setFakeOptions(o);else if(t instanceof ds)this._setRanges([new us(t)]),this._setFakeOptions(o);else if(t instanceof Dr){const e=!!o&&!!o.backward;let n;if(void 0===i)throw new A("view-selection-setto-required-second-parameter",this);n="in"==i?us._createIn(t):"on"==i?us._createOn(t):new us(ds._createAt(t,i)),this._setRanges([n],e),this._setFakeOptions(o)}else{if(!ie(t))throw new A("view-selection-setto-not-selectable",this);this._setRanges(t,o&&o.backward),this._setFakeOptions(o)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new A("view-selection-setfocus-no-ranges",this);const i=ds._createAt(e,t);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==i.compareWith(o)?this._addRange(new us(i,o),!0):this._addRange(new us(o,i)),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 us))throw new A("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 A("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new us(e.start,e.end))}}ms.prototype.is=function(e){return"selection"===e||"view:selection"===e};class gs extends(V(Rr)){constructor(...e){super(),this._selection=new ms,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)}}gs.prototype.is=function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e};class ps extends _{constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const fs=Symbol("bubbling contexts");function bs(e){return class extends e{fire(e,...t){try{const i=e instanceof _?e:new _(this,e),o=vs(this);if(!o.size)return;if(ks(i,"capturing",this),_s(o,"$capture",i,...t))return i.return;const n=i.startRange||this.selection.getFirstRange(),r=n?n.getContainedElement():null,s=!!r&&Boolean(ws(o,r));let a=r||function(e){if(!e)return null;const t=e.start.parent,i=e.end.parent,o=t.getPath(),n=i.getPath();return o.length>n.length?t:i}(n);if(ks(i,"atTarget",a),!s){if(_s(o,"$text",i,...t))return i.return;ks(i,"bubbling",a)}for(;a;){if(a.is("rootElement")){if(_s(o,"$root",i,...t))return i.return}else if(a.is("element")&&_s(o,a.name,i,...t))return i.return;if(_s(o,a,i,...t))return i.return;a=a.parent,ks(i,"bubbling",a)}return ks(i,"bubbling",this),_s(o,"$document",i,...t),i.return}catch(e){A.rethrowUnexpectedError(e,this)}}_addEventListener(e,t,i){const o=No(i.context||"$document"),n=vs(this);for(const r of o){let o=n.get(r);o||(o=new(V()),n.set(r,o)),this.listenTo(o,e,t,i)}}_removeEventListener(e,t){const i=vs(this);for(const o of i.values())this.stopListening(o,e,t)}}}{const e=bs(Object);["fire","_addEventListener","_removeEventListener"].forEach((t=>{bs[t]=e.prototype[t]}))}function ks(e,t,i){e instanceof ps&&(e._eventPhase=t,e._currentTarget=i)}function _s(e,t,i,...o){const n="string"==typeof t?e.get(t):ws(e,t);return!!n&&(n.fire(i,...o),i.stop.called)}function ws(e,t){for(const[i,o]of e)if("function"==typeof i&&i(t))return o;return null}function vs(e){return e[fs]||(e[fs]=new Map),e[fs]}class ys extends(bs(Z())){constructor(e){super(),this._postFixers=new Set,this.selection=new gs,this.roots=new Jo({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach((e=>e.destroy())),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(t=i(e),t)break}while(t)}}class xs extends ts{constructor(e,t,i,o){super(e,t,i,o),this._priority=10,this._id=null,this._clonesGroup=null,this.getFillerOffset=Cs}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new A("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}_canMergeAttributesFrom(e){return null===this.id&&null===e.id&&this.priority===e.priority&&super._canMergeAttributesFrom(e)}_canSubtractAttributesOf(e){return null===this.id&&null===e.id&&this.priority===e.priority&&super._canSubtractAttributesOf(e)}}xs.DEFAULT_PRIORITY=10;const As=xs;function Cs(){if(Ts(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Ts(e)>1)return null;e=e.parent}return!e||Ts(e)>1?null:this.childCount}function Ts(e){return Array.from(e.getChildren()).filter((e=>!e.is("uiElement"))).length}xs.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 Es extends ts{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Ss}_insertChild(e,t){if(t&&(t instanceof Dr||Array.from(t).length>0))throw new A("view-emptyelement-cannot-add",[this,t]);return 0}}function Ss(){return null}Es.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 Ps extends ts{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Is}_insertChild(e,t){if(t&&(t instanceof Dr||Array.from(t).length>0))throw new A("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 Is(){return null}Ps.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 Ms extends ts{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Os}_insertChild(e,t){if(t&&(t instanceof Dr||Array.from(t).length>0))throw new A("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}}function Os(){return null}Ms.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 Vs extends(V(Rr)){constructor(e,t){super(),this._children=[],this._customProperties=new Map,this.document=e,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}get name(){}get getFillerOffset(){}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,{index:e});let i=0;const o=function(e,t){return"string"==typeof t?[new Lr(e,t)]:(ie(t)||(t=[t]),Array.from(t).map((t=>"string"==typeof t?new Lr(e,t):t instanceof zr?new Lr(e,t.data):t)))}(this.document,t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;i<e+t;i++)this._children[i].parent=null;return this._children.splice(e,t)}_fireChange(e,t,i){this.fire(`change:${e}`,t,i)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}Vs.prototype.is=function(e){return"documentFragment"===e||"view:documentFragment"===e};class Ns{constructor(e){this._cloneGroups=new Map,this._slotFactory=null,this.document=e}setSelection(...e){this.document.selection._setTo(...e)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createDocumentFragment(e){return new Vs(this.document,e)}createText(e){return new Lr(this.document,e)}createAttributeElement(e,t,i={}){const o=new As(this.document,e,t);return"number"==typeof i.priority&&(o._priority=i.priority),i.id&&(o._id=i.id),i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createContainerElement(e,t,i={},o={}){let n=null;Ce(i)?o=i:n=i;const r=new ns(this.document,e,t,n);return o.renderUnsafeAttributes&&r._unsafeAttributesToRender.push(...o.renderUnsafeAttributes),r}createEditableElement(e,t,i={}){const o=new ss(this.document,e,t);return i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createEmptyElement(e,t,i={}){const o=new Es(this.document,e,t);return i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createUIElement(e,t,i){const o=new Ps(this.document,e,t);return i&&(o.render=i),o}createRawElement(e,t,i,o={}){const n=new Ms(this.document,e,t);return i&&(n.render=i),o.renderUnsafeAttributes&&n._unsafeAttributesToRender.push(...o.renderUnsafeAttributes),n}setAttribute(e,t,i,o){void 0!==o?o._setAttribute(e,t,i):i._setAttribute(e,t)}removeAttribute(e,t,i){void 0!==i?i._removeAttribute(e,t):t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){Ce(e)&&void 0===i?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof ds?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new A("view-writer-break-non-container-element",this.document);if(!t.parent)throw new A("view-writer-break-root",this.document);if(e.isAtStart)return ds._createBefore(t);if(!e.isAtEnd){const i=t._clone(!1);this.insert(ds._createAfter(t),i);const o=new us(e,ds._createAt(t,"end")),n=new ds(i,0);this.move(o,n)}return ds._createAfter(t)}mergeAttributes(e){const t=e.offset,i=e.parent;if(i.is("$text"))return e;if(i.is("attributeElement")&&0===i.childCount){const e=i.parent,t=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new ds(e,t))}const o=i.getChild(t-1),n=i.getChild(t);if(!o||!n)return e;if(o.is("$text")&&n.is("$text"))return Ls(o,n);if(o.is("attributeElement")&&n.is("attributeElement")&&o.isSimilar(n)){const e=o.childCount;return o._appendChild(n.getChildren()),n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new ds(o,e))}return e}mergeContainers(e){const t=e.nodeBefore,i=e.nodeAfter;if(!(t&&i&&t.is("containerElement")&&i.is("containerElement")))throw new A("view-writer-merge-containers-invalid-position",this.document);const o=t.getChild(t.childCount-1),n=o instanceof Lr?ds._createAt(o,"end"):ds._createAt(t,"end");return this.move(us._createIn(i),ds._createAt(t,"end")),this.remove(us._createOn(i)),n}insert(e,t){Fs(t=ie(t)?[...t]:[t],this.document);const i=t.reduce(((e,t)=>{const i=e[e.length-1],o=!t.is("uiElement");return i&&i.breakAttributes==o?i.nodes.push(t):e.push({breakAttributes:o,nodes:[t]}),e}),[]);let o=null,n=e;for(const{nodes:e,breakAttributes:t}of i){const i=this._insertNodes(n,e,t);o||(o=i.start),n=i.end}return o?new us(o,n):new us(e)}remove(e){const t=e instanceof us?e:us._createOn(e);if(Us(t,this.document),t.isCollapsed)return new Vs(this.document);const{start:i,end:o}=this._breakAttributesRange(t,!0),n=i.parent,r=o.offset-i.offset,s=n._removeChildren(i.offset,r);for(const e of s)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(i);return t.start=a,t.end=a.clone(),new Vs(this.document,s)}clear(e,t){Us(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of i){const i=o.item;let n;if(i.is("element")&&t.isSimilar(i))n=us._createOn(i);else if(!o.nextPosition.isAfter(e.start)&&i.is("$textProxy")){const e=i.getAncestors().find((e=>e.is("element")&&t.isSimilar(e)));e&&(n=us._createIn(e))}n&&(n.end.isAfter(e.end)&&(n.end=e.end),n.start.isBefore(e.start)&&(n.start=e.start),this.remove(n))}}move(e,t){let i;if(t.isAfter(e.end)){const o=(t=this._breakAttributes(t,!0)).parent,n=o.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=o.childCount-n}else i=this.remove(e);return this.insert(t,i)}wrap(e,t){if(!(t instanceof As))throw new A("view-writer-wrap-invalid-attribute",this.document);if(Us(e,this.document),e.isCollapsed){let o=e.start;o.parent.is("element")&&(i=o.parent,!Array.from(i.getChildren()).some((e=>!e.is("uiElement"))))&&(o=o.getLastMatchingPosition((e=>e.item.is("uiElement")))),o=this._wrapPosition(o,t);const n=this.document.selection;return n.isCollapsed&&n.getFirstPosition().isEqual(e.start)&&this.setSelection(o),new us(o)}return this._wrapRange(e,t);var i}unwrap(e,t){if(!(t instanceof As))throw new A("view-writer-unwrap-invalid-attribute",this.document);if(Us(e,this.document),e.isCollapsed)return e;const{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,r=this._unwrapChildren(n,i.offset,o.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new us(s,a)}rename(e,t){const i=new ns(this.document,e,t.getAttributes());return this.insert(ds._createAfter(t),i),this.move(us._createIn(t),ds._createAt(i,0)),this.remove(us._createOn(t)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ds._createAt(e,t)}createPositionAfter(e){return ds._createAfter(e)}createPositionBefore(e){return ds._createBefore(e)}createRange(e,t){return new us(e,t)}createRangeOn(e){return us._createOn(e)}createRangeIn(e){return us._createIn(e)}createSelection(...e){return new ms(...e)}createSlot(e="children"){if(!this._slotFactory)throw new A("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,i){let o,n;if(o=i?Rs(e):e.parent.is("$text")?e.parent.parent:e.parent,!o)throw new A("view-writer-invalid-position-container",this.document);n=i?this._breakAttributes(e,!0):e.parent.is("$text")?Ds(e):e;const r=o._insertChild(n.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const s=n.getShiftedBy(r),a=this.mergeAttributes(n);a.isEqual(n)||s.offset--;const l=this.mergeAttributes(s);return new us(a,l)}_wrapChildren(e,t,i,o){let n=t;const r=[];for(;n<i;){const t=e.getChild(n),i=t.is("$text"),l=t.is("attributeElement");if(l&&t._canMergeAttributesFrom(o))t._mergeAttributesFrom(o),r.push(new ds(e,n));else if(i||!l||(a=t,(s=o).priority<a.priority||!(s.priority>a.priority)&&s.getIdentity()<a.getIdentity())){const i=o._clone();t._remove(),i._appendChild(t),e._insertChild(n,i),this._addToClonedElementsGroup(i),r.push(new ds(e,n))}else this._wrapChildren(t,0,t.childCount,o);n++}var s,a;let l=0;for(const e of r)e.offset-=l,e.offset!=t&&(this.mergeAttributes(e).isEqual(e)||(l++,i--));return us._createFromParentsAndOffsets(e,t,e,i)}_unwrapChildren(e,t,i,o){let n=t;const r=[];for(;n<i;){const t=e.getChild(n);if(t.is("attributeElement"))if(t.isSimilar(o)){const o=t.getChildren(),s=t.childCount;t._remove(),e._insertChild(n,o),this._removeFromClonedElementsGroup(t),r.push(new ds(e,n),new ds(e,n+s)),n+=s,i+=s-1}else t._canSubtractAttributesOf(o)?(t._subtractAttributesOf(o),r.push(new ds(e,n),new ds(e,n+1)),n++):(this._unwrapChildren(t,0,t.childCount,o),n++);else n++}let s=0;for(const e of r)e.offset-=s,e.offset!=t&&e.offset!=i&&(this.mergeAttributes(e).isEqual(e)||(s++,i--));return us._createFromParentsAndOffsets(e,t,e,i)}_wrapRange(e,t){const{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,r=this._wrapChildren(n,i.offset,o.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new us(s,a)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return Bs(e.clone());e.parent.is("$text")&&(e=Ds(e));const i=this.createAttributeElement("_wrapPosition-fake-element");i._priority=Number.POSITIVE_INFINITY,i.isSimilar=()=>!1,e.parent._insertChild(e.offset,i);const o=new us(e,e.getShiftedBy(1));this.wrap(o,t);const n=new ds(i.parent,i.index);i._remove();const r=n.nodeBefore,s=n.nodeAfter;return r&&r.is("view:$text")&&s&&s.is("view:$text")?Ls(r,s):Bs(n)}_breakAttributesRange(e,t=!1){const i=e.start,o=e.end;if(Us(e,this.document),e.isCollapsed){const i=this._breakAttributes(e.start,t);return new us(i,i)}const n=this._breakAttributes(o,t),r=n.parent.childCount,s=this._breakAttributes(i,t);return n.offset+=n.parent.childCount-r,new us(s,n)}_breakAttributes(e,t=!1){const i=e.offset,o=e.parent;if(e.parent.is("emptyElement"))throw new A("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new A("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new A("view-writer-cannot-break-raw-element",this.document);if(!t&&o.is("$text")&&js(o.parent))return e.clone();if(js(o))return e.clone();if(o.is("$text"))return this._breakAttributes(Ds(e),t);if(i==o.childCount){const e=new ds(o.parent,o.index+1);return this._breakAttributes(e,t)}if(0===i){const e=new ds(o.parent,o.index);return this._breakAttributes(e,t)}{const e=o.index+1,n=o._clone();o.parent._insertChild(e,n),this._addToClonedElementsGroup(n);const r=o.childCount-i,s=o._removeChildren(i,r);n._appendChild(s);const a=new ds(o.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i||(i=new Set,this._cloneGroups.set(t,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const i=this._cloneGroups.get(t);i&&i.delete(e)}}function Rs(e){let t=e.parent;for(;!js(t);){if(!t)return;t=t.parent}return t}function Bs(e){const t=e.nodeBefore;if(t&&t.is("$text"))return new ds(t,t.data.length);const i=e.nodeAfter;return i&&i.is("$text")?new ds(i,0):e}function Ds(e){if(e.offset==e.parent.data.length)return new ds(e.parent.parent,e.parent.index+1);if(0===e.offset)return new ds(e.parent.parent,e.parent.index);const t=e.parent.data.slice(e.offset);return e.parent._data=e.parent.data.slice(0,e.offset),e.parent.parent._insertChild(e.parent.index+1,new Lr(e.root.document,t)),new ds(e.parent.parent,e.parent.index+1)}function Ls(e,t){const i=e.data.length;return e._data+=t.data,t._remove(),new ds(e,i)}const zs=[Lr,As,ns,Es,Ms,Ps];function Fs(e,t){for(const i of e){if(!zs.some((e=>i instanceof e)))throw new A("view-writer-insert-invalid-node-type",t);i.is("$text")||Fs(i.getChildren(),t)}}function js(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function Us(e,t){const i=Rs(e.start),o=Rs(e.end);if(!i||!o||i!==o)throw new A("view-writer-invalid-range-container",t)}const Hs=e=>e.createTextNode(" "),Ws=e=>{const t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},$s=e=>{const t=e.createElement("br");return t.dataset.ckeFiller="true",t},qs="⁠".repeat(7);function Zs(e){return"string"==typeof e?e.substr(0,7)===qs:Zi(e)&&e.data.substr(0,7)===qs}function Gs(e){return 7==e.data.length&&Zs(e)}function Ks(e){const t="string"==typeof e?e:e.data;return Zs(e)?t.slice(7):t}function Ys(e,t){if(t.keyCode==Eo.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,i=e.getRangeAt(0).startOffset;Zs(t)&&i<=7&&e.collapse(t,0)}}}var Qs=n(8397),Js={attributes:{"data-cke":!0}};Js.setAttributes=Wn(),Js.insert=Un().bind(null,"head"),Js.domAPI=Fn(),Js.insertStyleElement=qn(),Ln()(Qs.A,Js),Qs.A&&Qs.A.locals&&Qs.A.locals;class Xs extends(Z()){constructor(e,t){super(),this.domDocuments=new Set,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this._inlineFiller=null,this._fakeSelectionContainer=null,this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),s.isBlink&&!s.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()}))}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 A("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!s.isAndroid)return;let e=null;const t=!(s.isBlink&&!s.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=ds._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),i=t.parent.ownerDocument;Zs(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=ea(i,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const i=Array.from(t.childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),n=this._diffNodeLists(i,o),r=this._findUpdateActions(n,i,o,ta);if(-1!==r.indexOf("update")){const t={equal:0,insert:0,delete:0};for(const n of r)if("update"===n){const n=t.equal+t.insert,r=t.equal+t.delete,s=e.getChild(n);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,i[r]),go(o[n]),t.equal++}else t[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")?ds._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&&Zi(t.parent)&&Zs(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Zs(e))throw new A("view-renderer-filler-was-lost",this);Gs(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,i=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;const o=e.nodeBefore,n=e.nodeAfter;return!(o instanceof Lr||n instanceof Lr||!(i!==t.getFillerOffset()||o&&o.is("element","br"))||s.isAndroid&&(o||n))}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);let o=this.domConverter.viewToDom(e).data;const n=t.inlineFillerPosition;n&&n.parent==e.parent&&n.offset==e.index&&(o=qs+o),this._updateTextNode(i,o)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(t){for(const i of Array.from(t.attributes)){const o=i.name;e.hasAttribute(o)||this.domConverter.removeDomElementAttribute(t,o)}for(const i of e.getAttributeKeys())this.domConverter.setDomElementAttribute(t,i,e.getAttribute(i),e)}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i)return;if(s.isAndroid){let e=null;for(const t of Array.from(i.childNodes)){if(e&&Zi(e)&&Zi(t)){i.normalize();break}e=t}}const o=t.inlineFillerPosition,n=i.childNodes,r=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));o&&o.parent===e&&ea(i.ownerDocument,r,o.offset);const a=this._diffNodeLists(n,r),l=this._findUpdateActions(a,n,r,ia);let c=0;const d=new Set;for(const e of l)"delete"===e?(d.add(n[c]),go(n[c])):"equal"!==e&&"update"!==e||c++;c=0;for(const e of l)"insert"===e?(ao(i,c,r[c]),c++):"update"===e?(this._updateTextNode(n[c],r[c].data),c++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(r[c])),c++);for(const e of d)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return k(e=function(e,t){const i=Array.from(e);if(0==i.length||!t)return i;return i[i.length-1]==t&&i.pop(),i}(e,this._fakeSelectionContainer),t,oa.bind(null,this.domConverter))}_findUpdateActions(e,t,i,o){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let n=[],r=[],s=[];const a={equal:0,insert:0,delete:0};for(const l of e)"insert"===l?s.push(i[a.equal+a.insert]):"delete"===l?r.push(t[a.equal+a.delete]):(n=n.concat(k(r,s,o).map((e=>"equal"===e?"update":e))),n.push("equal"),r=[],s=[]),a[l]++;return n.concat(k(r,s,o).map((e=>"equal"===e?"update":e)))}_updateTextNode(e,t){const i=e.data;i!=t&&(s.isAndroid&&this.isComposing&&i.replace(/\u00A0/g," ")==t.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,t))}_updateTextNodeInternal(e,t){const i=p(e.data,t);for(const t of i)"insert"===t.type?e.insertData(t.index,t.values.join("")):e.deleteData(t.index,t.howMany)}_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(s.isBlink&&!s.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&&s.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 i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;i.parentElement&&i.parentElement==e||e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const o=t.getSelection(),n=t.createRange();o.removeAllRanges(),n.selectNodeContents(i),o.addRange(n)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.setBaseAndExtent(i.parent,i.offset,o.parent,o.offset),s.isGecko&&function(e,t){let i=e.parent,o=e.offset;if(Zi(i)&&Gs(i)&&(o=so(i)+1,i=i.parentNode),i.nodeType!=Node.ELEMENT_NODE||o!=i.childNodes.length-1)return;const n=i.childNodes[o];n&&"BR"==n.tagName&&t.addRange(t.getRangeAt(0))}(o,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,i=e.ownerDocument.getSelection();return!t||t.parentElement!==e||i.anchorNode!==t&&!t.contains(i.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const i=e.activeElement,o=this.domConverter.mapDomToView(i);i&&o&&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 ea(e,t,i){const o=t instanceof Array?t:t.childNodes,n=o[i];if(Zi(n))return n.data=qs+n.data,n;{const n=e.createTextNode(qs);return Array.isArray(t)?o.splice(i,0,n):ao(t,i,n),n}}function ta(e,t){return zi(e)&&zi(t)&&!Zi(e)&&!Zi(t)&&!lo(e)&&!lo(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function ia(e,t){return zi(e)&&zi(t)&&Zi(e)&&Zi(t)}function oa(e,t,i){return t===i||(Zi(t)&&Zi(i)?t.data===i.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(i)))}const na=$s(t.document),ra=Hs(t.document),sa=Ws(t.document),aa="data-ck-unsafe-attribute-",la="data-ck-unsafe-element";class ca{constructor(e,{blockFillerMode:i,renderingMode:o="editing"}={}){this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Wr,this._inlineObjectElementMatcher=new Wr,this._elementsWithTemporaryCustomProperties=new Set,this.document=e,this.renderingMode=o,this.blockFillerMode=i||("editing"===o?"br":"nbsp"),this.preElements=["pre","textarea"],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?t.document:t.document.implementation.createHTMLDocument("")}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new ms(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.children)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,i){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&("srcdoc"!==e||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===i&&("src"===e||"srcset"===e)||"source"===i&&"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 i=(new DOMParser).parseFromString(t,"text/html"),o=i.createDocumentFragment(),n=i.body.childNodes;for(;n.length>0;)o.appendChild(n[0]);const r=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT),s=[];let a;for(;a=r.nextNode();)s.push(a);for(const e of s){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(fa(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(o)}viewToDom(e,t={}){if(e.is("$text")){const t=this._processDataFromViewText(e);return this._domDocument.createTextNode(t)}{const i=e;if(this.mapViewToDom(i)){if(!i.getCustomProperty("editingPipeline:doNotReuseOnce"))return this.mapViewToDom(i);this._elementsWithTemporaryCustomProperties.add(i)}let o;if(i.is("documentFragment"))o=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(o,i);else{if(i.is("uiElement"))return o="$comment"===i.name?this._domDocument.createComment(i.getCustomProperty("$rawContent")):i.render(this._domDocument,this),t.bind&&this.bindElements(o,i),o;this._shouldRenameElement(i.name)?(fa(i.name),o=this._createReplacementDomElement(i.name)):o=i.hasAttribute("xmlns")?this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(o,this),t.bind&&this.bindElements(o,i);for(const e of i.getAttributeKeys())this.setDomElementAttribute(o,e,i.getAttribute(e),i)}if(!1!==t.withChildren)for(const e of this.viewChildrenToDom(i,t))o instanceof HTMLTemplateElement?o.content.appendChild(e):o.appendChild(e);return o}}setDomElementAttribute(e,i,o,n){const r=this.shouldRenderAttribute(i,o,e.tagName.toLowerCase())||n&&n.shouldRenderUnsafeAttribute(i);r||C("domconverter-unsafe-attribute-detected",{domElement:e,key:i,value:o}),function(e){try{t.document.createAttribute(e)}catch(e){return!1}return!0}(i)?(e.hasAttribute(i)&&!r?e.removeAttribute(i):e.hasAttribute(aa+i)&&r&&e.removeAttribute(aa+i),e.setAttribute(r?i:aa+i,o)):C("domconverter-invalid-attribute-detected",{domElement:e,key:i,value:o})}removeDomElementAttribute(e,t){t!=la&&(e.removeAttribute(t),e.removeAttribute(aa+t))}*viewChildrenToDom(e,t={}){const i=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const n of e.getChildren()){i===o&&(yield this._getBlockFiller());const e=n.is("element")&&!!n.getCustomProperty("dataPipeline:transparentRendering")&&!Xo(n.getAttributes());if(e&&"data"==this.renderingMode)if(n.is("rawElement")){const e=this._domDocument.createElement(n.name);n.render(e,this),yield*[...e.childNodes]}else yield*this.viewChildrenToDom(n,t);else e&&C("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:n}),yield this.viewToDom(n,t);o++}i===o&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),o=this._domDocument.createRange();return o.setStart(t.parent,t.offset),o.setEnd(i.parent,i.offset),o}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const i=this.findCorrespondingDomText(t);if(!i)return null;let o=e.offset;return Zs(i)&&(o+=7),{parent:i,offset:o}}{let i,o,n;if(0===e.offset){if(i=this.mapViewToDom(t),!i)return null;n=i.childNodes[0]}else{const t=e.nodeBefore;if(o=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(t),!o)return null;i=o.parentNode,n=o.nextSibling}return Zi(n)&&Zs(n)?{parent:n,offset:7}:{parent:i,offset:o?so(o)+1:0}}}domToView(e,t={}){const i=[],o=this._domToView(e,t,i),n=o.next().value;return n?(o.next(),this._processDomInlineNodes(null,i,t),"br"==this.blockFillerMode&&ga(n)||n.is("$text")&&0==n.data.length?null:n):null}*domChildrenToView(e,t={},i=[]){let o=[];o=e instanceof HTMLTemplateElement?[...e.content.childNodes]:[...e.childNodes];for(let n=0;n<o.length;n++){const r=o[n],s=this._domToView(r,t,i),a=s.next().value;null!==a&&(this._isBlockViewElement(a)&&this._processDomInlineNodes(e,i,t),"br"==this.blockFillerMode&&ga(a)||(yield a),s.next())}this._processDomInlineNodes(e,i,t)}domSelectionToView(e){if(function(e){if(!s.isGecko)return!1;if(!e.rangeCount)return!1;const t=e.getRangeAt(0).startContainer;try{Object.prototype.toString.call(t)}catch(e){return!0}return!1}(e))return new ms([]);if(1===e.rangeCount){let t=e.getRangeAt(0).startContainer;Zi(t)&&(t=t.parentNode);const i=this.fakeSelectionToView(t);if(i)return i}const t=this.isDomSelectionBackward(e),i=[];for(let t=0;t<e.rangeCount;t++){const o=e.getRangeAt(t),n=this.domRangeToView(o);n&&i.push(n)}return new ms(i,{backward:t})}domRangeToView(e){const t=this.domPositionToView(e.startContainer,e.startOffset),i=this.domPositionToView(e.endContainer,e.endOffset);return t&&i?new us(t,i):null}domPositionToView(e,t=0){if(this.isBlockFiller(e))return this.domPositionToView(e.parentNode,so(e));const i=this.mapDomToView(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return ds._createBefore(i);if(Zi(e)){if(Gs(e))return this.domPositionToView(e.parentNode,so(e));const i=this.findCorrespondingViewText(e);let o=t;return i?(Zs(e)&&(o-=7,o=o<0?0:o),new ds(i,o)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new ds(t,0)}else{const i=e.childNodes[t-1];if(Zi(i)&&Gs(i)||i&&this.isBlockFiller(i))return this.domPositionToView(i.parentNode,so(i));const o=Zi(i)?this.findCorrespondingViewText(i):this.mapDomToView(i);if(o&&o.parent)return new ds(o.parent,o.index+1)}return null}mapDomToView(e){return this.getHostViewElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(Gs(e))return null;const t=this.getHostViewElement(e);if(t)return t;const i=e.previousSibling;if(i){if(!this.isElement(i))return null;const e=this.mapDomToView(i);if(e){const t=e.nextSibling;return t instanceof Lr?t:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof Lr?e:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const i=this.mapViewToDom(e);if(i&&i.ownerDocument.activeElement!==i){const{scrollX:e,scrollY:o}=t.window,n=[];da(i,(e=>{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])})),i.focus(),da(i,(e=>{const[t,i]=n.shift();e.scrollLeft=t,e.scrollTop=i})),t.window.scrollTo(e,o)}}_clearDomSelection(){const e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;const t=e.ownerDocument.defaultView.getSelection(),i=this.domSelectionToView(t);i&&i.rangeCount>0&&t.removeAllRanges()}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(na):!!pa(e,this.blockElements)||e.isEqualNode(sa)||function(e,t){return e.isEqualNode(ra)&&ua(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 i=t.collapsed;return t.detach(),i}getHostViewElement(e){const t=function(e){const t=[];let i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}(e);for(t.pop();t.length;){const e=t.pop(),i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(const e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return Hs(this._domDocument);case"markedNbsp":return Ws(this._domDocument);case"br":return $s(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(Zi(e)&&Zs(e)&&t<7)return!1;if(this.isElement(e)&&Zs(e.childNodes[t]))return!1;const i=this.mapDomToView(e);return!i||!i.is("uiElement")&&!i.is("rawElement")}*_domToView(e,t,i){if("br"!=this.blockFillerMode&&pa(e,this.blockElements))return null;const o=this.getHostViewElement(e);if(o)return o;if(lo(e)&&t.skipComments)return null;if(Zi(e)){if(Gs(e))return null;{const t=e.data;if(""===t)return null;const o=new Lr(this.document,t);return i.push(o),o}}{let o=this.mapDomToView(e);if(o)return this._isInlineObjectElement(o)&&i.push(o),o;if(this.isDocumentFragment(e))o=new Vs(this.document),t.bind&&this.bindDocumentFragments(e,o);else{o=this._createViewElement(e,t),t.bind&&this.bindElements(e,o);const n=e.attributes;if(n)for(let e=n.length,t=0;t<e;t++)o._setAttribute(n[t].name,n[t].value);if(this._isViewElementWithRawContent(o,t))return o._setCustomProperty("$rawContent",e.innerHTML),this._isBlockViewElement(o)||i.push(o),o;if(lo(e))return o._setCustomProperty("$rawContent",e.data),o}yield o;const n=[];if(!1!==t.withChildren)for(const i of this.domChildrenToView(e,t,n))o._appendChild(i);if(this._isInlineObjectElement(o))i.push(o),this._processDomInlineNodes(null,n,t);else for(const e of n)i.push(e)}}_processDomInlineNodes(e,t,i){if(!t.length)return;if(e&&!this.isDocumentFragment(e)&&!this._isBlockDomElement(e))return;let o=!1;for(let e=0;e<t.length;e++){const n=t[e];if(!n.is("$text")){o=!1;continue}let r,s=!1;if(this._isPreFormatted(n))r=Ks(n.data);else{r=n.data.replace(/[ \n\t\r]{1,}/g," "),s=/[^\S\u00A0]/.test(r.charAt(r.length-1));const a=e>0?t[e-1]:null,l=e+1<t.length?t[e+1]:null,c=!a||a.is("element")&&"br"==a.name||o,d=!l&&!Zs(n.data);!1!==i.withChildren&&(c&&(r=r.replace(/^ /,"")),d&&(r=r.replace(/ $/,""))),r=Ks(r),"br"!=this.blockFillerMode&&n.parent&&(ma(n.parent,r)?(r="",n.parent.parent&&(n.parent.parent._setCustomProperty("$hasBlockFiller",!0),n.parent._remove())):ha(n.parent,r,this.blockElements)&&(r="",n.parent._setCustomProperty("$hasBlockFiller",!0))),r=r.replace(/ \u00A0/g," ");const u=l&&l.is("element")&&"br"!=l.name,h=l&&l.is("$text")&&" "==l.data.charAt(0);(/[ \u00A0]\u00A0$/.test(r)||!l||u||h)&&(r=r.replace(/\u00A0$/," ")),(c||a&&a.is("element")&&"br"!=a.name)&&(r=r.replace(/^\u00A0/," "))}0==r.length&&n.parent?(n._remove(),t.splice(e,1),e--):(n._data=r,o=s)}t.length=0}_processDataFromViewText(e){let t=e.data;if(this._isPreFormatted(e))return t;if(" "==t.charAt(0)){const i=this._getTouchingInlineViewNode(e,!1);!(i&&i.is("$textProxy")&&this._nodeEndsWithSpace(i))&&i||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const i=this._getTouchingInlineViewNode(e,!0),o=i&&i.is("$textProxy")&&" "==i.data.charAt(0);" "!=t.charAt(t.length-2)&&i&&!o||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(this._isPreFormatted(e))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_isPreFormatted(e){if(function(e,t){return e.getAncestors().some((e=>e.is("element")&&t.includes(e.name)))}(e,this.preElements))return!0;for(const t of e.getAncestors({parentFirst:!0}))if(t.is("element")&&t.hasStyle("white-space")&&"inherit"!==t.getStyle("white-space"))return["pre","pre-wrap","break-spaces"].includes(t.getStyle("white-space"));return!1}_getTouchingInlineViewNode(e,t){const i=new cs({startPosition:t?ds._createAfter(e):ds._createBefore(e),direction:t?"forward":"backward"});for(const{item:e}of i){if(e.is("$textProxy"))return e;if(!e.is("element")||!e.getCustomProperty("dataPipeline:transparentRendering")){if(e.is("element","br"))return null;if(this._isInlineObjectElement(e))return e;if(e.is("containerElement"))return null}}return null}_isBlockDomElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isBlockViewElement(e){return e.is("element")&&this.blockElements.includes(e.name)}_isInlineObjectElement(e){return!!e.is("element")&&("br"==e.name||this.inlineObjectElements.includes(e.name)||!!this._inlineObjectElementMatcher.match(e))}_createViewElement(e,t){if(lo(e))return new Ps(this.document,"$comment");const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new ts(this.document,i)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&e.is("element")&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const i=this._domDocument.createElement("span");if(i.setAttribute(la,e),t){for(;t.firstChild;)i.appendChild(t.firstChild);for(const e of t.getAttributeNames())i.setAttribute(e,t.getAttribute(e))}return i}}function da(e,t){let i=e;for(;i;)t(i),i=i.parentElement}function ua(e,t){const i=e.parentNode;return!!i&&!!i.tagName&&t.includes(i.tagName.toLowerCase())}function ha(e,t,i){return" "==t&&e&&e.is("element")&&1==e.childCount&&i.includes(e.name)}function ma(e,t){return" "==t&&e&&e.is("element","span")&&1==e.childCount&&e.hasAttribute("data-cke-filler")}function ga(e){return e.is("element","br")&&e.hasAttribute("data-cke-filler")}function pa(e,t){return"BR"===e.tagName&&ua(e,t)&&1===e.parentNode.childNodes.length}function fa(e){"script"===e&&C("domconverter-unsafe-script-element-detected"),"style"===e&&C("domconverter-unsafe-style-element-detected")}class ba extends(Ui()){constructor(e){super(),this._isEnabled=!1,this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}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 ka=qo((function(e,t){rt(t,Bt(t),e)}));const _a=ka;class wa{constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,_a(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class va extends ba{constructor(){super(...arguments),this.useCapture=!1,this.usePassive=!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,usePassive:this.usePassive})}))}stopObserving(e){this.stopListening(e)}fire(e,t,i){this.isEnabled&&this.document.fire(e,new wa(this.view,t,i))}}class ya extends va{constructor(){super(...arguments),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 Po(this)}};this.fire(e.type,e,t)}}const xa=function(){return re.Date.now()};var Aa=/\s/;var Ca=/^\s+/;const Ta=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Aa.test(e.charAt(t)););return t}(e)+1).replace(Ca,""):e};var Ea=/^[-+]0x[0-9a-f]+$/i,Sa=/^0b[01]+$/i,Pa=/^0o[0-7]+$/i,Ia=parseInt;const Ma=function(e){if("number"==typeof e)return e;if(ar(e))return NaN;if(F(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=F(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ta(e);var i=Sa.test(e);return i||Pa.test(e)?Ia(e.slice(2),i?2:8):Ea.test(e)?NaN:+e};var Oa=Math.max,Va=Math.min;const Na=function(e,t,i){var o,n,r,s,a,l,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var i=o,r=n;return o=n=void 0,c=t,s=e.apply(r,i)}function g(e){var i=e-l;return void 0===l||i>=t||i<0||u&&e-c>=r}function p(){var e=xa();if(g(e))return f(e);a=setTimeout(p,function(e){var i=t-(e-l);return u?Va(i,r-(e-c)):i}(e))}function f(e){return a=void 0,h&&o?m(e):(o=n=void 0,s)}function b(){var e=xa(),i=g(e);if(o=arguments,n=this,l=e,i){if(void 0===a)return function(e){return c=e,a=setTimeout(p,t),d?m(e):s}(l);if(u)return clearTimeout(a),a=setTimeout(p,t),m(l)}return void 0===a&&(a=setTimeout(p,t)),s}return t=Ma(t)||0,F(i)&&(d=!!i.leading,r=(u="maxWait"in i)?Oa(Ma(i.maxWait)||0,t):r,h="trailing"in i?!!i.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=n=a=void 0},b.flush=function(){return void 0===a?s:f(xa())},b};class Ra extends ba{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Na((e=>{this.document.fire("selectionChangeDone",e)}),200)}observe(){const e=this.document;e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()}),{context:"$capture"}),e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)}),{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,i=new ms(t.getRanges(),{backward:t.isBackward,fake:!1});e!=Eo.arrowleft&&e!=Eo.arrowup||i.setTo(i.getFirstPosition()),e!=Eo.arrowright&&e!=Eo.arrowdown||i.setTo(i.getLastPosition());const o={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}function Ba(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Je;++t<i;)this.add(e[t])}Ba.prototype.add=Ba.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ba.prototype.has=function(e){return this.__data__.has(e)};const Da=Ba,La=function(e,t){for(var i=-1,o=null==e?0:e.length;++i<o;)if(t(e[i],i,e))return!0;return!1},za=function(e,t){return e.has(t)},Fa=function(e,t,i,o,n,r){var s=1&i,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(e),d=r.get(t);if(c&&d)return c==t&&d==e;var u=-1,h=!0,m=2&i?new Da:void 0;for(r.set(e,t),r.set(t,e);++u<a;){var g=e[u],p=t[u];if(o)var f=s?o(p,g,u,t,e,r):o(g,p,u,e,t,r);if(void 0!==f){if(f)continue;h=!1;break}if(m){if(!La(t,(function(e,t){if(!za(m,t)&&(g===e||n(g,e,i,o,r)))return m.push(t)}))){h=!1;break}}else if(g!==p&&!n(g,p,i,o,r)){h=!1;break}}return r.delete(e),r.delete(t),h},ja=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e,o){i[++t]=[o,e]})),i},Ua=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i};var Ha=se?se.prototype:void 0,Wa=Ha?Ha.valueOf:void 0;var $a=Object.prototype.hasOwnProperty;var qa="[object Arguments]",Za="[object Array]",Ga="[object Object]",Ka=Object.prototype.hasOwnProperty;const Ya=function(e,t,i,o,n,r){var s=ge(e),a=ge(t),l=s?Za:mi(e),c=a?Za:mi(t),d=(l=l==qa?Ga:l)==Ga,u=(c=c==qa?Ga:c)==Ga,h=l==c;if(h&&gt(e)){if(!gt(t))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new et),s||Ct(e)?Fa(e,t,i,o,n,r):function(e,t,i,o,n,r,s){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new pi(e),new pi(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Te(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ja;case"[object Set]":var l=1&o;if(a||(a=Ua),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;o|=2,s.set(e,t);var d=Fa(a(e),a(t),o,n,r,s);return s.delete(e),d;case"[object Symbol]":if(Wa)return Wa.call(e)==Wa.call(t)}return!1}(e,t,l,i,o,n,r);if(!(1&i)){var m=d&&Ka.call(e,"__wrapped__"),g=u&&Ka.call(t,"__wrapped__");if(m||g){var p=m?e.value():e,f=g?t.value():t;return r||(r=new et),n(p,f,i,o,r)}}return!!h&&(r||(r=new et),function(e,t,i,o,n,r){var s=1&i,a=Yt(e),l=a.length;if(l!=Yt(t).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in t:$a.call(t,d)))return!1}var u=r.get(e),h=r.get(t);if(u&&h)return u==t&&h==e;var m=!0;r.set(e,t),r.set(t,e);for(var g=s;++c<l;){var p=e[d=a[c]],f=t[d];if(o)var b=s?o(f,p,d,t,e,r):o(p,f,d,e,t,r);if(!(void 0===b?p===f||n(p,f,i,o,r):b)){m=!1;break}g||(g="constructor"==d)}if(m&&!g){var k=e.constructor,_=t.constructor;k==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof k&&k instanceof k&&"function"==typeof _&&_ instanceof _||(m=!1)}return r.delete(e),r.delete(t),m}(e,t,i,o,n,r))},Qa=function e(t,i,o,n,r){return t===i||(null==t||null==i||!pe(t)&&!pe(i)?t!=t&&i!=i:Ya(t,i,o,n,e,r))};class Ja extends ba{constructor(e){super(e),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(0===e.length)return;const t=this.domConverter,i=new Set,o=new Set;for(const i of e){const e=t.mapDomToView(i.target);e&&(e.is("uiElement")||e.is("rawElement")||"childList"!==i.type||this._isBogusBrMutation(i)||o.add(e))}for(const n of e){const e=t.mapDomToView(n.target);if((!e||!e.is("uiElement")&&!e.is("rawElement"))&&"characterData"===n.type){const e=t.findCorrespondingViewText(n.target);e&&!o.has(e.parent)?i.add(e):!e&&Zs(n.target)&&o.add(t.mapDomToView(n.target.parentNode))}}const n=[];for(const e of i)n.push({type:"text",node:e});for(const e of o){const i=t.mapViewToDom(e),o=Array.from(e.getChildren()),c=Array.from(t.domChildrenToView(i,{withChildren:!1}));r=o,s=c,l=void 0,(void 0===(l=(a="function"==typeof(a=Xa)?a:void 0)?a(r,s):void 0)?Qa(r,s,void 0,a):l)||n.push({type:"children",node:e})}var r,s,a,l;n.length&&this.document.fire("mutations",{mutations:n})}_isBogusBrMutation(e){let t=null;return null===e.nextSibling&&0===e.removedNodes.length&&1==e.addedNodes.length&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}function Xa(e,t){if(!Array.isArray(e))return e===t||!(!e.is("$text")||!t.is("$text"))&&e.data===t.data}class el extends va{constructor(e){super(e),this._renderTimeoutId=null,this._isFocusChanging=!1,this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",(()=>this._handleFocus())),t.on("blur",((e,t)=>this._handleBlur(t))),t.on("beforeinput",(()=>{t.isFocused||this._handleFocus()}),{priority:"highest"})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._clearTimeout(),super.destroy()}_handleFocus(){this._clearTimeout(),this._isFocusChanging=!0,this._renderTimeoutId=setTimeout((()=>{this._renderTimeoutId=null,this.flush(),this.view.change((()=>{}))}),50)}_handleBlur(e){const t=this.document.selection.editableElement;null!==t&&t!==e.target||(this.document.isFocused=!1,this._isFocusChanging=!1,this.view.change((()=>{})))}_clearTimeout(){this._renderTimeoutId&&(clearTimeout(this._renderTimeoutId),this._renderTimeoutId=null)}}class tl extends ba{constructor(e){super(e),this.mutationObserver=e.getObserver(Ja),this.focusObserver=e.getObserver(el),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Na((e=>{this.document.fire("selectionChangeDone",e)}),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=Na((()=>this.document.isSelecting=!1),5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,i=()=>{this.document.isSelecting&&(this._handleSelectionChange(t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(e,"keydown",i,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",i,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",i,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",(()=>{this.document.isComposing&&!s.isAndroid||(this._handleSelectionChange(t),this._documentIsSelectingInactivityTimeoutDebounced())})),this.listenTo(this.view.document,"compositionstart",(()=>{this._handleSelectionChange(t)}),{priority:"lowest"}),this._documents.add(t))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e){if(!this.isEnabled)return;const t=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(t.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(t);if(0!=i.rangeCount){if(this.view.hasDomSelection=!0,this.focusObserver.flush(),!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(t))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(this.selection.isSimilar(i))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class il extends va{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 ol{constructor(e,t={}){this._files=t.cacheFiles?nl(e):null,this._native=e}get files(){return this._files||(this._files=nl(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}setDragImage(e,t,i){this._native.setDragImage(e,t,i)}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}function nl(e){const t=Array.from(e.files||[]),i=Array.from(e.items||[]);return t.length?t:i.filter((e=>"file"===e.kind)).map((e=>e.getAsFile()))}class rl extends va{constructor(){super(...arguments),this.domEventType="beforeinput"}onDomEvent(e){const t=e.getTargetRanges(),i=this.view,o=i.document;let n=null,r=null,a=[];if(e.dataTransfer&&(n=new ol(e.dataTransfer)),null!==e.data?r=e.data:n&&(r=n.getData("text/plain")),o.selection.isFake)a=Array.from(o.selection.getRanges());else if(t.length)a=t.map((e=>{const t=i.domConverter.domPositionToView(e.startContainer,e.startOffset),o=i.domConverter.domPositionToView(e.endContainer,e.endOffset);return t?i.createRange(t,o):o?i.createRange(o):void 0})).filter((e=>!!e));else if(s.isAndroid){const t=e.target.ownerDocument.defaultView.getSelection();a=Array.from(i.domConverter.domSelectionToView(t).getRanges())}if(s.isAndroid&&"insertCompositionText"==e.inputType&&r&&r.endsWith("\n"))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[i.createRange(a[0].end)]});else if("insertText"==e.inputType&&r&&r.includes("\n")){const t=r.split(/\n{1,2}/g);let i=a;for(let r=0;r<t.length;r++){const s=t[r];""!=s&&(this.fire(e.type,e,{data:s,dataTransfer:n,targetRanges:i,inputType:e.inputType,isComposing:e.isComposing}),i=[o.selection.getFirstRange()]),r+1<t.length&&(this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:i}),i=[o.selection.getFirstRange()])}}else this.fire(e.type,e,{data:r,dataTransfer:n,targetRanges:a,inputType:e.inputType,isComposing:e.isComposing})}}class sl extends ba{constructor(e){super(e),this.document.on("keydown",((e,t)=>{if(this.isEnabled&&((i=t.keyCode)==Eo.arrowright||i==Eo.arrowleft||i==Eo.arrowup||i==Eo.arrowdown)){const i=new ps(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,t),i.stop.called&&e.stop()}var i}))}observe(){}stopObserving(){}}class al extends ba{constructor(e){super(e);const t=this.document;t.on("keydown",((e,i)=>{if(!this.isEnabled||i.keyCode!=Eo.tab||i.ctrlKey)return;const o=new ps(t,"tab",t.selection.getFirstRange());t.fire(o,i),o.stop.called&&e.stop()}))}observe(){}stopObserving(){}}const ll=function(e){return Vi(e,5)};class cl extends(Z()){constructor(e){var t;super(),this.domRoots=new Map,this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this.document=new ys(e),this.domConverter=new ca(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Xs(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new Ns(this.document),this.addObserver(Ja),this.addObserver(el),this.addObserver(tl),this.addObserver(ya),this.addObserver(Ra),this.addObserver(il),this.addObserver(sl),this.addObserver(rl),this.addObserver(al),this.document.on("arrowKey",Ys,{priority:"low"}),(t=this).document.on("arrowKey",((e,i)=>function(e,t,i){if(t.keyCode==Eo.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(o||t.shiftKey){const t=e.focusNode,n=e.focusOffset,r=i.domPositionToView(t,n);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition((e=>(e.item.is("uiElement")&&(s=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement")))));if(s){const t=i.viewPositionToDom(a);o?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,i,t.domConverter)),{priority:"low"}),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})),s.isiOS&&this.listenTo(this.document,"blur",((e,t)=>{this.domConverter.mapDomToView(t.domEvent.relatedTarget)||this.domConverter._clearDomSelection()})),this.listenTo(this.document,"mutations",((e,{mutations:t})=>{t.forEach((e=>this._renderer.markToSync(e.type,e.node)))}),{priority:"low"}),this.listenTo(this.document,"mutations",(()=>{this.forceRender()}),{priority:"lowest"})}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const o={};for(const{name:t,value:n}of Array.from(e.attributes))o[t]=n,"class"===t?this._writer.addClass(n.split(" "),i):i.hasAttribute(t)||this._writer.setAttribute(t,n,i);this._initialDomRootAttributes.set(e,o);const n=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(e.ownerDocument),i.on("change:children",((e,t)=>this._renderer.markToSync("children",t))),i.on("change:attributes",((e,t)=>this._renderer.markToSync("attributes",t))),i.on("change:text",((e,t)=>this._renderer.markToSync("text",t))),i.on("change:isReadOnly",(()=>this.change(n))),i.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const i of this._observers.values())i.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach((({name:e})=>t.removeAttribute(e)));const i=this._initialDomRootAttributes.get(t);for(const e in i)t.setAttribute(e,i[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t);for(const e of this._observers.values())e.stopObserving(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,i]of this.domRoots)t.observe(i,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({alignToTop:e,forceScroll:t,viewportOffset:i=20,ancestorOffset:o=20}={}){const n=this.document.selection.getFirstRange();if(!n)return;const r=ll({alignToTop:e,forceScroll:t,viewportOffset:i,ancestorOffset:o});"number"==typeof i&&(i={top:i,bottom:i,left:i,right:i});const s={target:this.domConverter.viewRangeToDom(n),viewportOffset:i,ancestorOffset:o,alignToTop:e,forceScroll:t};this.fire("scrollToTheSelection",s,r),function({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:o,forceScroll:n}){const r=vo(e);let s=r,a=null;for(t=function(e){return"number"==typeof e?{top:e,bottom:e,left:e,right:e}:e}(t);s;){let l;l=yo(s==r?e:a),fo({parent:l,getRect:()=>xo(e,s),alignToTop:o,ancestorOffset:i,forceScroll:n});let c=xo(e,s);const d=xo(l,s);if(c.height>d.height){const e=c.getIntersection(d);e&&(c=e)}if(po({window:s,rect:c,viewportOffset:t,alignToTop:o,forceScroll:n}),s.parent!=s){if(a=s.frameElement,s=s.parent,!a)return}else s=null}}(s)}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 A("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){A.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(el).flush(),this.change((()=>{}))}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return ds._createAt(e,t)}createPositionAfter(e){return ds._createAfter(e)}createPositionBefore(e){return ds._createBefore(e)}createRange(e,t){return new us(e,t)}createRangeOn(e){return us._createOn(e)}createRangeIn(e){return us._createIn(e)}createSelection(...e){return new ms(...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 dl{is(){throw new Error("is() method is abstract")}}class ul extends dl{constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new A("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new A("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),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 i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.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()}}ul.prototype.is=function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e};class hl{constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new A("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new A("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=gl._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}get position(){return this._position}skip(e){let t,i,o,n;do{o=this.position,n=this._visitedParent,({done:t,value:i}=this.next())}while(!t&&e(i));t||(this._position=o,this._visitedParent=n)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone(),this._visitedParent=e.parent}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),i=this._visitedParent;if(null===i.parent&&t.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const o=pl(t,i),n=o||fl(t,i,o);if(n&&n.is("model:element")){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}else t.path.push(0),this._visitedParent=n;return this._position=t,ml("elementStart",n,e,t,1)}if(n&&n.is("model:$text")){let o;if(this.singleCharacters)o=1;else{let e=n.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offset<e&&(e=this.boundaries.end.offset),o=e-t.offset}const r=t.offset-n.startOffset,s=new ul(n,r,o);return t.offset+=o,this._position=t,ml("text",s,e,t,o)}return t.path.pop(),t.offset++,this._position=t,this._visitedParent=i.parent,this.ignoreElementEnd?this._next():ml("elementEnd",i,e,t)}_previous(){const e=this.position,t=this.position.clone(),i=this._visitedParent;if(null===i.parent&&0===t.offset)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0,value:void 0};const o=t.parent,n=pl(t,o),r=n||bl(t,o,n);if(r&&r.is("model:element"))return t.offset--,this.shallow?(this._position=t,ml("elementStart",r,e,t,1)):(t.path.push(r.maxOffset),this._position=t,this._visitedParent=r,this.ignoreElementEnd?this._previous():ml("elementEnd",r,e,t));if(r&&r.is("model:$text")){let o;if(this.singleCharacters)o=1;else{let e=r.startOffset;this._boundaryStartParent==i&&this.boundaries.start.offset>e&&(e=this.boundaries.start.offset),o=t.offset-e}const n=t.offset-r.startOffset,s=new ul(r,n-o,o);return t.offset-=o,this._position=t,ml("text",s,e,t,o)}return t.path.pop(),this._position=t,this._visitedParent=i.parent,ml("elementStart",i,e,t,1)}}function ml(e,t,i,o,n){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}class gl extends dl{constructor(e,t,i="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new A("model-position-root-invalid",e);if(!Array.isArray(t)||0===t.length)throw new A("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=i}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;t<this.path.length-1;t++)if(e=e.getChildAtOffset(this.path[t]),!e)throw new A("model-position-path-incorrect",this,{position:this});if(e.is("$text"))throw new A("model-position-path-incorrect",this,{position:this});return e}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return pl(this,this.parent)}get nodeAfter(){const e=this.parent;return fl(this,e,pl(this,e))}get nodeBefore(){const e=this.parent;return bl(this,e,pl(this,e))}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}isValid(){if(this.offset<0)return!1;let e=this.root;for(let t=0;t<this.path.length-1;t++)if(e=e.getChildAtOffset(this.path[t]),!e)return!1;return this.offset<=e.maxOffset}compareWith(e){if(this.root!=e.root)return"different";const t=te(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]<e.path[t]?"before":"after"}}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new hl(t);return i.skip(e),i.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}findAncestor(e){const t=this.parent;return t.is("element")?t.findAncestor(e,{includeSelf:!0}):null}getCommonPath(e){if(this.root!=e.root)return[];const t=te(this.path,e.path),i="string"==typeof t?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,i)}getCommonAncestor(e){const t=this.getAncestors(),i=e.getAncestors();let o=0;for(;t[o]==i[o]&&t[o];)o++;return 0===o?null:t[o-1]}getShiftedBy(e){const t=this.clone(),i=t.offset+e;return t.offset=i<0?0:i,t}isAfter(e){return"after"==this.compareWith(e)}isBefore(e){return"before"==this.compareWith(e)}isEqual(e){return"same"==this.compareWith(e)}isTouching(e){if(this.root!==e.root)return!1;const t=Math.min(this.path.length,e.path.length);for(let i=0;i<t;i++){const t=this.path[i]-e.path[i];if(t<-1||t>1)return!1;if(1===t)return kl(e,this,i);if(-1===t)return kl(this,e,i)}return this.path.length===e.path.length||(this.path.length>e.path.length?_l(this.path,t):_l(e.path,t))}hasSameParentAs(e){return this.root===e.root&&"same"==te(this.getParentPath(),e.getParentPath())}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=gl._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 i;return t.containsPosition(this)||t.start.isEqual(this)?(i=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(i=i._getTransformedByDeletion(e.deletionPosition,1))):i=this.isEqual(e.deletionPosition)?gl._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),i}_getTransformedByDeletion(e,t){const i=gl._createAt(this);if(this.root!=e.root)return i;if("same"==te(e.getParentPath(),this.getParentPath())){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;i.offset-=t}}else if("prefix"==te(e.getParentPath(),this.getParentPath())){const o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o])return null;i.path[o]-=t}}return i}_getTransformedByInsertion(e,t){const i=gl._createAt(this);if(this.root!=e.root)return i;if("same"==te(e.getParentPath(),this.getParentPath()))(e.offset<this.offset||e.offset==this.offset&&"toPrevious"!=this.stickiness)&&(i.offset+=t);else if("prefix"==te(e.getParentPath(),this.getParentPath())){const o=e.path.length-1;e.offset<=this.path[o]&&(i.path[o]+=t)}return i}_getTransformedByMove(e,t,i){if(t=t._getTransformedByDeletion(e,i),e.isEqual(t))return gl._createAt(this);const o=this._getTransformedByDeletion(e,i);return null===o||e.isEqual(this)&&"toNext"==this.stickiness||e.getShiftedBy(i).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(e,t):o._getTransformedByInsertion(t,i)}_getCombined(e,t){const i=e.path.length-1,o=gl._createAt(t);return o.stickiness=this.stickiness,o.offset=o.offset+this.path[i]-e.offset,o.path=[...o.path,...this.path.slice(i+1)],o}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,t,i="toNone"){if(e.is("model:position"))return new gl(e.root,e.path,e.stickiness);{const o=e;if("end"==t)t=o.maxOffset;else{if("before"==t)return this._createBefore(o,i);if("after"==t)return this._createAfter(o,i);if(0!==t&&!t)throw new A("model-createpositionat-offset-required",[this,e])}if(!o.is("element")&&!o.is("documentFragment"))throw new A("model-position-parent-incorrect",[this,e]);const n=o.getPath();return n.push(t),new this(o.root,n,i)}}static _createAfter(e,t){if(!e.parent)throw new A("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}static _createBefore(e,t){if(!e.parent)throw new A("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}static fromJSON(e,t){if("$graveyard"===e.root){const i=new gl(t.graveyard,e.path);return i.stickiness=e.stickiness,i}if(!t.getRoot(e.root))throw new A("model-position-fromjson-no-root",t,{rootName:e.root});return new gl(t.getRoot(e.root),e.path,e.stickiness)}}function pl(e,t){const i=t.getChildAtOffset(e.offset);return i&&i.is("$text")&&i.startOffset<e.offset?i:null}function fl(e,t,i){return null!==i?null:t.getChildAtOffset(e.offset)}function bl(e,t,i){return null!==i?null:t.getChild(t.offsetToIndex(e.offset)-1)}function kl(e,t,i){return i+1!==e.path.length&&!!_l(t.path,i+1)&&!!function(e,t){let i=e.parent,o=e.path.length-1,n=0;for(;o>=t;){if(e.path[o]+n!==i.maxOffset)return!1;n=1,o--,i=i.parent}return!0}(e,i+1)}function _l(e,t){for(;t<e.length;){if(0!==e[t])return!1;t++}return!0}gl.prototype.is=function(e){return"position"===e||"model:position"===e};class wl extends dl{constructor(e,t){super(),this.start=gl._createAt(e),this.end=t?gl._createAt(t):gl._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new hl({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==te(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const i=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),o=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return i&&o}containsItem(e){const t=gl._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}isEqual(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new wl(this.start,e.start)),this.containsPosition(e.end)&&t.push(new wl(e.end,this.end))):t.push(new wl(this.start,this.end)),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,i=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(i=e.end),new wl(t,i)}return null}getJoined(e,t=!1){let i=this.isIntersecting(e);if(i||(i=this.start.isBefore(e.start)?t?this.end.isTouching(e.start):this.end.isEqual(e.start):t?e.end.isTouching(this.start):e.end.isEqual(this.start)),!i)return null;let o=this.start,n=this.end;return e.start.isBefore(o)&&(o=e.start),e.end.isAfter(n)&&(n=e.end),new wl(o,n)}getMinimalFlatRanges(){const e=[],t=this.start.getCommonPath(this.end).length,i=gl._createAt(this.start);let o=i.parent;for(;i.path.length>t+1;){const t=o.maxOffset-i.offset;0!==t&&e.push(new wl(i,i.getShiftedBy(t))),i.path=i.path.slice(0,-1),i.offset++,o=o.parent}for(;i.path.length<=this.end.path.length;){const t=this.end.path[i.path.length-1],o=t-i.offset;0!==o&&e.push(new wl(i,i.getShiftedBy(o))),i.offset=t,i.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new hl(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new hl(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new hl(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 wl(this.start,this.end)]}getTransformedByOperations(e){const t=[new wl(this.start,this.end)];for(const i of e)for(let e=0;e<t.length;e++){const o=t[e].getTransformedByOperation(i);t.splice(e,1,...o),e+=o.length-1}for(let e=0;e<t.length;e++){const i=t[e];for(let o=e+1;o<t.length;o++){const e=t[o];(i.containsRange(e)||e.containsRange(i)||i.isEqual(e))&&t.splice(o,1)}}return t}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const e=this.start.nodeAfter,t=this.end.nodeBefore;return e&&e.is("element")&&e===t?e:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,t=!1){return this._getTransformedByInsertion(e.position,e.howMany,t)}_getTransformedByMoveOperation(e,t=!1){const i=e.sourcePosition,o=e.howMany,n=e.targetPosition;return this._getTransformedByMove(i,n,o,t)}_getTransformedBySplitOperation(e){const t=this.start._getTransformedBySplitOperation(e);let i=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(i=this.end.getShiftedBy(1)),t.root!=i.root&&(i=this.end.getShiftedBy(-1)),new wl(t,i)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new wl(this.start);let t=this.start._getTransformedByMergeOperation(e),i=this.end._getTransformedByMergeOperation(e);return t.root!=i.root&&(i=this.end.getShiftedBy(-1)),t.isAfter(i)?(e.sourcePosition.isBefore(e.targetPosition)?(t=gl._createAt(i),t.offset=0):(e.deletionPosition.isEqual(t)||(i=e.deletionPosition),t=e.targetPosition),new wl(t,i)):new wl(t,i)}_getTransformedByInsertion(e,t,i=!1){if(i&&this.containsPosition(e))return[new wl(this.start,e),new wl(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const i=new wl(this.start,this.end);return i.start=i.start._getTransformedByInsertion(e,t),i.end=i.end._getTransformedByInsertion(e,t),[i]}}_getTransformedByMove(e,t,i,o=!1){if(this.isCollapsed){const o=this.start._getTransformedByMove(e,t,i);return[new wl(o)]}const n=wl._createFromPositionAndShift(e,i),r=t._getTransformedByDeletion(e,i);if(this.containsPosition(t)&&!o&&(n.containsPosition(this.start)||n.containsPosition(this.end))){const o=this.start._getTransformedByMove(e,t,i),n=this.end._getTransformedByMove(e,t,i);return[new wl(o,n)]}let s;const a=this.getDifference(n);let l=null;const c=this.getIntersection(n);if(1==a.length?l=new wl(a[0].start._getTransformedByDeletion(e,i),a[0].end._getTransformedByDeletion(e,i)):2==a.length&&(l=new wl(this.start,this.end._getTransformedByDeletion(e,i))),s=l?l._getTransformedByInsertion(r,i,null!==c||o):[],c){const e=new wl(c.start._getCombined(n.start,r),c.end._getCombined(n.start,r));2==s.length?s.splice(1,0,e):s.push(e)}return s}_getTransformedByDeletion(e,t){let i=this.start._getTransformedByDeletion(e,t),o=this.end._getTransformedByDeletion(e,t);return null==i&&null==o?null:(null==i&&(i=e),null==o&&(o=e),new wl(i,o))}static _createFromPositionAndShift(e,t){const i=e,o=e.getShiftedBy(t);return t>0?new this(i,o):new this(o,i)}static _createIn(e){return new this(gl._createAt(e,0),gl._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(gl._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new A("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 i=e.indexOf(t),o=new this(t.start,t.end);for(let t=i-1;t>=0&&e[t].end.isEqual(o.start);t--)o.start=gl._createAt(e[t].start);for(let t=i+1;t<e.length&&e[t].start.isEqual(o.end);t++)o.end=gl._createAt(e[t].end);return o}static fromJSON(e,t){return new this(gl.fromJSON(e.start,t),gl.fromJSON(e.end,t))}}wl.prototype.is=function(e){return"range"===e||"model:range"===e};class vl extends(V()){constructor(){super(),this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._deferredBindingRemovals=new Map,this._unboundMarkerNames=new Set,this._cache=new yl,this.on("modelToViewPosition",((e,t)=>{if(t.viewPosition)return;const i=this._modelToViewMapping.get(t.modelPosition.parent);if(!i)throw new A("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((e,t)=>{if(t.modelPosition)return;const i=this.findMappedViewAncestor(t.viewPosition),o=this._viewToModelMapping.get(i),n=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=gl._createAt(o,n)}),{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const i=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._cache.stopTracking(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)&&this._cache.stopTracking(t)}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const o=this._elementToMarkerNames.get(e)||new Set;o.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);i&&(i.delete(e),0==i.size&&this._markerNameToElements.delete(t));const o=this._elementToMarkerNames.get(e);o&&(o.delete(t),0==o.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 wl(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new us(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 i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const i=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())i.add(t);else i.add(e);return i}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,i){if(i!=e)return this._toModelOffset(e.parent,e.index,i)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let o=0;for(let i=0;i<t;i++)o+=this.getModelLength(e.getChild(i));return o}getModelLength(e){const t=[e];let i=0;for(;t.length>0;){const e=t.pop(),o=e.name&&this._viewToModelLengthCallbacks.size>0&&this._viewToModelLengthCallbacks.get(e.name);if(o)i+=o(e);else if(this._viewToModelMapping.has(e))i+=1;else if(e.is("$text"))i+=e.data.length;else{if(e.is("uiElement"))continue;for(const i of e.getChildren())t.push(i)}}return i}findPositionIn(e,t){if(0===t)return this._moveViewPositionToTextNode(new ds(e,0));if(0==this._viewToModelLengthCallbacks.size&&this._viewToModelMapping.has(e)){const i=this._cache.getClosest(e,t);return this._findPositionStartingFrom(i.viewPosition,i.modelOffset,t,e,!0)}return this._findPositionStartingFrom(new ds(e,0),0,t,e,!1)}_findPositionStartingFrom(e,t,i,o,n){let r,s=e.parent,a=e.offset;if(s.is("$text"))return new ds(s,i-t);let l=t,c=0;for(;l<i;)if(r=s.getChild(a),r)c=this.getModelLength(r),l+=c,a++,n&&this._cache.save(s,a,o,l);else{if(s==o)throw new A("mapping-model-offset-not-found",this,{modelOffset:i,viewContainer:o});a=s.parent.getChildIndex(s)+1,s=s.parent}return l==i?this._moveViewPositionToTextNode(new ds(s,a)):this._findPositionStartingFrom(new ds(r,0),l-c,i,o,n)}_moveViewPositionToTextNode(e){const t=e.nodeBefore,i=e.nodeAfter;return t&&t.is("view:$text")?new ds(t,t.data.length):i&&i.is("view:$text")?new ds(i,0):e}}class yl extends(V()){constructor(){super(...arguments),this._cachedMapping=new WeakMap,this._nodeToCacheListIndex=new WeakMap,this._invalidateOnChildrenChangeCallback=(e,t,i)=>{this._clearCacheInsideParent(t,i.index)},this._invalidateOnTextChangeCallback=(e,t)=>{this._clearCacheStartingBefore(t)}}save(e,t,i,o){const n=this._cachedMapping.get(i),r=n.cacheMap.get(o);if(r){const i=e.getChild(t-1),o=r.viewPosition.nodeBefore?this._nodeToCacheListIndex.get(r.viewPosition.nodeBefore):0;return void this._nodeToCacheListIndex.set(i,o)}const s={viewPosition:new ds(e,t),modelOffset:o};n.maxModelOffset=o>n.maxModelOffset?o:n.maxModelOffset,n.cacheMap.set(o,s);let a=n.cacheList.length-1;for(;a>=0&&n.cacheList[a].modelOffset>o;)a--;if(n.cacheList.splice(a+1,0,s),t>0){const i=e.getChild(t-1);this._nodeToCacheListIndex.set(i,a+1)}}getClosest(e,t){const i=this._cachedMapping.get(e);let o;if(i)if(t>i.maxModelOffset)o=i.cacheList[i.cacheList.length-1];else{o=i.cacheMap.get(t)||this._findInCacheList(i.cacheList,t)}else o=this.startTracking(e);const n=this._hoistViewPosition(o.viewPosition);return{modelOffset:o.modelOffset,viewPosition:n}}_hoistViewPosition(e){for(;e.parent.parent&&!this._cachedMapping.has(e.parent)&&e.isAtEnd;){const t=e.parent.parent,i=t.getChildIndex(e.parent)+1;e=new ds(t,i)}return e}startTracking(e){const t={viewPosition:new ds(e,0),modelOffset:0},i={maxModelOffset:0,cacheList:[t],cacheMap:new Map([[0,t]])};return this._cachedMapping.set(e,i),e.on("change:children",this._invalidateOnChildrenChangeCallback),e.on("change:text",this._invalidateOnTextChangeCallback),t}stopTracking(e){e.off("change:children",this._invalidateOnChildrenChangeCallback),e.off("change:text",this._invalidateOnTextChangeCallback),this._cachedMapping.delete(e)}_clearCacheInsideParent(e,t){if(0==t)this._cachedMapping.has(e)?this._clearCacheAll(e):this._clearCacheStartingBefore(e);else{const i=e.getChild(t-1);this._clearCacheStartingBefore(i)}}_clearCacheAll(e){const t=this._cachedMapping.get(e);t.maxModelOffset>0&&(t.maxModelOffset=0,t.cacheList.length=1,t.cacheMap.clear(),t.cacheMap.set(0,t.cacheList[0]))}_clearCacheStartingBefore(e){const t=this._nodeToCacheListIndex.get(e);if(void 0===t){const t=e.parent;return void(this._cachedMapping.has(t)||this._clearCacheStartingBefore(t))}let i=e.parent;for(;!this._cachedMapping.has(i);)i=i.parent;this._clearCacheFromIndex(i,t)}_clearCacheFromIndex(e,t){0===t&&(t=1);const i=this._cachedMapping.get(e),o=i.cacheList[t-1];if(!o)return;i.maxModelOffset=o.modelOffset;const n=i.cacheList.splice(t);for(const e of n){i.cacheMap.delete(e.modelOffset);const t=e.viewPosition.nodeBefore;this._nodeToCacheListIndex.delete(t)}}_findInCacheList(e,t){let i=0,o=e.length-1,n=o-i>>1,r=e[n];for(;i<o;)r.modelOffset<t?i=n+1:o=n-1,n=i+(o-i>>1),r=e[n];return r.modelOffset<=t?r:e[n-1]}}class xl{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(e,t){t=Al(t),e instanceof ul&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=Al(t),e instanceof ul&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=Al(t),e instanceof ul&&(e=this._getSymbolForTextProxy(e));const i=this._consumable.get(e);if(void 0===i)return null;const o=i.get(t);return void 0===o?null:o}revert(e,t){t=Al(t),e instanceof ul&&(e=this._getSymbolForTextProxy(e));const i=this.test(e,t);return!1===i?(this._consumable.get(e).set(t,!0),!0):!0!==i&&null}verifyAllConsumed(e){const t=[];for(const[i,o]of this._consumable)for(const[n,r]of o){const o=n.split(":")[0];r&&e==o&&t.push({event:n,item:i.name||i.description})}if(t.length)throw new A("conversion-model-consumable-not-consumed",null,{items:t})}_getSymbolForTextProxy(e){let t=null;const i=this._textProxyRegistry.get(e.startOffset);if(i){const o=i.get(e.endOffset);o&&(t=o.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e)),t}_addSymbolForTextProxy(e){const t=e.startOffset,i=e.endOffset,o=e.parent,n=Symbol("$textProxy:"+e.data);let r,s;return r=this._textProxyRegistry.get(t),r||(r=new Map,this._textProxyRegistry.set(t,r)),s=r.get(i),s||(s=new Map,r.set(i,s)),s.set(o,n),n}}function Al(e){const t=e.split(":");return"insert"==t[0]?t[0]:"addMarker"==t[0]||"removeMarker"==t[0]?e:t.length>1?t[0]+":"+t[1]:t[0]}class Cl extends(V()){constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,i){const o=this._createConversionApi(i,e.getRefreshedItems());for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,o);const n=this._reduceChanges(e.getChanges());for(const e of n)"insert"===e.type?this._convertInsert(wl._createFromPositionAndShift(e.position,e.length),o):"reinsert"===e.type?this._convertReinsert(wl._createFromPositionAndShift(e.position,e.length),o):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,o):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,o);o.mapper.flushDeferredBindings();for(const e of o.mapper.flushUnboundMarkerNames()){const i=t.get(e).getRange();this._convertMarkerRemove(e,i,o),this._convertMarkerAdd(e,i,o)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,o);o.consumable.verifyAllConsumed("insert")}convert(e,t,i,o={}){const n=this._createConversionApi(i,void 0,o);this._convertInsert(e,n);for(const[e,i]of t)this._convertMarkerAdd(e,i,n);n.consumable.verifyAllConsumed("insert")}convertSelection(e,t,i){const o=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},o);const n=e.getFirstPosition().root;if(!o.mapper.toViewElement(n))return;const r=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(o.consumable,e,r),this.fire("selection",{selection:e},o),e.isCollapsed){for(const t of r)if(o.consumable.test(e,"addMarker:"+t.name)){const i=t.getRange();if(!Tl(e.getFirstPosition(),t,o.mapper))continue;const n={item:e,markerName:t.name,markerRange:i};this.fire(`addMarker:${t.name}`,n,o)}for(const t of e.getAttributeKeys())if(o.consumable.test(e,"attribute:"+t)){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.fire(`attribute:${t}:$text`,i,o)}}}_convertInsert(e,t,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,e);for(const i of e.getWalker({shallow:!0}))this._testAndFire("insert",El(i),t)}_convertRemove(e,t,i,o){this.fire(`remove:${i}`,{position:e,length:t},o)}_convertAttribute(e,t,i,o,n){this._addConsumablesForRange(n.consumable,e,`attribute:${t}`);for(const r of e){const e={item:r.item,range:wl._createFromPositionAndShift(r.previousPosition,r.length),attributeKey:t,attributeOldValue:i,attributeNewValue:o};this._testAndFire(`attribute:${t}`,e,n)}}_convertReinsert(e,t){const i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,i);for(const e of i.map(El))this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,i){if("$graveyard"==t.root.rootName)return;const o=`addMarker:${e}`;if(i.consumable.add(t,o),this.fire(o,{markerName:e,markerRange:t},i),i.consumable.consume(t,o)){this._addConsumablesForRange(i.consumable,t,o);for(const n of t.getItems()){if(!i.consumable.test(n,o))continue;const r={item:n,range:wl._createOn(n),markerName:e,markerRange:t};this.fire(o,r,i)}}}_convertMarkerRemove(e,t,i){"$graveyard"!=t.root.rootName&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},i)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const i of t){const t=i.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}}return e}_addConsumablesForRange(e,t,i){for(const o of t.getItems())e.add(o,i);return e}_addConsumablesForSelection(e,t,i){e.add(t,"selection");for(const o of i)e.add(t,"addMarker:"+o.name);for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i);return e}_testAndFire(e,t,i){const o=function(e,t){return`${e}:${t.item.is("element")?t.item.name:"$text"}`}(e,t),n=t.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(t.item):t.item,r=this._firedEventsMap.get(i),s=r.get(n);if(s){if(s.has(o))return;s.add(o)}else r.set(n,new Set([o]));this.fire(o,t,i)}_testAndFireAddAttributes(e,t){const i={item:e,range:wl._createOn(e)};for(const e of i.item.getAttributeKeys())i.attributeKey=e,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(e),this._testAndFire(`attribute:${e}`,i,t)}_createConversionApi(e,t=new Set,i={}){const o={...this._conversionApi,consumable:new xl,writer:e,options:i,convertItem:e=>this._convertInsert(wl._createOn(e),o),convertChildren:e=>this._convertInsert(wl._createIn(e),o,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,o),canReuseView:e=>!t.has(o.mapper.toModelElement(e))};return this._firedEventsMap.set(o,new Map),o}}function Tl(e,t,i){const o=t.getRange(),n=Array.from(e.getAncestors());return n.shift(),n.reverse(),!n.some((e=>{if(o.containsItem(e))return!!i.toViewElement(e).getCustomProperty("addHighlight")}))}function El(e){return{item:e.item,range:wl._createFromPositionAndShift(e.previousPosition,e.length)}}class Sl extends dl{constructor(e){super(),this.parent=null,this._index=null,this._startOffset=null,this._attrs=sn(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return null===this.startOffset?null:this.startOffset+this.offsetSize}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 null!==this.parent&&this.root.isAttached()}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),o=te(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]<i[o]}}isAfter(e){return this!=e&&this.root===e.root&&!this.isBefore(e)}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce(((e,t)=>(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=sn(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}Sl.prototype.is=function(e){return"node"===e||"model:node"===e};class Pl extends(V(dl)){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 i=!1;for(const o of e._ranges)if(t.isEqual(o)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new wl(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 wl(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 wl(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,i,o]=e;if("object"==typeof i&&(o=i,i=void 0),null===t)this._setRanges([]);else if(t instanceof Pl)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof wl)this._setRanges([t],!!o&&!!o.backward);else if(t instanceof gl)this._setRanges([new wl(t)]);else if(t instanceof Sl){const e=!!o&&!!o.backward;let n;if("in"==i)n=wl._createIn(t);else if("on"==i)n=wl._createOn(t);else{if(void 0===i)throw new A("model-selection-setto-required-second-parameter",[this,t]);n=new wl(gl._createAt(t,i))}this._setRanges([n],e)}else{if(!ie(t))throw new A("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,o&&!!o.backward)}}_setRanges(e,t=!1){const i=Array.from(e),o=i.some((t=>{if(!(t instanceof wl))throw new A("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every((e=>!e.isEqual(t)))}));(i.length!==this._ranges.length||o)&&(this._replaceAllRanges(i),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(null===this.anchor)throw new A("model-selection-setfocus-no-ranges",[this,e]);const i=gl._createAt(e,t);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(o)?(this._pushRange(new wl(i,o)),this._lastRangeBackward=!0):(this._pushRange(new wl(o,i)),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 i=Ol(t.start,e);Nl(i,t)&&(yield i);const o=t.getWalker();for(const i of o){const n=i.item;"elementEnd"==i.type&&Ml(n,e,t)?yield n:"elementStart"==i.type&&n.is("model:element")&&n.root.document.model.schema.isBlock(n)&&o.jumpTo(gl._createAt(n,"end"))}const n=Ol(t.end,e);Rl(n,t)&&(yield n)}}containsEntireContent(e=this.anchor.root){const t=gl._createAt(e,0),i=gl._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new wl(e.start,e.end))}_checkRange(e){for(let t=0;t<this._ranges.length;t++)if(e.isIntersecting(this._ranges[t]))throw new A("model-selection-range-intersects",[this,e],{addedRange:e,intersectingRange:this._ranges[t]})}_replaceAllRanges(e){this._removeAllRanges();for(const t of e)this._pushRange(t)}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function Il(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function Ml(e,t,i){return Il(e,t)&&Vl(e,i)}function Ol(e,t){const i=e.parent.root.document.model.schema,o=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let n=!1;const r=o.find((e=>!n&&(n=i.isLimit(e),!n&&Il(e,t))));return o.forEach((e=>t.add(e))),r}function Vl(e,t){const i=function(e){const t=e.root.document.model.schema;let i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}(e);return!i||!t.containsRange(wl._createOn(i),!0)}function Nl(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.start.isTouching(gl._createAt(e,e.maxOffset))&&Vl(e,t))}function Rl(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.end.isTouching(gl._createAt(e,0))&&Vl(e,t))}Pl.prototype.is=function(e){return"selection"===e||"model:selection"===e};class Bl extends(V(wl)){constructor(e,t){super(e,t),Dl.call(this)}detach(){this.stopListening()}toRange(){return new wl(this.start,this.end)}static fromRange(e){return new Bl(e.start,e.end)}}function Dl(){this.listenTo(this.root.document.model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&Ll.call(this,i)}),{priority:"low"})}function Ll(e){const t=this.getTransformedByOperation(e),i=wl._createFromRanges(t),o=!i.isEqual(this),n=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 r=null;if(o){"$graveyard"==i.root.rootName&&(r="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",t,{deletionPosition:r})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:r})}Bl.prototype.is=function(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e};class zl extends Sl{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 zl(this.data,this.getAttributes())}static fromJSON(e){return new zl(e.data,e.attributes)}}zl.prototype.is=function(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e};const Fl="selection:";class jl extends(V(dl)){constructor(e){super(),this._selection=new Ul(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 Fl+e}static _isStoreAttributeKey(e){return e.startsWith(Fl)}}jl.prototype.is=function(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e};class Ul extends Pl{constructor(e){super(),this.markers=new Jo({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 i=t[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.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,i,o)=>{this._updateMarker(t,o)})),this.listenTo(this._document,"change",((e,t)=>{!function(e,t){const i=e.document.differ;for(const o of i.getChanges()){if("insert"!=o.type)continue;const i=o.position.parent;o.length===i.maxOffset&&e.enqueueChange(t,(e=>{const t=Array.from(i.getAttributeKeys()).filter((e=>e.startsWith(Fl)));for(const o of t)e.removeAttribute(o,i)}))}}(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<this._ranges.length;e++)this._ranges[e].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(...e){super.setTo(...e),this._updateAttributes(!0),this.updateMarkers()}setFocus(e,t){super.setFocus(e,t),this._updateAttributes(!0),this.updateMarkers()}setAttribute(e,t){if(this._setAttribute(e,t)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}removeAttribute(e){if(this._removeAttribute(e)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}overrideGravity(){const e=v();return this._overriddenGravityRegister.add(e),1===this._overriddenGravityRegister.size&&this._updateAttributes(!0),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new A("document-selection-gravity-wrong-restore",this,{uid:e});this._overriddenGravityRegister.delete(e),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(e){this._observedMarkers.add(e),this.updateMarkers()}_replaceAllRanges(e){this._validateSelectionRanges(e),super._replaceAllRanges(e)}_popRange(){this._ranges.pop().detach()}_pushRange(e){const t=this._prepareRange(e);t&&this._ranges.push(t)}_validateSelectionRanges(e){for(const t of e)if(!this._document._validateSelectionRange(t))throw new A("document-selection-wrong-position",this,{range:t})}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const t=Bl.fromRange(e);return t.on("change:range",((e,i,o)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=o.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 i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const o=t.getRange();for(const i of this.getRanges())o.containsRange(i,!i.isCollapsed)&&e.push(t)}const i=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,t){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let o=!1;const n=Array.from(this.markers),r=this.markers.has(e);if(t){let i=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){i=!0;break}i&&!r?(this.markers.add(e),o=!0):!i&&r&&(this.markers.remove(e),o=!0)}else r&&(this.markers.remove(e),o=!0);o&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(e){const t=sn(this._getSurroundingAttributes()),i=sn(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 o=[];for(const[e,t]of this.getAttributes())i.has(e)&&i.get(e)===t||o.push(e);for(const[e]of i)this.hasAttribute(e)||o.push(e);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(e,t,i=!0){const o=i?"normal":"low";return("low"!=o||"normal"!=this._attributePriority.get(e))&&(super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,o),!0))}_removeAttribute(e,t=!0){const i=t?"normal":"low";return!("low"==i&&"normal"==this._attributePriority.get(e)||(this._attributePriority.set(e,i),!super.hasAttribute(e)||(this._attrs.delete(e),0)))}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes())e.get(t)!==i&&this._removeAttribute(t,!1);for(const[i,o]of e)this._setAttribute(i,o,!1)&&t.add(i);return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(Fl)){const i=t.substr(10);yield[i,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;if("$graveyard"==e.root.rootName)return null;let i=null;if(this.isCollapsed){const o=e.textNode?e.textNode:e.nodeBefore,n=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(i=Hl(o,t)),i||(i=Hl(n,t)),!this.isGravityOverridden&&!i){let e=o;for(;e&&!i;)e=e.previousSibling,i=Hl(e,t)}if(!i){let e=n;for(;e&&!i;)e=e.nextSibling,i=Hl(e,t)}i||(i=this.getStoredAttributes())}else{const e=this.getFirstRange();for(const o of e){if(o.item.is("element")&&t.isObject(o.item)){i=Hl(o.item,t);break}if("text"==o.type){i=o.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Hl(e,t){if(!e)return null;if(e instanceof ul||e instanceof zl)return e.getAttributes();if(!t.isInline(e))return null;if(!t.isObject(e))return[];const i=[];for(const[o,n]of e.getAttributes())t.checkAttribute("$text",o)&&!1!==t.getAttributeProperties(o).copyFromObject&&i.push([o,n]);return i}class Wl{constructor(e){this._nodes=[],this._offsetToNode=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._offsetToNode.length}getNode(e){return this._nodes[e]||null}getNodeAtOffset(e){return this._offsetToNode[e]||null}getNodeIndex(e){return e.index}getNodeStartOffset(e){return e.startOffset}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new A("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){if(e==this._offsetToNode.length)return this._nodes.length;const t=this._offsetToNode[e];if(!t)throw new A("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.getNodeIndex(t)}_insertNodes(e,t){const i=[];for(const e of t){if(!(e instanceof Sl))throw new A("model-nodelist-insertnodes-not-node",this);i.push(e)}let o=this.indexToOffset(e);an(this._nodes,i,e),an(this._offsetToNode,function(e){const t=[];let i=0;for(const o of e)for(let e=0;e<o.offsetSize;e++)t[i++]=o;return t}(i),o);for(let t=e;t<this._nodes.length;t++)this._nodes[t]._index=t,this._nodes[t]._startOffset=o,o+=this._nodes[t].offsetSize}_removeNodes(e,t=1){if(0==t)return[];let i=this.indexToOffset(e);const o=this._nodes.splice(e,t),n=o[o.length-1],r=n.startOffset+n.offsetSize-i;this._offsetToNode.splice(i,r);for(const e of o)e._index=null,e._startOffset=null;for(let t=e;t<this._nodes.length;t++)this._nodes[t]._index=t,this._nodes[t]._startOffset=i,i+=this._nodes[t].offsetSize;return o}_removeNodesArray(e){if(0==e.length)return;for(const t of e)t._index=null,t._startOffset=null;this._nodes=this._nodes.filter((e=>null!==e.index)),this._offsetToNode=this._offsetToNode.filter((e=>null!==e.index));let t=0;for(let e=0;e<this._nodes.length;e++)this._nodes[e]._index=e,this._nodes[e]._startOffset=t,t+=this._nodes[e].offsetSize}toJSON(){return this._nodes.map((e=>e.toJSON()))}}class $l extends Sl{constructor(e,t,i){super(t),this._children=new Wl,this.name=e,i&&this._insertChild(0,i)}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)}getChildAtOffset(e){return this._children.getNodeAtOffset(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 i of e)t=t.getChildAtOffset(i);return t}findAncestor(e,t={}){let i=t.includeSelf?this:this.parent;for(;i;){if(i.name===e)return i;i=i.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?function(e){const t=[];for(const i of e)t.push(i._clone(!0));return t}(this._children):void 0;return new $l(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new zl(e)];ie(e)||(e=[e]);const t=[];for(const i of e)"string"==typeof i?t.push(new zl(i)):i instanceof ul?t.push(new zl(i.data,i.getAttributes())):t.push(i);return t}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const t of e)t.parent=null}static fromJSON(e){let t;if(e.children){t=[];for(const i of e.children)i.name?t.push($l.fromJSON(i)):t.push(zl.fromJSON(i))}return new $l(e.name,e.attributes,t)}}$l.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 ql{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}class Zl extends ql{elementToElement(e){return this.add(function(e){const t=Yl(e.model),i=Ql(e.view,"container");return t.attributes.length&&(t.children=!0),o=>{o.on(`insert:${t.name}`,function(e,t=rc){return(i,o,n)=>{if(!t(o.item,n.consumable,{preflight:!0}))return;const r=e(o.item,n,o);if(!r)return;t(o.item,n.consumable);const s=n.mapper.toViewPosition(o.range.start);n.mapper.bindElements(o.item,r),n.writer.insert(s,r),n.convertAttributes(o.item),oc(r,o.item.getChildren(),n,{reconversion:o.reconversion})}}(i,ic(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&o.on("reduceChanges",tc(t),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){const t=Yl(e.model),i=Ql(e.view,"container");return t.children=!0,o=>{if(o._conversionApi.schema.checkChild(t.name,"$text"))throw new A("conversion-element-to-structure-disallowed-text",o,{elementName:t.name});var n,r;o.on(`insert:${t.name}`,(n=i,r=ic(t),(e,t,i)=>{if(!r(t.item,i.consumable,{preflight:!0}))return;const o=new Map;i.writer._registerSlotFactory(function(e,t,i){return(o,n)=>{const r=o.createContainerElement("$slot");let s=null;if("children"===n)s=Array.from(e.getChildren());else{if("function"!=typeof n)throw new A("conversion-slot-mode-unknown",i.dispatcher,{modeOrFilter:n});s=Array.from(e.getChildren()).filter((e=>n(e)))}return t.set(r,s),r}}(t.item,o,i));const s=n(t.item,i,t);if(i.writer._clearSlotFactory(),!s)return;!function(e,t,i){const o=Array.from(t.values()).flat(),n=new Set(o);if(n.size!=o.length)throw new A("conversion-slot-filter-overlap",i.dispatcher,{element:e});if(n.size!=e.childCount)throw new A("conversion-slot-filter-incomplete",i.dispatcher,{element:e})}(t.item,o,i),r(t.item,i.consumable);const a=i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(t.item,s),i.writer.insert(a,s),i.convertAttributes(t.item),function(e,t,i,o){i.mapper.on("modelToViewPosition",s,{priority:"highest"});let n=null,r=null;for([n,r]of t)oc(e,r,i,o),i.writer.move(i.writer.createRangeIn(n),i.writer.createPositionBefore(n)),i.writer.remove(n);function s(e,t){const i=t.modelPosition.nodeAfter,o=r.indexOf(i);o<0||(t.viewPosition=t.mapper.findPositionIn(n,o))}i.mapper.off("modelToViewPosition",s)}(s,o,i,{reconversion:t.reconversion})}),{priority:e.converterPriority||"normal"}),o.on("reduceChanges",tc(t),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){let t=(e=ll(e)).model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;if(t.name&&(i+=":"+t.name),t.values)for(const i of t.values)e.view[i]=Ql(e.view[i],"attribute");else e.view=Ql(e.view,"attribute");const o=Jl(e);return t=>{t.on(i,function(e){return(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;const n=e(i.attributeOldValue,o,i),r=e(i.attributeNewValue,o,i);if(!n&&!r)return;o.consumable.consume(i.item,t.name);const s=o.writer,a=s.document.selection;if(i.item instanceof Pl||i.item instanceof jl)s.wrap(a.getFirstRange(),r);else{let e=o.mapper.toViewRange(i.range);null!==i.attributeOldValue&&n&&(e=s.unwrap(e,n)),null!==i.attributeNewValue&&r&&s.wrap(e,r)}}}(o),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t=(e=ll(e)).model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;if(t.name&&(i+=":"+t.name),t.values)for(const i of t.values)e.view[i]=Xl(e.view[i]);else e.view=Xl(e.view);const o=Jl(e);return t=>{var n;t.on(i,(n=o,(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const o=n(t.attributeOldValue,i,t),r=n(t.attributeNewValue,i,t);if(!o&&!r)return;i.consumable.consume(t.item,e.name);const s=i.mapper.toViewElement(t.item),a=i.writer;if(!s)throw new A("conversion-attribute-to-attribute-on-text",i.dispatcher,t);if(null!==t.attributeOldValue&&o){let e=o.value;"style"==o.key&&(e="string"==typeof o.value?new Yr(a.document.stylesProcessor).setTo(o.value).getStylesEntries().map((([e])=>e)):Object.keys(o.value)),a.removeAttribute(o.key,e,s)}if(null!==t.attributeNewValue&&r){let e=r.value;"style"==r.key&&"string"==typeof r.value&&(e=Object.fromEntries(new Yr(a.document.stylesProcessor).setTo(r.value).getStylesEntries())),a.setAttribute(r.key,e,!1,s)}}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){const t=Ql(e.view,"ui");return i=>{var o;i.on(`addMarker:${e.model}`,(o=t,(e,t,i)=>{t.isOpening=!0;const n=o(t,i);t.isOpening=!1;const r=o(t,i);if(!n||!r)return;const s=t.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,e.name))return;for(const t of s)if(!i.consumable.consume(t.item,e.name))return;const a=i.mapper,l=i.writer;l.insert(a.toViewPosition(s.start),n),i.mapper.bindElementToMarker(n,t.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),i.mapper.bindElementToMarker(r,t.markerName)),e.stop()}),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,((e,t,i)=>{const o=i.mapper.markerNameToElements(t.markerName);if(o){for(const e of o)i.mapper.unbindElementFromMarkerName(e,t.markerName),i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var i;t.on(`addMarker:${e.model}`,(i=e.view,(e,t,o)=>{if(!t.item)return;if(!(t.item instanceof Pl||t.item instanceof jl||t.item.is("$textProxy")))return;const n=ec(i,t,o);if(!n)return;if(!o.consumable.consume(t.item,e.name))return;const r=o.writer,s=Gl(r,n),a=r.document.selection;if(t.item instanceof Pl||t.item instanceof jl)r.wrap(a.getFirstRange(),s);else{const e=o.mapper.toViewRange(t.range),i=r.wrap(e,s);for(const e of i.getItems())if(e.is("attributeElement")&&e.isSimilar(s)){o.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,function(e){return(t,i,o)=>{if(!i.item)return;if(!(i.item instanceof $l))return;const n=ec(e,i,o);if(!n)return;if(!o.consumable.test(i.item,t.name))return;const r=o.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){o.consumable.consume(i.item,t.name);for(const e of wl._createIn(i.item))o.consumable.consume(e.item,t.name);r.getCustomProperty("addHighlight")(r,n,o.writer),o.mapper.bindElementToMarker(r,i.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,function(e){return(t,i,o)=>{if(i.markerRange.isCollapsed)return;const n=ec(e,i,o);if(!n)return;const r=Gl(o.writer,n),s=o.mapper.markerNameToElements(i.markerName);if(s){for(const e of s)o.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("attributeElement")?o.writer.unwrap(o.writer.createRangeOn(e),r):e.getCustomProperty("removeHighlight")(e,n.id,o.writer);o.writer.clearClonedElementsGroup(i.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){const t=(e=ll(e)).model;let i=e.view;return i||(i=i=>({group:t,name:i.substr(e.model.length+1)})),o=>{var n;o.on(`addMarker:${t}`,(n=i,(e,t,i)=>{const o=n(t.markerName,i);if(!o)return;const r=t.markerRange;i.consumable.consume(r,e.name)&&(Kl(r,!1,i,t,o),Kl(r,!0,i,t,o),e.stop())}),{priority:e.converterPriority||"normal"}),o.on(`removeMarker:${t}`,function(e){return(t,i,o)=>{const n=e(i.markerName,o);if(!n)return;const r=o.mapper.markerNameToElements(i.markerName);if(r){for(const e of r)o.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("containerElement")?(s(`data-${n.group}-start-before`,e),s(`data-${n.group}-start-after`,e),s(`data-${n.group}-end-before`,e),s(`data-${n.group}-end-after`,e)):o.writer.clear(o.writer.createRangeOn(e),e);o.writer.clearClonedElementsGroup(i.markerName),t.stop()}function s(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(n.name),0==i.size?o.writer.removeAttribute(e,t):o.writer.setAttribute(e,Array.from(i).join(","),t)}}}}(i),{priority:e.converterPriority||"normal"})}}(e))}}function Gl(e,t){const i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),"number"==typeof t.priority&&(i._priority=t.priority),i._id=t.id,i}function Kl(e,t,i,o,n){const r=t?e.start:e.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let e,r;t&&s||!t&&!a?(e=s,r=!0):(e=a,r=!1);const l=i.mapper.toViewElement(e);if(l)return void function(e,t,i,o,n,r){const s=`data-${r.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(s)?e.getAttribute(s).split(","):[];a.unshift(r.name),o.writer.setAttribute(s,a.join(","),e),o.mapper.bindElementToMarker(e,n.markerName)}(l,t,r,i,o,n)}!function(e,t,i,o,n){const r=`${n.group}-${t?"start":"end"}`,s=n.name?{name:n.name}:null,a=i.writer.createUIElement(r,s);i.writer.insert(e,a),i.mapper.bindElementToMarker(a,o.markerName)}(i.mapper.toViewPosition(r),t,i,o,n)}function Yl(e){return"string"==typeof e&&(e={name:e}),{name:e.name,attributes:e.attributes?No(e.attributes):[],children:!!e.children}}function Ql(e,t){return"function"==typeof e?e:(i,o)=>function(e,t,i){let o;"string"==typeof e&&(e={name:e});const n=t.writer,r=Object.assign({},e.attributes);if("container"==i)o=n.createContainerElement(e.name,r);else if("attribute"==i){const t={priority:e.priority||As.DEFAULT_PRIORITY};o=n.createAttributeElement(e.name,r,t)}else o=n.createUIElement(e.name,r);if(e.styles){const t=Object.keys(e.styles);for(const i of t)n.setStyle(i,e.styles[i],o)}if(e.classes){const t=e.classes;if("string"==typeof t)n.addClass(t,o);else for(const e of t)n.addClass(e,o)}return o}(e,o,t)}function Jl(e){return e.model.values?(t,i,o)=>{const n=e.view[t];return n?n(t,i,o):null}:e.view}function Xl(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function ec(e,t,i){const o="function"==typeof e?e(t,i):e;return o?(o.priority||(o.priority=10),o.id||(o.id=t.markerName),o):null}function tc(e){const t=function(e){return(t,i)=>{if(!t.is("element",e.name))return!1;if("attribute"==i.type){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,i)=>{const o=[];i.reconvertedElements||(i.reconvertedElements=new Set);for(const e of i.changes){const n="attribute"==e.type?e.range.start.nodeAfter:e.position.parent;if(n&&t(n,e)){if(!i.reconvertedElements.has(n)){i.reconvertedElements.add(n);const e=gl._createBefore(n);let t=o.length;for(let i=o.length-1;i>=0;i--){const n=o[i],r=("attribute"==n.type?n.range.start:n.position).compareWith(e);if("before"==r||"remove"==n.type&&"same"==r)break;t=i}o.splice(t,0,{type:"remove",name:n.name,position:e,length:1},{type:"reinsert",name:n.name,position:e,length:1})}}else o.push(e)}i.changes=o}}function ic(e){return(t,i,o={})=>{const n=["insert"];for(const i of e.attributes)t.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((e=>i.test(t,e)))&&(o.preflight||n.forEach((e=>i.consume(t,e))),!0)}}function oc(e,t,i,o){for(const n of t)nc(e.root,n,i,o)||i.convertItem(n)}function nc(e,t,i,o){const{writer:n,mapper:r}=i;if(!o.reconversion)return!1;const s=r.toViewElement(t);return!(!s||s.root==e||!i.canReuseView(s)||(n.move(n.createRangeOn(s),r.toViewPosition(gl._createBefore(t))),0))}function rc(e,t,{preflight:i}={}){return i?t.test(e,"insert"):t.consume(e,"insert")}function sc(e){const{schema:t,document:i}=e.model;for(const o of i.getRoots())if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0;return!1}function ac(e,t,i){const o=i.createContext(e);return!!i.checkChild(o,"paragraph")&&!!i.checkChild(o.push("paragraph"),t)}function lc(e,t){const i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}class cc extends ql{elementToElement(e){return this.add(dc(e))}elementToAttribute(e){return this.add(function(e){mc(e=ll(e));const t=gc(e,!1),i=uc(e.view),o=i?`element:${i}`:"element";return i=>{i.on(o,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t=null;("string"==typeof(e=ll(e)).view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key,i=void 0===e.view.value?/[\s\S]*/:e.view.value;let o;if("class"==t||"style"==t){const e="class"==t?"classes":"styles";o={[e]:i}}else o={attributes:{[t]:i}};return e.view.name&&(o.name=e.view.name),e.view=o,t}(e)),mc(e,t);const i=gc(e,!0);return t=>{t.on("element",i,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){const t=function(e){return(t,i)=>{const o="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":o})}}(e.model);return dc({...e,model:t})}(e))}dataToMarker(e){return this.add(function(e){(e=ll(e)).model||(e.model=t=>t?e.view+":"+t:e.view);const t={view:e.view,model:e.model},i=hc(pc(t,"start")),o=hc(pc(t,"end"));return n=>{n.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),n.on(`element:${e.view}-end`,o,{priority:e.converterPriority||"normal"});const r=y.low,s=y.highest,a=y.get(e.converterPriority)/s;n.on("element",function(e){return(t,i,o)=>{const n=`data-${e.view}`;function r(t,n){for(const r of n){const n=e.model(r,o),s=o.writer.createElement("$marker",{"data-name":n});o.writer.insert(s,t),i.modelCursor.isEqual(t)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(t,1),i.modelRange=i.modelRange._getTransformedByInsertion(t,1)[0]}}(o.consumable.test(i.viewItem,{attributes:n+"-end-after"})||o.consumable.test(i.viewItem,{attributes:n+"-start-after"})||o.consumable.test(i.viewItem,{attributes:n+"-end-before"})||o.consumable.test(i.viewItem,{attributes:n+"-start-before"}))&&(i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor)),o.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(",")))}}(t),{priority:r+a})}}(e))}}function dc(e){const t=hc(e=ll(e)),i=uc(e.view),o=i?`element:${i}`:"element";return i=>{i.on(o,t,{priority:e.converterPriority||"normal"})}}function uc(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function hc(e){const t=new Wr(e.view);return(i,o,n)=>{const r=t.match(o.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!n.consumable.test(o.viewItem,s))return;const a=function(e,t,i){return e instanceof Function?e(t,i):i.writer.createElement(e)}(e.model,o.viewItem,n);a&&n.safeInsert(a,o.modelCursor)&&(n.consumable.consume(o.viewItem,s),n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o))}}function mc(e,t=null){const i=null===t||(e=>e.getAttribute(t)),o="object"!=typeof e.model?e.model:e.model.key,n="object"!=typeof e.model||void 0===e.model.value?i:e.model.value;e.model={key:o,value:n}}function gc(e,t){const i=new Wr(e.view);return(o,n,r)=>{if(!n.modelRange&&t)return;const s=i.match(n.viewItem);if(!s)return;if(function(e,t){const i="function"==typeof e?e(t):e;return!("object"==typeof i&&!uc(i))&&(!i.classes&&!i.attributes&&!i.styles)}(e.view,n.viewItem)?s.match.name=!0:delete s.match.name,!r.consumable.test(n.viewItem,s.match))return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(n.viewItem,r):e.model.value;if(null===l)return;n.modelRange||Object.assign(n,r.convertChildren(n.viewItem,n.modelCursor));const c=function(e,t,i,o){let n=!1;for(const r of Array.from(e.getItems({shallow:i})))o.schema.checkAttribute(r,t.key)&&(n=!0,r.hasAttribute(t.key)||o.writer.setAttribute(t.key,t.value,r));return n}(n.modelRange,{key:a,value:l},t,r);c&&(r.consumable.test(n.viewItem,{name:!0})&&(s.match.name=!0),r.consumable.consume(n.viewItem,s.match))}}function pc(e,t){return{view:`${e.view}-${t}`,model:(t,i)=>{const o=t.getAttribute("name"),n=e.model(o,i);return i.writer.createElement("$marker",{"data-name":n})}}}function fc(e,t){return e.isCollapsed?function(e,t){const i=e.start,o=t.getNearestSelectionRange(i);if(!o){const e=i.getAncestors().reverse().find((e=>t.isObject(e)));return e?wl._createOn(e):null}if(!o.isCollapsed)return o;const n=o.start;return i.isEqual(n)?null:new wl(n)}(e,t):function(e,t){const{start:i,end:o}=e,n=t.checkChild(i,"$text"),r=t.checkChild(o,"$text"),s=t.getLimitElement(i),a=t.getLimitElement(o);if(s===a){if(n&&r)return null;if(function(e,t,i){const o=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),n=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return o||n}(i,o,t)){const e=i.nodeAfter&&t.isSelectable(i.nodeAfter)?null:t.getNearestSelectionRange(i,"forward"),n=o.nodeBefore&&t.isSelectable(o.nodeBefore)?null:t.getNearestSelectionRange(o,"backward"),r=e?e.start:i,s=n?n.end:o;return new wl(r,s)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const e=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,n=l&&(!e||!kc(i.nodeAfter,t)),r=c&&(!e||!kc(o.nodeBefore,t));let d=i,u=o;return n&&(d=gl._createBefore(bc(s,t))),r&&(u=gl._createAfter(bc(a,t))),new wl(d,u)}return null}(e,t)}function bc(e,t){let i=e,o=i;for(;t.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function kc(e,t){return e&&t.isSelectable(e)}class _c extends(Z()){constructor(e,t){super(),this.model=e,this.view=new cl(t),this.mapper=new vl,this.downcastDispatcher=new Cl({mapper:this.mapper,schema:e.schema});const i=this.model.document,o=i.selection,n=this.model.markers;var r,a,l;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(i,"change",(()=>{this.view.change((e=>{this.downcastDispatcher.convertChanges(i.differ,n,e),this.downcastDispatcher.convertSelection(o,n,e)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(i,o)=>{const n=o.newSelection,r=[];for(const e of n.getRanges())r.push(t.toModelRange(e));const s=e.createSelection(r,{backward:n.isBackward});s.isEqual(e.document.selection)||e.change((e=>{e.setSelection(s)}))}}(this.model,this.mapper)),this.listenTo(this.view.document,"beforeinput",(r=this.mapper,a=this.model.schema,l=this.view,(e,t)=>{if(!l.document.isComposing||s.isAndroid)for(let e=0;e<t.targetRanges.length;e++){const i=t.targetRanges[e],o=r.toModelRange(i),n=fc(o,a);n&&!n.isEqual(o)&&(t.targetRanges[e]=r.toViewRange(n))}}),{priority:"high"}),this.downcastDispatcher.on("insert:$text",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewPosition(t.range.start),r=o.createText(t.item.data);o.insert(n,r)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((e,t,i)=>{const o=i.mapper.toViewPosition(t.position),n=t.position.getShiftedBy(t.length),r=i.mapper.toViewPosition(n,{isPhantom:!0}),s=i.writer.createRange(o,r),a=i.writer.remove(s.getTrimmed());for(const e of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(e,{defer:!0})}),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",((e,t,i)=>{const o=i.writer,n=o.document.selection;for(const e of n.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&i.writer.mergeAttributes(e.start);o.setSelection(null)})),this.downcastDispatcher.on("selection",((e,t,i)=>{const o=t.selection;if(o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=[];for(const e of o.getRanges())n.push(i.mapper.toViewRange(e));i.writer.setSelection(n,{backward:o.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,i)=>{const o=t.selection;if(!o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=i.writer,r=o.getFirstPosition(),s=i.mapper.toViewPosition(r),a=n.breakAttributes(s);n.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((e=>{if("$graveyard"==e.rootName)return null;const t=new ls(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,i=this.model.markers.get(t);if(!i)throw new A("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change((()=>{this.model.markers._refresh(i)}))}reconvertItem(e){this.model.change((()=>{this.model.document.differ._refreshItem(e)}))}}class wc extends(Z()){constructor(){super(),this._sourceDefinitions={},this._attributeProperties=Object.create(null),this._customChildChecks=new Map,this._customAttributeChecks=new Map,this._genericCheckSymbol=Symbol("$generic"),this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((e,t)=>{t[0]=new vc(t[0])}),{priority:"highest"}),this.on("checkChild",((e,t)=>{t[0]=new vc(t[0]),t[1]=this.getDefinition(t[1])}),{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new A("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 A("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(e,t)}checkAttribute(e,t){const i=this.getDefinition(e.last);if(!i)return!1;const o=this._evaluateAttributeChecks(e,t);return void 0!==o?o:i.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof gl){const t=e.nodeBefore,i=e.nodeAfter;if(!(t instanceof $l))throw new A("schema-check-merge-no-element-before",this);if(!(i instanceof $l))throw new A("schema-check-merge-no-element-after",this);return this.checkMerge(t,i)}if(this.isLimit(e)||this.isLimit(t))return!1;for(const i of t.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,o=this._customChildChecks.get(i)||[];o.push(e),this._customChildChecks.set(i,o)}addAttributeCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,o=this._customAttributeChecks.get(i)||[];o.push(e),this._customAttributeChecks.set(i,o)}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let t;for(t=e instanceof gl?e.parent:(e instanceof wl?[e]:Array.from(e.getRanges())).reduce(((e,t)=>{const i=t.getCommonAncestor();return e?e.getCommonAncestor(i,{includeSelf:!0}):i}),null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=[...e.getFirstPosition().getAncestors(),new zl("",e.getAttributes())];return this.checkAttribute(i,t)}{const i=e.getRanges();for(const e of i)for(const i of e)if(this.checkAttribute(i.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const i of e)yield*this._getValidRangesForRange(i,t)}getNearestSelectionRange(e,t="both"){if("$graveyard"==e.root.rootName)return null;if(this.checkChild(e,"$text"))return new wl(e);let i,o;const n=e.getAncestors().reverse().find((e=>this.isLimit(e)))||e.root;"both"!=t&&"backward"!=t||(i=new hl({boundaries:wl._createIn(n),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(o=new hl({boundaries:wl._createIn(n),startPosition:e}));for(const e of function*(e,t){let i=!1;for(;!i;){if(i=!0,e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}}}(i,o)){const t=e.walker==i?"elementEnd":"elementStart",o=e.value;if(o.type==t&&this.isObject(o.item))return wl._createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new wl(o.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,t,i){const o=i.model;for(const[n,r]of Object.entries(t))o.schema.checkAttribute(e,n)&&i.setAttribute(n,r,e)}removeDisallowedAttributes(e,t){for(const i of e)if(i.is("$text"))Nc(this,i,t);else{const e=wl._createIn(i).getPositions();for(const i of e)Nc(this,i.nodeBefore||i.parent,t)}}getAttributesWithProperty(e,t,i){const o={};for(const[n,r]of e.getAttributes()){const e=this.getAttributeProperties(n);void 0!==e[t]&&(void 0!==i&&i!==e[t]||(o[n]=r))}return o}createContext(e){return new vc(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,i=Object.keys(t);for(const o of i)e[o]=yc(t[o],o);const o=Object.values(e);for(const t of o)xc(e,t),Ac(e,t),Cc(e,t),Tc(e,t);for(const e of o)Ec(0,e);for(const t of o)Sc(e,t);for(const t of o)Pc(e,t);for(const t of o)Ic(e,t);for(const t of o)Mc(e,t);this._compiledDefinitions=function(e){const t={};for(const i of Object.values(e))t[i.name]={name:i.name,isBlock:!!i.isBlock,isContent:!!i.isContent,isInline:!!i.isInline,isLimit:!!i.isLimit,isObject:!!i.isObject,isSelectable:!!i.isSelectable,allowIn:Array.from(i.allowIn).filter((t=>!!e[t])),allowChildren:Array.from(i.allowChildren).filter((t=>!!e[t])),allowAttributes:Array.from(i.allowAttributes)};return t}(e)}_checkContextMatch(e,t){const i=e.last;let o=this._evaluateChildChecks(e,t);if(o=void 0!==o?o:t.allowIn.includes(i.name),!o)return!1;const n=this.getDefinition(i),r=e.trimLast();return!!n&&(0==r.length||this._checkContextMatch(r,n))}_evaluateChildChecks(e,t){const i=this._customChildChecks.get(this._genericCheckSymbol)||[],o=this._customChildChecks.get(t.name)||[];for(const n of[...i,...o]){const i=n(e,t);if(void 0!==i)return i}}_evaluateAttributeChecks(e,t){const i=this._customAttributeChecks.get(this._genericCheckSymbol)||[],o=this._customAttributeChecks.get(t)||[];for(const n of[...i,...o]){const i=n(e,t);if(void 0!==i)return i}}*_getValidRangesForRange(e,t){let i=e.start,o=e.start;for(const n of e.getItems({shallow:!0}))n.is("element")&&(yield*this._getValidRangesForRange(wl._createIn(n),t)),this.checkAttribute(n,t)||(i.isEqual(o)||(yield new wl(i,o)),i=gl._createAfter(n)),o=gl._createAfter(n);i.isEqual(o)||(yield new wl(i,o))}findOptimalInsertionRange(e,t){const i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return"before"==t||"after"==t?new wl(gl._createAt(i,t)):wl._createOn(i);const o=Xo(e.getSelectedBlocks());if(!o)return new wl(e.focus);if(o.isEmpty)return new wl(gl._createAt(o,0));const n=gl._createAfter(o);return e.focus.isTouching(n)?new wl(n):new wl(gl._createBefore(o))}}class vc{constructor(e){if(e instanceof vc)return e;let t;t="string"==typeof e?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(Vc)}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 vc([e]);return t._items=[...this._items,...t._items],t}trimLast(){const e=new vc([]);return e._items=this._items.slice(0,-1),e}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 yc(e,t){const i={name:t,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return function(e,t){for(const i of e){const e=Object.keys(i).filter((e=>e.startsWith("is")));for(const o of e)t[o]=!!i[o]}}(e,i),Oc(e,i,"allowIn"),Oc(e,i,"allowChildren"),Oc(e,i,"disallowIn"),Oc(e,i,"disallowChildren"),Oc(e,i,"allowContentOf"),Oc(e,i,"allowWhere"),Oc(e,i,"allowAttributes"),Oc(e,i,"disallowAttributes"),Oc(e,i,"allowAttributesOf"),Oc(e,i,"inheritTypesFrom"),function(e,t){for(const i of e){const e=i.inheritAllFrom;e&&(t.allowContentOf.add(e),t.allowWhere.add(e),t.allowAttributesOf.add(e),t.inheritTypesFrom.add(e))}}(e,i),i}function xc(e,t){for(const i of t.allowIn){const o=e[i];o?o.allowChildren.add(t.name):t.allowIn.delete(i)}}function Ac(e,t){for(const i of t.allowChildren){const o=e[i];o?o.allowIn.add(t.name):t.allowChildren.delete(i)}}function Cc(e,t){for(const i of t.disallowIn){const o=e[i];o?o.disallowChildren.add(t.name):t.disallowIn.delete(i)}}function Tc(e,t){for(const i of t.disallowChildren){const o=e[i];o?o.disallowIn.add(t.name):t.disallowChildren.delete(i)}}function Ec(e,t){for(const e of t.disallowChildren)t.allowChildren.delete(e);for(const e of t.disallowIn)t.allowIn.delete(e);for(const e of t.disallowAttributes)t.allowAttributes.delete(e)}function Sc(e,t){for(const i of t.allowContentOf){const o=e[i];o&&(o.disallowChildren.forEach((i=>{t.allowChildren.has(i)||(t.disallowChildren.add(i),e[i].disallowIn.add(t.name))})),o.allowChildren.forEach((i=>{t.disallowChildren.has(i)||(t.allowChildren.add(i),e[i].allowIn.add(t.name))})))}}function Pc(e,t){for(const i of t.allowWhere){const o=e[i];o&&(o.disallowIn.forEach((i=>{t.allowIn.has(i)||(t.disallowIn.add(i),e[i].disallowChildren.add(t.name))})),o.allowIn.forEach((i=>{t.disallowIn.has(i)||(t.allowIn.add(i),e[i].allowChildren.add(t.name))})))}}function Ic(e,t){for(const i of t.allowAttributesOf){const o=e[i];if(!o)return;o.allowAttributes.forEach((e=>{t.disallowAttributes.has(e)||t.allowAttributes.add(e)}))}}function Mc(e,t){for(const i of t.inheritTypesFrom){const o=e[i];if(o){const e=Object.keys(o).filter((e=>e.startsWith("is")));for(const i of e)i in t||(t[i]=o[i])}}}function Oc(e,t,i){for(const o of e){let e=o[i];"string"==typeof e&&(e=[e]),Array.isArray(e)&&e.forEach((e=>t[i].add(e)))}}function Vc(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 Nc(e,t,i){for(const o of t.getAttributeKeys())e.checkAttribute(t,o)||i.removeAttribute(o,t)}class Rc extends(V()){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,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let i;for(const o of new vc(e)){const e={};for(const t of o.getAttributeKeys())e[t]=o.getAttribute(t);const n=t.createElement(o.name,e);i&&t.insert(n,i),i=gl._createAt(n,0)}return i}(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=Fr.createFrom(e),this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor),n=t.createDocumentFragment();if(o){this._removeEmptyElements();const e=this._modelCursor.parent,i=e._removeChildren(0,e.childCount);n._insertChild(0,i),n.markers=function(e,t){const i=new Set,o=new Map,n=wl._createIn(e).getItems();for(const e of n)e.is("element","$marker")&&i.add(e);for(const e of i){const i=e.getAttribute("data-name"),n=t.createPositionBefore(e);o.has(i)?o.get(i).end=n.clone():o.set(i,new wl(n.clone())),t.remove(e)}return o}(n,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(e,t){const i={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof wl))throw new A("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:gl._createAt(t,0);const o=new wl(i);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,i);e.modelRange instanceof wl&&(o.end=e.modelRange.end,i=e.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(e,t){const i=this._splitToAllowedParent(e,t);return!!i&&(this.conversionApi.writer.insert(e,i.position),!0)}_updateConversionResult(e,t){const i=this._getSplitParts(e),o=this.conversionApi.writer;t.modelRange||(t.modelRange=o.createRange(o.createPositionBefore(e),o.createPositionAfter(i[i.length-1])));const n=this._cursorParents.get(e);t.modelCursor=n?o.createPositionAt(n,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:i,writer:o}=this.conversionApi;let n=i.findAllowedParent(t,e);if(n){if(n===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return ac(t,e,i)?{position:lc(t,o)}:null;const r=this.conversionApi.writer.split(t,n),s=[];for(const e of r.range.getWalker())if("elementEnd"==e.type)s.push(e.item);else{const t=s.pop(),i=e.item;this._registerSplitPair(t,i)}const a=r.range.end.parent;return this._cursorParents.set(e,a),{position:r.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const i=this._splitParts.get(e);this._splitParts.set(t,i),i.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(){const e=new Map;for(const t of this._splitParts.keys())if(t.isEmpty&&!this._emptyElementsToKeep.has(t)){const i=e.get(t.parent)||[];i.push(t),this._splitParts.delete(t),e.set(t.parent,i)}for(const[t,i]of e)t._removeChildrenArray(i);e.size&&this._removeEmptyElements()}}class Bc{getHtml(e){const i=t.document.implementation.createHTMLDocument("").createElement("div");return i.appendChild(e),i.innerHTML}}class Dc{constructor(e){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new ca(e,{renderingMode:"data"}),this.htmlWriter=new Bc}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){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4))||(e=`<body>${e}</body>`);const t=this.domParser.parseFromString(e,"text/html"),i=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}}class Lc extends(V()){constructor(e,t){super(),this.model=e,this.mapper=new vl,this.downcastDispatcher=new Cl({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewPosition(t.range.start),r=o.createText(t.item.data);o.insert(n,r)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.upcastDispatcher=new Rc({schema:e.schema}),this.viewDocument=new ys(t),this.stylesProcessor=t,this.htmlProcessor=new Dc(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Ns(this.viewDocument),this.upcastDispatcher.on("text",((e,t,{schema:i,consumable:o,writer:n})=>{let r=t.modelCursor;if(!o.test(t.viewItem))return;if(!i.checkChild(r,"$text")){if(!ac(r,"$text",i))return;if(0==t.viewItem.data.trim().length)return;r=lc(r,n)}o.consume(t.viewItem);const s=n.createText(t.viewItem.data);n.insert(s,r),t.modelRange=n.createRange(r,r.getShiftedBy(s.offsetSize)),t.modelCursor=t.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}),{priority:"lowest"}),Z().prototype.decorate.call(this,"init"),Z().prototype.decorate.call(this,"set"),Z().prototype.decorate.call(this,"get"),Z().prototype.decorate.call(this,"toView"),Z().prototype.decorate.call(this,"toModel"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange({isUndoable:!1},sc)}),{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new A("datacontroller-get-non-existent-root",this);const o=this.model.document.getRoot(t);return o.isAttached()||C("datacontroller-get-detached-root",this),"empty"!==i||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o,e):""}stringify(e,t={}){const i=this.toView(e,t);return this.processor.toData(i)}toView(e,t={}){const i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();const n=wl._createIn(e),r=new Vs(i);this.mapper.bindElements(e,r);const s=e.is("documentFragment")?e.markers:function(e){const t=[],i=e.root.document;if(!i)return new Map;const o=wl._createIn(e);for(const e of i.model.markers){const i=e.getRange(),n=i.isCollapsed,r=i.start.isEqual(o.start)||i.end.isEqual(o.end);if(n&&r)t.push([e.name,i]);else{const n=o.getIntersection(i);n&&t.push([e.name,n])}}return t.sort((([e,t],[i,o])=>{if("after"!==t.end.compareWith(o.start))return 1;if("before"!==t.start.compareWith(o.end))return-1;switch(t.start.compareWith(o.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(o.end)){case"before":return 1;case"after":return-1;default:return i.localeCompare(e)}}})),new Map(t)}(e);return this.downcastDispatcher.convert(n,s,o,t),r}init(e){if(this.model.document.version)throw new A("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new A("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},(e=>{for(const i of Object.keys(t)){const o=this.model.document.getRoot(i);e.insert(this.parse(t[i],o),o,0)}})),Promise.resolve()}set(e,t={}){let i={};if("string"==typeof e?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new A("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(i)){const o=this.model.document.getRoot(t);e.remove(e.createRangeIn(o)),e.insert(this.parse(i[t],o),o,0)}}))}parse(e,t="$root"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change((i=>this.upcastDispatcher.convert(e,i,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.getRoot(t))return!1;return!0}}class zc{constructor(e,t){this._helpers=new Map,this._downcast=No(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=No(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new A("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new A("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:i}of Fc(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:i}of Fc(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:i}of Fc(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new A("conversion-group-exists",this);const o=i?new Zl(t):new cc(t);this._helpers.set(e,o)}}function*Fc(e){if(e.model.values)for(const t of e.model.values){const i={key:e.model.key,value:t},o=e.view[t],n=e.upcastAlso?e.upcastAlso[t]:void 0;yield*jc(i,o,n)}else yield*jc(e.model,e.view,e.upcastAlso)}function*jc(e,t,i){if(yield{model:e,view:t},i)for(const t of No(i))yield{model:e,view:t}}class Uc{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 Hc(e,t){const i=qc(t),o=i.reduce(((e,t)=>e+t.offsetSize),0),n=e.parent;Gc(e);const r=e.index;return n._insertChild(r,i),Zc(n,r+i.length),Zc(n,r),new wl(e,e.getShiftedBy(o))}function Wc(e){if(!e.isFlat)throw new A("operation-utils-remove-range-not-flat",this);const t=e.start.parent;Gc(e.start),Gc(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);return Zc(t,e.start.index),i}function $c(e,t){if(!e.isFlat)throw new A("operation-utils-move-range-not-flat",this);const i=Wc(e);return Hc(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),i)}function qc(e){const t=[];!function e(i){if("string"==typeof i)t.push(new zl(i));else if(i instanceof ul)t.push(new zl(i.data,i.getAttributes()));else if(i instanceof Sl)t.push(i);else if(ie(i))for(const t of i)e(t)}(e);for(let e=1;e<t.length;e++){const i=t[e],o=t[e-1];i instanceof zl&&o instanceof zl&&Kc(i,o)&&(t.splice(e-1,2,new zl(o.data+i.data,o.getAttributes())),e--)}return t}function Zc(e,t){const i=e.getChild(t-1),o=e.getChild(t);if(i&&o&&i.is("$text")&&o.is("$text")&&Kc(i,o)){const n=new zl(i.data+o.data,i.getAttributes());e._removeChildren(t-1,2),e._insertChild(t-1,n)}}function Gc(e){const t=e.textNode,i=e.parent;if(t){const o=e.offset-t.startOffset,n=t.index;i._removeChildren(n,1);const r=new zl(t.data.substr(0,o),t.getAttributes()),s=new zl(t.data.substr(o),t.getAttributes());i._insertChild(n,[r,s])}}function Kc(e,t){const i=e.getAttributes(),o=t.getAttributes();for(const e of i){if(e[1]!==t.getAttribute(e[0]))return!1;o.next()}return o.next().done}class Yc extends Uc{constructor(e,t,i,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=t,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}get affectedSelectable(){return[wl._createFromPositionAndShift(this.sourcePosition,this.howMany),wl._createFromPositionAndShift(this.targetPosition,0)]}clone(){return new Yc(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new Yc(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent,i=this.sourcePosition.offset,o=this.targetPosition.offset;if(i+this.howMany>e.maxOffset)throw new A("move-operation-nodes-do-not-exist",this);if(e===t&&i<o&&o<i+this.howMany)throw new A("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==te(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const e=this.sourcePosition.path.length-1;if(this.targetPosition.path[e]>=i&&this.targetPosition.path[e]<i+this.howMany)throw new A("move-operation-node-into-itself",this)}}_execute(){$c(wl._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e.targetPosition=this.targetPosition.toJSON(),e}static get className(){return"MoveOperation"}static fromJSON(e,t){const i=gl.fromJSON(e.sourcePosition,t),o=gl.fromJSON(e.targetPosition,t);return new this(i,e.howMany,o,e.baseVersion)}}class Qc extends Uc{constructor(e,t,i){super(i),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new Wl(qc(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}get affectedSelectable(){return this.position.clone()}clone(){const e=new Wl([...this.nodes].map((e=>e._clone(!0)))),t=new Qc(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new gl(e,[0]);return new Yc(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new A("insert-operation-position-invalid",this)}_execute(){const e=this.nodes;this.nodes=new Wl([...e].map((e=>e._clone(!0)))),Hc(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 i=[];for(const t of e.nodes)t.name?i.push($l.fromJSON(t)):i.push(zl.fromJSON(t));const o=new Qc(gl.fromJSON(e.position,t),i,e.baseVersion);return o.shouldReceiveAttributes=e.shouldReceiveAttributes,o}}class Jc extends Uc{constructor(e,t,i,o,n){super(n),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=i,this.graveyardPosition=o?o.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 gl(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new wl(this.splitPosition,e)}get affectedSelectable(){const e=[wl._createFromPositionAndShift(this.splitPosition,0),wl._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(wl._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new Jc(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new gl(e,[0]);return new Xc(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset<t)throw new A("split-operation-position-invalid",this);if(!e.parent)throw new A("split-operation-split-in-root",this);if(this.howMany!=e.maxOffset-this.splitPosition.offset)throw new A("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new A("split-operation-graveyard-position-invalid",this)}_execute(){const e=this.splitPosition.parent;if(this.graveyardPosition)$c(wl._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const t=e._clone();Hc(this.insertionPosition,t)}$c(new wl(gl._createAt(e,this.splitPosition.offset),gl._createAt(e,e.maxOffset)),this.moveTargetPosition)}toJSON(){const e=super.toJSON();return e.splitPosition=this.splitPosition.toJSON(),e.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(e.graveyardPosition=this.graveyardPosition.toJSON()),e}static get className(){return"SplitOperation"}static getInsertionPosition(e){const t=e.path.slice(0,-1);return t[t.length-1]++,new gl(e.root,t,"toPrevious")}static fromJSON(e,t){const i=gl.fromJSON(e.splitPosition,t),o=gl.fromJSON(e.insertionPosition,t),n=e.graveyardPosition?gl.fromJSON(e.graveyardPosition,t):null;return new this(i,e.howMany,o,n,e.baseVersion)}}class Xc extends Uc{constructor(e,t,i,o,n){super(n),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=o.clone()}get type(){return"merge"}get deletionPosition(){return new gl(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new wl(this.sourcePosition,e)}get affectedSelectable(){const e=this.sourcePosition.parent;return[wl._createOn(e),wl._createFromPositionAndShift(this.targetPosition,0),wl._createFromPositionAndShift(this.graveyardPosition,0)]}clone(){return new Xc(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),i=new gl(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new Jc(e,this.howMany,i,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new A("merge-operation-source-position-invalid",this);if(!t.parent)throw new A("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new A("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;$c(wl._createIn(e),this.targetPosition),$c(wl._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 i=gl.fromJSON(e.sourcePosition,t),o=gl.fromJSON(e.targetPosition,t),n=gl.fromJSON(e.graveyardPosition,t);return new this(i,e.howMany,o,n,e.baseVersion)}}class ed extends Uc{constructor(e,t,i,o,n,r){super(r),this.name=e,this.oldRange=t?t.clone():null,this.newRange=i?i.clone():null,this.affectsData=n,this._markers=o}get type(){return"marker"}get affectedSelectable(){const e=[];return this.oldRange&&e.push(this.oldRange.clone()),this.newRange&&(this.oldRange?e.push(...this.newRange.getDifference(this.oldRange)):e.push(this.newRange.clone())),e}clone(){return new ed(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new ed(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 ed(e.name,e.oldRange?wl.fromJSON(e.oldRange,t):null,e.newRange?wl.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}const td=function(e,t){return Qa(e,t)};class id extends Uc{constructor(e,t,i,o,n){super(n),this.range=e.clone(),this.key=t,this.oldValue=void 0===i?null:i,this.newValue=void 0===o?null:o}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}get affectedSelectable(){return this.range.clone()}clone(){return new id(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new id(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 A("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!td(e.getAttribute(this.key),this.oldValue))throw new A("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 A("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){td(this.oldValue,this.newValue)||function(e,t,i){Gc(e.start),Gc(e.end);for(const o of e.getItems({shallow:!0})){const e=o.is("$textProxy")?o.textNode:o;null!==i?e._setAttribute(t,i):e._removeAttribute(t),Zc(e.parent,e.index)}Zc(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new id(wl.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class od extends Uc{get type(){return"noop"}get affectedSelectable(){return null}clone(){return new od(this.baseVersion)}getReversed(){return new od(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}class nd extends Uc{constructor(e,t,i,o){super(o),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=i}get type(){return"rename"}get affectedSelectable(){return this.position.nodeAfter}clone(){return new nd(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new nd(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof $l))throw new A("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new A("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 nd(gl.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class rd extends Uc{constructor(e,t,i,o,n){super(n),this.root=e,this.key=t,this.oldValue=void 0===i?null:i,this.newValue=void 0===o?null:o}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}get affectedSelectable(){return this.root}clone(){return new rd(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new rd(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new A("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 A("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 A("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 A("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new rd(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class sd extends Uc{constructor(e,t,i,o,n){super(n),this.rootName=e,this.elementName=t,this.isAdd=i,this._document=o,this._document.getRoot(this.rootName)||(this._document.createRoot(this.elementName,this.rootName)._isAttached=!1)}get type(){return this.isAdd?"addRoot":"detachRoot"}get affectedSelectable(){return this._document.getRoot(this.rootName)}clone(){return new sd(this.rootName,this.elementName,this.isAdd,this._document,this.baseVersion)}getReversed(){return new sd(this.rootName,this.elementName,!this.isAdd,this._document,this.baseVersion+1)}_execute(){this._document.getRoot(this.rootName)._isAttached=this.isAdd}toJSON(){const e=super.toJSON();return delete e._document,e}static get className(){return"RootOperation"}static fromJSON(e,t){return new sd(e.rootName,e.elementName,e.isAdd,t,e.baseVersion)}}const ad={};ad[id.className]=id,ad[Qc.className]=Qc,ad[ed.className]=ed,ad[Yc.className]=Yc,ad[od.className]=od,ad[Uc.className]=Uc,ad[nd.className]=nd,ad[rd.className]=rd,ad[sd.className]=sd,ad[Jc.className]=Jc,ad[Xc.className]=Xc;class ld{static fromJSON(e,t){return ad[e.__className].fromJSON(e,t)}}const cd=new Map;function dd(e,t,i){let o=cd.get(e);o||(o=new Map,cd.set(e,o)),o.set(t,i)}function ud(e){return[e]}function hd(e,t,i={}){const o=function(e,t){const i=cd.get(e);return i&&i.has(t)?i.get(t):ud}(e.constructor,t.constructor);try{return o(e=e.clone(),t,i)}catch(e){throw e}}function md(e,t,i){e=e.slice(),t=t.slice();const o=new gd(i.document,i.useRelations,i.forceWeakRemove);o.setOriginalOperations(e),o.setOriginalOperations(t);const n=o.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:n};const r=new WeakMap;for(const t of e)r.set(t,0);const s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;for(;a<e.length;){const i=e[a],n=r.get(i);if(n==t.length){a++;continue}const s=t[n],l=hd(i,s,o.getContext(i,s,!0)),c=hd(s,i,o.getContext(s,i,!1));o.updateRelation(i,s),o.setOriginalOperations(l,i),o.setOriginalOperations(c,s);for(const e of l)r.set(e,n+c.length);e.splice(a,1,...l),t.splice(n,1,...c)}if(bd(e),bd(t),i.padWithNoOps){const i=e.length-s.originalOperationsACount,o=t.length-s.originalOperationsBCount;fd(e,o-i),fd(t,i-o)}return pd(e,s.nextBaseVersionB),pd(t,s.nextBaseVersionA),{operationsA:e,operationsB:t,originalOperations:n}}class gd{constructor(e,t,i=!1){this.originalOperations=new Map,this._history=e.history,this._useRelations=t,this._forceWeakRemove=!!i,this._relations=new Map}setOriginalOperations(e,t=null){const i=t?this.originalOperations.get(t):null;for(const t of e)this.originalOperations.set(t,i||t)}updateRelation(e,t){if(e instanceof Yc)t instanceof Xc?e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter"):t instanceof Yc&&(e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter"));else if(e instanceof Jc){if(t instanceof Xc)e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");else if(t instanceof Yc)if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const i=wl._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){const o=i.end.offset-e.splitPosition.offset,n=e.splitPosition.offset-i.start.offset;this._setRelation(e,t,{howMany:o,offset:n})}}}else if(e instanceof Xc)t instanceof Xc?(e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement")):t instanceof Jc?e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource"):t instanceof Yc&&t.howMany>0&&(e.sourcePosition.isEqual(t.sourcePosition.getShiftedBy(t.howMany))&&this._setRelation(e,t,"mergeSourceAffected"),e.targetPosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeTargetWasBefore"));else if(e instanceof ed){const i=e.newRange;if(!i)return;if(t instanceof Xc){const o=i.start.isEqual(t.targetPosition),n=i.start.isEqual(t.deletionPosition),r=i.end.isEqual(t.deletionPosition),s=i.end.isEqual(t.sourcePosition);(o||n||r||s)&&this._setRelation(e,t,{wasInLeftElement:o,wasStartBeforeMergedElement:n,wasEndBeforeMergedElement:r,wasInRightElement:s})}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const i=this.originalOperations.get(t),o=this._history.getUndoneOperation(i);if(!o)return null;const n=this.originalOperations.get(e),r=this._relations.get(n);return r&&r.get(o)||null}_setRelation(e,t,i){const o=this.originalOperations.get(e),n=this.originalOperations.get(t);let r=this._relations.get(o);r||(r=new Map,this._relations.set(o,r)),r.set(n,i)}}function pd(e,t){for(const i of e)i.baseVersion=t++}function fd(e,t){for(let i=0;i<t;i++)e.push(new od(0))}function bd(e){const t=new Map;for(let i=0;i<e.length;i++){const o=e[i];o instanceof ed&&(-1!==o.baseVersion?t.set(o.name,{op:o,ranges:o.newRange?[o.newRange]:[]}):(o.newRange&&t.get(o.name).ranges.push(o.newRange),e.splice(i,1),i--))}for(const{op:e,ranges:i}of t.values())i.length?e.newRange=wl._createFromRanges(i):e.newRange=null}function kd(e,t,i){const o=e.nodes.getNode(0).getAttribute(t);if(o==i)return null;const n=new wl(e.position,e.position.getShiftedBy(e.howMany));return new id(n,t,o,i,0)}function _d(e,t){return null===e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}function wd(e,t){const i=[];for(let o=0;o<e.length;o++){const n=e[o],r=new Yc(n.start,n.end.offset-n.start.offset,t,0);i.push(r);for(let t=o+1;t<e.length;t++)e[t]=e[t]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];t=t._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return i}dd(id,id,((e,t,i)=>{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const o=e.range.getDifference(t.range).map((t=>new id(t,e.key,e.oldValue,e.newValue,0))),n=e.range.getIntersection(t.range);return n&&i.aIsStrong&&o.push(new id(n,t.key,t.newValue,e.newValue,0)),0==o.length?[new od(0)]:o}return[e]})),dd(id,Qc,((e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map((t=>new id(t,e.key,e.oldValue,e.newValue,e.baseVersion)));if(t.shouldReceiveAttributes){const o=kd(t,e.key,e.oldValue);o&&i.unshift(o)}return i}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]})),dd(id,Xc,((e,t)=>{const i=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&i.push(wl._createFromPositionAndShift(t.graveyardPosition,1));const o=e.range._getTransformedByMergeOperation(t);return o.isCollapsed||i.push(o),i.map((t=>new id(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),dd(id,Yc,((e,t)=>{const i=function(e,t){const i=wl._createFromPositionAndShift(t.sourcePosition,t.howMany);let o=null,n=[];i.containsRange(e,!0)?o=e:e.start.hasSameParentAs(i.start)?(n=e.getDifference(i),o=e.getIntersection(i)):n=[e];const r=[];for(let e of n){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart(),o=e.start.hasSameParentAs(i),n=e._getTransformedByInsertion(i,t.howMany,o);r.push(...n)}return o&&r.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]),r}(e.range,t);return i.map((t=>new id(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),dd(id,Jc,((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 i=e.clone();return i.range=new wl(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]})),dd(Qc,id,((e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const o=kd(e,t.key,t.newValue);o&&i.push(o)}return i})),dd(Qc,Qc,((e,t,i)=>(e.position.isEqual(t.position)&&i.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e]))),dd(Qc,Yc,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),dd(Qc,Jc,((e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]))),dd(Qc,Xc,((e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]))),dd(ed,Qc,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]))),dd(ed,ed,((e,t,i)=>{if(e.name==t.name){if(!i.aIsStrong)return[new od(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]})),dd(ed,Xc,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]))),dd(ed,Yc,((e,t)=>{const i=[e];if(e.oldRange&&(e.oldRange=wl._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){const o=e.newRange._getTransformedByMoveOperation(t);e.newRange=o[0];for(let t=1;t<o.length;t++){const n=e.clone();n.oldRange=null,n.newRange=o[t],n.baseVersion=-1,i.push(n)}}return i})),dd(ed,Jc,((e,t,i)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){const o=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?e.newRange.start=gl._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!i.abRelation.wasInLeftElement?e.newRange.start=gl._createAt(t.moveTargetPosition):e.newRange.start=o.start,e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasInRightElement?e.newRange.end=gl._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=gl._createAt(t.insertionPosition):e.newRange.end=o.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]})),dd(Xc,Qc,((e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]))),dd(Xc,Xc,((e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(i.bWasUndone){const i=t.graveyardPosition.path.slice();return i.push(0),e.sourcePosition=new gl(t.graveyardPosition.root,i),e.howMany=0,[e]}return[new od(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const o="$graveyard"==e.targetPosition.root.rootName,n="$graveyard"==t.targetPosition.root.rootName;if(n&&!o||(!o||n)&&i.aIsStrong){const i=t.targetPosition._getTransformedByMergeOperation(t),o=e.targetPosition._getTransformedByMergeOperation(t);return[new Yc(i,e.howMany,o,0)]}return[new od(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)&&i.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),dd(Xc,Yc,((e,t,i)=>{const o=wl._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!i.bWasUndone&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)?[new od(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(e.sourcePosition)?e.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(e.sourcePosition)&&"mergeSourceAffected"==i.abRelation?e.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(e.targetPosition)?(e.targetPosition.stickiness="toNone",e.howMany-=t.howMany):t.targetPosition.isEqual(e.targetPosition)&&"mergeTargetWasBefore"==i.abRelation?(e.targetPosition.stickiness="toPrevious",e.howMany+=t.howMany):(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.sourcePosition.stickiness="toPrevious",e.targetPosition.stickiness="toNext",e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])})),dd(Xc,Jc,((e,t,i)=>{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)&&(t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition)||"mergeTargetNotMoved"==i.abRelation))return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e];if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==i.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]})),dd(Yc,Qc,((e,t)=>{const i=wl._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),dd(Yc,Yc,((e,t,i)=>{const o=wl._createFromPositionAndShift(e.sourcePosition,e.howMany),n=wl._createFromPositionAndShift(t.sourcePosition,t.howMany);let r,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),r=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),_d(e,t)&&_d(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),wd([o],r);if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),wd([o],r);const l=te(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),wd([o],r);"remove"!=e.type||"remove"==t.type||i.aWasUndone||i.forceWeakRemove?"remove"==e.type||"remove"!=t.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const c=[],d=o.getDifference(n);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i="same"==te(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),o=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);c.push(...o)}const u=o.getIntersection(n);return null!==u&&s&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(u):1==c.length?n.start.isBefore(o.start)||n.start.isEqual(o.start)?c.unshift(u):c.push(u):c.splice(1,0,u)),0===c.length?[new od(e.baseVersion)]:wd(c,r)})),dd(Yc,Jc,((e,t,i)=>{let o=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(o=e.targetPosition._getTransformedBySplitOperation(t));const n=wl._createFromPositionAndShift(e.sourcePosition,e.howMany);if(n.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=o,[e];if(n.start.hasSameParentAs(t.splitPosition)&&n.containsPosition(t.splitPosition)){let e=new wl(t.splitPosition,n.end);return e=e._getTransformedBySplitOperation(t),wd([new wl(n.start,t.splitPosition),e],o)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==i.abRelation&&(o=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==i.abRelation&&(o=e.targetPosition);const r=[n._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const o=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);e.howMany>1&&o&&!i.aWasUndone&&r.push(wl._createFromPositionAndShift(t.insertionPosition,1))}return wd(r,o)})),dd(Yc,Xc,((e,t,i)=>{const o=wl._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition))if("remove"!=e.type||i.forceWeakRemove){if(1==e.howMany)return i.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new od(0)]}else if(!i.aWasUndone){const i=[];let o=t.graveyardPosition.clone(),n=t.targetPosition._getTransformedByMergeOperation(t);const r=e.targetPosition.getTransformedByOperation(t);e.howMany>1&&(i.push(new Yc(e.sourcePosition,e.howMany-1,r,0)),o=o._getTransformedByMove(e.sourcePosition,r,e.howMany-1),n=n._getTransformedByMove(e.sourcePosition,r,e.howMany-1));const s=t.deletionPosition._getCombined(e.sourcePosition,r),a=new Yc(o,1,s,0),l=a.getMovedRangeStart().path.slice();l.push(0);const c=new gl(a.targetPosition.root,l);n=n._getTransformedByMove(o,s,1);const d=new Yc(n,t.howMany,c,0);return i.push(a),i.push(d),i}const n=wl._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),dd(nd,Qc,((e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]))),dd(nd,Xc,((e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]))),dd(nd,Yc,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),dd(nd,nd,((e,t,i)=>{if(e.position.isEqual(t.position)){if(!i.aIsStrong)return[new od(0)];e.oldName=t.newName}return[e]})),dd(nd,Jc,((e,t)=>{if("same"==te(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new nd(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),dd(rd,rd,((e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong||e.newValue===t.newValue)return[new od(0)];e.oldValue=t.newValue}return[e]})),dd(sd,sd,((e,t)=>e.rootName===t.rootName&&e.isAdd===t.isAdd?[new od(0)]:[e])),dd(Jc,Qc,((e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset<t.position.offset&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByInsertOperation(t),e.insertionPosition=e.insertionPosition._getTransformedByInsertOperation(t),[e]))),dd(Jc,Xc,((e,t,i)=>{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const o=new gl(t.graveyardPosition.root,i),n=Jc.getInsertionPosition(new gl(t.graveyardPosition.root,i)),r=new Jc(o,0,n,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Jc.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,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=Jc.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),dd(Jc,Yc,((e,t,i)=>{const o=wl._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const n=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&n){const i=e.splitPosition._getTransformedByMoveOperation(t),o=e.graveyardPosition._getTransformedByMoveOperation(t),n=o.path.slice();n.push(0);const r=new gl(o.root,n);return[new Yc(i,e.howMany,r,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const n=e.splitPosition.isEqual(t.targetPosition);if(n&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=Jc.getInsertionPosition(e.splitPosition),[e];if(n&&i.abRelation&&i.abRelation.howMany){const{howMany:t,offset:o}=i.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(o),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=i,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany),e.splitPosition=t.sourcePosition.clone(),e.insertionPosition=Jc.getInsertionPosition(e.splitPosition),[e]}return t.sourcePosition.isEqual(t.targetPosition)||(e.splitPosition.hasSameParentAs(t.sourcePosition)&&e.splitPosition.offset<=t.sourcePosition.offset&&(e.howMany-=t.howMany),e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany)),e.splitPosition.stickiness="toNone",e.splitPosition=e.splitPosition._getTransformedByMoveOperation(t),e.splitPosition.stickiness="toNext",e.graveyardPosition?e.insertionPosition=e.insertionPosition._getTransformedByMoveOperation(t):e.insertionPosition=Jc.getInsertionPosition(e.splitPosition),[e]})),dd(Jc,Jc,((e,t,i)=>{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new od(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new od(0)];if("splitBefore"==i.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const o="$graveyard"==e.splitPosition.root.rootName,n="$graveyard"==t.splitPosition.root.rootName;if(n&&!o||(!o||n)&&i.aIsStrong){const i=[];return t.howMany&&i.push(new Yc(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&i.push(new Yc(e.splitPosition,e.howMany,e.moveTargetPosition,0)),i}return[new od(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.baRelation){const i=t.insertionPosition.path.slice();i.push(0);const o=new gl(t.insertionPosition.root,i);return[e,new Yc(e.insertionPosition,1,o,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset<t.splitPosition.offset&&(e.howMany-=t.howMany),e.splitPosition=e.splitPosition._getTransformedBySplitOperation(t),e.insertionPosition=Jc.getInsertionPosition(e.splitPosition),[e]}));class vd extends(V(gl)){constructor(e,t,i="toNone"){if(super(e,t,i),!this.root.is("rootElement"))throw new A("model-liveposition-root-not-rootelement",e);yd.call(this)}detach(){this.stopListening()}toPosition(){return new gl(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function yd(){this.listenTo(this.root.document.model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&xd.call(this,i)}),{priority:"low"})}function xd(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)}}vd.prototype.is=function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e};class Ad{constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},C("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:i=!0,isUndo:o=!1,isTyping:n=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=i,this.isUndo=o,this.isTyping=n}get type(){return C("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.isDocumentOperation&&(e.batch=this,this.operations.push(e)),e}}class Cd{constructor(e){this._changesInElement=new Map,this._elementsSnapshots=new Map,this._elementChildrenSnapshots=new Map,this._elementState=new Map,this._changedMarkers=new Map,this._changedRoots=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&&0==this._changedRoots.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),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);const o=wl._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of o.getItems({shallow:!0}))this._setElementState(e,"move");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=wl._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}this._setElementState(t.position.nodeAfter,"rename");break}case"split":{const e=t.splitPosition.parent;if(!this._isInInsertedElement(e)){this._markRemove(e,t.splitPosition.offset,t.howMany);const i=wl._createFromPositionAndShift(t.splitPosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}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),this._setElementState(t.graveyardPosition.nodeAfter,"move"));break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1),this._setElementState(e,"move");const o=t.targetPosition.parent;if(!this._isInInsertedElement(o)){this._markInsert(o,t.targetPosition.offset,e.maxOffset);const i=wl._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}break}case"detachRoot":case"addRoot":{const e=t.affectedSelectable;if(!e._isLoaded)return;if(e.isAttached()==t.isAdd)return;this._bufferRootStateChange(t.rootName,t.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!t.root._isLoaded)return;const e=t.root.rootName;this._bufferRootAttributeChange(e,t.key,t.oldValue,t.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,t,i){t.range&&t.range.root.is("rootElement")&&!t.range.root._isLoaded&&(t.range=null),i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null);let o=this._changedMarkers.get(e);o?o.newMarkerData=i:(o={newMarkerData:i,oldMarkerData:t},this._changedMarkers.set(e,o)),null==o.oldMarkerData.range&&null==i.range&&this._changedMarkers.delete(e)}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.oldMarkerData.range&&e.push({name:t,range:i.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.newMarkerData.range&&e.push({name:t,range:i.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.getChanges().length)return!0;if(this._changedRoots.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 i=e.range&&!t.range,o=!e.range&&t.range,n=e.range&&t.range&&!e.range.isEqual(t.range);if(i||o||n)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 i=this._changesInElement.get(e).sort(((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offset<t.offset?-1:1)),o=this._elementChildrenSnapshots.get(e),n=Sd(e.getChildren()),r=Pd(o.length,i);let s=0,a=0;for(const i of r)if("i"===i){const i=this._getDiffActionForNode(n[s].node,"insert"),o=this._elementsSnapshots.get(n[s].node),r=this._getInsertDiff(e,s,i,n[s],o);t.push(r),s++}else if("r"===i){const i=this._getDiffActionForNode(o[a].node,"remove"),n=this._getRemoveDiff(e,s,i,o[a]);t.push(n),a++}else if("a"===i){const i=o[a].attributes,r=n[s].attributes;let l;if("$text"==n[s].name)l=new wl(gl._createAt(e,s),gl._createAt(e,s+1));else{const t=e.offsetToIndex(s);l=new wl(gl._createAt(e,s),gl._createAt(e.getChild(t),0))}const c=this._getAttributesDiff(l,i,r);t.push(...c),s++,a++}else s++,a++}t.sort(((e,t)=>e.position.root!=t.position.root?e.position.root.rootName<t.position.root.rootName?-1:1:e.position.isEqual(t.position)?e.changeCount-t.changeCount:e.position.isBefore(t.position)?-1:1));for(let e=1,i=0;e<t.length;e++){const o=t[i],n=t[e],r="remove"==o.type&&"remove"==n.type&&"$text"==o.name&&"$text"==n.name&&o.position.isEqual(n.position),s="insert"==o.type&&"insert"==n.type&&"$text"==o.name&&"$text"==n.name&&o.position.parent==n.position.parent&&o.position.offset+o.length==n.position.offset,a="attribute"==o.type&&"attribute"==n.type&&o.position.parent==n.position.parent&&o.range.isFlat&&n.range.isFlat&&o.position.offset+o.length==n.position.offset&&o.attributeKey==n.attributeKey&&o.attributeOldValue==n.attributeOldValue&&o.attributeNewValue==n.attributeNewValue;r||s||a?(o.length++,a&&(o.range.end=o.range.end.getShiftedBy(1)),t[e]=null):i=e}t=t.filter((e=>e));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(Id),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map((e=>{const t={...e};return void 0!==t.state&&delete t.attributes,t}))}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),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),this._setElementState(e,"refresh");const t=wl._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_bufferRootLoad(e){if(e.isAttached()){this._bufferRootStateChange(e.rootName,!0),this._markInsert(e,0,e.maxOffset);for(const t of e.getAttributeKeys())this._bufferRootAttributeChange(e.rootName,t,null,e.getAttribute(t));for(const t of this._markerCollection)if(t.getRange().root==e){const e=t.getData();this.bufferMarkerChange(t.name,{...e,range:null},e)}}}_bufferRootStateChange(e,t){if(!this._changedRoots.has(e))return void this._changedRoots.set(e,{name:e,state:t?"attached":"detached"});const i=this._changedRoots.get(e);void 0!==i.state?(delete i.state,void 0===i.attributes&&this._changedRoots.delete(e)):i.state=t?"attached":"detached"}_bufferRootAttributeChange(e,t,i,o){const n=this._changedRoots.get(e)||{name:e},r=n.attributes||{};if(r[t]){const e=r[t];o===e.oldValue?delete r[t]:e.newValue=o}else r[t]={oldValue:i,newValue:o};0===Object.entries(r).length?(delete n.attributes,void 0===n.state&&this._changedRoots.delete(e)):(n.attributes=r,this._changedRoots.set(e,n))}_markInsert(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const o={type:"insert",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o)}_markRemove(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const o={type:"remove",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o),this._removeAllNestedChanges(e,t,i)}_markAttribute(e){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshots(e);const i=this._getChangesForElement(e);this._handleChange(t,i),i.push(t);for(let e=0;e<i.length;e++)i[e].howMany<1&&(i.splice(e,1),e--)}_setElementState(e,t){if(!e.is("element"))return;const i=Cd._statesPriority.indexOf(this._elementState.get(e));Cd._statesPriority.indexOf(t)>i&&this._elementState.set(e,t)}_getDiffActionForNode(e,t){if(!e.is("element"))return t;if(!this._elementsSnapshots.has(e))return t;const i=this._elementState.get(e);return i&&"move"!=i?i:t}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshots(e){if(this._elementChildrenSnapshots.has(e))return;const t=Sd(e.getChildren());this._elementChildrenSnapshots.set(e,t);for(const e of t)this._elementsSnapshots.set(e.node,e)}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const i of t){const o=e.offset+e.howMany,n=i.offset+i.howMany;if("insert"==e.type&&("insert"==i.type&&(e.offset<=i.offset?i.offset+=e.howMany:e.offset<n&&(i.howMany+=e.nodesToHandle,e.nodesToHandle=0)),"remove"==i.type&&e.offset<i.offset&&(i.offset+=e.howMany),"attribute"==i.type))if(e.offset<=i.offset)i.offset+=e.howMany;else if(e.offset<n){const n=i.howMany;i.howMany=e.offset-i.offset,t.unshift({type:"attribute",offset:o,howMany:n-i.howMany,count:this._changeCount++})}if("remove"==e.type){if("insert"==i.type)if(o<=i.offset)i.offset-=e.howMany;else if(o<=n)if(e.offset<i.offset){const t=o-i.offset;i.offset=e.offset,i.howMany-=t,e.nodesToHandle-=t}else i.howMany-=e.nodesToHandle,e.nodesToHandle=0;else if(e.offset<=i.offset)e.nodesToHandle-=i.howMany,i.howMany=0;else if(e.offset<n){const t=n-e.offset;i.howMany-=t,e.nodesToHandle-=t}if("remove"==i.type&&(o<=i.offset?i.offset-=e.howMany:e.offset<i.offset&&(e.nodesToHandle+=i.howMany,i.howMany=0)),"attribute"==i.type)if(o<=i.offset)i.offset-=e.howMany;else if(e.offset<i.offset){const t=o-i.offset;i.offset=e.offset,i.howMany-=t}else if(e.offset<n)if(o<=n){const o=i.howMany;i.howMany=e.offset-i.offset;const n=o-i.howMany-e.nodesToHandle;t.unshift({type:"attribute",offset:e.offset,howMany:n,count:this._changeCount++})}else i.howMany-=n-e.offset}if("attribute"==e.type){if("insert"==i.type)if(e.offset<i.offset&&o>i.offset){if(o>n){const e={type:"attribute",offset:n,howMany:o-n,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=i.offset&&e.offset<n&&(o>n?(e.nodesToHandle=o-n,e.offset=n):e.nodesToHandle=0);if("remove"==i.type&&e.offset<i.offset&&o>i.offset){const n={type:"attribute",offset:i.offset,howMany:o-i.offset,count:this._changeCount++};this._handleChange(n,t),t.push(n),e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==i.type&&(e.offset>=i.offset&&o<=n?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=i.offset&&o>=n&&(i.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,i,o,n){const r={type:"insert",position:gl._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++,action:i};return"insert"!=i&&n&&(r.before={name:n.name,attributes:new Map(n.attributes)}),r}_getRemoveDiff(e,t,i,o){return{type:"remove",action:i,position:gl._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const o=[];i=new Map(i);for(const[n,r]of t){const t=i.has(n)?i.get(n):null;t!==r&&o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:n,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++}),i.delete(n)}for(const[t,n]of i)o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:n,changeCount:this._changeCount++});return o}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const i=this._changesInElement.get(t),o=e.startOffset;if(i)for(const e of i)if("insert"==e.type&&o>=e.offset&&o<e.offset+e.howMany)return!0;return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,i){const o=new wl(gl._createAt(e,t),gl._createAt(e,t+i));for(const e of o.getItems({shallow:!0}))e.is("element")&&(this._changesInElement.delete(e),this._removeAllNestedChanges(e,0,e.maxOffset))}}Cd._statesPriority=[void 0,"refresh","rename","move"];const Td=Cd;function Ed(e){return{node:e,name:e.is("$text")?"$text":e.name,attributes:new Map(e.getAttributes())}}function Sd(e){const t=[];for(const i of e)if(i.is("$text"))for(let e=0;e<i.data.length;++e)t.push(Ed(i));else t.push(Ed(i));return t}function Pd(e,t){const i=[];let o=0,n=0;for(const e of t){if(e.offset>o){for(let t=0;t<e.offset-o;t++)i.push("e");n+=e.offset-o}if("insert"==e.type){for(let t=0;t<e.howMany;t++)i.push("i");o=e.offset+e.howMany}else if("remove"==e.type){for(let t=0;t<e.howMany;t++)i.push("r");o=e.offset,n+=e.howMany}else{if(e.howMany>1500)for(let t=0;t<e.howMany;t++)i.push("a");else i.push(..."a".repeat(e.howMany).split(""));o=e.offset+e.howMany,n+=e.howMany}}if(n<e)for(let t=0;t<e-n-o;t++)i.push("e");return i}function Id(e){const t="position"in e&&"$graveyard"==e.position.root.rootName,i="range"in e&&"$graveyard"==e.range.root.rootName;return!t&&!i}class Md{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set,this._baseVersionToOperationIndex=new Map,this._version=0,this._gaps=new Map}get version(){return this._version}set version(e){this._operations.length&&e>this._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 A("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 i=this._operations[0];void 0===e&&(e=i.baseVersion);let o=t-1;for(const[t,i]of this._gaps)e>t&&e<i&&(e=i),o>t&&o<i&&(o=t-1);if(o<i.baseVersion||e>this.lastOperation.baseVersion)return[];let n=this._baseVersionToOperationIndex.get(e);void 0===n&&(n=0);let r=this._baseVersionToOperationIndex.get(o);return void 0===r&&(r=this._operations.length-1),this._operations.slice(n,r+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 Od extends $l{constructor(e,t,i="main"){super(t),this._isAttached=!0,this._isLoaded=!0,this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}Od.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 Vd="$graveyard";class Nd extends(V()){constructor(e){super(),this.model=e,this.history=new Md,this.selection=new jl(this),this.roots=new Jo({idProperty:"rootName"}),this.differ=new Td(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Vd),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.differ.bufferOperation(i)}),{priority:"high"}),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.history.addOperation(i)}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(e.markers,"update",((e,t,i,o,n)=>{const r={...t.getData(),range:o};this.differ.bufferMarkerChange(t.name,n,r),null===i&&t.on("change",((e,i)=>{const o=t.getData();this.differ.bufferMarkerChange(t.name,{...o,range:i},o)}))})),this.registerPostFixer((e=>{let t=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(e.remove(e.createRangeIn(i)),t=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(e.removeMarker(i),t=!0);return t}))}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Vd)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new A("model-document-createroot-name-exists",this,{name:t});const i=new Od(this,e,t);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map((e=>e.rootName))}getRoots(e=!1){return this.roots.filter((t=>t!=this.graveyard&&(e||t.isAttached())&&t._isLoaded))}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Br(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(){const e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,i=t.schema,o=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(o)||t.createRange(o)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&Rd(e.start)&&Rd(e.end)}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break}while(t)}}function Rd(e){const t=e.textNode;if(t){const i=t.data,o=e.offset-t.startOffset;return!dn(i,o)&&!un(i,o)}return!0}class Bd extends(V()){constructor(){super(...arguments),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Dd?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,o=!1){const n=e instanceof Dd?e.name:e;if(n.includes(","))throw new A("markercollection-incorrect-marker-name",this);const r=this._markers.get(n);if(r){const e=r.getData(),s=r.getRange();let a=!1;return s.isEqual(t)||(r._attachLiveRange(Bl.fromRange(t)),a=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,a=!0),"boolean"==typeof o&&o!=r.affectsData&&(r._affectsData=o,a=!0),a&&this.fire(`update:${n}`,r,s,t,e),r}const s=Bl.fromRange(t),a=new Dd(n,s,i,o);return this._markers.set(n,a),this.fire(`update:${n}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof Dd?e.name:e,i=this._markers.get(t);return!!i&&(this._markers.delete(t),this.fire(`update:${t}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0)}_refresh(e){const t=e instanceof Dd?e.name:e,i=this._markers.get(t);if(!i)throw new A("markercollection-refresh-marker-not-exists",this);const o=i.getRange();this.fire(`update:${t}`,i,o,o,i.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 Dd extends(V(dl)){constructor(e,t,i,o){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new A("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}}Dd.prototype.is=function(e){return"marker"===e||"model:marker"===e};class Ld extends Uc{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new A("detach-operation-on-document-node",this)}_execute(){Wc(wl._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class zd extends dl{constructor(e){super(),this.markers=new Map,this._children=new Wl,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}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(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 i of e)t=t.getChildAtOffset(i);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 i of e)i.name?t.push($l.fromJSON(i)):t.push(zl.fromJSON(i));return new zd(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){return"string"==typeof e?[new zl(e)]:(ie(e)||(e=[e]),Array.from(e).map((e=>"string"==typeof e?new zl(e):e instanceof ul?new zl(e.data,e.getAttributes()):e)))}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const t of e)t.parent=null}}zd.prototype.is=function(e){return"documentFragment"===e||"model:documentFragment"===e};class Fd{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new zl(e,t)}createElement(e,t){return new $l(e,t)}createDocumentFragment(){return new zd}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),e instanceof zl&&""==e.data)return;const o=gl._createAt(t,i);if(e.parent){if($d(e.root,o.root))return void this.move(wl._createOn(e),o);if(e.root.document)throw new A("model-writer-insert-forbidden-move",this);this.remove(e)}const n=o.root.document?o.root.document.version:null,r=e instanceof zd?e._removeChildren(0,e.childCount):e,s=new Qc(o,r,n);if(e instanceof zl&&(s.shouldReceiveAttributes=!0),this.batch.addOperation(s),this.model.applyOperation(s),e instanceof zd)for(const[t,i]of e.markers){const e=gl._createAt(i.root,0),n={range:new wl(i.start._getCombined(e,o),i.end._getCombined(e,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,n):this.addMarker(t,n)}}insertText(e,t,i,o){t instanceof zd||t instanceof $l||t instanceof gl?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,o)}insertElement(e,t,i,o){t instanceof zd||t instanceof $l||t instanceof gl?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof zd||t instanceof $l?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof zd||t instanceof $l?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof wl){const o=i.getMinimalFlatRanges();for(const i of o)jd(this,e,t,i)}else Ud(this,e,t,i)}setAttributes(e,t){for(const[i,o]of sn(e))this.setAttribute(i,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof wl){const i=t.getMinimalFlatRanges();for(const t of i)jd(this,e,null,t)}else Ud(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof wl)for(const i of e.getItems())t(i);else t(e)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof wl))throw new A("writer-move-invalid-range",this);if(!e.isFlat)throw new A("writer-move-range-not-flat",this);const o=gl._createAt(t,i);if(o.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!$d(e.root,o.root))throw new A("writer-move-different-document",this);const n=e.root.document?e.root.document.version:null,r=new Yc(e.start,e.end.offset-e.start.offset,o,n);this.batch.addOperation(r),this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof wl?e:wl._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),Wd(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof $l))throw new A("writer-merge-no-element-before",this);if(!(i instanceof $l))throw new A("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}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,i=e.nodeAfter;this.move(wl._createIn(i),gl._createAt(t,"end")),this.remove(i)}_merge(e){const t=gl._createAt(e.nodeBefore,"end"),i=gl._createAt(e.nodeAfter,0),o=e.root.document.graveyard,n=new gl(o,[0]),r=e.root.document.version,s=new Xc(i,e.nodeAfter.maxOffset,t,n,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof $l))throw new A("writer-rename-not-element-instance",this);const i=e.root.document?e.root.document.version:null,o=new nd(gl._createBefore(e),e.name,t,i);this.batch.addOperation(o),this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let i,o,n=e.parent;if(!n.parent)throw new A("writer-split-element-no-parent",this);if(t||(t=n.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new A("writer-split-invalid-limit-element",this);do{const t=n.root.document?n.root.document.version:null,r=n.maxOffset-e.offset,s=Jc.getInsertionPosition(e),a=new Jc(e,r,s,null,t);this.batch.addOperation(a),this.model.applyOperation(a),i||o||(i=n,o=e.parent.nextSibling),n=(e=this.createPositionAfter(e.parent)).parent}while(n!==t);return{position:e,range:new wl(gl._createAt(i,"end"),gl._createAt(o,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new A("writer-wrap-range-not-flat",this);const i=t instanceof $l?t:new $l(t);if(i.childCount>0)throw new A("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new A("writer-wrap-element-attached",this);this.insert(i,e.start);const o=new wl(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,gl._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new A("writer-unwrap-element-no-parent",this);this.move(wl._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new A("writer-addmarker-no-usingoperation",this);const i=t.usingOperation,o=t.range,n=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new A("writer-addmarker-marker-exists",this);if(!o)throw new A("writer-addmarker-no-range",this);return i?(Hd(this,e,null,o,n),this.model.markers.get(e)):this.model.markers._set(e,o,i,n)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i="string"==typeof e?e:e.name,o=this.model.markers.get(i);if(!o)throw new A("writer-updatemarker-marker-not-exists",this);if(!t)return C("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),void this.model.markers._refresh(o);const n="boolean"==typeof t.usingOperation,r="boolean"==typeof t.affectsData,s=r?t.affectsData:o.affectsData;if(!n&&!t.range&&!r)throw new A("writer-updatemarker-wrong-options",this);const a=o.getRange(),l=t.range?t.range:a;n&&t.usingOperation!==o.managedUsingOperations?t.usingOperation?Hd(this,i,null,l,s):(Hd(this,i,a,null,s),this.model.markers._set(i,l,void 0,s)):o.managedUsingOperations?Hd(this,i,a,l,s):this.model.markers._set(i,l,void 0,s)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new A("writer-removemarker-no-marker",this);const i=this.model.markers.get(t);i.managedUsingOperations?Hd(this,t,i.getRange(),null,i.affectsData):this.model.markers._remove(t)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();const i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new A("writer-addroot-root-exists",this);const o=this.model.document,n=new sd(e,t,!0,o,o.version);return this.batch.addOperation(n),this.model.applyOperation(n),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new A("writer-detachroot-no-root",this);for(const e of this.model.markers)e.getRange().root===t&&this.removeMarker(e);for(const e of t.getAttributeKeys())this.removeAttribute(e,t);this.remove(this.createRangeIn(t));const i=this.model.document,o=new sd(t.rootName,t.name,!1,i,i.version);this.batch.addOperation(o),this.model.applyOperation(o)}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,i]of sn(e))this._setSelectionAttribute(t,i)}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 i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const o=jl._getStoreAttributeKey(e);this.setAttribute(o,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=jl._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new A("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const o=i.getRange();let n=!1;if("move"===e){const e=t;n=e.containsPosition(o.start)||e.start.isEqual(o.start)||e.containsPosition(o.end)||e.end.isEqual(o.end)}else{const e=t,i=e.nodeBefore,r=e.nodeAfter,s=o.start.parent==i&&o.start.isAtEnd,a=o.end.parent==r&&0==o.end.offset,l=o.end.nodeAfter==r,c=o.start.nodeAfter==r;n=s||a||l||c}n&&this.updateMarker(i.name,{range:o})}}}function jd(e,t,i,o){const n=e.model,r=n.document;let s,a,l,c=o.start;for(const e of o.getWalker({shallow:!0}))l=e.item.getAttribute(t),s&&a!=l&&(a!=i&&d(),c=s),s=e.nextPosition,a=l;function d(){const o=new wl(c,s),l=o.root.document?r.version:null,d=new id(o,t,a,i,l);e.batch.addOperation(d),n.applyOperation(d)}s instanceof gl&&s!=c&&a!=i&&d()}function Ud(e,t,i,o){const n=e.model,r=n.document,s=o.getAttribute(t);let a,l;if(s!=i){if(o.root===o){const e=o.document?r.version:null;l=new rd(o,t,s,i,e)}else{a=new wl(gl._createBefore(o),e.createPositionAfter(o));const n=a.root.document?r.version:null;l=new id(a,t,s,i,n)}e.batch.addOperation(l),n.applyOperation(l)}}function Hd(e,t,i,o,n){const r=e.model,s=r.document,a=new ed(t,i,o,r.markers,!!n,s.version);e.batch.addOperation(a),r.applyOperation(a)}function Wd(e,t,i,o){let n;if(e.root.document){const i=o.document,r=new gl(i.graveyard,[0]);n=new Yc(e,t,r,i.version)}else n=new Ld(e,t);i.addOperation(n),o.applyOperation(n)}function $d(e,t){return e===t||e instanceof Od&&t instanceof Od}function qd(e,t,i={}){if(t.isCollapsed)return;const o=t.getFirstRange();if("$graveyard"==o.root.rootName)return;const n=e.schema;e.change((e=>{if(!i.doNotResetEntireContent&&function(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;const o=t.getFirstRange();return o.start.parent!=o.end.parent&&e.checkChild(i,"paragraph")}(n,t))return void function(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i)),Yd(e,e.createPositionAt(i,0),t)}(e,t);const r={};if(!i.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(r,n.getAttributesWithProperty(e,"copyOnReplace",!0))}const[s,a]=function(e){const t=e.root.document.model,i=e.start;let o=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const i=function(e){const t=e.parent,i=t.root.document.model.schema,o=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of o){if(i.isLimit(e))return null;if(i.isBlock(e))return e}}(o);if(i&&o.isTouching(t.createPositionAt(i,0))){const i=t.createSelection(e);t.modifySelection(i,{direction:"backward"});const n=i.getLastPosition(),r=t.createRange(n,o);t.hasContent(r,{ignoreMarkers:!0})||(o=n)}}return[vd.fromPosition(i,"toPrevious"),vd.fromPosition(o,"toNext")]}(o);s.isTouching(a)||e.remove(e.createRange(s,a)),i.leaveUnmerged||(function(e,t,i){const o=e.model;if(!Kd(e.model.schema,t,i))return;const[n,r]=function(e,t){const i=e.getAncestors(),o=t.getAncestors();let n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}(t,i);n&&r&&(!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(r,{ignoreMarkers:!0})?Gd(e,t,i,n.parent):Zd(e,t,i,n.parent))}(e,s,a),n.removeDisallowedAttributes(s.parent.getChildren(),e)),Qd(e,t,s),!i.doNotAutoparagraph&&function(e,t){const i=e.checkChild(t,"$text"),o=e.checkChild(t,"paragraph");return!i&&o}(n,s)&&Yd(e,s,t,r),s.detach(),a.detach()}))}function Zd(e,t,i,o){const n=t.parent,r=i.parent;if(n!=o&&r!=o){for(t=e.createPositionAfter(n),(i=e.createPositionBefore(r)).isEqual(t)||e.insert(r,t),e.merge(t);i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}Kd(e.model.schema,t,i)&&Zd(e,t,i,o)}}function Gd(e,t,i,o){const n=t.parent,r=i.parent;if(n!=o&&r!=o){for(t=e.createPositionAfter(n),(i=e.createPositionBefore(r)).isEqual(t)||e.insert(n,i);t.parent.isEmpty;){const i=t.parent;t=e.createPositionBefore(i),e.remove(i)}i=e.createPositionBefore(r),function(e,t){const i=t.nodeBefore,o=t.nodeAfter;i.name!=o.name&&e.rename(i,o.name),e.clearAttributes(i),e.setAttributes(Object.fromEntries(o.getAttributes()),i),e.merge(t)}(e,i),Kd(e.model.schema,t,i)&&Gd(e,t,i,o)}}function Kd(e,t,i){const o=t.parent,n=i.parent;return o!=n&&!e.isLimit(o)&&!e.isLimit(n)&&function(e,t,i){const o=new wl(e,t);for(const e of o.getWalker())if(i.isLimit(e.item))return!1;return!0}(t,i,e)}function Yd(e,t,i,o={}){const n=e.createElement("paragraph");e.model.schema.setAllowedAttributes(n,o,e),e.insert(n,t),Qd(e,i,e.createPositionAt(n,0))}function Qd(e,t,i){t instanceof jl?e.setSelection(i):t.setTo(i)}function Jd(e,t){const i=[];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=>{i.push(e.start.parent),t.remove(e)})),i.forEach((e=>{let i=e;for(;i.parent&&i.isEmpty;){const e=t.createRangeOn(i);i=i.parent,t.remove(e)}}))}class Xd{constructor(e,t,i){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=i,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),i=this.writer.createPositionAfter(e);if(i.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new A("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?wl._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new wl(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){this._checkAndSplitToAllowedPosition(e)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this.schema.isObject(e)||this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=vd.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()}_handleDisallowedNode(e){e.is("element")&&this.handleNodes(e.getChildren())}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new A("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=vd.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=vd.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof $l))return;if(!this._canMergeLeft(e))return;const t=vd._createBefore(e);t.stickiness="toNext";const i=vd.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=vd._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=vd._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof $l))return;if(!this._canMergeRight(e))return;const t=vd._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new A("insertcontent-invalid-insertion-position",this);this.position=gl._createAt(t.nodeBefore,"end");const i=vd.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=vd._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=vd._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof $l&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof $l&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_insertAutoParagraph(){this._insertPartialFragment();const e=this.writer.createElement("paragraph");this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,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 this.schema.checkChild(this.position.parent,e)||this._insertAutoParagraph(),!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)||this.schema.checkChild(e,"paragraph")&&this.schema.checkChild("paragraph",t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function eu(e,t){const{isForward:i,walker:o,unit:n,schema:r,treatEmojiAsSingleUnit:s}=e,{type:a,item:l,nextPosition:c}=t;if("text"==a)return"word"===e.unit?function(e,t){let i=e.position.textNode;for(i||(i=t?e.position.nodeAfter:e.position.nodeBefore);i&&i.is("$text");){const o=e.position.offset-i.startOffset;if(ou(i,o,t))i=t?e.position.nodeAfter:e.position.nodeBefore;else{if(iu(i.data,o,t))break;e.next()}}return e.position}(o,i):function(e,t,i){const o=e.position.textNode;if(o){const n=o.data;let r=e.position.offset-o.startOffset;for(;dn(n,r)||"character"==t&&un(n,r)||i&&mn(n,r);)e.next(),r=e.position.offset-o.startOffset}return e.position}(o,n,s);if(a==(i?"elementStart":"elementEnd")){if(r.isSelectable(l))return gl._createAt(l,i?"after":"before");if(r.checkChild(c,"$text"))return c}else{if(r.isLimit(l))return void o.skip((()=>!0));if(r.checkChild(c,"$text"))return c}}function tu(e,t){const i=e.root,o=gl._createAt(i,t?"end":0);return t?new wl(e,o):new wl(o,e)}function iu(e,t,i){const o=t+(i?0:-1);return' ,.?!:;"-()'.includes(e.charAt(o))}function ou(e,t,i){return t===(i?e.offsetSize:0)}class nu extends(Z()){constructor(){var e;super(),this.markers=new Bd,this.document=new Nd(this),this.schema=new wc,this._pendingChanges=[],this._currentWriter=null,["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((()=>!0),"$marker"),(e=this).document.registerPostFixer((t=>function(e,t){const i=t.document.selection,o=t.schema,n=[];let r=!1;for(const e of i.getRanges()){const t=fc(e,o);t&&!t.isEqual(e)?(n.push(t),r=!0):n.push(e)}return r&&e.setSelection(function(e){const t=[...e],i=new Set;let o=1;for(;o<t.length;){const e=t[o],n=t.slice(0,o);for(const[r,s]of n.entries())if(!i.has(r))if(e.isEqual(s))i.add(r);else if(e.isIntersecting(s)){i.add(r),i.add(o);const n=e.getJoined(s);t.push(n)}o++}return t.filter(((e,t)=>!i.has(t)))}(n),{backward:i.isBackward}),!1}(t,e))),this.document.registerPostFixer(sc),this.on("insertContent",((e,[t,i])=>{e.return=function(e,t,i){return e.change((o=>{const n=i||e.document.selection;n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0});const r=new Xd(e,o,n.anchor),s=[];let a;if(t.is("documentFragment")){if(t.markers.size){const e=[];for(const[i,o]of t.markers){const{start:t,end:n}=o,r=t.isEqual(n);e.push({position:t,name:i,isCollapsed:r},{position:n,name:i,isCollapsed:r})}e.sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:i,name:n,isCollapsed:r}of e){let e=null,a=null;const l=i.parent===t&&i.isAtStart,c=i.parent===t&&i.isAtEnd;l||c?r&&(a=l?"start":"end"):(e=o.createElement("$marker"),o.insert(e,i)),s.push({name:n,element:e,collapsed:a})}}a=t.getChildren()}else a=[t];r.handleNodes(a);let l=r.getSelectionRange();if(t.is("documentFragment")&&s.length){const e=l?Bl.fromRange(l):null,t={};for(let e=s.length-1;e>=0;e--){const{name:i,element:n,collapsed:a}=s[e],l=!t[i];if(l&&(t[i]=[]),n){const e=o.createPositionAt(n,"before");t[i].push(e),o.remove(n)}else{const e=r.getAffectedRange();if(!e){a&&t[i].push(r.position);continue}a?t[i].push(e[a]):t[i].push(l?e.start:e.end)}}for(const[e,[i,n]]of Object.entries(t))i&&n&&i.root===n.root&&i.root.document&&!o.model.markers.has(e)&&o.addMarker(e,{usingOperation:!0,affectsData:!0,range:new wl(i,n)});e&&(l=e.toRange(),e.detach())}l&&(n instanceof jl?o.setSelection(l):n.setTo(l));const c=r.getAffectedRange()||e.createRange(n.anchor);return r.destroy(),c}))}(this,t,i)})),this.on("insertObject",((e,[t,i,o])=>{e.return=function(e,t,i,o={}){if(!e.schema.isObject(t))throw new A("insertobject-element-not-an-object",e,{object:t});const n=i||e.document.selection;let r=n;o.findOptimalPosition&&e.schema.isBlock(t)&&(r=e.createSelection(e.schema.findOptimalInsertionRange(n,o.findOptimalPosition)));const s=Xo(n.getSelectedBlocks()),a={};return s&&Object.assign(a,e.schema.getAttributesWithProperty(s,"copyOnReplace",!0)),e.change((i=>{r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});let n=t;const s=r.anchor.parent;!e.schema.checkChild(s,t)&&e.schema.checkChild(s,"paragraph")&&e.schema.checkChild("paragraph",t)&&(n=i.createElement("paragraph"),i.insert(t,n)),e.schema.setAllowedAttributes(n,a,i);const l=e.insertContent(n,r);return l.isCollapsed||o.setSelection&&function(e,t,i,o){const n=e.model;if("on"==i)return void e.setSelection(t,"on");if("after"!=i)throw new A("insertobject-invalid-place-parameter-value",n);let r=t.nextSibling;n.schema.isInline(t)?e.setSelection(t,"after"):(!(r&&n.schema.checkChild(r,"$text"))&&n.schema.checkChild(t.parent,"paragraph")&&(r=e.createElement("paragraph"),n.schema.setAllowedAttributes(r,o,e),n.insertContent(r,e.createPositionAfter(t))),r&&e.setSelection(r,0))}(i,t,o.setSelection,a),l}))}(this,t,i,o)})),this.on("canEditAt",(e=>{const t=!this.document.isReadOnly;e.return=t,t||e.stop()}))}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Ad,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){A.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new Ad):e instanceof Ad||(e=new Ad(e)):e=new Ad,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){A.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i,...o){const n=ru(t,i);return this.fire("insertContent",[e,n,i,...o])}insertObject(e,t,i,o,...n){const r=ru(t,i);return this.fire("insertObject",[e,r,o,o,...n])}deleteContent(e,t){qd(this,e,t)}modifySelection(e,t){!function(e,t,i={}){const o=e.schema,n="backward"!=i.direction,r=i.unit?i.unit:"character",s=!!i.treatEmojiAsSingleUnit,a=t.focus,l=new hl({boundaries:tu(a,n),singleCharacters:!0,direction:n?"forward":"backward"}),c={walker:l,schema:o,isForward:n,unit:r,treatEmojiAsSingleUnit:s};let d;for(;d=l.next();){if(d.done)return;const i=eu(c,d.value);if(i)return void(t instanceof jl?e.change((e=>{e.setSelectionFocus(i)})):t.setFocus(i))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change((e=>{const i=e.createDocumentFragment(),o=t.getFirstRange();if(!o||o.isCollapsed)return i;const n=o.start.root,r=o.start.getCommonPath(o.end),s=n.getNodeByPath(r);let a;a=o.start.parent==o.end.parent?o:e.createRange(e.createPositionAt(s,o.start.path[r.length]),e.createPositionAt(s,o.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),i):e.append(e.cloneElement(t,!0),i);if(a!=o){const t=o._getTransformedByMove(a.start,e.createPositionAt(i,0),l)[0],n=e.createRange(e.createPositionAt(i,0),t.start);Jd(e.createRange(t.end,e.createPositionAt(i,"end")),e),Jd(n,e)}return i}))}(this,e)}hasContent(e,t={}){const i=e instanceof wl?e:wl._createIn(e);if(i.isCollapsed)return!1;const{ignoreWhitespaces:o=!1,ignoreMarkers:n=!1}=t;if(!n)for(const e of this.markers.getMarkersIntersectingRange(i))if(e.affectsData)return!0;for(const e of i.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!o)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}canEditAt(e){const t=ru(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,i){return new gl(e,t,i)}createPositionAt(e,t){return gl._createAt(e,t)}createPositionAfter(e){return gl._createAfter(e)}createPositionBefore(e){return gl._createBefore(e)}createRange(e,t){return new wl(e,t)}createRangeIn(e){return wl._createIn(e)}createRangeOn(e){return wl._createOn(e)}createSelection(...e){return new Pl(...e)}createBatch(e){return new Ad(e)}createOperationFromJSON(e){return ld.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 Fd(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function ru(e,t){if(e)return e instanceof Pl||e instanceof jl?e:e instanceof Sl?t||0===t?new Pl(e,t):e.is("rootElement")?new Pl(e,"in"):new Pl(e,"on"):new Pl(e)}class su extends va{constructor(){super(...arguments),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class au extends va{constructor(){super(...arguments),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class lu extends va{constructor(){super(...arguments),this.domEventType=["touchstart","touchend","touchmove"]}onDomEvent(e){this.fire(e.type,e)}}class cu{constructor(e){this.document=e}createDocumentFragment(e){return new Vs(this.document,e)}createElement(e,t,i){return new ts(this.document,e,t,i)}createText(e){return new Lr(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const i=e.parent;if(i){const o=i.getChildIndex(e);return this.removeChildren(o,1,i),this.insertChild(o,t,i),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new ts(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){Ce(e)&&void 0===i?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ds._createAt(e,t)}createPositionAfter(e){return ds._createAfter(e)}createPositionBefore(e){return ds._createBefore(e)}createRange(e,t){return new us(e,t)}createRangeOn(e){return us._createOn(e)}createRangeIn(e){return us._createIn(e)}createSelection(...e){return new ms(...e)}}const du=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,uu=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,hu=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,mu=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,gu=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,pu=/\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi,fu=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 bu(e){return e.startsWith("#")?du.test(e):e.startsWith("rgb")?uu.test(e)||hu.test(e):e.startsWith("hsl")?mu.test(e)||gu.test(e):fu.has(e.toLowerCase())}const ku=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function _u(e){return ku.includes(e)}const wu=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function vu(e){return wu.test(e)}const yu=/^[+-]?[0-9]*([.][0-9]+)?%$/;function xu(e){return yu.test(e)}const Au=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const Cu=["center","top","bottom","left","right"];function Tu(e){return Cu.includes(e)}const Eu=["fixed","scroll","local"];function Su(e){return Eu.includes(e)}const Pu=/^url\(/;function Iu(e){return Pu.test(e)}function Mu(e=""){if(""===e)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const t=Nu(e),i=t[0],o=t[2]||i,n=t[1]||i;return{top:i,bottom:o,right:n,left:t[3]||n}}function Ou(e){return t=>{const{top:i,right:o,bottom:n,left:r}=t,s=[];return[i,o,r,n].every((e=>!!e))?s.push([e,Vu(t)]):(i&&s.push([e+"-top",i]),o&&s.push([e+"-right",o]),n&&s.push([e+"-bottom",n]),r&&s.push([e+"-left",r])),s}}function Vu({top:e,right:t,bottom:i,left:o}){const n=[];return o!==t?n.push(e,t,i,o):i!==e?n.push(e,t,i):t!==e?n.push(e,t):n.push(e),n.join(" ")}function Nu(e){const t=e.trim().slice(0,1500).matchAll(pu);return Array.from(t).map((e=>e[0]))}function Ru(e){e.setNormalizer("background",(e=>{const t={},i=Nu(e);for(const e of i)o=e,Au.includes(o)?(t.repeat=t.repeat||[],t.repeat.push(e)):Tu(e)?(t.position=t.position||[],t.position.push(e)):Su(e)?t.attachment=e:bu(e)?t.color=e:Iu(e)&&(t.image=e);var o;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 Bu(e){e.setNormalizer("border",(e=>{const{color:t,style:i,width:o}=Hu(e);return{path:"border",value:{color:Mu(t),style:Mu(i),width:Mu(o)}}})),e.setNormalizer("border-top",Du("top")),e.setNormalizer("border-right",Du("right")),e.setNormalizer("border-bottom",Du("bottom")),e.setNormalizer("border-left",Du("left")),e.setNormalizer("border-color",Lu("color")),e.setNormalizer("border-width",Lu("width")),e.setNormalizer("border-style",Lu("style")),e.setNormalizer("border-top-color",Fu("color","top")),e.setNormalizer("border-top-style",Fu("style","top")),e.setNormalizer("border-top-width",Fu("width","top")),e.setNormalizer("border-right-color",Fu("color","right")),e.setNormalizer("border-right-style",Fu("style","right")),e.setNormalizer("border-right-width",Fu("width","right")),e.setNormalizer("border-bottom-color",Fu("color","bottom")),e.setNormalizer("border-bottom-style",Fu("style","bottom")),e.setNormalizer("border-bottom-width",Fu("width","bottom")),e.setNormalizer("border-left-color",Fu("color","left")),e.setNormalizer("border-left-style",Fu("style","left")),e.setNormalizer("border-left-width",Fu("width","left")),e.setExtractor("border-top",ju("top")),e.setExtractor("border-right",ju("right")),e.setExtractor("border-bottom",ju("bottom")),e.setExtractor("border-left",ju("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",Ou("border-color")),e.setReducer("border-style",Ou("border-style")),e.setReducer("border-width",Ou("border-width")),e.setReducer("border-top",Wu("top")),e.setReducer("border-right",Wu("right")),e.setReducer("border-bottom",Wu("bottom")),e.setReducer("border-left",Wu("left")),e.setReducer("border",function(){return t=>{const i=Uu(t,"top"),o=Uu(t,"right"),n=Uu(t,"bottom"),r=Uu(t,"left"),s=[i,o,n,r],a={width:e(s,"width"),style:e(s,"style"),color:e(s,"color")},l=$u(a,"all");if(l.length)return l;const c=Object.entries(a).reduce(((e,[t,i])=>(i&&(e.push([`border-${t}`,i]),s.forEach((e=>delete e[t]))),e)),[]);return[...c,...$u(i,"top"),...$u(o,"right"),...$u(n,"bottom"),...$u(r,"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 Du(e){return t=>{const{color:i,style:o,width:n}=Hu(t),r={};return void 0!==i&&(r.color={[e]:i}),void 0!==o&&(r.style={[e]:o}),void 0!==n&&(r.width={[e]:n}),{path:"border",value:r}}}function Lu(e){return t=>({path:"border",value:zu(t,e)})}function zu(e,t){return{[t]:Mu(e)}}function Fu(e,t){return i=>({path:"border",value:{[e]:{[t]:i}}})}function ju(e){return(t,i)=>{if(i.border)return Uu(i.border,e)}}function Uu(e,t){const i={};return e.width&&e.width[t]&&(i.width=e.width[t]),e.style&&e.style[t]&&(i.style=e.style[t]),e.color&&e.color[t]&&(i.color=e.color[t]),i}function Hu(e){const t={},i=Nu(e);for(const e of i)vu(e)||/thin|medium|thick/.test(e)?t.width=e:_u(e)?t.style=e:t.color=e;return t}function Wu(e){return t=>$u(t,e)}function $u(e,t){const i=[];if(e&&e.width&&i.push("width"),e&&e.style&&i.push("style"),e&&e.color&&i.push("color"),3==i.length){const o=i.map((t=>e[t])).join(" ");return["all"==t?["border",o]:[`border-${t}`,o]]}return"all"==t?[]:i.map((i=>[`border-${t}-${i}`,e[i]]))}class qu{constructor(e){if(this.crashes=[],this.state="initializing",this._now=Date.now,this.crashes=[],this._crashNumberLimit="number"==typeof e.crashNumberLimit?e.crashNumberLimit:3,this._minimumNonErrorTimePeriod="number"==typeof e.minimumNonErrorTimePeriod?e.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=e=>{const t="error"in e?e.error:e.reason;t instanceof Error&&this._handleError(t,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]=this._listeners[e].filter((e=>e!==t))}_fire(e,...t){const i=this._listeners[e]||[];for(const e of i)e.apply(this,[null,...t])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,t){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:t instanceof ErrorEvent?t.filename:void 0,lineno:t instanceof ErrorEvent?t.lineno:void 0,colno:t instanceof ErrorEvent?t.colno:void 0,date:this._now()});const i=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:i}),i?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&void 0!==e.context&&null!==e.context&&"ready"===this.state&&this._isErrorComingFromThisItem(e)}_shouldRestart(){return this.crashes.length<=this._crashNumberLimit||(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}const Zu=function(e,t,i){var o=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return F(i)&&(o="leading"in i?!!i.leading:o,n="trailing"in i?!!i.trailing:n),Na(e,t,{leading:o,maxWait:t,trailing:n})};function Gu(e,t=new Set){const i=[e],o=new Set;let n=0;for(;i.length>n;){const e=i[n++];if(!o.has(e)&&Ku(e)&&!t.has(e))if(o.add(e),Symbol.iterator in e)try{for(const t of e)i.push(t)}catch(e){}else for(const t in e)"defaultValue"!==t&&i.push(e[t])}return o}function Ku(e){const t=Object.prototype.toString.call(e),i=typeof e;return!("number"===i||"boolean"===i||"string"===i||"symbol"===i||"function"===i||"[object Date]"===t||"[object RegExp]"===t||"[object Module]"===t||null==e||e._watchdogExcluded||e instanceof EventTarget||e instanceof Event)}function Yu(e,t,i=new Set){if(e===t&&"object"==typeof(o=e)&&null!==o)return!0;var o;const n=Gu(e,i),r=Gu(t,i);for(const e of n)if(r.has(e))return!0;return!1}class Qu extends qu{constructor(e,t={}){super(t),this._editor=null,this._lifecyclePromise=null,this._initUsingData=!0,this._editables={},this._throttledSave=Zu(this._save.bind(this),"number"==typeof t.saveInterval?t.saveInterval:5e3),e&&(this._creator=(t,i)=>e.create(t,i)),this._destructor=e=>e.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then((()=>(this.state="initializing",this._fire("stateChange"),this._destroy()))).catch((e=>{console.error("An error happened during the editor destroying.",e)})).then((()=>{const e={},t=[],i=this._config.rootsAttributes||{},o={};for(const[n,r]of Object.entries(this._data.roots))r.isLoaded?(e[n]="",o[n]=i[n]||{}):t.push(n);const n={...this._config,extraPlugins:this._config.extraPlugins||[],lazyRoots:t,rootsAttributes:o,_watchdogInitialData:this._data};return delete n.initialData,n.extraPlugins.push(Ju),this._initUsingData?this.create(e,n,n.context):Ri(this._elementOrData)?this.create(this._elementOrData,n,n.context):this.create(this._editables,n,n.context)})).then((()=>{this._fire("restart")}))}create(e=this._elementOrData,t=this._config,i){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>(super._startErrorHandling(),this._elementOrData=e,this._initUsingData="string"==typeof e||Object.keys(e).length>0&&"string"==typeof Object.values(e)[0],this._config=this._cloneEditorConfiguration(t)||{},this._config.context=i,this._creator(e,this._config)))).then((e=>{this._editor=e,e.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=e.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")})).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling(),this._throttledSave.cancel();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)}))}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=e}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e=this._editor,t=e.model.document.roots.filter((e=>e.isAttached()&&"$graveyard"!=e.rootName)),{plugins:i}=e,o=i.has("CommentsRepository")&&i.get("CommentsRepository"),n=i.has("TrackChanges")&&i.get("TrackChanges"),r={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};t.forEach((e=>{r.roots[e.rootName]={content:JSON.stringify(Array.from(e.getChildren())),attributes:JSON.stringify(Array.from(e.getAttributes())),isLoaded:e._isLoaded}}));for(const t of e.model.markers)t._affectsData&&(r.markers[t.name]={rangeJSON:t.getRange().toJSON(),usingOperation:t._managedUsingOperations,affectsData:t._affectsData});return o&&(r.commentThreads=JSON.stringify(o.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),n&&(r.suggestions=JSON.stringify(n.getSuggestions({toJSON:!0,skipNotAttached:!0}))),r}_getEditables(){const e={};for(const t of this.editor.model.document.getRootNames()){const i=this.editor.ui.getEditableElement(t);i&&(e[t]=i)}return e}_isErrorComingFromThisItem(e){return Yu(this._editor,e.context,this._excludedProps)}_cloneEditorConfiguration(e){return Ni(e,((e,t)=>Ri(e)||"context"===t?e:void 0))}}class Ju{constructor(e){this.editor=e,this._data=e.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",(e=>{e.stop(),this.editor.model.enqueueChange({isUndoable:!1},(e=>{this._restoreCollaborationData(),this._restoreEditorData(e)})),this.editor.data.fire("ready")}),{priority:999})}_createNode(e,t){if("name"in t){const i=e.createElement(t.name,t.attributes);if(t.children)for(const o of t.children)i._appendChild(this._createNode(e,o));return i}return e.createText(t.data,t.attributes)}_restoreEditorData(e){const t=this.editor;Object.entries(this._data.roots).forEach((([i,{content:o,attributes:n}])=>{const r=JSON.parse(o),s=JSON.parse(n),a=t.model.document.getRoot(i);for(const[t,i]of s)e.setAttribute(t,i,a);for(const t of r){const i=this._createNode(e,t);e.insert(i,a,"end")}})),Object.entries(this._data.markers).forEach((([i,o])=>{const{document:n}=t.model,{rangeJSON:{start:r,end:s},...a}=o,l=n.getRoot(r.root),c=e.createPositionFromPath(l,r.path,r.stickiness),d=e.createPositionFromPath(l,s.path,s.stickiness),u=e.createRange(c,d);e.addMarker(i,{range:u,...a})}))}_restoreCollaborationData(){const e=JSON.parse(this._data.commentThreads),t=JSON.parse(this._data.suggestions);e.forEach((e=>{const t=this.editor.config.get("collaboration.channelId"),i=this.editor.plugins.get("CommentsRepository");i.hasCommentThread(e.threadId)&&i.getCommentThread(e.threadId).remove(),i.addCommentThread({channelId:t,...e})})),t.forEach((e=>{const t=this.editor.plugins.get("TrackChangesEditing");t.hasSuggestion(e.id)?t.getSuggestion(e.id).attributes=e.attributes:t.addSuggestionData(e)}))}}const Xu=Symbol("MainQueueId");class eh{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._activeActions=0}onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,t){const i=e===Xu;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const o=(i?Promise.all(this._queues.values()):Promise.all([this._queues.get(Xu),this._queues.get(e)])).then(t),n=o.catch((()=>{}));return this._queues.set(e,n),o.finally((()=>{this._activeActions--,this._queues.get(e)===n&&0===this._activeActions&&this._onEmptyCallbacks.forEach((e=>e()))}))}}function th(e){return Array.isArray(e)?e:[e]}class ih{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new A("commandcollection-command-not-found",this,{commandName:e});return i.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 oh extends rn{constructor(e){super(),this.editor=e}set(e,t,i={}){if("string"==typeof t){const e=t;t=(t,i)=>{this.editor.execute(e),i()}}super.set(e,t,i)}}const nh="contentEditing",rh="common";class sh{constructor(e){this.keystrokeInfos=new Map,this._editor=e;const t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:nh,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const o=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&o.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:o}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:o}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:rh}),o&&o.forEach((t=>{this.addKeystrokeInfoGroup({categoryId:e,...t})}))}addKeystrokeInfoGroup({categoryId:e=nh,id:t,label:i,keystrokes:o}){const n=this.keystrokeInfos.get(e);if(!n)throw new A("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});n.groups.set(t,{id:t,label:i,keystrokes:o||[]})}addKeystrokeInfos({categoryId:e=nh,groupId:t=rh,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new A("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const o=this.keystrokeInfos.get(e);if(!o.groups.has(t))throw new A("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});o.groups.get(t).keystrokes.push(...i)}}function ah(e){return Object.getPrototypeOf(e).constructor.editorName}function lh(e){if(!e)return;const t=Array.isArray(e)?{items:e}:e,i=function e(t){return t.flatMap((t=>"string"==typeof t?[t]:e(t.items)))}(t.items||[]);return{isMultiline:i.includes("-"),shouldNotGroupWhenFull:!!t.shouldNotGroupWhenFull,items:(o=i,o.filter((e=>"|"!==e&&"-"!==e)))};var o}function ch(){let e="unknown",t="unknown";return s.isMac?e="mac":s.isWindows?e="windows":s.isiOS?e="ios":s.isAndroid&&(e="android"),s.isGecko?t="gecko":s.isBlink?t="blink":s.isSafari&&(t="safari"),{os:e,browser:t}}class dh extends(Z()){static get editorName(){return"Editor"}constructor(e={}){if(super(),"sanitizeHtml"in e)throw new A("editor-config-sanitizehtml-not-supported");const t=this.constructor,{translations:i,...o}=t.defaultConfig||{},{translations:n=i,...r}=e,s=e.language||o.language;this._context=e.context||new rr({language:s,translations:n}),this._context._addEditor(this,!e.context);const a=Array.from(t.builtinPlugins||[]);this.config=new Bi(r,o),this.config.define("plugins",a),this.config.define(this._context._getEditorConfig()),function(e){let t=e.get("licenseKey");if(!t&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(t=window.CKEDITOR_GLOBAL_LICENSE_KEY,e.set("licenseKey",t)),!t)throw new A("license-key-missing")}(this.config),this.plugins=new nr(this,a,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new ih,this.set("state","initializing"),this.once("ready",(()=>this.state="ready"),{priority:"high"}),this.once("destroy",(()=>this.state="destroyed"),{priority:"high"}),this.model=new nu,this.on("change:isReadOnly",(()=>{this.model.document.isReadOnly=this.isReadOnly}));const l=new Qr;this.data=new Lc(this.model,l),this.editing=new _c(this.model,l),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new zc([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 oh(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new sh(this),function(e){const t=e.config.get("licenseKey"),i=window[Symbol.for("cke distribution")]||"sh";function o(t){e.enableReadOnlyMode(Symbol("invalidLicense")),e._showLicenseError(t)}if("GPL"==t)return void("cloud"==i&&o("distributionChannel"));const n=function(e){const t=e.split(".");return 3!=t.length?null:t[1]}(t);if(!n)return void o("invalid");const r=cn(n);if(!r)return void o("invalid");if(!function(e){return["exp","jti","vc"].every((t=>t in e))}(r))return void o("invalid");if(r.distributionChannel&&!No(r.distributionChannel).includes(i))return void o("distributionChannel");if(function(e){const t=Array.isArray(e)?e:[e],i=function(){const e=[];for(let t=0;t<256;t++){let i=t;for(let e=0;e<8;e++)1&i?i=3988292384^i>>>1:i>>>=1;e[t]=i}return e}();let o=-1;const n=t.map((e=>Array.isArray(e)?e.join(""):String(e))).join("");for(let e=0;e<n.length;e++)o=o>>>8^i[255&(o^n.charCodeAt(e))];return o=~o>>>0,o.toString(16).padStart(8,"0")}(function(e){return Object.getOwnPropertyNames(e).sort().filter((t=>"vc"!=t&&null!=e[t])).map((t=>e[t]))}(r))!=r.vc.toLowerCase())return void o("invalid");if(new Date(1e3*r.exp)<S)return void o("expired");const s=r.licensedHosts;if(s&&s.length>0&&!function(e){const{hostname:t}=new URL(window.location.href);if(e.includes(t))return!0;const i=t.split(".");return e.filter((e=>e.includes("*"))).map((e=>e.split("."))).filter((e=>e.length<=i.length)).map((e=>Array(i.length-e.length).fill("*"===e[0]?"*":"").concat(e))).some((e=>i.every(((t,i)=>e[i]===t||"*"===e[i]))))}(s))o("domainLimit");else if(["evaluation","trial"].includes(r.licenseType)&&1e3*r.exp<Date.now())o("expired");else{if(["development","evaluation","trial"].includes(r.licenseType)){const{licenseType:e}=r,t=e[0].toUpperCase()+e.slice(1),i="evaluation"===e?"an":"a";console.info(`%cCKEditor 5 ${t} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`⚠️ You are using ${i} ${e} license of CKEditor 5`+("trial"===e?" which is for evaluation purposes only":"")+". For production usage, please obtain a production license at https://portal.ckeditor.com/")}if(["evaluation","trial"].includes(r.licenseType)){const t=r.licenseType,i=setTimeout((()=>{o(`${t}Limit`)}),6e5);e.on("destroy",(()=>{clearTimeout(i)}))}r.usageEndpoint&&e.once("ready",(()=>{const i={requestId:v(),requestTime:Math.round(Date.now()/1e3),license:t,editor:hh(e)};e._sendUsageRequest(r.usageEndpoint,i).then((e=>{const{status:t,message:i}=e;i&&console.warn(i),"ok"!=t&&o("usageLimit")}),(()=>{var e;e={url:r.usageEndpoint},console.error(...E("license-key-validation-endpoint-not-reachable",e))}))}),{priority:"high"})}}(this)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new A("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new A("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 A("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))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],o=e.get("extraPlugins")||[],n=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(o),i,n)}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){A.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}_showLicenseError(e,t){setTimeout((()=>{if("invalid"==e)throw new A("invalid-license-key");if("expired"==e)throw new A("license-key-expired");if("domainLimit"==e)throw new A("license-key-domain-limit");if("featureNotAllowed"==e)throw new A("license-key-plugin-not-allowed",null,{pluginName:t});if("evaluationLimit"==e)throw new A("license-key-evaluation-limit");if("trialLimit"==e)throw new A("license-key-trial-limit");if("developmentLimit"==e)throw new A("license-key-development-limit");if("usageLimit"==e)throw new A("license-key-usage-limit");if("distributionChannel"==e)throw new A("license-key-invalid-distribution-channel")}),0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){const i=new Headers({"Content-Type":"application/json"}),o=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok)throw new Error(`HTTP Response: ${o.status}`);return o.json()}}dh.Context=rr,dh.EditorWatchdog=Qu,dh.ContextWatchdog=class extends qu{constructor(e,t={}){super(t),this._watchdogs=new Map,this._context=null,this._contextProps=new Set,this._actionQueues=new eh,this._watchdogConfig=t,this._creator=t=>e.create(t),this._destructor=e=>e.destroy(),this._actionQueues.onEmpty((()=>{"initializing"===this.state&&(this.state="ready",this._fire("stateChange"))}))}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}get context(){return this._context}create(e={}){return this._actionQueues.enqueue(Xu,(()=>(this._contextConfig=e,this._create())))}getItem(e){return this._getWatchdog(e)._item}getItemState(e){return this._getWatchdog(e).state}add(e){const t=th(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e.id,(()=>{if("destroyed"===this.state)throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let t;if(this._watchdogs.has(e.id))throw new Error(`Item with the given id is already added: '${e.id}'.`);if("editor"===e.type)return t=new Qu(null,this._watchdogConfig),t.setCreator(e.creator),t._setExcludedProperties(this._contextProps),e.destructor&&t.setDestructor(e.destructor),this._watchdogs.set(e.id,t),t.on("error",((i,{error:o,causesRestart:n})=>{this._fire("itemError",{itemId:e.id,error:o}),n&&this._actionQueues.enqueue(e.id,(()=>new Promise((i=>{const o=()=>{t.off("restart",o),this._fire("itemRestart",{itemId:e.id}),i()};t.on("restart",o)}))))})),t.create(e.sourceElementOrData,e.config,this._context);throw new Error(`Not supported item type: '${e.type}'.`)})))))}remove(e){const t=th(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e,(()=>{const t=this._getWatchdog(e);return this._watchdogs.delete(e),t.destroy()})))))}destroy(){return this._actionQueues.enqueue(Xu,(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())))}_restart(){return this._actionQueues.enqueue(Xu,(()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch((e=>{console.error("An error happened during destroying the context or items.",e)})).then((()=>this._create())).then((()=>this._fire("restart"))))))}_create(){return Promise.resolve().then((()=>(this._startErrorHandling(),this._creator(this._contextConfig)))).then((e=>(this._context=e,this._contextProps=Gu(this._context),Promise.all(Array.from(this._watchdogs.values()).map((e=>(e._setExcludedProperties(this._contextProps),e.create(void 0,void 0,this._context))))))))}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling();const e=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map((e=>e.destroy()))).then((()=>this._destructor(e)))}))}_getWatchdog(e){const t=this._watchdogs.get(e);if(!t)throw new Error(`Item with the given id was not registered: ${e}.`);return t}_isErrorComingFromThisItem(e){for(const t of this._watchdogs.values())if(t._isErrorComingFromThisItem(e))return!1;return Yu(this._context,e.context)}};const uh=dh;function hh(e){const i=function(e){return{sessionId:(localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",v()),localStorage.getItem("__ckeditor-session-id")),pageSessionId:(t.window.CKEDITOR_PAGE_SESSION_ID=t.window.CKEDITOR_PAGE_SESSION_ID||v(),t.window.CKEDITOR_PAGE_SESSION_ID),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:ah(e),plugins:(i=e.plugins,Array.from(i).filter((([e])=>!!e.pluginName)).map((([e])=>{const{pluginName:t,isContextPlugin:i,isOfficialPlugin:o,isPremiumPlugin:n}=e;return{isContext:!!i,isOfficial:!!o,isPremium:!!n,name:t}}))),distribution:{channel:window[Symbol.for("cke distribution")]||"sh"},env:ch(),integration:Object.create(null),menuBar:{isVisible:!!e.config.get("menuBar.isVisible")},language:{ui:e.locale.uiLanguage,content:e.locale.contentLanguage},toolbar:{main:lh(e.config.get("toolbar")),block:lh(e.config.get("blockToolbar")),balloon:lh(e.config.get("balloonToolbar"))}};var i}(e);return e.fire("collectUsageData",{setUsageData:function(e,t){if(void 0!==Cr(i,e))throw new A("editor-usage-data-path-already-set",{path:e});Tr(i,e,t)}}),i}function mh(e){return class extends e{updateSourceElement(e){if(!this.sourceElement)throw new A("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),i=this.sourceElement instanceof HTMLTextAreaElement;if(!t&&!i)return void no(this.sourceElement,"");const o="string"==typeof e?e:this.data.get();no(this.sourceElement,o)}}}mh.updateSourceElement=mh(Object).prototype.updateSourceElement;class gh extends sr{static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new Jo({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new A("pendingactions-add-invalid-message",this);const t=new(Z());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 ph='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>',fh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>',bh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>',kh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',_h='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',wh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z"/></svg>',vh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',yh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',xh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',Ah='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',Ch='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>',Th='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>',Eh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>',Sh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.87 12.61a.75.75 0 0 1-.089.976l-.085.07-3.154 2.254 3.412 2.414a.75.75 0 0 1 .237.95l-.057.095a.75.75 0 0 1-.95.237l-.096-.058-4.272-3.022-.003-1.223 4.01-2.867a.75.75 0 0 1 1.047.174zm2.795-.231.095.057 4.011 2.867-.003 1.223-4.272 3.022-.095.058a.75.75 0 0 1-.88-.151l-.07-.086-.058-.095a.75.75 0 0 1 .15-.88l.087-.07 3.412-2.414-3.154-2.253-.085-.071a.75.75 0 0 1 .862-1.207zM16 0a2 2 0 0 1 2 2v9.354l-.663-.492-.837-.001V2a.5.5 0 0 0-.5-.5H2a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3.118L7.156 19H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h14zM5.009 15l.003 1H3v-1h2.009zm2.188-2-1.471 1H5v-1h2.197zM10 11v.095L8.668 12H7v-1h3zm4-2v1H7V9h7zm0-2v1H7V7h7zm-4-2v1H5V5h5zM6 3v1H3V3h3z"/></svg>',Ph='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 5.5v3h4v-3H3Zm0 4v3h4v-3H3Zm0 4v3h4v-3H3Zm5 3h4v-3H8v3Zm5 0h4v-3h-4v3Zm4-4v-3h-4v3h4Zm0-4v-3h-4v3h4Zm1.5 8A1.5 1.5 0 0 1 17 18H3a1.5 1.5 0 0 1-1.5-1.5V3c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13.5Zm-6.5-4v-3H8v3h4Zm0-4v-3H8v3h4Z"/></svg>';var Ih=n(6912),Mh={attributes:{"data-cke":!0}};Mh.setAttributes=Wn(),Mh.insert=Un().bind(null,"head"),Mh.domAPI=Fn(),Mh.insertStyleElement=qn(),Ln()(Ih.A,Mh),Ih.A&&Ih.A.locals&&Ih.A.locals;class Oh extends Kn{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",(e=>!e)),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}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:i}of Array.from(e.attributes))Oh.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,i);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}))}}Oh.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"];const Vh=Oh;class Nh extends Kn{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}var Rh=n(5810),Bh={attributes:{"data-cke":!0}};Bh.setAttributes=Wn(),Bh.insert=Un().bind(null,"head"),Bh.domAPI=Fn(),Bh.insertStyleElement=qn(),Ln()(Rh.A,Bh),Rh.A&&Rh.A.locals&&Rh.A.locals;class Dh extends Kn{constructor(e,t=new Nh){super(e),this._focusDelayed=null;const i=this.bindTemplate,o=v();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),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("role",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._setupLabelView(t),this.iconView=new Vh,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 n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",(e=>!e)),i.if("isVisible","ck-hidden",(e=>!e)),i.to("isOn",(e=>e?"ck-on":"ck-off")),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",(e=>e||"button")),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,(e=>!e)),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to((e=>{this.isEnabled?this.fire("execute"):e.preventDefault()}))}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",((e,t,i)=>!(!t||Lh(i))&&String(!!e))),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",((e,t,i)=>!(!t||!Lh(i))&&String(!!e))),s.isSafari&&(this._focusDelayed||(this._focusDelayed=ln((()=>this.focus()),0)),n.on.mousedown=i.to((()=>{this._focusDelayed()})),n.on.mouseup=i.to((()=>{this._focusDelayed.cancel()}))),this.setTemplate(n)}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()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new Kn;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(e=>Mo(e)))}]}),e}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i&&(i=Mo(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}function Lh(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}var zh=n(3224),Fh={attributes:{"data-cke":!0}};Fh.setAttributes=Wn(),Fh.insert=Un().bind(null,"head"),Fh.domAPI=Fn(),Fh.insertStyleElement=qn(),Ln()(zh.A,Fh),zh.A&&zh.A.locals&&zh.A.locals;class jh extends Kn{constructor(e,t={}){super(e);const i=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",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new Vh,this.iconView.content=t.icon,this.children.add(this.iconView));const o=new Kn(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}}class Uh extends(V()){constructor(e){if(super(),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 i=e.actions[t];"string"==typeof i&&(i=[i]);for(const o of i)e.keystrokeHandler.set(o,((e,i)=>{this[t](),i()}),e.keystrokeHandlerOptions)}this.on("forwardCycle",(()=>this.focusFirst()),{priority:"low"}),this.on("backwardCycle",(()=>this.focusLast()),{priority:"low"})}get first(){return this.focusables.find(Hh)||null}get last(){return this.focusables.filter(Hh).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find(((t,i)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o})),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;e&&this.focusables.getIndex(e)===this.current||e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;e&&this.focusables.getIndex(e)===this.current||e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const t=()=>null===this.current?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",(e=>{const i=t();this.focusNext(),i!==t()&&e.stop()}),{priority:"low"}),this.listenTo(e,"backwardCycle",(e=>{const i=t();this.focusPrevious(),i!==t()&&e.stop()}),{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(null===i)return this[1===e?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{const i=this.focusables.get(n);if(Hh(i)){o=i;break}n=(n+t+e)%t}while(n!==i);return o}}function Hh(e){return Wh(e)&&co(e.element)}function Wh(e){return!(!("focus"in e)||"function"!=typeof e.focus)}function $h(e){return class extends e{constructor(...e){super(...e),this._onDragBound=this._onDrag.bind(this),this._onDragEndBound=this._onDragEnd.bind(this),this._lastDraggingCoordinates={x:0,y:0},this.on("render",(()=>{this._attachListeners()})),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(t.document,"mouseup",this._onDragEndBound),this.listenTo(t.document,"touchend",this._onDragEndBound),this.listenTo(t.document,"mousemove",this._onDragBound),this.listenTo(t.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(t.document,"mouseup",this._onDragEndBound),this.stopListening(t.document,"touchend",this._onDragEndBound),this.stopListening(t.document,"mousemove",this._onDragBound),this.stopListening(t.document,"touchmove",this._onDragBound)}_onDragStart(e,t){if(!this._isHandleElementPressed(t))return;this._attachDragListeners();let i=0,o=0;t instanceof MouseEvent?(i=t.clientX,o=t.clientY):(i=t.touches[0].clientX,o=t.touches[0].clientY),this._lastDraggingCoordinates={x:i,y:o},this.isDragging=!0}_onDrag(e,t){if(!this.isDragging)return void this._detachDragListeners();let i=0,o=0;t instanceof MouseEvent?(i=t.clientX,o=t.clientY):(i=t.touches[0].clientX,o=t.touches[0].clientY),t.preventDefault(),this.fire("drag",{deltaX:Math.round(i-this._lastDraggingCoordinates.x),deltaY:Math.round(o-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:i,y:o}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(e){return!!this.dragHandleElement&&(this.dragHandleElement===e.target||e.target instanceof HTMLElement&&this.dragHandleElement.contains(e.target))}}}var qh=n(6533),Zh={attributes:{"data-cke":!0}};Zh.setAttributes=Wn(),Zh.insert=Un().bind(null,"head"),Zh.domAPI=Fn(),Zh.insertStyleElement=qn(),Ln()(qh.A,Zh),qh.A&&qh.A.locals&&qh.A.locals;class Gh extends Kn{constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new rn,this._focusTracker=new en,this._focusables=new pn,this.focusCycler=new Uh({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const e=new Dh(this.locale);let i;for(i in e.on("execute",(()=>t.onExecute())),t.onCreate&&t.onCreate(e),t)"onExecute"!=i&&"onCreate"!=i&&e.set(i,t[i]);this.children.add(e)}this._updateFocusCyclableItems()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach((e=>{this._focusables.add(e),this._focusTracker.add(e.element)}))}}class Kh extends Kn{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}var Yh=n(8390),Qh={attributes:{"data-cke":!0}};Qh.setAttributes=Wn(),Qh.insert=Un().bind(null,"head"),Qh.domAPI=Fn(),Qh.insertStyleElement=qn(),Ln()(Yh.A,Qh),Yh.A&&Yh.A.locals&&Yh.A.locals;const Jh="screen-center",Xh="editor-center",em=ro("px");class tm extends($h(Kn)){constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:o}){super(e),this.wasMoved=!1;const n=this.bindTemplate,r=e.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",Jh),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new rn,this.focusTracker=new en,this._focusables=new pn,this._focusCycler=new Uh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:o}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",n.if("isModal","ck-dialog-overlay__transparent",(e=>!e)),n.if("_isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.if("isModal","ck-dialog_modal"),n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",(e=>em(e))),left:n.to("_left",(e=>em(e))),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",((e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())})),this.on("drag",((e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)})),this.listenTo(t.window,"resize",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.listenTo(t.document,"scroll",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.on("change:_isVisible",((e,t,i)=>{i&&(this._isTransparent=!0,setTimeout((()=>{this.updatePosition(),this._isTransparent=!1,this.focus()}),10))})),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:o,actionButtons:n}){t&&(this.headerView=new jh(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),o&&(o instanceof Kn&&(o=[o]),this.contentView=new Kh(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),n&&(this.actionsView=new Gh(this.locale),this.actionsView.setButtons(n),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),o=this._getDialogRect();e+o.width>i.right&&(e=i.right-o.width),e<i.left&&(e=i.left),t<i.top&&(t=i.top),this._moveTo(e,t)}_moveTo(e,t){this._left=e,this._top=t}moveBy(e,t){this.moveTo(this._left+e,this._top+t)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){if(!this.element||!this.element.parentNode)return;const e=this._getViewportRect();let t,i=this.position;this._getCurrentDomRoot()?t=this._getVisibleDomRootRect(e):i=Jh;const o=tm.defaultOffset,n=this._getDialogRect();switch(i){case"editor-top-side":if(t){const e="ltr"===this.locale.contentLanguageDirection?t.right-n.width-o:t.left+o;this.moveTo(e,t.top+o)}else this._moveOffScreen();break;case Xh:t?this.moveTo(Math.round(t.left+t.width/2-n.width/2),Math.round(t.top+t.height/2-n.height/2)):this._moveOffScreen();break;case Jh:this.moveTo(Math.round((e.width-n.width)/2),Math.round((e.height-n.height)/2));break;case"editor-top-center":t?this.moveTo(Math.round(t.left+t.width/2-n.width/2),t.top+o):this._moveOffScreen();break;case"editor-bottom-center":t?this.moveTo(Math.round(t.left+t.width/2-n.width/2),t.bottom-n.height-o):this._moveOffScreen();break;case"editor-above-center":t?this.moveTo(Math.round(t.left+t.width/2-n.width/2),t.top-n.height-o):this._moveOffScreen();break;case"editor-below-center":t?this.moveTo(Math.round(t.left+t.width/2-n.width/2),t.bottom+o):this._moveOffScreen()}}_getVisibleDomRootRect(e){let t=new Qi(this._getCurrentDomRoot()).getVisible();return t?(t=e.getIntersection(t),t||null):null}_getDialogRect(){return new Qi(this.element.firstElementChild)}_getViewportRect(){const e=new Qi(t.window);if(this.isModal)return e;const i={top:0,bottom:0,left:0,right:0,...this._getViewportOffset()};return e.top+=i.top,e.height-=i.top,e.bottom-=i.bottom,e.height-=i.bottom,e.left+=i.left,e.right-=i.right,e.width-=i.left+i.right,e}_updateFocusCyclableItems(){const e=[];if(this.contentView)for(const t of this.contentView.children)Wh(t)&&e.push(t);this.actionsView&&e.push(this.actionsView),this.closeButtonView&&e.push(this.closeButtonView),e.forEach((e=>{var t;this._focusables.add(e),this.focusTracker.add(e.element),Wh(t=e)&&"focusCycler"in t&&t.focusCycler instanceof Uh&&this._focusCycler.chain(e.focusCycler)}))}_createCloseButton(){const e=new Dh(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:fh}),e.on("execute",(()=>this.fire("close",{source:"closeButton"}))),e}}tm.defaultOffset=15;const im=tm;class om extends er{static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),om._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",((e,t)=>{this._show(t)})),this.on("show",((e,t)=>{t.onShow&&t.onShow(this)}),{priority:"low"}),this.on("hide",(()=>{om._visibleDialogPlugin&&om._visibleDialogPlugin._hide()})),this.on("hide",(()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)}),{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",((t,i)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())}))}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",(()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const e of t)e.state&&this.view.updatePosition()}))}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:r,className:s,isModal:a,position:l,onHide:c,keystrokeHandlerOptions:d}){const u=this.editor;this.view=new im(u.locale,{getCurrentDomRoot:()=>u.editing.view.getDomRoot(u.model.document.selection.anchor.root.rootName),getViewportOffset:()=>u.ui.viewportOffset,keystrokeHandlerOptions:d});const h=this.view;h.on("close",(()=>{this.hide()})),u.ui.view.body.add(h),u.keystrokes.listenTo(h.element),l||(l=a?Jh:Xh),a&&this._lockBodyScroll(),h.set({position:l,_isVisible:!0,className:s,isModal:a}),h.setupParts({icon:t,title:i,hasCloseButton:o,content:n,actionButtons:r}),this.id=e,c&&(this._onHide=c),this.isOpen=!0,om._visibleDialogPlugin=this}hide(){om._visibleDialogPlugin&&om._visibleDialogPlugin.fire(`hide:${om._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,om._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}var nm=n(47),rm={attributes:{"data-cke":!0}};rm.setAttributes=Wn(),rm.insert=Un().bind(null,"head"),rm.domAPI=Fn(),rm.insertStyleElement=qn(),Ln()(nm.A,rm),nm.A&&nm.A.locals&&nm.A.locals;class sm extends Dh{constructor(e,t=new Nh){super(e,t),this._checkIconHolderView=new am,this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",((e,t)=>e||t))}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",(e=>this.isToggleable&&e)),this.on("change:_hasCheck",((e,t,i)=>{const{children:o,_checkIconHolderView:n}=this;i?o.add(n,0):o.remove(n)}))}}class am extends Kn{constructor(){super(),this._checkIconView=this._createCheckIconView();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",(e=>e?"ck-on":"ck-off"))]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",((e,t,i)=>{const{children:o,_checkIconView:n}=this;i&&!o.has(n)?o.add(n):!i&&o.has(n)&&o.remove(n)}))}_createCheckIconView(){const e=new Vh;return e.content=bh,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}var lm=n(2992),cm={attributes:{"data-cke":!0}};cm.setAttributes=Wn(),cm.insert=Un().bind(null,"head"),cm.domAPI=Fn(),cm.insertStyleElement=qn(),Ln()(lm.A,cm),lm.A&&lm.A.locals&&lm.A.locals;class dm extends sm{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}var um=n(3756),hm={attributes:{"data-cke":!0}};hm.setAttributes=Wn(),hm.insert=Un().bind(null,"head"),hm.domAPI=Fn(),hm.insertStyleElement=qn(),Ln()(um.A,hm),um.A&&um.A.locals&&um.A.locals;class mm extends Kn{constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${v()}`;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 gm extends Kn{constructor(e,t){super(e);const i=e.t,o=new mm;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[be(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map((e=>{const t=[be(document,"h3",{},e.label),...Array.from(e.groups.values()).map((e=>this._createGroup(e))).flat()];return e.description&&t.splice(1,0,be(document,"p",{},e.description)),be(document,"section",{},t)}))}_createGroup(e){const t=e.keystrokes.sort(((e,t)=>e.label.localeCompare(t.label))).map((e=>this._createGroupRow(e))).flat(),i=[be(document,"dl",{},t)];return e.label&&i.unshift(be(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=be(document,"dt"),o=be(document,"dd"),n="string"==typeof(a=e.keystroke)?[[a]]:"string"==typeof a[0]?[a]:a,r=[];var a;for(const e of n)r.push(e.map(pm).join(""));return i.innerHTML=e.label,o.innerHTML=r.join(", ")+(e.mayRequireFn&&s.isMac?` ${t("(may require <kbd>Fn</kbd>)")}`:""),[i,o]}}function pm(e){return Mo(e).split("+").map((e=>`<kbd>${e}</kbd>`)).join("+")}const fm='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 6.628a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"/><path d="M8.5 9.125a.3.3 0 0 0-.253-.296L5.11 8.327a.75.75 0 1 1 .388-1.449l4.04.716c.267.072.624.08.893.009l4.066-.724a.75.75 0 1 1 .388 1.45l-3.132.5a.3.3 0 0 0-.253.296v1.357a.3.3 0 0 0 .018.102l1.615 4.438a.75.75 0 0 1-1.41.513l-1.35-3.71a.3.3 0 0 0-.281-.197h-.209a.3.3 0 0 0-.282.198l-1.35 3.711a.75.75 0 0 1-1.41-.513l1.64-4.509a.3.3 0 0 0 .019-.103V9.125Z"/><path clip-rule="evenodd" d="M10 18.5a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17Zm0 1.5c5.523 0 10-4.477 10-10S15.523 0 10 0 0 4.477 0 10s4.477 10 10 10Z"/></svg>';var bm=n(8020),km={attributes:{"data-cke":!0}};km.setAttributes=Wn(),km.insert=Un().bind(null,"head"),km.domAPI=Fn(),km.insertStyleElement=qn(),Ln()(bm.A,km),bm.A&&bm.A.locals&&bm.A.locals;class _m extends er{constructor(){super(...arguments),this.contentView=null}static get requires(){return[om]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",(()=>{const e=this._createButton(Dh);return e.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),e})),e.ui.componentFactory.add("menuBar:accessibilityHelp",(()=>{const e=this._createButton(dm);return e.label=t("Accessibility"),e})),e.keystrokes.set("Alt+0",((e,t)=>{this._toggleDialog(),t()})),this._setupRootLabels()}_createButton(e){const t=this.editor,i=t.plugins.get("Dialog"),o=new e(t.locale);return o.set({keystroke:"Alt+0",icon:fm,isToggleable:!0}),o.on("execute",(()=>this._toggleDialog())),o.bind("isOn").to(i,"id",(e=>"accessibilityHelp"===e)),o}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;function o(e,t){const o=[t.getAttribute("aria-label"),i("Press %0 for help.",[Mo("Alt+0")])].filter((e=>e)).join(". ");e.setAttribute("aria-label",o,t)}e.ui.on("ready",(()=>{t.change((e=>{for(const i of t.document.roots)o(e,i)})),e.on("addRoot",((i,n)=>{const r=e.editing.view.document.getRoot(n.rootName);t.change((e=>o(e,r)))}),{priority:"low"})}))}_toggleDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new gm(e.locale,e.accessibility.keystrokeInfos)),"accessibilityHelp"===t.id?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:fm,hasCloseButton:!0,content:this.contentView})}}class wm extends pn{constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new fn({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),wm._bodyWrapper&&wm._bodyWrapper.isConnected||(wm._bodyWrapper=be(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(wm._bodyWrapper)),wm._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),wm._bodyWrapper&&!wm._bodyWrapper.childElementCount&&(wm._bodyWrapper.remove(),delete wm._bodyWrapper)}}var vm=n(3986),ym={attributes:{"data-cke":!0}};ym.setAttributes=Wn(),ym.insert=Un().bind(null,"head"),ym.domAPI=Fn(),ym.insertStyleElement=qn(),Ln()(vm.A,ym),vm.A&&vm.A.locals&&vm.A.locals;class xm extends Dh{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 Kn;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class Am extends(Tm(Dh)){}class Cm extends(Tm(sm)){}function Tm(e){return class extends e{constructor(...e){super(...e),this.buttonView=this,this._fileInputView=new Em(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",(()=>{this._fileInputView.open()})),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}}class Em extends Kn{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()}}const Sm='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';var Pm=n(3476),Im={attributes:{"data-cke":!0}};Im.setAttributes=Wn(),Im.insert=Un().bind(null,"head"),Im.domAPI=Fn(),Im.insertStyleElement=qn(),Ln()(Pm.A,Im),Pm.A&&Pm.A.locals&&Pm.A.locals;class Mm extends Kn{constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new Dh(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:Sm}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",(e=>!e)),e.on("execute",(()=>{this.isCollapsed=!this.isCollapsed})),e}}function Om(e,t){const i=e.t,o={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map((e=>{const t=o[e.label];return t&&t!=e.label&&(e.label=t),e}))}function Vm(e){return e.map(Nm).filter((e=>!!e))}function Nm(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 Rm extends Dh{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path class="ck-icon__fill" d="M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z"/><path d="M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z"/></svg>',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",(e=>s.isMediaForcedColors?null:e))},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}var Bm=n(4488),Dm={attributes:{"data-cke":!0}};Dm.setAttributes=Wn(),Dm.insert=Un().bind(null,"head"),Dm.domAPI=Fn(),Dm.insertStyleElement=qn(),Ln()(Bm.A,Dm),Bm.A&&Bm.A.locals&&Bm.A.locals;class Lm extends Kn{constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t&&t.columns?t.columns:5;const o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new en,this.keystrokes=new rn,this.items.on("add",((e,t)=>{t.isOn=t.color===this.selectedColor})),i.forEach((e=>{const t=new Rm;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:o}}),this.on("change:selectedColor",((e,t,i)=>{for(const e of this.items)e.isOn=e.color===i}))}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),Xn({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 zm=n(8156);const Fm=function(e){var t,i,o=[],n=1;if("string"==typeof e)if(zm[e])o=zm[e].slice(),i="rgb";else if("transparent"===e)n=0,i="rgb",o=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var r=e.slice(1);n=1,(l=r.length)<=4?(o=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],4===l&&(n=parseInt(r[3]+r[3],16)/255)):(o=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],8===l&&(n=parseInt(r[6]+r[7],16)/255)),o[0]||(o[0]=0),o[1]||(o[1]=0),o[2]||(o[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var s=t[1],a="rgb"===s;i=r=s.replace(/a$/,"");var l="cmyk"===r?4:"gray"===r?1:3;o=t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e,t){if(/%$/.test(e))return t===l?parseFloat(e)/100:"rgb"===r?255*parseFloat(e)/100:parseFloat(e);if("h"===r[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==jm[e])return jm[e]}return parseFloat(e)})),s===r&&o.push(1),n=a||void 0===o[l]?1:o[l],o=o.slice(0,l)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(o=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(o=[e[0],e[1],e[2]],i="rgb",n=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(i="rgb",o=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(i="hsl",o=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),n=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(n/=100)):(i="rgb",o=[e>>>16,(65280&e)>>>8,255&e]);return{space:i,values:o,alpha:n}};var jm={red:0,orange:60,yellow:120,green:180,blue:240,purple:300},Um=n(734),Hm=n.t(Um,2);function Wm(e,t){if(!e)return"";const i=$m(e);if(!i)return"";if(i.space===t)return e;if(o=i,!Object.keys(Hm).includes(o.space))return"";var o;const n=Hm[i.space][t];return n?function(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb(${e[0]}, ${e[1]}, ${e[2]})`;case"hsl":return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`;case"hwb":return`hwb(${e[0]}, ${e[1]}, ${e[2]})`;case"lab":return`lab(${e[0]}% ${e[1]} ${e[2]})`;case"lch":return`lch(${e[0]}% ${e[1]} ${e[2]})`;default:return""}}(n("hex"===i.space?i.hexValue:i.values),t):""}function $m(e){if(e.startsWith("#")){const t=Fm(e);return{space:"hex",values:t.values,hexValue:e,alpha:t.alpha}}const t=Fm(e);return t.space?t:null}var qm=n(7883),Zm={attributes:{"data-cke":!0}};Zm.setAttributes=Wn(),Zm.insert=Un().bind(null,"head"),Zm.domAPI=Fn(),Zm.insertStyleElement=qn(),Ln()(qm.A,Zm),qm.A&&qm.A.locals&&qm.A.locals;class Gm extends Kn{constructor(e,t){super(e);const i=`ck-labeled-field-view-${v()}`,o=`ck-labeled-field-view-status-${v()}`;this.fieldView=t(this,i,o),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(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",((e,t)=>e||t));const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",(e=>!e)),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.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 mm(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Kn(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",(e=>!e))],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Km extends Kn{constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new en,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);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"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},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,i)=>{this._setDomElementValue(i),this._updateIsEmpty()}))}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}var Ym=n(1272),Qm={attributes:{"data-cke":!0}};Qm.setAttributes=Wn(),Qm.insert=Un().bind(null,"head"),Qm.domAPI=Fn(),Qm.insertStyleElement=qn(),Ln()(Ym.A,Qm),Ym.A&&Ym.A.locals&&Ym.A.locals;class Jm extends Km{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class Xm extends Jm{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class eg extends Jm{constructor(e,{min:t,max:i,step:o}={}){super(e);const n=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:n.to("min"),max:n.to("max"),step:n.to("step")}})}}var tg=n(8118),ig={attributes:{"data-cke":!0}};ig.setAttributes=Wn(),ig.insert=Un().bind(null,"head"),ig.domAPI=Fn(),ig.insertStyleElement=qn(),Ln()(tg.A,ig),tg.A&&tg.A.locals&&tg.A.locals;class og extends Kn{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")],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(){if(this.children.length){const e=this.children.first;"function"==typeof e.focus?e.focus():C("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 ng=n(6608),rg={attributes:{"data-cke":!0}};rg.setAttributes=Wn(),rg.insert=Un().bind(null,"head"),rg.domAPI=Fn(),rg.insertStyleElement=qn(),Ln()(ng.A,rg),ng.A&&ng.A.locals&&ng.A.locals;class sg extends Kn{constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new rn,this.focusTracker=new en,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",(e=>!e))],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":o.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.on("change:isOpen",((e,t,i)=>{if(i)if("auto"===this.panelPosition){const e=sg._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=e?e.name:this._defaultPanelPositionName}else 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:i,southWest:o,northEast:n,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=sg.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,o,s,a,e,n,r,l,c,t]:[o,i,a,s,e,r,n,c,l,t]}get _defaultPanelPositionName(){return"rtl"===this.locale.uiLanguageDirection?"sw":"se"}}sg.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"})},sg._getOptimalPosition=uo;const ag=sg;class lg extends Dh{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 Vh;return e.content=Sm,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}var cg=n(3348),dg={attributes:{"data-cke":!0}};dg.setAttributes=Wn(),dg.insert=Un().bind(null,"head"),dg.domAPI=Fn(),dg.insertStyleElement=qn(),Ln()(cg.A,dg),cg.A&&cg.A.locals&&cg.A.locals;var ug=n(6365),hg={attributes:{"data-cke":!0}};hg.setAttributes=Wn(),hg.insert=Un().bind(null,"head"),hg.domAPI=Fn(),hg.insertStyleElement=qn(),Ln()(ug.A,hg),ug.A&&ug.A.locals&&ug.A.locals;class mg extends sm{constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e))),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Vh;return e.content=Sm,e.extendTemplate({attributes:{class:"ck-dropdown-menu-list__nested-menu__button__arrow"}}),e}}class gg extends Kn{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))],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class pg extends Kn{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class fg extends Kn{constructor(e,t=new mm){super(e);const i=this.bindTemplate,o=new _g(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",(e=>!e))]},children:this.children})}focus(){if(this.items){const e=this.items.find((e=>!(e instanceof pg)));e&&e.focus()}}}var bg=n(9118),kg={attributes:{"data-cke":!0}};kg.setAttributes=Wn(),kg.insert=Un().bind(null,"head"),kg.domAPI=Fn(),kg.insertStyleElement=qn(),Ln()(bg.A,kg),bg.A&&bg.A.locals&&bg.A.locals;class _g extends Kn{constructor(e){super(e),this._listItemGroupToChangeListeners=new WeakMap;const t=this.bindTemplate;this.focusables=new pn,this.items=this.createCollection(),this.focusTracker=new en,this.keystrokes=new rn,this._focusCycler=new Uh({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof fg?this._registerFocusableItemsGroup(e):e instanceof gg&&this._registerFocusableListItem(e);this.items.on("change",((e,t)=>{for(const e of t.removed)e instanceof fg?this._deregisterFocusableItemsGroup(e):e instanceof gg&&this._deregisterFocusableListItem(e);for(const e of Array.from(t.added).reverse())e instanceof fg?this._registerFocusableItemsGroup(e,t.index):this._registerFocusableListItem(e,t.index)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const e of i.removed)this._deregisterFocusableListItem(e);for(const t of Array.from(i.added).reverse())this._registerFocusableListItem(t,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach(((e,i)=>{const o=void 0!==t?t+i:void 0;this._registerFocusableListItem(e,o)}));const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class wg extends _g{constructor(e){super(e);const t=this.bindTemplate;this.role="menu",this.set("isVisible",!0),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list",t.if("isVisible","ck-hidden",(e=>!e))]}})}}const vg={eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height+e.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height+e.height,left:e.left-t.width+5,name:"wn"})};var yg=n(1760),xg={attributes:{"data-cke":!0}};xg.setAttributes=Wn(),xg.insert=Un().bind(null,"head"),xg.domAPI=Fn(),xg.insertStyleElement=qn(),Ln()(yg.A,xg),yg.A&&yg.A.locals&&yg.A.locals;const Ag={openOnArrowRightKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isEnabled&&(e.isOpen=!0)}))},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())}))},closeOnArrowLeftKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,((t,i)=>{e.isOpen&&(e.focus(),e.isOpen=!1,i())}))},closeOnEscKey(e){e.keystrokes.set("esc",((t,i)=>{e.isOpen&&(e.focus(),e.isOpen=!1,i())}))},closeOnParentClose(e,t){t.on("change:isOpen",((i,o,n)=>{n||i.source!==t||(e.isOpen=!1)}))}};var Cg=n(3617),Tg={attributes:{"data-cke":!0}};Tg.setAttributes=Wn(),Tg.insert=Un().bind(null,"head"),Tg.domAPI=Fn(),Tg.insertStyleElement=qn(),Ln()(Cg.A,Tg),Cg.A&&Cg.A.locals&&Cg.A.locals;const Eg=ro("px"),Sg={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class Pg extends Kn{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._resizeObserver=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",Eg),left:t.to("left",Eg)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const i=Mg(e.target);if(i&&!co(i))return!1;this.show();const o=Pg.defaultPositions,n=Object.assign({},{element:this.element,positions:[o.southArrowNorth,o.southArrowNorthMiddleWest,o.southArrowNorthMiddleEast,o.southArrowNorthWest,o.southArrowNorthEast,o.northArrowSouth,o.northArrowSouthMiddleWest,o.northArrowSouthMiddleEast,o.northArrowSouthWest,o.northArrowSouthEast,o.viewportStickyNorth],limiter:t.document.body,fitInViewport:!0},e),r=Pg._getOptimalPosition(n)||Sg,s=parseInt(r.left),a=parseInt(r.top),l=r.name,c=r.config||{},{withArrow:d=!0}=c;return this.top=a,this.left=s,this.position=l,this.withArrow=d,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},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){if(!this.attachTo(e))return!1;let i=Mg(e.target);const o=e.limiter?Mg(e.limiter):t.document.body;if(this.listenTo(t.document,"scroll",((t,n)=>{const r=n.target,s=i&&r.contains(i),a=o&&r.contains(o);!s&&!a&&i&&o||this.attachTo(e)}),{useCapture:!0}),this.listenTo(t.window,"resize",(()=>{this.attachTo(e)})),!this._resizeObserver&&(i&&Zi(i)&&(i=i.parentElement),i)){const e=()=>{co(i)||this.unpin()};this._resizeObserver=new oo(i,e)}return!0}_stopPinning(){this.stopListening(t.document,"scroll"),this.stopListening(t.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:t=Pg.arrowSideOffset,heightOffset:i=Pg.arrowHeightOffset,stickyVerticalOffset:o=Pg.stickyVerticalOffset,config:n}=e;return{northWestArrowSouthWest:(e,i)=>({top:r(e,i),left:e.left-t,name:"arrow_sw",...n&&{config:n}}),northWestArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.left-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northWestArrowSouth:(e,t)=>({top:r(e,t),left:e.left-t.width/2,name:"arrow_s",...n&&{config:n}}),northWestArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.left-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northWestArrowSouthEast:(e,i)=>({top:r(e,i),left:e.left-i.width+t,name:"arrow_se",...n&&{config:n}}),northArrowSouthWest:(e,i)=>({top:r(e,i),left:e.left+e.width/2-t,name:"arrow_sw",...n&&{config:n}}),northArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.left+e.width/2-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northArrowSouth:(e,t)=>({top:r(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...n&&{config:n}}),northArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.left+e.width/2-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northArrowSouthEast:(e,i)=>({top:r(e,i),left:e.left+e.width/2-i.width+t,name:"arrow_se",...n&&{config:n}}),northEastArrowSouthWest:(e,i)=>({top:r(e,i),left:e.right-t,name:"arrow_sw",...n&&{config:n}}),northEastArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.right-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northEastArrowSouth:(e,t)=>({top:r(e,t),left:e.right-t.width/2,name:"arrow_s",...n&&{config:n}}),northEastArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.right-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northEastArrowSouthEast:(e,i)=>({top:r(e,i),left:e.right-i.width+t,name:"arrow_se",...n&&{config:n}}),southWestArrowNorthWest:e=>({top:s(e),left:e.left-t,name:"arrow_nw",...n&&{config:n}}),southWestArrowNorthMiddleWest:(e,i)=>({top:s(e),left:e.left-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southWestArrowNorth:(e,t)=>({top:s(e),left:e.left-t.width/2,name:"arrow_n",...n&&{config:n}}),southWestArrowNorthMiddleEast:(e,i)=>({top:s(e),left:e.left-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southWestArrowNorthEast:(e,i)=>({top:s(e),left:e.left-i.width+t,name:"arrow_ne",...n&&{config:n}}),southArrowNorthWest:e=>({top:s(e),left:e.left+e.width/2-t,name:"arrow_nw",...n&&{config:n}}),southArrowNorthMiddleWest:(e,i)=>({top:s(e),left:e.left+e.width/2-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southArrowNorth:(e,t)=>({top:s(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...n&&{config:n}}),southArrowNorthMiddleEast:(e,i)=>({top:s(e),left:e.left+e.width/2-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southArrowNorthEast:(e,i)=>({top:s(e),left:e.left+e.width/2-i.width+t,name:"arrow_ne",...n&&{config:n}}),southEastArrowNorthWest:e=>({top:s(e),left:e.right-t,name:"arrow_nw",...n&&{config:n}}),southEastArrowNorthMiddleWest:(e,i)=>({top:s(e),left:e.right-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southEastArrowNorth:(e,t)=>({top:s(e),left:e.right-t.width/2,name:"arrow_n",...n&&{config:n}}),southEastArrowNorthMiddleEast:(e,i)=>({top:s(e),left:e.right-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southEastArrowNorthEast:(e,i)=>({top:s(e),left:e.right-i.width+t,name:"arrow_ne",...n&&{config:n}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-i,name:"arrow_e",...n&&{config:n}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+i,name:"arrow_w",...n&&{config:n}}),viewportStickyNorth:(e,t,i,r)=>{const s=r||i;return e.getIntersection(s)?s.height-e.height>o?null:{top:s.top+o,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...n}}:null}};function r(e,t){return e.top-t.height-i}function s(e){return e.bottom+i}}}Pg.arrowSideOffset=25,Pg.arrowHeightOffset=10,Pg.stickyVerticalOffset=20,Pg._getOptimalPosition=uo,Pg.defaultPositions=Pg.generatePositions();const Ig=Pg;function Mg(e){return Ri(e)?e:Gi(e)?e.commonAncestorContainer:"function"==typeof e?Mg(e()):null}var Og=n(6103),Vg={attributes:{"data-cke":!0}};Vg.setAttributes=Wn(),Vg.insert=Un().bind(null,"head"),Vg.domAPI=Fn(),Vg.insertStyleElement=qn(),Ln()(Og.A,Vg),Og.A&&Og.A.locals&&Og.A.locals;class Ng extends Ig{constructor(e){super(e);const t=this.bindTemplate;this.set({isVisible:!1,position:"se",class:null,top:0,left:0}),this.extendTemplate({tag:"div",attributes:{class:["ck-reset","ck-dropdown-menu__nested-menu__panel"],tabindex:"-1"},on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(e=1){const{content:t}=this;t.length&&(1===e?t.first.focus():t.last.focus())}}var Rg=n(4749),Bg={attributes:{"data-cke":!0}};Bg.setAttributes=Wn(),Bg.insert=Un().bind(null,"head"),Bg.domAPI=Fn(),Bg.insertStyleElement=qn(),Ln()(Rg.A,Bg),Rg.A&&Rg.A.locals&&Rg.A.locals;class Dg extends Kn{constructor(e,t,i,o,n){super(e),this._bodyCollection=t,this.id=i,this.set({isOpen:!1,isEnabled:!0,panelPosition:"w",class:void 0,parentMenuView:null}),this.keystrokes=new rn,this.focusTracker=new en,this.buttonView=new mg(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.buttonView.label=o,this.panelView=new Ng(e),this.panelView.isVisible=!0,this.listView=new wg(e),this.listView.bind("ariaLabel").to(this.buttonView,"label"),this.panelView.content.add(this.listView);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown-menu-list__nested-menu",r.to("class"),r.if("isEnabled","ck-disabled",(e=>!e))],role:"presentation"},children:[this.buttonView]}),this.parentMenuView=n,this.parentMenuView&&this._handleParentMenuView(),this._attachBehaviors()}get _panelPositions(){const{westSouth:e,eastSouth:t,westNorth:i,eastNorth:o}=vg;return"ltr"===this.locale.uiLanguageDirection?[t,o,e,i]:[e,i,t,o]}render(){super.render(),this.panelView.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.focusTracker.add(this.listView),this.keystrokes.listenTo(this.element),this._mountPanelOnOpen()}destroy(){this._removePanelFromBody(),this.panelView.destroy(),super.destroy()}focus(){this.buttonView.focus()}_handleParentMenuView(){this.delegate(...Dg.DELEGATED_EVENTS).to(this.parentMenuView),Ag.closeOnParentClose(this,this.parentMenuView)}_attachBehaviors(){Ag.openOnButtonClick(this),Ag.openAndFocusOnEnterKeyPress(this),Ag.openOnArrowRightKey(this),Ag.closeOnEscKey(this),Ag.closeOnArrowLeftKey(this)}_mountPanelOnOpen(){const{panelView:e}=this;this.on("change:isOpen",((t,i,o)=>{t.source===this&&(o||!this._bodyCollection.has(e)?o&&!this._bodyCollection.has(e)&&this._addPanelToBody():this._removePanelFromBody())}))}_removePanelFromBody(){const{panelView:e,keystrokes:t}=this;this._bodyCollection.has(e)&&(this._bodyCollection.remove(e),t.stopListening(e.element))}_addPanelToBody(){const{panelView:e,buttonView:i,keystrokes:o}=this;this._bodyCollection.has(e)||(this._bodyCollection.add(e),o.listenTo(e.element),e.pin({positions:this._panelPositions,limiter:t.document.body,element:e.element,target:i.element,fitInViewport:!0}))}}Dg.DELEGATED_EVENTS=["mouseenter","execute","change:isOpen"];class Lg extends Kn{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class zg extends Kn{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Fg(e){if(Array.isArray(e))return{items:e,removeItems:[]};const t={items:[],removeItems:[]};return e?{...t,...e}:t}var jg=n(6808),Ug={attributes:{"data-cke":!0}};Ug.setAttributes=Wn(),Ug.insert=Un().bind(null,"head"),Ug.domAPI=Fn(),Ug.insertStyleElement=qn(),Ln()(jg.A,Ug),jg.A&&jg.A.locals&&jg.A.locals;const Hg=(()=>({alignLeft:kh,bold:ph,importExport:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M19 4.5 14 0H3v12.673l.868-1.041c.185-.222.4-.402.632-.54V1.5h8v5h5v7.626a2.24 2.24 0 0 1 1.5.822V4.5ZM14 5V2l3.3 3H14Zm-3.692 12.5c.062.105.133.206.213.303L11.52 19H8v-.876a2.243 2.243 0 0 0 1.82-.624h.488Zm7.518-.657a.75.75 0 0 0-1.152-.96L15.5 17.29V12H14v5.29l-1.174-1.408a.75.75 0 0 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0l2.346-2.815Zm-15.056-.38a.75.75 0 0 1-.096-1.056l2.346-2.815a.95.95 0 0 1 1.46 0l2.346 2.815a.75.75 0 1 1-1.152.96L6.5 14.96V20H5v-5.04l-1.174 1.408a.75.75 0 0 1-1.056.096Z"/></svg>',paragraph:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5zM5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"/></svg>',plus:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2a1 1 0 0 0-1 1v6H3a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2h-6V3a1 1 0 0 0-1-1Z"/></svg>',text:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.816 11.5 7.038 4.785 4.261 11.5h5.555Zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13Z"/><path d="m12.09 17-.534-1.292.848-1.971.545 1.319L12.113 17h-.023Zm1.142-5.187.545 1.319L15.5 9.13l1.858 4.316h-3.45l.398.965h3.467L18.887 17H20l-3.873-9h-1.254l-1.641 3.813Z"/></svg>',threeVerticalDots:Ch,pilcrow:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z"/></svg>',dragIndicator:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5 3.25a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"/><path d="M12 3.25a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"/><path d="M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"/><path d="M12 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"/><path d="M5 16.75a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"/><path d="M12 16.75a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"/></svg>'}))();class Wg extends Kn{constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.items=this.createCollection(),this.focusTracker=new en,this.keystrokes=new rn,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new $g(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const n="rtl"===e.uiLanguageDirection;this._focusCycler=new Uh({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];var s;this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(s=this,s.bindTemplate.to((e=>{e.target===s.element&&e.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new Zg(this):new qg(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",((e,t)=>{this.focusTracker.add(t)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t)})),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,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}_buildItemsFromConfig(e,t,i){const o=Fg(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map((e=>F(e)?this._createNestedToolbarDropdown(e,t,n):"|"===e?new Lg:"-"===e?new zg:t.create(e))).filter((e=>!!e))}_cleanItemsConfiguration(e,t,i){const o=e.filter(((e,o,n)=>"|"===e||-1===i.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||(C("toolbarview-line-break-ignored-when-grouping-items",n),!1):!(!F(e)&&!t.has(e)&&(C("toolbarview-item-unavailable",{item:e}),1)))));return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){const t=e=>"-"!==e&&"|"!==e,i=e.length,o=e.findIndex(t);if(-1===o)return[];const n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter(((e,i,o)=>!!t(e)||!(i>0&&o[i-1]===e)))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:r,tooltip:s=!0,withText:a=!1}=e;if(r=this._cleanItemsConfiguration(r,t,i),!r.length)return null;const l=tp(this.locale);return o||C("toolbarview-nested-toolbar-dropdown-missing-label",e),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:o,tooltip:s,withText:!!a}),!1!==n?l.buttonView.icon=Hg[n]||n||Ch:l.buttonView.withText=!0,ip(l,(()=>l.toolbarView._buildItemsFromConfig(r,t,i))),l}}class $g extends Kn{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class qg{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=>Wh(e)?e:null)),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Zg{constructor(e){this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,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(),e.itemsView.children.bindTo(this.ungroupedItems).using((e=>e)),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",((e,t)=>{const i=t.index,o=Array.from(t.added);for(const e of t.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=i;e<i+o.length;e++){const t=o[e-i];e>this.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(!co(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,i=this.viewLocale.uiLanguageDirection,o=new Qi(e.lastChild),n=new Qi(e);if(!this.cachedPadding){const o=t.window.getComputedStyle(e),n="ltr"===i?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(o[n])}return"ltr"===i?o.right>n.right-this.cachedPadding:o.left<n.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new oo(this.viewElement,(t=>{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 Lg),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,i=tp(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",ip(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:Ch}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((e=>{Wh(e)&&this.viewFocusables.add(e)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var Gg=n(4515),Kg={attributes:{"data-cke":!0}};Kg.setAttributes=Wn(),Kg.insert=Un().bind(null,"head"),Kg.domAPI=Fn(),Kg.insertStyleElement=qn(),Ln()(Gg.A,Kg),Gg.A&&Gg.A.locals&&Gg.A.locals;class Yg extends Kn{constructor(e,t){super(e);const i=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(t),this.arrowView=this._createArrowView(),this.keystrokes=new rn,this.focusTracker=new en,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.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(e){const t=e||new Dh;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new Dh,t=e.bindTemplate;return e.icon=Sm,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}}var Qg=n(4245),Jg={attributes:{"data-cke":!0}};Jg.setAttributes=Wn(),Jg.insert=Un().bind(null,"head"),Jg.domAPI=Fn(),Jg.insertStyleElement=qn(),Ln()(Qg.A,Jg),Qg.A&&Qg.A.locals&&Qg.A.locals;var Xg=n(8424),ep={attributes:{"data-cke":!0}};function tp(e,i=lg){const o="function"==typeof i?new i(e):i,n=new og(e),r=new ag(e,o,n);return o.bind("isEnabled").to(r),o instanceof Yg?o.arrowView.bind("isOn").to(r,"isOpen"):o.bind("isOn").to(r,"isOpen"),function(e){(function(e){Yn({emitter:e,activator:()=>e.isRendered&&e.isOpen,callback:()=>{e.isOpen=!1},contextElements:()=>[e.element,...ap(e.focusTracker).filter((t=>!e.element.contains(t)))]})})(e),function(e){e.on("execute",(t=>{t.source instanceof xm||(e.isOpen=!1)}))}(e),function(e){e.focusTracker.on("change:isFocused",((t,i,o)=>{!o&&e.isOpen&&(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",((t,i)=>{e.isOpen&&(e.panelView.focus(),i())})),e.keystrokes.set("arrowup",((t,i)=>{e.isOpen&&(e.panelView.focusLast(),i())}))}(e),function(e){e.on("change:isOpen",((i,o,n)=>{n||e.focusTracker.elements.some((e=>e.contains(t.document.activeElement)))&&e.buttonView.focus()}))}(e),function(e){e.on("change:isOpen",((t,i,o)=>{o&&e.panelView.focus()}),{priority:"low"})}(e)}(r),r}function ip(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?op(e,t,i):e.once("change:isOpen",(()=>op(e,t,i)),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&sp(e,(()=>e.toolbarView.items.find((e=>e.isOn))))}function op(e,t,i){const o=e.locale,n=o.t,r=e.toolbarView=new Wg(o),s="function"==typeof t?t():t;r.ariaLabel=i.ariaLabel||n("Dropdown toolbar"),i.maxWidth&&(r.maxWidth=i.maxWidth),i.class&&(r.class=i.class),i.isCompact&&(r.isCompact=i.isCompact),i.isVertical&&(r.isVertical=!0),s instanceof pn?r.items.bindTo(s).using((e=>e)):r.items.addMany(s),e.panelView.children.add(r),e.focusTracker.add(r),r.items.delegate("execute").to(e)}function np(e,t,i={}){e.isOpen?rp(e,t,i):e.once("change:isOpen",(()=>rp(e,t,i)),{priority:"highest"}),sp(e,(()=>e.listView.items.find((e=>e instanceof gg&&e.children.first.isOn))))}function rp(e,t,i){const o=e.locale,n=e.listView=new _g(o),r="function"==typeof t?t():t;n.ariaLabel=i.ariaLabel,n.role=i.role,lp(e,n.items,r,o),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function sp(e,t){e.on("change:isOpen",(()=>{if(!e.isOpen)return;const i=t();i&&("function"==typeof i.focus?i.focus():C("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))}),{priority:y.low-10})}function ap(e){return[...e.elements,...e.externalViews.flatMap((e=>ap(e.focusTracker)))]}function lp(e,t,i,o){t.on("change",(()=>{const e=[...t].reduce(((e,t)=>(t instanceof gg&&t.children.first instanceof sm&&e.push(t.children.first),e)),[]),i=e.some((e=>e.isToggleable));e.forEach((e=>{e.hasCheckSpace=i}))})),t.bindTo(i).using((t=>{if("separator"===t.type)return new pg(o);if("group"===t.type){const i=new fg(o);return i.set({label:t.label}),lp(e,i.items,t.items,o),i.items.delegate("execute").to(e),i}if("button"===t.type||"switchbutton"===t.type){const e="menuitemcheckbox"===t.model.role||"menuitemradio"===t.model.role,i=new gg(o);let n;return"button"===t.type?(n=new sm(o),n.set({isToggleable:e})):n=new xm(o),n.bind(...Object.keys(t.model)).to(t.model),n.delegate("execute").to(i),i.children.add(n),i}return null}))}ep.setAttributes=Wn(),ep.insert=Un().bind(null,"head"),ep.domAPI=Fn(),ep.insertStyleElement=qn(),Ln()(Xg.A,ep),Xg.A&&Xg.A.locals&&Xg.A.locals;const cp=(e,t,i)=>{const o=new Xm(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),o.bind("hasError").to(e,"errorText",(e=>!!e)),o.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(o),o},dp=(e,t,i)=>{const o=new eg(e.locale);return o.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),o.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),o.bind("hasError").to(e,"errorText",(e=>!!e)),o.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(o),o},up=(e,t,i)=>{const o=tp(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isEnabled").to(e),o},hp=(e,t=0,i=1)=>e>i?i:e<t?t:e,mp=(e,t=0,i=Math.pow(10,t))=>Math.round(i*e)/i,gp=(Math.PI,e=>("#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?mp(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?mp(parseInt(e.substring(6,8),16)/255,2):1})),pp=e=>{const{h:t,s:i,l:o}=(({h:e,s:t,v:i,a:o})=>{const n=(200-t)*i/100;return{h:mp(e),s:mp(n>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0),l:mp(n/2),a:mp(o,2)}})(e);return`hsl(${t}, ${i}%, ${o}%)`},fp=e=>{const t=e.toString(16);return t.length<2?"0"+t:t},bp=(e,t)=>{if(e===t)return!0;for(const i in e)if(e[i]!==t[i])return!1;return!0},kp={},_p=e=>{let t=kp[e];return t||(t=document.createElement("template"),t.innerHTML=e,kp[e]=t),t},wp=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))};let vp=!1;const yp=e=>"touches"in e,xp=(e,t)=>{const i=yp(t)?t.touches[0]:t,o=e.el.getBoundingClientRect();wp(e.el,"move",e.getMove({x:hp((i.pageX-(o.left+window.pageXOffset))/o.width),y:hp((i.pageY-(o.top+window.pageYOffset))/o.height)}))};class Ap{constructor(e,t,i,o){const n=_p(`<div role="slider" tabindex="0" part="${t}" ${i}><div part="${t}-pointer"></div></div>`);e.appendChild(n.content.cloneNode(!0));const r=e.querySelector(`[part=${t}]`);r.addEventListener("mousedown",this),r.addEventListener("touchstart",this),r.addEventListener("keydown",this),this.el=r,this.xy=o,this.nodes=[r.firstChild,r]}set dragging(e){const t=e?document.addEventListener:document.removeEventListener;t(vp?"touchmove":"mousemove",this),t(vp?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!(e=>!(vp&&!yp(e)||(vp||(vp=yp(e)),0)))(e)||!vp&&0!=e.button)return;this.el.focus(),xp(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),xp(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":((e,t)=>{const i=t.keyCode;i>40||e.xy&&i<37||i<33||(t.preventDefault(),wp(e.el,"move",e.getMove({x:39===i?.01:37===i?-.01:34===i?.05:33===i?-.05:35===i?1:36===i?-1:0,y:40===i?.01:38===i?-.01:0},!0)))})(this,e)}}style(e){e.forEach(((e,t)=>{for(const i in e)this.nodes[t].style.setProperty(i,e[i])}))}}class Cp extends Ap{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:e/360*100+"%",color:pp({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${mp(e)}`)}getMove(e,t){return{h:t?hp(this.h+360*e.x,0,360):360*e.x}}}class Tp extends Ap{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:100-e.v+"%",left:`${e.s}%`,color:pp(e)},{"background-color":pp({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${mp(e.s)}%, Brightness ${mp(e.v)}%`)}getMove(e,t){return{s:t?hp(this.hsva.s+100*e.x,0,100):100*e.x,v:t?hp(this.hsva.v-100*e.y,0,100):Math.round(100-100*e.y)}}}const Ep=Symbol("same"),Sp=Symbol("color"),Pp=Symbol("hsva"),Ip=Symbol("update"),Mp=Symbol("parts"),Op=Symbol("css"),Vp=Symbol("sliders");class Np extends HTMLElement{static get observedAttributes(){return["color"]}get[Op](){return[':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',"[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}","[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]}get[Vp](){return[Tp,Cp]}get color(){return this[Sp]}set color(e){if(!this[Ep](e)){const t=this.colorModel.toHsva(e);this[Ip](t),this[Sp]=e}}constructor(){super();const e=_p(`<style>${this[Op].join("")}</style>`),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[Mp]=this[Vp].map((e=>new e(t)))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,i){const o=this.colorModel.fromAttr(i);this[Ep](o)||(this.color=o)}handleEvent(e){const t=this[Pp],i={...t,...e.detail};let o;this[Ip](i),bp(i,t)||this[Ep](o=this.colorModel.fromHsva(i))||(this[Sp]=o,wp(this,"color-changed",{value:o}))}[Ep](e){return this.color&&this.colorModel.equal(e,this.color)}[Ip](e){this[Pp]=e,this[Mp].forEach((t=>t.update(e)))}}const Rp={defaultColor:"#000",toHsva:e=>(({r:e,g:t,b:i,a:o})=>{const n=Math.max(e,t,i),r=n-Math.min(e,t,i),s=r?n===e?(t-i)/r:n===t?2+(i-e)/r:4+(e-t)/r:0;return{h:mp(60*(s<0?s+6:s)),s:mp(n?r/n*100:0),v:mp(n/255*100),a:o}})(gp(e)),fromHsva:({h:e,s:t,v:i})=>(({r:e,g:t,b:i,a:o})=>{const n=o<1?fp(mp(255*o)):"";return"#"+fp(e)+fp(t)+fp(i)+n})((({h:e,s:t,v:i,a:o})=>{e=e/360*6,t/=100,i/=100;const n=Math.floor(e),r=i*(1-t),s=i*(1-(e-n)*t),a=i*(1-(1-e+n)*t),l=n%6;return{r:mp(255*[i,s,r,r,a,i][l]),g:mp(255*[a,i,i,s,r,r][l]),b:mp(255*[r,r,a,i,i,s][l]),a:mp(o,2)}})({h:e,s:t,v:i,a:1})),equal:(e,t)=>e.toLowerCase()===t.toLowerCase()||bp(gp(e),gp(t)),fromAttr:e=>e};class Bp extends Np{get colorModel(){return Rp}}var Dp=n(3900),Lp={attributes:{"data-cke":!0}};Lp.setAttributes=Wn(),Lp.insert=Un().bind(null,"head"),Lp.domAPI=Fn(),Lp.insertStyleElement=qn(),Ln()(Dp.A,Lp),Dp.A&&Dp.A.locals&&Dp.A.locals;class zp extends Kn{constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=Na((e=>{this.set("color",e),this.fire("colorSelected",{color:this.color})}),150,{leading:!0}),this.on("set:color",((e,t,i)=>{e.return=Wm(i,this._config.format||"hsl")})),this.on("change:color",(()=>{this._hexColor=Fp(this.color)})),this.on("change:_hexColor",(()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),Fp(this.color)!=Fp(this._hexColor)&&(this.color=this._hexColor)}))}render(){var e,i;if(super.render(),e="hex-color-picker",i=Bp,void 0===customElements.get(e)&&customElements.define(e,i),this.picker=t.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",(e=>{const t=e.detail.value;this._debounceColorPickerEvent(t)}))}focus(){!this._config.hideInput&&(s.isGecko||s.isiOS||s.isSafari||s.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){const e=[...this.picker.shadowRoot.children].filter((e=>"slider"===e.getAttribute("role"))).map((e=>new jp(e)));this.slidersView=this.createCollection(),e.forEach((e=>{this.slidersView.add(e)}))}_createInputRow(){const e=this._createColorInput();return new Hp(this.locale,e)}_createColorInput(){const e=new Gm(this.locale,cp),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",(t=>e.isFocused?e.fieldView.value:t.startsWith("#")?t.substring(1):t)),e.fieldView.on("input",(()=>{const t=e.fieldView.element.value;if(t){const e=Wp(t);e&&this._debounceColorPickerEvent(e)}})),e}isValid(){const{t:e}=this.locale;return!!this._config.hideInput||(this.resetValidationStatus(),!!this.hexInputRow.getParsedColor()||(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function Fp(e){let t=function(e){if(!e)return"";const t=$m(e);return t?"hex"===t.space?t.hexValue:Wm(e,"hex"):"#000"}(e);return t||(t="#000"),4===t.length&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}class jp extends Kn{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class Up extends Kn{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class Hp extends Kn{constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new Up,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return Wp(this.inputView.fieldView.element.value)}}function Wp(e){if(!e)return null;const t=e.trim().replace(/^#/,"");return[3,4,6,8].includes(t.length)&&/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?`#${t}`:null}class $p extends(Z(Jo)){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",(()=>{this.set("isEmpty",0===this.length)}))}add(e,t){return this.find((t=>t.color===e.color))?this:super.add(e,t)}hasColor(e){return!!this.find((t=>t.color===e))}}class qp extends Kn{constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:s,focusTracker:a,focusables:l}){super(e);const c=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new $p,this.documentColorsCount=r,this._focusables=l,this._removeButtonLabel=o,this._colorPickerLabel=s,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",c.if("isVisible","ck-hidden",(e=>!e))]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){const i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRoots()){const i=e.createRangeIn(n);for(const e of i.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=fn.bind(this.documentColors,this.documentColors),t=new Kn(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new Dh,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.209 18.717A8.5 8.5 0 1 1 18.686 9.6h-.008l.002.12a3 3 0 0 1-2.866 2.997h-.268l-.046-.002v.002h-4.791a2 2 0 1 0 0 4 1 1 0 1 1-.128 1.992 8.665 8.665 0 0 1-.372.008Zm-3.918-7.01a1.25 1.25 0 1 0-2.415-.648 1.25 1.25 0 0 0 2.415.647ZM5.723 8.18a1.25 1.25 0 1 0 .647-2.414 1.25 1.25 0 0 0-.647 2.414ZM9.76 6.155a1.25 1.25 0 1 0 .647-2.415 1.25 1.25 0 0 0-.647 2.415Zm4.028 1.759a1.25 1.25 0 1 0 .647-2.415 1.25 1.25 0 0 0-.647 2.415Z"/></svg>',class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",(()=>{this.fire("colorPicker:show")}))}_createRemoveColorButton(){const e=new Dh;return e.set({withText:!0,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>',label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",(()=>{this.fire("execute",{value:null,source:"removeColorButton"})})),e.render(),e}_createStaticColorsGrid(){const e=new Lm(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",((e,t)=>{this.fire("execute",{value:t.value,source:"staticColorsGrid"})})),e}_createDocumentColorsGrid(){const e=fn.bind(this.documentColors,this.documentColors),t=new Lm(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using((e=>{const t=new Rm;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",(()=>{this.fire("execute",{value:e.color,source:"documentColorsGrid"})})),t})),this.documentColors.on("change:isEmpty",((e,i,o)=>{o&&(t.selectedColor=null)})),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find((t=>t.color===e));t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class Zp extends Kn{constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;const r=this.bindTemplate,{saveButtonView:s,cancelButtonView:a}=this._createActionButtons();this.saveButtonView=s,this.cancelButtonView=a,this.actionBarView=this._createActionBarView({saveButtonView:s,cancelButtonView:a}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",r.if("isVisible","ck-hidden",(e=>!e))]},children:this.items})}render(){super.render();const e=new zp(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",((t,i,o)=>{e.color=o})),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",(e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())}))}_stopPropagationOnArrowsKeys(){const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(const e of this.colorPickerView.slidersView)this.focusTracker.add(e.element),this._focusables.add(e);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){const i=new Kn,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){const e=this.locale,t=e.t,i=new Dh(e),o=new Dh(e);return i.set({icon:bh,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:fh,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",(()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})})),o.on("execute",(()=>{this.fire("colorPicker:cancel")})),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",((e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)}))}}var Gp=n(9576),Kp={attributes:{"data-cke":!0}};Kp.setAttributes=Wn(),Kp.insert=Un().bind(null,"head"),Kp.domAPI=Fn(),Kp.insertStyleElement=qn(),Ln()(Gp.A,Kp),Gp.A&&Gp.A.locals&&Gp.A.locals;class Yp extends Kn{constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:s,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new en,this.keystrokes=new rn,this._focusables=new pn,this._colorPickerViewConfig=a,this._focusCycler=new Uh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new qp(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:s,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new Zp(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",((e,t,i)=>{this.colorGridsFragmentView.set("selectedColor",i),this.colorPickerFragmentView.set("selectedColor",i)})),this.colorGridsFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.colorPickerFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){this.colorPickerFragmentView.colorPickerView&&!this._isColorPickerFragmentVisible&&(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){2!==this.items.length&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",(()=>{this.showColorPickerFragment()})),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class Qp{constructor(e){this._components=new Map,this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(Jp(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new A("componentfactory-item-missing",this,{name:e});return this._components.get(Jp(e)).callback(this.editor.locale)}has(e){return this._components.has(Jp(e))}}function Jp(e){return String(e).toLowerCase()}var Xp=n(2424),ef={attributes:{"data-cke":!0}};ef.setAttributes=Wn(),ef.insert=Un().bind(null,"head"),ef.domAPI=Fn(),ef.insertStyleElement=qn(),Ln()(Xp.A,ef),Xp.A&&Xp.A.locals&&Xp.A.locals;const tf="ck-tooltip";class of extends(Ui()){constructor(e){if(super(),this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._mutationObserver=null,of._editors.add(e),of._instance)return of._instance;of._instance=this,this.tooltipTextView=new Kn(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 Ig(e.locale),this.balloonPanelView.class=tf,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(e){const t=new MutationObserver((()=>{e()}));return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}((()=>{this._updateTooltipPosition()})),this._pinTooltipDebounced=Na(this._pinTooltip,600),this._unpinTooltipDebounced=Na(this._unpinTooltip,400),this.listenTo(t.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(t.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(t.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(t.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(t.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(t.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;of._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),of._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),of._instance=null)}static getPositioningFunctions(e){const t=of.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]}_onKeyDown(e,t){"Escape"===t.key&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=rf(t);i?i!==this._currentElementWithTooltip?(this._unpinTooltip(),"focus"===e.name&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,sf(i)):this._pinTooltipDebounced(i,sf(i))):this._unpinTooltipDebounced.cancel():"focus"===e.name&&this._unpinTooltip()}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if("mouseleave"===e.name){if(!Ri(t))return;const e=this.balloonPanelView.element,o=e&&(e===i||e.contains(i)),n=!o&&t===e;if(o)return void this._unpinTooltipDebounced.cancel();if(!n&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const r=rf(t),s=rf(i);(n||r&&r!==s)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||r&&r.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:o}){this._unpinTooltip();const n=Xo(of._editors.values()).ui.view.body;n.has(this.balloonPanelView)||n.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[tf,o].filter((e=>e)).join(" "),this.balloonPanelView.pin({target:e,positions:of.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const e of of._editors)this.listenTo(e.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of of._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=sf(this._currentElementWithTooltip);co(this._currentElementWithTooltip)&&e.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:of.getPositioningFunctions(e.position)}):this._unpinTooltip()}}of.defaultBalloonPositions=Ig.generatePositions({heightOffset:5,sideOffset:13}),of._editors=new Set,of._instance=null;const nf=of;function rf(e){return Ri(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function sf(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}class af extends(Ui()){constructor(e,t={}){super(),this._balloonView=null,this._showBalloonThrottled=Zu((()=>this._showBalloon()),50,{leading:!0}),this._lastFocusedEditableElement=null,this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",(()=>this._handleEditorReady()))}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",((e,t,i)=>{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()})),e.ui.focusTracker.on("change:focusedElement",((e,t,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()})),e.ui.on("update",(()=>{this._showBalloonThrottled()})))}_getNormalizedConfig(){return{side:"ltr"===this.editor.locale.contentLanguageDirection?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,t=new Ig,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),t="right"===e.side?lf(this._lastFocusedEditableElement,i=e,((e,t)=>e.left+e.width-t.width-i.horizontalOffset)):function(e,t){return lf(e,t,(e=>e.left+t.horizontalOffset))}(this._lastFocusedEditableElement,e);var i;return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i)return void(this._lastFocusedEditableElement=null);const o=Array.from(e.ui.getEditableElementsNames()).map((t=>e.ui.getEditableElement(t)));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}}function lf(e,t,i){return(o,n)=>{const r=new Qi(e);if(r.width<350||r.height<50)return null;let s;s="inside"===t.position?r.bottom-n.height:r.bottom-n.height/2,s-=t.verticalOffset;const a=i(r,n),l=o.clone().moveTo(a,s).getIntersection(n.clone().moveTo(a,s)).getVisible();return!l||l.getArea()<n.getArea()?null:{top:s,left:a,name:`position_${t.position}-side_${t.side}`,config:{withArrow:!1}}}}class cf extends af{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){const e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;const t=e.config.get("licenseKey");if("GPL"==t)return!0;const i=cn(t.split(".")[1]);return!i||!i.whiteLabel}_createBadgeContent(){return new df(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o="inside"===i?5:e.verticalOffset;return{position:i,side:t.side||e.side,label:void 0===t.label?"Powered by":t.label,verticalOffset:void 0!==t.verticalOffset?t.verticalOffset:o,horizontalOffset:void 0!==t.horizontalOffset?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}}class df extends Kn{constructor(e,t){super(e);const i=new Vh,o=this.bindTemplate;i.set({content:'<svg xmlns="http://www.w3.org/2000/svg" width="53" height="10" viewBox="0 0 53 10"><path fill="#1C2331" d="M31.724 1.492a15.139 15.139 0 0 0 .045 1.16 2.434 2.434 0 0 0-.687-.34 3.68 3.68 0 0 0-1.103-.166 2.332 2.332 0 0 0-1.14.255 1.549 1.549 0 0 0-.686.87c-.15.41-.225.98-.225 1.712 0 .939.148 1.659.444 2.161.297.503.792.754 1.487.754.452.015.9-.094 1.294-.316.296-.174.557-.4.771-.669l.14.852h1.282V.007h-1.623v1.485ZM31 6.496a1.77 1.77 0 0 1-.494.061.964.964 0 0 1-.521-.127.758.758 0 0 1-.296-.466 3.984 3.984 0 0 1-.093-.992 4.208 4.208 0 0 1 .098-1.052.753.753 0 0 1 .307-.477 1.08 1.08 0 0 1 .55-.122c.233-.004.466.026.69.089l.483.144v2.553c-.11.076-.213.143-.307.2a1.73 1.73 0 0 1-.417.189ZM35.68 0l-.702.004c-.322.002-.482.168-.48.497l.004.581c.002.33.164.493.486.49l.702-.004c.322-.002.481-.167.48-.496L36.165.49c-.002-.33-.164-.493-.486-.491ZM36.145 2.313l-1.612.01.034 5.482 1.613-.01-.035-5.482ZM39.623.79 37.989.8 38 2.306l-.946.056.006 1.009.949-.006.024 2.983c.003.476.143.844.419 1.106.275.26.658.39 1.148.387.132 0 .293-.01.483-.03.19-.02.38-.046.57-.08.163-.028.324-.068.482-.119l-.183-1.095-.702.004a.664.664 0 0 1-.456-.123.553.553 0 0 1-.14-.422l-.016-2.621 1.513-.01-.006-1.064-1.514.01-.01-1.503ZM46.226 2.388c-.41-.184-.956-.274-1.636-.27-.673.004-1.215.101-1.627.29-.402.179-.72.505-.888.91-.18.419-.268.979-.264 1.68.004.688.1 1.24.285 1.655.172.404.495.724.9.894.414.18.957.268 1.63.264.68-.004 1.224-.099 1.632-.284.4-.176.714-.501.878-.905.176-.418.263-.971.258-1.658-.004-.702-.097-1.261-.28-1.677a1.696 1.696 0 0 0-.888-.9Zm-.613 3.607a.77.77 0 0 1-.337.501 1.649 1.649 0 0 1-1.317.009.776.776 0 0 1-.343-.497 4.066 4.066 0 0 1-.105-1.02 4.136 4.136 0 0 1 .092-1.03.786.786 0 0 1 .337-.507 1.59 1.59 0 0 1 1.316-.008.79.79 0 0 1 .344.502c.078.337.113.683.105 1.03.012.343-.019.685-.092 1.02ZM52.114 2.07a2.67 2.67 0 0 0-1.128.278c-.39.191-.752.437-1.072.73l-.157-.846-1.273.008.036 5.572 1.623-.01-.024-3.78c.35-.124.646-.22.887-.286.26-.075.53-.114.8-.118l.45-.003.144-1.546-.286.001ZM22.083 7.426l-1.576-2.532a2.137 2.137 0 0 0-.172-.253 1.95 1.95 0 0 0-.304-.29.138.138 0 0 1 .042-.04 1.7 1.7 0 0 0 .328-.374l1.75-2.71c.01-.015.025-.028.024-.048-.01-.01-.021-.007-.031-.007L20.49 1.17a.078.078 0 0 0-.075.045l-.868 1.384c-.23.366-.46.732-.688 1.099a.108.108 0 0 1-.112.06c-.098-.005-.196-.001-.294-.002-.018 0-.038.006-.055-.007.002-.02.002-.039.005-.058a4.6 4.6 0 0 0 .046-.701V1.203c0-.02-.009-.032-.03-.03h-.033L16.93 1.17c-.084 0-.073-.01-.073.076v6.491c-.001.018.006.028.025.027h1.494c.083 0 .072.007.072-.071v-2.19c0-.055-.003-.11-.004-.166a3.366 3.366 0 0 0-.05-.417h.06c.104 0 .209.002.313-.002a.082.082 0 0 1 .084.05c.535.913 1.07 1.824 1.607 2.736a.104.104 0 0 0 .103.062c.554-.003 1.107-.002 1.66-.002l.069-.003-.019-.032-.188-.304ZM27.112 6.555c-.005-.08-.004-.08-.082-.08h-2.414c-.053 0-.106-.003-.159-.011a.279.279 0 0 1-.246-.209.558.558 0 0 1-.022-.15c0-.382 0-.762-.002-1.143 0-.032.007-.049.042-.044h2.504c.029.003.037-.012.034-.038V3.814c0-.089.013-.078-.076-.078h-2.44c-.07 0-.062.003-.062-.06v-.837c0-.047.004-.093.013-.14a.283.283 0 0 1 .241-.246.717.717 0 0 1 .146-.011h2.484c.024.002.035-.009.036-.033l.003-.038.03-.496c.01-.183.024-.365.034-.548.005-.085.003-.087-.082-.094-.218-.018-.437-.038-.655-.05a17.845 17.845 0 0 0-.657-.026 72.994 72.994 0 0 0-1.756-.016 1.7 1.7 0 0 0-.471.064 1.286 1.286 0 0 0-.817.655c-.099.196-.149.413-.145.633v3.875c0 .072.003.144.011.216a1.27 1.27 0 0 0 .711 1.029c.228.113.48.167.734.158.757-.005 1.515.002 2.272-.042.274-.016.548-.034.82-.053.03-.002.043-.008.04-.041-.008-.104-.012-.208-.019-.312a69.964 69.964 0 0 1-.05-.768ZM16.14 7.415l-.127-1.075c-.004-.03-.014-.04-.044-.037a13.125 13.125 0 0 1-.998.073c-.336.01-.672.02-1.008.016-.116-.001-.233-.014-.347-.039a.746.746 0 0 1-.45-.262c-.075-.1-.132-.211-.167-.33a3.324 3.324 0 0 1-.126-.773 9.113 9.113 0 0 1-.015-.749c0-.285.022-.57.065-.852.023-.158.066-.312.127-.46a.728.728 0 0 1 .518-.443 1.64 1.64 0 0 1 .397-.048c.628-.001 1.255.003 1.882.05.022.001.033-.006.036-.026l.003-.031.06-.55c.019-.177.036-.355.057-.532.004-.034-.005-.046-.04-.056a5.595 5.595 0 0 0-1.213-.21 10.783 10.783 0 0 0-.708-.02c-.24-.003-.48.01-.719.041a3.477 3.477 0 0 0-.625.14 1.912 1.912 0 0 0-.807.497c-.185.2-.33.433-.424.688a4.311 4.311 0 0 0-.24 1.096c-.031.286-.045.572-.042.86-.006.43.024.86.091 1.286.04.25.104.497.193.734.098.279.26.53.473.734.214.205.473.358.756.446.344.11.702.17 1.063.177a8.505 8.505 0 0 0 1.578-.083 6.11 6.11 0 0 0 .766-.18c.03-.008.047-.023.037-.057a.157.157 0 0 1-.003-.025Z"/><path fill="#AFE229" d="M6.016 6.69a1.592 1.592 0 0 0-.614.21c-.23.132-.422.32-.56.546-.044.072-.287.539-.287.539l-.836 1.528.009.006c.038.025.08.046.123.063.127.046.26.07.395.073.505.023 1.011-.007 1.517-.003.29.009.58.002.869-.022a.886.886 0 0 0 .395-.116.962.962 0 0 0 .312-.286c.056-.083.114-.163.164-.249.24-.408.48-.816.718-1.226.075-.128.148-.257.222-.386l.112-.192a1.07 1.07 0 0 0 .153-.518l-1.304.023s-1.258-.005-1.388.01Z"/><path fill="#771BFF" d="m2.848 9.044.76-1.39.184-.352c-.124-.067-.245-.14-.367-.21-.346-.204-.706-.384-1.045-.6a.984.984 0 0 1-.244-.207c-.108-.134-.136-.294-.144-.46-.021-.409-.002-.818-.009-1.227-.003-.195 0-.39.003-.585.004-.322.153-.553.427-.713l.833-.488c.22-.13.44-.257.662-.385.05-.029.105-.052.158-.077.272-.128.519-.047.76.085l.044.028c.123.06.242.125.358.196.318.178.635.357.952.537.095.056.187.117.275.184.194.144.254.35.266.578.016.284.007.569.006.853-.001.28.004.558 0 .838.592-.003 1.259 0 1.259 0l.723-.013c-.003-.292-.007-.584-.007-.876 0-.524.015-1.048-.016-1.571-.024-.42-.135-.8-.492-1.067a5.02 5.02 0 0 0-.506-.339A400.52 400.52 0 0 0 5.94.787C5.722.664 5.513.524 5.282.423 5.255.406 5.228.388 5.2.373 4.758.126 4.305-.026 3.807.21c-.097.046-.197.087-.29.14A699.896 699.896 0 0 0 .783 1.948c-.501.294-.773.717-.778 1.31-.004.36-.009.718-.001 1.077.016.754-.017 1.508.024 2.261.016.304.07.6.269.848.127.15.279.28.448.382.622.4 1.283.734 1.92 1.11l.183.109Z"/></svg>\n',isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:o.to((e=>e.preventDefault()))}}]})}}class uf extends af{constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"}),this.licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"}}_isEnabled(){const e=mf(this.editor.config.get("licenseKey"));return Boolean(e&&this.licenseTypeMessage[e])}_createBadgeContent(){const e=mf(this.editor.config.get("licenseKey"));return new hf(this.editor.locale,this.licenseTypeMessage[e])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{};return{position:t.position||e.position,side:"left"===(t.side||e.side)?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class hf extends Kn{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}}function mf(e){if("GPL"==e)return"GPL";const t=cn(e.split(".")[1]);return t?t.licenseType||"production":null}var gf=n(1836),pf={attributes:{"data-cke":!0}};pf.setAttributes=Wn(),pf.insert=Un().bind(null,"head"),pf.domAPI=Fn(),pf.insertStyleElement=qn(),Ln()(gf.A,pf),gf.A&&gf.A.locals&&gf.A.locals;const ff={POLITE:"polite",ASSERTIVE:"assertive"};class bf{constructor(e){this.editor=e,e.once("ready",(()=>{for(const e of Object.values(ff))this.announce("",e)}))}announce(e,t=ff.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new kf(i.locale),i.ui.view.body.add(this.view));const{politeness:o,isUnsafeHTML:n}="string"==typeof t?{politeness:t}:t;let r=this.view.regionViews.find((e=>e.politeness===o));r||(r=new _f(i,o),this.view.regionViews.add(r)),r.announce({announcement:e,isUnsafeHTML:n})}}class kf extends Kn{constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class _f extends Kn{constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",(()=>{null!==this._pruneAnnouncementsInterval&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)})),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval((()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()}),5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}var wf=n(5092),vf={attributes:{"data-cke":!0}};vf.setAttributes=Wn(),vf.insert=Un().bind(null,"head"),vf.domAPI=Fn(),vf.insertStyleElement=qn(),Ln()(wf.A,vf),wf.A&&wf.A.locals&&wf.A.locals;class yf extends gg{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}const xf={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",(t=>{if(e.isFocusBorderEnabled||e.isOpen){if(e.isOpen)for(const i of e.menus){const e=t.path[0],o=e instanceof yf&&e.children.first===i;i.isOpen=(t.path.includes(i)||o)&&i.isEnabled}t.source.focus()}}))},focusCycleMenusOnArrows(e){const t="rtl"===e.locale.uiLanguageDirection;function i(t,i){const o=e.children.getIndex(t),n=t.isOpen,r=e.children.length,s=e.children.get((o+r+i)%r);t.isOpen=!1,n&&(s.isOpen=!0),s.buttonView.focus()}e.on("menu:arrowright",(e=>{i(e.source,t?-1:1)})),e.on("menu:arrowleft",(e=>{i(e.source,t?1:-1)}))},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",(()=>{e.isOpen||e.menus.forEach((e=>{e.isOpen=!1}))}))},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",((t,i,o)=>{o&&e.menus.filter((e=>t.source.parentMenuView===e.parentMenuView&&t.source!==e&&e.isOpen)).forEach((e=>{e.isOpen=!1}))}))},closeOnClickOutside(e){Yn({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map((e=>e.element))})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",((i,o,n)=>{n||(t||(e.isFocusBorderEnabled=!1),t=!1)})),e.listenTo(e.element,"keydown",(()=>{t=!0}),{useCapture:!0}),e.listenTo(e.element,"keyup",(()=>{t=!1}),{useCapture:!0}),e.listenTo(e.element,"focus",(()=>{t&&(e.isFocusBorderEnabled=!0)}),{useCapture:!0})}},Af={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnArrowRightKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!0}))},toggleOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!e.isOpen}))},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())}))},closeOnArrowLeftKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnEscKey(e){e.keystrokes.set("esc",((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",((t,i,o)=>{o||t.source!==e.parentMenuView||(e.isOpen=!1)}))}},Cf={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+5,name:"wn"})},Tf=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable"]},{groupId:"insertInline",items:["menuBar:link","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function Ef({normalizedConfig:e,locale:t,componentFactory:i,extraItems:o}){const n=ll(e);return Sf(e,n,o),function(e,t){const i=t.removeItems,o=[];t.items=t.items.filter((({menuId:e})=>!i.includes(e)||(o.push(e),!1))),Of(t.items,(e=>{e.groups=e.groups.filter((({groupId:e})=>!i.includes(e)||(o.push(e),!1)));for(const t of e.groups)t.items=t.items.filter((e=>{const t=Rf(e);return!i.includes(t)||(o.push(t),!1)}))}));for(const t of i)o.includes(t)||C("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:t})}(e,n),Sf(e,n,n.addItems),function(e,t,i){Of(t.items,(o=>{for(const n of o.groups)n.items=n.items.filter((n=>{const r="string"==typeof n&&!i.has(n);return r&&!t.isUsingDefaultConfig&&C("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:ll(o),componentName:n}),!r}))}))}(e,n,i),If(e,n),function(e,t){const i=t.t,o={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};Of(e.items,(e=>{e.label in o&&(e.label=o[e.label])}))}(n,t),n}function Sf(e,t,i){const o=[];if(0!=i.length){for(const e of i){const i=(r=e.position).startsWith("start")?"start":r.startsWith("end")?"end":r.startsWith("after")?"after":"before",s=Nf(e.position);if("object"==typeof(n=e)&&"menu"in n)if(s){const n=t.items.findIndex((e=>e.menuId===s));-1!=n?"before"===i?(t.items.splice(n,0,e.menu),o.push(e)):"after"===i&&(t.items.splice(n+1,0,e.menu),o.push(e)):Pf(t,e.menu,s,i)&&o.push(e)}else"start"===i?(t.items.unshift(e.menu),o.push(e)):"end"===i&&(t.items.push(e.menu),o.push(e));else Vf(e)?Of(t.items,(t=>{if(t.menuId===s)"start"===i?(t.groups.unshift(e.group),o.push(e)):"end"===i&&(t.groups.push(e.group),o.push(e));else{const n=t.groups.findIndex((e=>e.groupId===s));-1!==n&&("before"===i?(t.groups.splice(n,0,e.group),o.push(e)):"after"===i&&(t.groups.splice(n+1,0,e.group),o.push(e)))}})):Pf(t,e.item,s,i)&&o.push(e)}var n;for(const t of i)o.includes(t)||C("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:t})}var r}function Pf(e,t,i,o){let n=!1;return Of(e.items,(e=>{for(const{groupId:r,items:s}of e.groups){if(n)return;if(r===i)"start"===o?(s.unshift(t),n=!0):"end"===o&&(s.push(t),n=!0);else{const e=s.findIndex((e=>Rf(e)===i));-1!==e&&("before"===o?(s.splice(e,0,t),n=!0):"after"===o&&(s.splice(e+1,0,t),n=!0))}}})),n}function If(e,t){const i=t.isUsingDefaultConfig;let o=!1;t.items=t.items.filter((t=>!!t.groups.length||(Mf(e,t,i),!1))),t.items.length?(Of(t.items,(t=>{t.groups=t.groups.filter((e=>!!e.items.length||(o=!0,!1)));for(const n of t.groups)n.items=n.items.filter((t=>!(Bf(t)&&!t.groups.length&&(Mf(e,t,i),o=!0,1))))})),o&&If(e,t)):Mf(e,e,i)}function Mf(e,t,i){i||C("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function Of(e,t){if(Array.isArray(e))for(const t of e)i(t);function i(e){t(e);for(const t of e.groups)for(const e of t.items)Bf(e)&&i(e)}}function Vf(e){return"object"==typeof e&&"group"in e}function Nf(e){const t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}function Rf(e){return"string"==typeof e?e:e.menuId}function Bf(e){return"object"==typeof e&&"menuId"in e}class Df extends(Z()){constructor(e){super(),this.isReady=!1,this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._extraMenuBarElements=[],this._lastFocusedForeignElement=null;const t=e.editing.view;this.editor=e,this.componentFactory=new Qp(e),this.focusTracker=new en,this.tooltipManager=new nf(e),this.poweredBy=new cf(e),this.evaluationBadge=new uf(e),this.ariaLiveAnnouncer=new bf(e),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.once("ready",(()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0})),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);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 i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",(()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)})),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}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}_initMenuBar(e){const t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);const i=function(e){let t;return t="items"in e&&e.items?{items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e}:{items:ll(Tf),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e},t}(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",((e,i)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),i())})),this.editor.keystrokes.set("Alt+F9",((i,o)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),o())}))}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(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:i}):{top:0}}_initFocusTracking(){const e=this.editor;let t;e.keystrokes.set("Alt+F10",((e,i)=>{this._saveLastFocusedForeignElement();const o=this._getCurrentFocusedToolbarDefinition();o&&t||(t=this._getFocusableCandidateToolbarDefinitions());for(let e=0;e<t.length;e++){const e=t.shift();if(t.push(e),e!==o&&this._focusFocusableCandidateToolbar(e)){o&&o.options.afterBlur&&o.options.afterBlur();break}}i()})),e.keystrokes.set("Esc",((t,i)=>{const o=this._getCurrentFocusedToolbarDefinition();o&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),o.options.afterBlur&&o.options.afterBlur(),i())}))}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:o}=t;(co(i.element)||o.beforeFocus)&&e.push(t)}return e.sort(((e,t)=>Lf(e)-Lf(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:i}}=e;return i&&i(),!!co(t.element)&&(t.focus(),!0)}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const t of e)this.focusTracker.add(t.element);e.on("add",((e,t)=>{this.focusTracker.add(t.element)})),e.on("remove",((e,t)=>{this.focusTracker.remove(t.element)}))}}function Lf(e){const{toolbarView:t,options:i}=e;let o=10;return co(t.element)&&o--,i.isContextual&&o--,o}var zf=n(6888),Ff={attributes:{"data-cke":!0}};Ff.setAttributes=Wn(),Ff.insert=Un().bind(null,"head"),Ff.domAPI=Fn(),Ff.insertStyleElement=qn(),Ln()(zf.A,Ff),zf.A&&zf.A.locals&&zf.A.locals;class jf extends Kn{constructor(e){super(e),this.body=new wm(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class Uf extends jf{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 mm;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class Hf extends Kn{constructor(e,t,i){super(e),this.name=null,this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,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()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change((i=>{const o=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",o),i.removeClass(t.isFocused?"ck-blurred":"ck-focused",o)}))}e.isRenderingInProgress?function i(o){e.once("change:isRenderingInProgress",((e,n,r)=>{r?i(o):t(o)}))}(this):t(this)}}class Wf extends Hf{constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change((t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)}))}getEditableAriaLabel(){const e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if("string"==typeof t)return t;if("object"==typeof t)return t[o];if("function"==typeof t)return t(this);if(i){const e=i.getAttribute("aria-label");if(e)return e}return e("Rich Text Editor. Editing area: %0",o)}}class $f extends sr{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}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||""})}}class qf extends(Z()){constructor(e,t){super(),t&&_a(this,t),e&&this.set(e)}}var Zf=n(9432),Gf={attributes:{"data-cke":!0}};Gf.setAttributes=Wn(),Gf.insert=Un().bind(null,"head"),Gf.domAPI=Fn(),Gf.insertStyleElement=qn(),Ln()(Zf.A,Gf),Zf.A&&Zf.A.locals&&Zf.A.locals;var Kf=n(3449),Yf={attributes:{"data-cke":!0}};Yf.setAttributes=Wn(),Yf.insert=Un().bind(null,"head"),Yf.domAPI=Fn(),Yf.insertStyleElement=qn(),Ln()(Kf.A,Yf),Kf.A&&Kf.A.locals&&Kf.A.locals;const Qf=ro("px");class Jf extends er{static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this._viewToStack=new Map,this._idToStack=new Map,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.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}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("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 i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new A("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.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){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}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new A("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new Ig(this.editor.locale),this.editor.ui.view.body.add(this._view),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 Xf(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,i)=>{if(i<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[o,i])})),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 eb(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:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}}class Xf extends Kn{constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new en,this.buttonPrevView=this._createButtonView(t("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>'),this.buttonNextView=this._createButtonView(t("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),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",i.to("isNavigationVisible",(e=>e?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.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 i=new Dh(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class eb extends Kn{constructor(e,t){super(e);const i=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",i.to("numberOfPanels",(e=>e?"":"ck-hidden"))],style:{top:i.to("top",Qf),left:i.to("left",Qf),width:i.to("width",Qf),height:i.to("height",Qf)}},children:this.content}),this.on("change:numberOfPanels",((e,t,i,o)=>{i>o?this._addPanels(i-o):this._removePanels(o-i),this.updatePosition()}))}_addPanels(e){for(;e--;){const e=new Kn;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:i,height:o}=new Qi(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}}var tb=n(4315),ib={attributes:{"data-cke":!0}};ib.setAttributes=Wn(),ib.insert=Un().bind(null,"head"),ib.domAPI=Fn(),ib.insertStyleElement=qn(),Ln()(tb.A,ib),tb.A&&tb.A.locals&&tb.A.locals;const ob=ro("px");class nb extends Kn{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("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new fn({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",(e=>e?"block":"none")),height:t.to("isSticky",(e=>e?ob(this._contentPanelRect.height):null))}}}).render(),this.contentPanelElement=new fn({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",(e=>e?ob(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:t.to("_stickyTopOffset",(e=>e?ob(e):e)),bottom:t.to("_stickyBottomOffset",(e=>e?ob(e):e)),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(t.document,"scroll",(()=>{this.checkIfShouldBeSticky()}),{useCapture:!0}),this.listenTo(this,"change:isActive",(()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const e=new Qi(this.limiterElement);let i=e.getVisible();if(i){const e=new Qi(t.window);e.top+=this.viewportTopOffset,e.height-=this.viewportTopOffset,i=i.getIntersection(e)}if(i&&e.top<i.top){const t=i.top;if(t+this._contentPanelRect.height+this.limiterBottomOffset>i.bottom){const t=Math.max(e.bottom-i.bottom,0)+this.limiterBottomOffset;e.bottom-t>e.top+this._contentPanelRect.height?this._stickToBottomOfLimiter(t):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<e.height?this._stickToTopOfAncestors(t):this._unstick()}else this._unstick()}_stickToTopOfAncestors(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=e,this._stickyBottomOffset=null,this._marginLeft=ob(-t.window.scrollX)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=ob(-t.window.scrollX)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new Qi(this.contentPanelElement)}}class rb extends Gm{constructor(e,t){const i=e.t,o=Object.assign({},{showResetButton:!0,showIcon:!0,creator:cp},t);super(e,o.creator),this.label=t.label,this._viewConfig=o,this._viewConfig.showIcon&&(this.iconView=new Vh,this.iconView.content='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.68 13.74h-.001l4.209 4.208a1 1 0 1 0 1.414-1.414l-4.267-4.268a6 6 0 1 0-1.355 1.474ZM13 9a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"/></svg>',this.fieldWrapperChildren.add(this.iconView,0),this.extendTemplate({attributes:{class:"ck-search__query_with-icon"}})),this._viewConfig.showResetButton&&(this.resetButtonView=new Dh(e),this.resetButtonView.set({label:i("Clear"),icon:fh,class:"ck-search__reset",isVisible:!1,tooltip:!0}),this.resetButtonView.on("execute",(()=>{this.reset(),this.focus(),this.fire("reset")})),this.resetButtonView.bind("isVisible").to(this.fieldView,"isEmpty",(e=>!e)),this.fieldWrapperChildren.add(this.resetButtonView),this.extendTemplate({attributes:{class:"ck-search__query_with-reset"}}))}reset(){this.fieldView.reset(),this._viewConfig.showResetButton&&(this.resetButtonView.isVisible=!1)}}class sb extends Kn{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,primaryText:"",secondaryText:""}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__info",e.if("isVisible","ck-hidden",(e=>!e))],tabindex:-1},children:[{tag:"span",children:[{text:[e.to("primaryText")]}]},{tag:"span",children:[{text:[e.to("secondaryText")]}]}]})}focus(){this.element.focus()}}class ab extends Kn{constructor(e){super(e),this.children=this.createCollection(),this.focusTracker=new en,this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__results"],tabindex:-1},children:this.children}),this._focusCycler=new Uh({focusables:this.children,focusTracker:this.focusTracker})}render(){super.render();for(const e of this.children)this.focusTracker.add(e.element)}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}var lb=/[\\^$.*+?()[\]{}|]/g,cb=RegExp(lb.source);var db=n(610),ub={attributes:{"data-cke":!0}};ub.setAttributes=Wn(),ub.insert=Un().bind(null,"head"),ub.domAPI=Fn(),ub.insertStyleElement=qn(),Ln()(db.A,ub),db.A&&db.A.locals&&db.A.locals;class hb extends Kn{constructor(e,t){super(e),this._config=t,this.filteredView=t.filteredView,this.queryView=this._createSearchTextQueryView(),this.focusTracker=new en,this.keystrokes=new rn,this.resultsView=new ab(e),this.children=this.createCollection(),this.focusableChildren=this.createCollection([this.queryView,this.resultsView]),this.set("isEnabled",!0),this.set("resultsCount",0),this.set("totalItemsCount",0),t.infoView&&t.infoView.instance?this.infoView=t.infoView.instance:(this.infoView=new sb,this._enableDefaultInfoViewBehavior(),this.on("render",(()=>{this.search("")}))),this.resultsView.children.addMany([this.infoView,this.filteredView]),this.focusCycler=new Uh({focusables:this.focusableChildren,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.on("search",((e,{resultsCount:t,totalItemsCount:i})=>{this.resultsCount=t,this.totalItemsCount=i})),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search",t.class||null],tabindex:"-1"},children:this.children})}render(){super.render(),this.children.addMany([this.queryView,this.resultsView]);const e=e=>e.stopPropagation();for(const e of this.focusableChildren)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}focus(){this.queryView.focus()}reset(){this.queryView.reset(),this.search(""),this.filteredView.element.scrollTo(0,0)}search(e){const t=e?new RegExp((o=vr(o=e))&&cb.test(o)?o.replace(lb,"\\$&"):o,"ig"):null,i=this.filteredView.filter(t);var o;this.fire("search",{query:e,...i})}_createSearchTextQueryView(){const e=new rb(this.locale,this._config.queryView);return this.listenTo(e.fieldView,"input",(()=>{this.search(e.fieldView.element.value)})),e.on("reset",(()=>this.reset())),e.bind("isEnabled").to(this),e}_enableDefaultInfoViewBehavior(){const e=this.locale.t,t=this.infoView;function i(e,{query:t,resultsCount:i,totalItemsCount:o}){return"function"==typeof e?e(t,i,o):e}this.on("search",((o,n)=>{if(n.resultsCount)t.set({isVisible:!1});else{const o=this._config.infoView&&this._config.infoView.text;let r,s;n.totalItemsCount?o&&o.notFound?(r=o.notFound.primary,s=o.notFound.secondary):(r=e("No results found"),s=""):o&&o.noSearchableItems?(r=o.noSearchableItems.primary,s=o.noSearchableItems.secondary):(r=e("No searchable items"),s=""),t.set({primaryText:i(r,n),secondaryText:i(s,n),isVisible:!0})}}))}}var mb=n(5558),gb={attributes:{"data-cke":!0}};gb.setAttributes=Wn(),gb.insert=Un().bind(null,"head"),gb.domAPI=Fn(),gb.insertStyleElement=qn(),Ln()(mb.A,gb),mb.A&&mb.A.locals&&mb.A.locals;class pb extends hb{constructor(e,i){super(e,i),this._config=i;const o=ro("px");this.extendTemplate({attributes:{class:["ck-autocomplete"]}});const n=this.resultsView.bindTemplate;this.resultsView.set("isVisible",!1),this.resultsView.set("_position","s"),this.resultsView.set("_width",0),this.resultsView.extendTemplate({attributes:{class:[n.if("isVisible","ck-hidden",(e=>!e)),n.to("_position",(e=>`ck-search__results_${e}`))],style:{width:n.to("_width",o)}}}),this.focusTracker.on("change:isFocused",((e,t,o)=>{this._updateResultsVisibility(),o?this.resultsView.element.scrollTop=0:i.resetOnBlur&&this.queryView.reset()})),this.on("search",(()=>{this._updateResultsVisibility(),this._updateResultsViewWidthAndPosition()})),this.keystrokes.set("esc",((e,t)=>{this.resultsView.isVisible&&(this.queryView.focus(),this.resultsView.isVisible=!1,t())})),this.listenTo(t.document,"scroll",(()=>{this._updateResultsViewWidthAndPosition()})),this.on("change:isEnabled",(()=>{this._updateResultsVisibility()})),this.filteredView.on("execute",((e,{value:t})=>{this.focus(),this.reset(),this.queryView.fieldView.value=this.queryView.fieldView.element.value=t,this.resultsView.isVisible=!1})),this.resultsView.on("change:isVisible",(()=>{this._updateResultsViewWidthAndPosition()}))}_updateResultsViewWidthAndPosition(){if(!this.resultsView.isVisible)return;this.resultsView._width=new Qi(this.queryView.fieldView.element).width;const e=pb._getOptimalPosition({element:this.resultsView.element,target:this.queryView.element,fitInViewport:!0,positions:pb.defaultResultsPositions});this.resultsView._position=e?e.name:"s"}_updateResultsVisibility(){const e=void 0===this._config.queryMinChars?0:this._config.queryMinChars,t=this.queryView.fieldView.element.value.length;this.resultsView.isVisible=this.focusTracker.isFocused&&this.isEnabled&&t>=e}}pb.defaultResultsPositions=[e=>({top:e.bottom,left:e.left,name:"s"}),(e,t)=>({top:e.top-t.height,left:e.left,name:"n"})],pb._getOptimalPosition=uo;RegExp(/[&<>"']/g.source);var fb=n(6580),bb={attributes:{"data-cke":!0}};bb.setAttributes=Wn(),bb.insert=Un().bind(null,"head"),bb.domAPI=Fn(),bb.insertStyleElement=qn(),Ln()(fb.A,bb),fb.A&&fb.A.locals&&fb.A.locals;var kb=n(4944),_b={attributes:{"data-cke":!0}};_b.setAttributes=Wn(),_b.insert=Un().bind(null,"head"),_b.domAPI=Fn(),_b.insertStyleElement=qn(),Ln()(kb.A,_b),kb.A&&kb.A.locals&&kb.A.locals;const wb=ro("px");class vb extends er{static get pluginName(){return"BalloonToolbar"}static get isOfficialPlugin(){return!0}static get requires(){return[Jf]}constructor(e){super(e),this._resizeObserver=null,this._balloonConfig=Fg(e.config.get("balloonToolbar")),this.toolbarView=this._createToolbarView(),this.focusTracker=new en,this._trackFocusableEditableElements(),this.focusTracker.add(this.toolbarView),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this.show(!0),afterBlur:()=>this.hide(),isContextual:!0}),this._balloon=e.plugins.get(Jf),this._fireSelectionChangeDebounced=Na((()=>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,i)=>{const o=this._balloon.visibleView===this.toolbarView;!i&&o?this.hide():i&&this.show()})),this.listenTo(t,"change:range",((e,i)=>{(i.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 oo(t,(e=>{this.toolbarView.maxWidth=wb(.9*e.contentRect.width)}))})),this.listenTo(this.toolbarView,"groupedItemsUpdate",(()=>{this._updatePosition()})),e.ui.once("ready",(()=>{this.toolbarView.fillFromConfig(this._balloonConfig,this.editor.ui.componentFactory)}))}_createToolbarView(){const e=this.editor.locale.t,t=!this._balloonConfig.shouldNotGroupWhenFull,i=new Wg(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return i.ariaLabel=e("Editor contextual toolbar"),i.render(),i}show(e=!1){const t=this.editor,i=t.model.document.selection,o=t.model.schema;this._balloon.hasView(this.toolbarView)||i.isCollapsed&&!e||function(e,t){return 1!==e.rangeCount&&[...e.getRanges()].every((e=>{const i=e.getContainedElement();return i&&t.isSelectable(i)}))}(i,o)||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))}_trackFocusableEditableElements(){const{editor:e,focusTracker:t}=this,{editing:i}=e;i.view.addObserver(class extends ba{observe(e){t.add(e)}stopObserving(e){t.remove(e)}})}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document,i=t.selection,o=t.selection.isBackward;return{target:()=>{const t=o?i.getFirstRange():i.getLastRange(),n=Qi.getDomRangeRects(e.domConverter.viewRangeToDom(t));return o?n[0]:(n.length>1&&0===n[n.length-1].width&&n.pop(),n[n.length-1])},positions:this._getBalloonPositions(o)}}_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 i=s.isSafari&&s.isiOS?Ig.generatePositions({heightOffset:Math.max(Ig.arrowHeightOffset,Math.round(20/t.window.visualViewport.scale))}):Ig.defaultPositions;return e?[i.northWestArrowSouth,i.northWestArrowSouthWest,i.northWestArrowSouthEast,i.northWestArrowSouthMiddleEast,i.northWestArrowSouthMiddleWest,i.southWestArrowNorth,i.southWestArrowNorthWest,i.southWestArrowNorthEast,i.southWestArrowNorthMiddleWest,i.southWestArrowNorthMiddleEast]:[i.southEastArrowNorth,i.southEastArrowNorthEast,i.southEastArrowNorthWest,i.southEastArrowNorthMiddleEast,i.southEastArrowNorthMiddleWest,i.northEastArrowSouth,i.northEastArrowSouthEast,i.northEastArrowSouthWest,i.northEastArrowSouthMiddleEast,i.northEastArrowSouthMiddleWest]}}var yb=n(4893),xb={attributes:{"data-cke":!0}};xb.setAttributes=Wn(),xb.insert=Un().bind(null,"head"),xb.domAPI=Fn(),xb.insertStyleElement=qn(),Ln()(yb.A,xb),yb.A&&yb.A.locals&&yb.A.locals;var Ab=n(2833),Cb={attributes:{"data-cke":!0}};Cb.setAttributes=Wn(),Cb.insert=Un().bind(null,"head"),Cb.domAPI=Fn(),Cb.insertStyleElement=qn(),Ln()(Ab.A,Cb),Ab.A&&Ab.A.locals&&Ab.A.locals;class Tb extends sm{constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e))),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Vh;return e.content=Sm,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}var Eb=n(5107),Sb={attributes:{"data-cke":!0}};Sb.setAttributes=Wn(),Sb.insert=Un().bind(null,"head"),Sb.domAPI=Fn(),Sb.insertStyleElement=qn(),Ln()(Eb.A,Sb),Eb.A&&Eb.A.locals&&Eb.A.locals;class Pb extends Kn{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-menu-bar__menu__panel",t.to("position",(e=>`ck-menu-bar__menu__panel_position_${e}`)),t.if("isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(e=1){this.children.length&&(1===e?this.children.first.focus():this.children.last.focus())}}var Ib=n(6681),Mb={attributes:{"data-cke":!0}};Mb.setAttributes=Wn(),Mb.insert=Un().bind(null,"head"),Mb.domAPI=Fn(),Mb.insertStyleElement=qn(),Ln()(Ib.A,Mb),Ib.A&&Ib.A.locals&&Ib.A.locals;class Ob extends Kn{constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new Tb(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new Pb(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new rn,this.focusTracker=new en,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",(e=>!e)),t.if("parentMenuView","ck-menu-bar__menu_top-level",(e=>!e))]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),Af.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(Af.openOnButtonClick(this),Af.openOnArrowRightKey(this),Af.closeOnArrowLeftKey(this),Af.openAndFocusOnEnterKeyPress(this),Af.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),Af.openAndFocusPanelOnArrowDownKey(this),Af.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",((e,t)=>{this.fire("arrowright"),t()})),this.keystrokes.set("arrowleft",((e,t)=>{this.fire("arrowleft"),t()}))}_repositionPanelOnOpen(){this.on("change:isOpen",((e,t,i)=>{if(!i)return;const o=Ob._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._defaultMenuPositionName}))}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:o,westSouth:n,eastSouth:r,westNorth:s,eastNorth:a}=Cf;return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?[r,a,n,s]:[e,t,i,o]:this.parentMenuView?[n,s,r,a]:[t,e,o,i]}get _defaultMenuPositionName(){return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}}Ob._getOptimalPosition=uo;const Vb=Ob;class Nb extends _g{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some((e=>{const t=Rb(e);return t&&t.isToggleable}));this.items.forEach((t=>{const i=Rb(t);i&&(i.hasCheckSpace=e)}))}}function Rb(e){return e instanceof gg?e.children.map((e=>function(e){return"object"==typeof e&&"buttonView"in e&&e.buttonView instanceof Dh}(e)?e.buttonView:e)).find((e=>e instanceof sm)):null}class Bb extends Cm{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}var Db=n(20),Lb={attributes:{"data-cke":!0}};Lb.setAttributes=Wn(),Lb.insert=Un().bind(null,"head"),Lb.domAPI=Fn(),Lb.insertStyleElement=qn(),Ln()(Db.A,Lb),Db.A&&Db.A.locals&&Db.A.locals;const zb=["mouseenter","arrowleft","arrowright","change:isOpen"];class Fb extends Kn{constructor(e){super(e),this.menus=[];const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){const o=Ef({normalizedConfig:e,locale:this.locale,componentFactory:t,extraItems:i}).items.map((e=>this._createMenu({componentFactory:t,menuDefinition:e})));this.children.addMany(o)}render(){super.render(),xf.toggleMenusAndFocusItemsOnHover(this),xf.closeMenusWhenTheBarCloses(this),xf.closeMenuWhenAnotherOnTheSameLevelOpens(this),xf.focusCycleMenusOnArrows(this),xf.closeOnClickOutside(this),xf.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}registerMenu(e,t=null){t?(e.delegate(...zb).to(t),e.parentMenuView=t):e.delegate(...zb).to(this,(e=>"menu:"+e)),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const o=this.locale,n=new Vb(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",(()=>{const i=new Nb(o);i.ariaLabel=t.label,n.panelView.children.add(i),i.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))})),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){const o=this.locale,n=[];for(const r of e.groups){for(const e of r.items){const r=new yf(o,t);if(F(e))r.children.add(this._createMenu({componentFactory:i,menuDefinition:e,parentMenuView:t}));else{const o=this._createMenuItemContentFromFactory({componentName:e,componentFactory:i,parentMenuView:t});if(!o)continue;r.children.add(o)}n.push(r)}r!==e.groups[e.groups.length-1]&&n.push(new pg(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const o=i.create(e);return o instanceof Vb||o instanceof dm||o instanceof Bb?(this._registerMenuTree(o,t),o.on("execute",(()=>{this.close()})),o):(C("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof Vb))return void e.delegate("mouseenter").to(t);this.registerMenu(e,t);const i=e.panelView.children.filter((e=>e instanceof Nb))[0];if(!i)return void e.delegate("mouseenter").to(t);const o=i.items.filter((e=>e instanceof gg));for(const t of o)this._registerMenuTree(t.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",((t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout((()=>{this.isOpen=Array.from(this.children).some((e=>e.isOpen))}),0)}))}}class jb extends Df{constructor(e,t){super(e),this.view=t,this._toolbarConfig=Fg(e.config.get("toolbar")),this._elementReplacer=new X,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(e){const t=this.editor,i=this.view,o=t.editing.view,n=i.editable,r=o.document.getRoot();n.name=r.rootName,i.render();const s=n.element;this.setEditableElement(n.name,s),i.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(s),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),i.menuBarView&&this._initMenuBar(i.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.getDomRoot(e.editable.name)&&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,i=t.document.getRoot(),o=e.sourceElement;let n;const r=e.config.get("placeholder");r&&(n="string"==typeof r?r:r[this.view.editable.name]),!n&&o&&"textarea"===o.tagName.toLowerCase()&&(n=o.getAttribute("placeholder")),n&&(i.placeholder=n),Mr({view:t,element:i,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:e}=this.view,t=this.editor.plugins.get("ContextualBalloon");t.on("getPositionOptions",(t=>{const i=t.return;if(!i||!e.isSticky||!e.element)return;const o=new Qi(e.element).height,n="function"==typeof i.target?i.target():i.target,r="function"==typeof i.limiter?i.limiter():i.limiter;if(n&&r&&new Qi(n).height>=new Qi(r).height-o)return;const s={...i.viewportOffsetConfig},a=(s.top||0)+o;t.return={...i,viewportOffsetConfig:{...s,top:a}}}),{priority:"low"});const i=()=>{t.visibleView&&t.updatePosition()};this.listenTo(e,"change:isSticky",i),this.listenTo(this.editor.ui,"change:viewportOffset",i)}_handleScrollToTheSelectionWithStickyPanel(e,t,i){const o=this.view.stickyPanel;if(o.isSticky){const e=new Qi(o.element).height;t.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(o,"change:isSticky",e),setTimeout((()=>{this.stopListening(o,"change:isSticky",e)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,t=this.editor.plugins.get("Dialog");t.on("show",(()=>{const i=t.view;i.on("moveTo",((t,o)=>{if(!e.isSticky||i.wasMoved||i.isModal)return;const n=new Qi(e.contentPanelElement);o[1]<n.bottom+im.defaultOffset&&(o[1]=n.bottom+im.defaultOffset)}),{priority:"high"})}),{priority:"low"})}}var Ub=n(2515),Hb={attributes:{"data-cke":!0}};Hb.setAttributes=Wn(),Hb.insert=Un().bind(null,"head"),Hb.domAPI=Fn(),Hb.insertStyleElement=qn(),Ln()(Ub.A,Hb),Ub.A&&Ub.A.locals&&Ub.A.locals;class Wb extends Uf{constructor(e,t,i={}){super(e),this.stickyPanel=new nb(e),this.toolbar=new Wg(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),i.useMenuBar&&(this.menuBarView=new Fb(e)),this.editable=new Wf(e,t,void 0,{label:i.label})}render(){super.render(),this.menuBarView?this.stickyPanel.content.addMany([this.menuBarView,this.toolbar]):this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class $b extends(mh(uh)){static get editorName(){return"ClassicEditor"}constructor(e,t={}){if(!qb(e)&&void 0!==t.initialData)throw new A("editor-create-initial-data",null);super(t),this.config.define("menuBar.isVisible",!1),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return qb(e)?(t=e)instanceof HTMLTextAreaElement?t.value:t.innerHTML:e;var t}(e)),qb(e)&&(this.sourceElement=e),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=this.config.get("menuBar"),n=new Wb(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,useMenuBar:o.isVisible,label:this.config.get("label")});this.ui=new jb(this,n),function(e){if(!Me(e.updateSourceElement))throw new A("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(function(e){return!!e&&"textarea"===e.tagName.toLowerCase()}(t)&&t.form){let i;const o=t.form,n=()=>e.updateSourceElement();Me(o.submit)&&(i=o.submit,o.submit=()=>{n(),i.apply(o)}),o.addEventListener("submit",n),e.on("destroy",(()=>{o.removeEventListener("submit",n),i&&(o.submit=i)}))}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise((i=>{const o=new this(e,t);i(o.initPlugins().then((()=>o.ui.init(qb(e)?e:null))).then((()=>o.data.init(o.config.get("initialData")))).then((()=>o.fire("ready"))).then((()=>o)))}))}}function qb(e){return Ri(e)}class Zb extends va{constructor(e){super(e),this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];const t=this.document;function i(e){return(i,o)=>{o.preventDefault();const n=o.dropRange?[o.dropRange]:null,r=new _(t,e);t.fire(r,{dataTransfer:o.dataTransfer,method:i.name,targetRanges:n,target:o.target,domEvent:o.domEvent}),r.stop.called&&o.stopPropagation()}}this.listenTo(t,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",i("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,i="drop"==e.type||"paste"==e.type,o={dataTransfer:new ol(t,{cacheFiles:i})};if("drop"==e.type||"dragover"==e.type){const t=qi(e);o.dropRange=t&&this.view.domConverter.domRangeToView(t)}this.fire(e.type,e,o)}}const Gb=["figcaption","li"],Kb=["ol","ul"];function Yb(e,t){if(t.is("$text")||t.is("$textProxy"))return t.data;if(t.is("element","img")&&t.hasAttribute("alt"))return t.getAttribute("alt");if(t.is("element","br"))return"\n";let i="",o=null;for(const s of t.getChildren())i+=(n=s,((r=o)?n.is("element","li")&&!n.isEmpty&&n.getChild(0).is("containerElement")||Kb.includes(n.name)&&Kb.includes(r.name)?"\n\n":n.is("containerElement")||r.is("containerElement")?Gb.includes(n.name)||Gb.includes(r.name)?"\n":n.is("element")&&n.getCustomProperty("dataPipeline:transparentRendering")||r.is("element")&&r.getCustomProperty("dataPipeline:transparentRendering")?"":"\n\n":"":"")+Yb(e,s)),o=s;var n,r;if(t.is("rawElement")){const o=document.createElement("div");t.render(o,e),i+=Qb(o)}return i}function Qb(e){let t="";if(e.nodeType===Node.TEXT_NODE)return e.textContent;if("BR"===e.tagName)return"\n";for(const i of e.childNodes)t+=Qb(i);return t}const Jb=function(e,t){return e&&Bo(e,t,Vt)},Xb=function(e){return e==e&&!F(e)},ek=function(e,t){return function(i){return null!=i&&i[e]===t&&(void 0!==t||e in Object(i))}},tk=function(e){var t=function(e){for(var t=Vt(e),i=t.length;i--;){var o=t[i],n=e[o];t[i]=[o,n,Xb(n)]}return t}(e);return 1==t.length&&t[0][2]?ek(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,o){var n=i.length,r=n,s=!o;if(null==e)return!r;for(e=Object(e);n--;){var a=i[n];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++n<r;){var l=(a=i[n])[0],c=e[l],d=a[1];if(s&&a[2]){if(void 0===c&&!(l in e))return!1}else{var u=new et;if(o)var h=o(c,d,l,e,t,u);if(!(void 0===h?Qa(d,c,3,o,u):h))return!1}}return!0}(i,e,t)}},ik=function(e,t){return null!=e&&t in Object(e)},ok=function(e,t){return null!=e&&function(e,t,i){for(var o=-1,n=(t=yr(t,e)).length,r=!1;++o<n;){var s=xr(t[o]);if(!(r=null!=e&&i(e,s)))break;e=e[s]}return r||++o!=n?r:!!(n=null==e?0:e.length)&&bt(n)&&ft(s,n)&&(ge(e)||dt(e))}(e,t,ik)},nk=function(e){return dr(e)?(t=xr(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Ar(t,e)}}(e);var t},rk=function(e){return"function"==typeof e?e:null==e?Fo:"object"==typeof e?ge(e)?(t=e[0],i=e[1],dr(t)&&Xb(i)?ek(xr(t),i):function(e){var o=Cr(e,t);return void 0===o&&o===i?ok(e,t):Qa(i,o,3)}):tk(e):nk(e);var t,i};class sk extends er{constructor(){super(...arguments),this._markersToCopy=new Map}static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,t){this._markersToCopy.set(e,t)}_copySelectedFragmentWithMarkers(e,t,i=e=>e.model.getSelectedContent(e.model.document.selection)){return this.editor.model.change((o=>{const n=o.model.document.selection;o.setSelection(t);const r=this._insertFakeMarkersIntoSelection(o,o.model.document.selection,e),s=i(o),a=this._removeFakeMarkersInsideElement(o,s);for(const[e,t]of Object.entries(r)){a[e]||(a[e]=o.createRangeIn(s));for(const e of t)o.remove(e)}s.markers.clear();for(const[e,t]of Object.entries(a))s.markers.set(e,t);return o.setSelection(n),s}))}_pasteMarkersIntoTransformedElement(e,t){const i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change((e=>{const o=this._insertFakeMarkersElements(e,i),n=t(e),r=this._removeFakeMarkersInsideElement(e,n);for(const t of Object.values(o).flat())e.remove(t);for(const[t,i]of Object.entries(r))e.model.markers.has(t)||e.addMarker(t,{usingOperation:!0,affectsData:!0,range:i});return n}))}_pasteFragmentWithMarkers(e){const t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const i of t)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const o=this._markersToCopy.get(e);this._markersToCopy.set(e,i),t(),o?this._markersToCopy.set(e,o):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){const i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!t)return!0;const{allowedActions:o}=i;return"all"===o||o.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,i){const o=this._getCopyableMarkersFromSelection(e,t,i);return this._insertFakeMarkersElements(e,o)}_getCopyableMarkersFromSelection(e,t,i){const o=Array.from(t.getRanges()),n=new Set(o.flatMap((t=>Array.from(e.model.markers.getMarkersIntersectingRange(t)))));return Array.from(n).filter((e=>{if(!this._isMarkerCopyable(e.name,i))return!1;const{copyPartiallySelected:t}=this._getMarkerClipboardConfig(e.name);if(!t){const t=e.getRange();return o.some((e=>e.containsRange(t,!0)))}return!0})).map((e=>({name:"dragstart"===i?this._getUniqueMarkerName(e.name):e.name,range:e.getRange()})))}_getPasteMarkersFromRangeMap(e,t=null){const{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap((([e,o])=>{if(!this._hasMarkerConfiguration(e))return[{name:e,range:o}];if(this._isMarkerCopyable(e,t)){const t=this._getMarkerClipboardConfig(e),n=i.markers.has(e)&&"$graveyard"===i.markers.get(e).getRange().root.rootName;return(t.duplicateOnPaste||n)&&(e=this._getUniqueMarkerName(e)),[{name:e,range:o}]}return[]}))}_insertFakeMarkersElements(e,t){const i={},o=t.flatMap((e=>{const{start:t,end:i}=e.range;return[{position:t,marker:e,type:"start"},{position:i,marker:e,type:"end"}]})).sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:t,marker:n,type:r}of o){const o=e.createElement("$marker",{"data-name":n.name,"data-type":r});i[n.name]||(i[n.name]=[]),i[n.name].push(o),e.insert(o,t)}return i}_removeFakeMarkersInsideElement(e,t){return function(e,t){var i={};return t=rk(t),Jb(e,(function(e,o,n){it(i,o,t(e,o,n))})),i}(this._getAllFakeMarkersFromElement(e,t).reduce(((t,i)=>{const o=i.markerElement&&e.createPositionBefore(i.markerElement);let n=t[i.name],r=!1;return n&&n.start&&n.end&&(this._getMarkerClipboardConfig(i.name).duplicateOnPaste?t[this._getUniqueMarkerName(i.name)]=t[i.name]:r=!0,n=null),r||(t[i.name]={...n,[i.type]:o}),i.markerElement&&e.remove(i.markerElement),t}),{}),(i=>new wl(i.start||e.createPositionFromPath(t,[0]),i.end||e.createPositionAt(t,"end"))))}_getAllFakeMarkersFromElement(e,t){const i=Array.from(e.createRangeIn(t)).flatMap((({item:e})=>{if(!e.is("element","$marker"))return[];const t=e.getAttribute("data-name"),i=e.getAttribute("data-type");return[{markerElement:e,name:t,type:i}]})),o=[],n=[];for(const e of i)"end"===e.type&&(i.some((t=>t.name===e.name&&"start"===t.type))||o.push({markerElement:null,name:e.name,type:"start"})),"start"===e.type&&(i.some((t=>t.name===e.name&&"end"===t.type))||n.unshift({markerElement:null,name:e.name,type:"end"}));return[...o,...i,...n]}_getUniqueMarkerName(e){const t=e.split(":"),i=v().substring(1,6);return 3===t.length?`${t.slice(0,2).join(":")}:${i}`:`${t.join(":")}:${i}`}}class ak extends er{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[sk]}init(){this.editor.editing.view.addObserver(Zb),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,i){const o=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:"cut"===i},(()=>{const n=o._copySelectedFragmentWithMarkers(i,t);this.fire("outputTransformation",{dataTransfer:e,content:n,method:i})}))}_setupPasteDrop(){const e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(o,"clipboardInput",((t,i)=>{"paste"!=i.method||e.model.canEditAt(e.model.document.selection)||t.stop()}),{priority:"highest"}),this.listenTo(o,"clipboardInput",((e,t)=>{const o=t.dataTransfer;let n;if(t.content)n=t.content;else{let e="";o.getData("text/html")?e=function(e){return e.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,((e,t)=>1==t.length?" ":t)).replace(/<!--[\s\S]*?-->/g,"")}(o.getData("text/html")):o.getData("text/plain")&&(((r=(r=o.getData("text/plain")).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).includes("</p><p>")||r.includes("<br>"))&&(r=`<p>${r}</p>`),e=r),n=this.editor.data.htmlProcessor.toView(e)}var r;const s=new _(this,"inputTransformation"),a=o.getData("application/ckeditor5-editor-id")||null;this.fire(s,{content:n,dataTransfer:o,sourceEditorId:a,targetRanges:t.targetRanges,method:t.method}),s.stop.called&&e.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,i)=>{if(i.content.isEmpty)return;const o=this.editor.data.toModel(i.content,"$clipboardHolder");0!=o.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:o,method:i.method,sourceEditorId:i.sourceEditorId,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,t)=>{t.resultRange=n._pasteFragmentWithMarkers(t.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,i=e.editing.view.document,o=(e,i)=>{const o=i.dataTransfer;i.preventDefault(),this._fireOutputTransformationEvent(o,t.selection,e.name)};this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",((t,i)=>{e.model.canEditAt(e.model.document.selection)?o(t,i):i.preventDefault()}),{priority:"low"}),this.listenTo(this,"outputTransformation",((t,o)=>{const n=e.data.toView(o.content,{isClipboardPipeline:!0});i.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:n,method:o.method})}),{priority:"low"}),this.listenTo(i,"clipboardOutput",((i,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",Yb(e.data.htmlProcessor.domConverter,o.content)),o.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),"cut"==o.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}class lk{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 ck extends ir{constructor(e,t){super(e),this._buffer=new lk(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,i=t.document,o=e.text||"",n=o.length;let r=i.selection;if(e.selection?r=e.selection:e.range&&(r=t.createSelection(e.range)),!t.canEditAt(r))return;const s=e.resultRange;t.enqueueChange(this._buffer.batch,(e=>{this._buffer.lock();const a=Array.from(i.selection.getAttributes());t.deleteContent(r),o&&t.insertContent(e.createText(o,a),r),s?e.setSelection(s):r.is("documentSelection")||e.setSelection(r),this._buffer.unlock(),this._buffer.input(n)}))}}const dk=["insertText","insertReplacementText"],uk=[...dk,"insertCompositionText"];class hk extends ba{constructor(e){super(e),this.focusObserver=e.getObserver(el);const t=s.isAndroid?uk:dk,i=e.document;i.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:l}=n;if(!t.includes(a))return;this.focusObserver.flush();const c=new _(i,"insertText");i.fire(c,new wa(e,l,{text:r,selection:e.createSelection(s)})),c.stop.called&&o.stop()})),s.isAndroid||i.on("compositionend",((t,{data:o,domEvent:n})=>{this.isEnabled&&o&&i.fire("insertText",new wa(e,n,{text:o}))}),{priority:"lowest"})}observe(){}stopObserving(){}}class mk extends er{static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,i=e.editing.view,o=e.editing.mapper,n=t.document.selection;this._compositionQueue=new gk(e),i.addObserver(hk);const r=new ck(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",r),e.commands.add("input",r),this.listenTo(i.document,"insertText",((r,a)=>{i.document.isComposing||a.preventDefault(),s.isAndroid&&i.document.isComposing&&this._compositionQueue.flush("next beforeinput");const{text:l,selection:c}=a;let d;d=c?Array.from(c.getRanges()).map((e=>o.toModelRange(e))):Array.from(n.getRanges());let u=l;if(s.isAndroid){const e=Array.from(d[0].getItems()).reduce(((e,t)=>e+(t.is("$textProxy")?t.data:"")),"");if(e&&(e.length<=u.length?u.startsWith(e)&&(u=u.substring(e.length),d[0].start=d[0].start.getShiftedBy(e.length)):e.startsWith(u)&&(d[0].start=d[0].start.getShiftedBy(u.length),u="")),0==u.length&&d[0].isCollapsed)return}const h={text:u,selection:t.createSelection(d)};s.isAndroid&&i.document.isComposing?this._compositionQueue.push(h):(e.execute("insertText",h),i.scrollToTheSelection())})),s.isAndroid?this.listenTo(i.document,"keydown",((e,o)=>{!n.isCollapsed&&229==o.keyCode&&i.document.isComposing&&pk(t,r)})):this.listenTo(i.document,"compositionstart",(()=>{n.isCollapsed||pk(t,r)})),s.isAndroid?(this.listenTo(i.document,"mutations",((e,{mutations:t})=>{if(i.document.isComposing)for(const{node:e}of t){const t=fk(e,o),i=o.toModelElement(t);if(this._compositionQueue.isComposedElement(i))return void this._compositionQueue.flush("mutations")}})),this.listenTo(i.document,"compositionend",(()=>{this._compositionQueue.flush("composition end")})),this.listenTo(i.document,"compositionend",(()=>{const e=[];for(const t of this._compositionQueue.flushComposedElements()){const i=o.toViewElement(t);i&&e.push({type:"children",node:i})}e.length&&i.document.fire("mutations",{mutations:e})}),{priority:"lowest"})):this.listenTo(i.document,"compositionend",(()=>{i.document.fire("mutations",{mutations:[]})}),{priority:"lowest"})}destroy(){super.destroy(),this._compositionQueue.destroy()}}class gk{constructor(e){this.flushDebounced=Na((()=>this.flush("timeout")),50),this._queue=[],this._compositionElements=new Set,this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._compositionElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e){const t={text:e.text};if(e.selection){t.selectionRanges=[];for(const i of e.selection.getRanges())t.selectionRanges.push(Bl.fromRange(i)),this._compositionElements.add(i.start.parent)}this._queue.push(t),this.flushDebounced()}shift(){const e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){const i=e.selectionRanges.map((e=>function(e){const t=e.toRange();return e.detach(),"$graveyard"==t.root.rootName?null:t}(e))).filter((e=>!!e));i.length&&(t.selection=this.editor.model.createSelection(i))}return t}flush(e){const t=this.editor,i=t.model,o=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;const n=t.commands.get("insertText").buffer;i.enqueueChange(n.batch,(()=>{for(n.lock();this._queue.length;){const e=this.shift();t.execute("insertText",e)}n.unlock()})),o.scrollToTheSelection()}isComposedElement(e){return this._compositionElements.has(e)}flushComposedElements(){const e=Array.from(this._compositionElements);return this._compositionElements.clear(),e}}function pk(e,t){if(!t.isEnabled)return;const i=t.buffer;i.lock(),e.enqueueChange(i.batch,(()=>{e.deleteContent(e.document.selection)})),i.unlock()}function fk(e,t){let i=e.is("$text")?e.parent:e;for(;!t.toModelElement(i);)i=i.parent;return i}class bk extends ir{constructor(e,t){super(e),this.direction=t,this._buffer=new lk(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,i=t.document;t.enqueueChange(this._buffer.batch,(o=>{this._buffer.lock();const n=o.createSelection(e.selection||i.selection);if(!t.canEditAt(n))return;const r=e.sequence||1,s=n.isCollapsed;if(n.isCollapsed&&t.modifySelection(n,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(r))return void this._replaceEntireContentWithParagraph(o);if(this._shouldReplaceFirstBlockWithParagraph(n,r))return void this.editor.execute("paragraph",{selection:n});if(n.isCollapsed)return;let a=0;n.getFirstRange().getMinimalFlatRanges().forEach((e=>{a+=ee(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),t.deleteContent(n,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(a),o.setSelection(n),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i);if(!i.isCollapsed||!i.containsEntireContent(o))return!1;if(!t.schema.checkChild(o,"paragraph"))return!1;const n=o.getChild(0);return!n||!n.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i),n=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(n,o),e.setSelection(n,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const i=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const o=e.getFirstPosition(),n=i.schema.getLimitElement(o),r=n.getChild(0);return o.parent==r&&!!e.containsEntireContent(r)&&!!i.schema.checkChild(n,"paragraph")&&"paragraph"!=r.name}}const kk="word",_k="selection",wk="backward",vk="forward",yk={deleteContent:{unit:_k,direction:wk},deleteContentBackward:{unit:"codePoint",direction:wk},deleteWordBackward:{unit:kk,direction:wk},deleteHardLineBackward:{unit:_k,direction:wk},deleteSoftLineBackward:{unit:_k,direction:wk},deleteContentForward:{unit:"character",direction:vk},deleteWordForward:{unit:kk,direction:vk},deleteHardLineForward:{unit:_k,direction:vk},deleteSoftLineForward:{unit:_k,direction:vk}};class xk extends ba{constructor(e){super(e);const t=e.document;let i=0;t.on("keydown",(()=>{i++})),t.on("keyup",(()=>{i=0})),t.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;const{targetRanges:r,domEvent:a,inputType:l}=n,c=yk[l];if(!c)return;const d={direction:c.direction,unit:c.unit,sequence:i};d.unit==_k&&(d.selectionToRemove=e.createSelection(r[0])),"deleteContentBackward"===l&&(s.isAndroid&&(d.sequence=1),function(e){if(1!=e.length||e[0].isCollapsed)return!1;const t=e[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let i=0;for(const{nextPosition:e,item:o}of t){if(e.parent.is("$text")){const t=e.parent.data,o=e.offset;if(dn(t,o)||un(t,o)||mn(t,o))continue;i++}else(o.is("containerElement")||o.is("emptyElement"))&&i++;if(i>1)return!0}return!1}(r)&&(d.unit=_k,d.selectionToRemove=e.createSelection(r)));const u=new ps(t,"delete",r[0]);t.fire(u,new wa(e,a,d)),u.stop.called&&o.stop()})),s.isBlink&&function(e){const t=e.view,i=t.document;let o=null,n=!1;function r(e){return e==Eo.backspace||e==Eo.delete}function s(e){return e==Eo.backspace?wk:vk}i.on("keydown",((e,{keyCode:t})=>{o=t,n=!1})),i.on("keyup",((a,{keyCode:l,domEvent:c})=>{const d=i.selection,u=e.isEnabled&&l==o&&r(l)&&!d.isCollapsed&&!n;if(o=null,u){const e=d.getFirstRange(),o=new ps(i,"delete",e),n={unit:_k,direction:s(l),selectionToRemove:d};i.fire(o,new wa(t,c,n))}})),i.on("beforeinput",((e,{inputType:t})=>{const i=yk[t];r(o)&&i&&i.direction==s(o)&&(n=!0)}),{priority:"high"}),i.on("beforeinput",((e,{inputType:t,data:i})=>{o==Eo.delete&&"insertText"==t&&""==i&&e.stop()}),{priority:"high"})}(this)}observe(){}stopObserving(){}}class Ak extends er{static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.model.document;t.addObserver(xk),this._undoOnBackspace=!1;const n=new bk(e,"forward");e.commands.add("deleteForward",n),e.commands.add("forwardDelete",n),e.commands.add("delete",new bk(e,"backward")),this.listenTo(i,"delete",((o,n)=>{i.isComposing||n.preventDefault();const{direction:r,sequence:s,selectionToRemove:a,unit:l}=n,c="forward"===r?"deleteForward":"delete",d={sequence:s};if("selection"==l){const t=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t)));d.selection=e.model.createSelection(t)}else d.unit=l;e.execute(c,d),t.scrollToTheSelection()}),{priority:"low"}),this.listenTo(i,"keydown",((t,n)=>{if(i.isComposing||n.keyCode!=Eo.backspace||!o.selection.isCollapsed)return;const r=e.model.schema.getLimitElement(o.selection);e.model.createPositionAt(r,0).isTouching(o.selection.getFirstPosition())&&n.preventDefault()})),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",((t,i)=>{this._undoOnBackspace&&"backward"==i.direction&&1==i.sequence&&"codePoint"==i.unit&&(this._undoOnBackspace=!1,e.execute("undo"),i.preventDefault(),t.stop())}),{context:"$capture"}),this.listenTo(o,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class Ck extends er{static get requires(){return[mk,Ak]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}}function Tk(e,t){let i=e.start;return{text:Array.from(e.getWalker({ignoreElementEnd:!1})).reduce(((e,{item:o})=>o.is("$text")||o.is("$textProxy")?e+o.data:(i=t.createPositionAfter(o),"")),""),range:t.createRange(i,e.end)}}class Ek extends(Z()){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:i})=>{i&&(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 i=this.model,o=i.document.selection,n=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:r,range:s}=Tk(n,i),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const i=Object.assign(t,{text:r,range:s});"object"==typeof a&&Object.assign(i,a),this.fire(`matched:${e}`,i)}}}class Sk extends er{static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this._isNextGravityRestorationSkipped=!1,this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,i=e.editing.view,o=e.locale,n=t.document.selection;this.listenTo(i.document,"arrowKey",((e,t)=>{if(!n.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const i=t.keyCode==Eo.arrowright,r=t.keyCode==Eo.arrowleft;if(!i&&!r)return;const s=o.contentLanguageDirection;let a=!1;a="ltr"===s&&i||"rtl"===s&&r?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()}),{context:"$text",priority:"highest"}),this.listenTo(n,"change:range",((e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&Nk(n.getFirstPosition(),this.attributes)||this._restoreGravity())})),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return!(this._isGravityOverridden||n.isAtStart&&Pk(o,t)||!Nk(n,t)||(Ok(e),Pk(o,t)&&Nk(n,t,!0)?Mk(i,t):this._overrideGravity(),0))}_handleBackwardMovement(e){const t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden?(Ok(e),this._restoreGravity(),Nk(n,t,!0)?Mk(i,t):Ik(i,t,n),!0):n.isAtStart?!!Pk(o,t)&&(Ok(e),Ik(i,t,n),!0):!Pk(o,t)&&Nk(n,t,!0)?(Ok(e),Ik(i,t,n),!0):!!Vk(n,t)&&(n.isAtEnd&&!Pk(o,t)&&Nk(n,t)?(Ok(e),Ik(i,t,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view.document;e.editing.view.addObserver(au),e.editing.view.addObserver(lu);let n=!1,r=!1;this.listenTo(o,"touchstart",(()=>{r=!1,n=!0})),this.listenTo(o,"mousedown",(()=>{r=!0})),this.listenTo(o,"selectionChange",(()=>{const e=this.attributes;if(!r&&!n)return;if(r=!1,n=!1,!i.isCollapsed)return;if(!Pk(i,e))return;const o=i.getFirstPosition();Nk(o,e)&&(o.isAtStart||Nk(o,e,!0)?Mk(t,e):this._isGravityOverridden||this._overrideGravity())}))}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection,i=this.attributes;this.listenTo(e,"insertContent",(()=>{const o=t.getFirstPosition();Pk(t,i)&&Nk(o,i)&&Mk(e,i)}),{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view;let n=!1,r=!1;this.listenTo(o.document,"delete",((e,t)=>{n="backward"===t.direction}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{if(!n)return;const e=i.getFirstPosition();r=Pk(i,this.attributes)&&!Vk(e,this.attributes)}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{n&&(n=!1,r||e.model.enqueueChange((()=>{const e=i.getFirstPosition();Pk(i,this.attributes)&&Nk(e,this.attributes)&&(e.isAtStart||Nk(e,this.attributes,!0)?Mk(t,this.attributes):this._isGravityOverridden||this._overrideGravity())})))}),{priority:"low"})}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 Pk(e,t){for(const i of t)if(e.hasAttribute(i))return!0;return!1}function Ik(e,t,i){const o=i.nodeBefore;e.change((i=>{if(o){const t=[],n=e.schema.isObject(o)&&e.schema.isInline(o);for(const[i,r]of o.getAttributes())!e.schema.checkAttribute("$text",i)||n&&!1===e.schema.getAttributeProperties(i).copyFromObject||t.push([i,r]);i.setSelectionAttribute(t)}else i.removeSelectionAttribute(t)}))}function Mk(e,t){e.change((e=>{e.removeSelectionAttribute(t)}))}function Ok(e){e.preventDefault()}function Vk(e,t){return Nk(e.getShiftedBy(-1),t)}function Nk(e,t,i=!1){const{nodeBefore:o,nodeAfter:n}=e;for(const e of t){const t=o?o.getAttribute(e):void 0,r=n?n.getAttribute(e):void 0;if((!i||void 0!==t&&void 0!==r)&&r!==t)return!0}return!1}function Rk(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function Bk(e,t,i,o){return o.createRange(Dk(e,t,i,!0,o),Dk(e,t,i,!1,o))}function Dk(e,t,i,o,n){let r=e.textNode||(o?e.nodeBefore:e.nodeAfter),s=null;for(;r&&r.getAttribute(t)==i;)s=r,r=o?r.previousSibling:r.nextSibling;return s?n.createPositionAt(s,o?"before":"after"):e}function*Lk(e,t){for(const i of t)i&&e.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}Rk('"'),Rk("'"),Rk("'"),Rk('"'),Rk('"'),Rk("'");class zk extends ir{execute(){this.editor.model.change((e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})}))}enterBlock(e){const t=this.editor.model,i=t.document.selection,o=t.schema,n=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,a=r.end.parent;if(o.isLimit(s)||o.isLimit(a))return n||s!=a||t.deleteContent(i),!1;if(n){const t=Lk(e.model.schema,i.getAttributes());return Fk(e,r.start),e.setSelectionAttribute(t),!0}{const o=!(r.start.isAtStart&&r.end.isAtEnd),n=s==a;if(t.deleteContent(i,{leaveUnmerged:o}),o){if(n)return Fk(e,i.focus),!0;e.setSelection(a,0)}}return!1}}function Fk(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}const jk={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Uk extends ba{constructor(e){super(e);const t=this.document;let i=!1;t.on("keydown",((e,t)=>{i=t.shiftKey})),t.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;let r=n.inputType;s.isSafari&&i&&"insertParagraph"==r&&(r="insertLineBreak");const a=n.domEvent,l=jk[r];if(!l)return;const c=new ps(t,"enter",n.targetRanges[0]);t.fire(c,new wa(e,a,{isSoft:l.isSoft})),c.stop.called&&o.stop()}))}observe(){}stopObserving(){}}class Hk extends er{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,o=this.editor.t;t.addObserver(Uk),e.commands.add("enter",new zk(e)),this.listenTo(i,"enter",((o,n)=>{i.isComposing||n.preventDefault(),n.isSoft||(e.execute("enter"),t.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class Wk extends ir{execute(){const e=this.editor.model,t=e.document;e.change((i=>{!function(e,t,i){const o=i.isCollapsed,n=i.getFirstRange(),r=n.start.parent,s=n.end.parent,a=r==s;if(o){const o=Lk(e.schema,i.getAttributes());$k(e,t,n.end),t.removeSelectionAttribute(i.getAttributeKeys()),t.setSelectionAttribute(o)}else{const o=!(n.start.isAtStart&&n.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:o}),a?$k(e,t,i.focus):o&&t.setSelection(s,0)}}(e,i,t.selection),this.fire("afterExecute",{writer:i})}))}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;const o=t.getFirstRange(),n=o.start.parent,r=o.end.parent;return!qk(n,e)&&!qk(r,e)||n===r}(e.schema,t.selection)}}function $k(e,t,i){const o=t.createElement("softBreak");e.insertContent(o,i),t.setSelection(o,"after")}function qk(e,t){return!e.is("rootElement")&&(t.isLimit(e)||qk(e.parent,t))}class Zk extends er{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.conversion,o=e.editing.view,n=o.document,r=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),o.addObserver(Uk),e.commands.add("shiftEnter",new Wk(e)),this.listenTo(n,"enter",((t,i)=>{n.isComposing||i.preventDefault(),i.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:r("Insert a soft break (a <code>&lt;br&gt;</code> element)"),keystroke:"Shift+Enter"}]})}}class Gk extends(V()){constructor(){super(...arguments),this._stack=[]}add(e,t){const i=this._stack,o=i[0];this._insertDescriptor(e);const n=i[0];o===n||Kk(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}remove(e,t){const i=this._stack,o=i[0];this._removeDescriptor(e);const n=i[0];o===n||Kk(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e.id));if(Kk(e,t[i]))return;i>-1&&t.splice(i,1);let o=0;for(;t[o]&&(n=t[o],r=e,n.priority>r.priority||!(n.priority<r.priority)&&Yk(n.classes)>Yk(r.classes));)o++;var n,r;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e));i>-1&&t.splice(i,1)}}function Kk(e,t){return e&&t&&e.priority==t.priority&&Yk(e.classes)==Yk(t.classes)}function Yk(e){return Array.isArray(e)?e.sort().join(","):e}const Qk="ck-widget_selected";function Jk(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Xk(e,t,i={}){if(!e.is("containerElement"))throw new A("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=r_,t.setCustomProperty("widgetLabel",[],e),i.label&&function(e,t){e.getCustomProperty("widgetLabel").push(t)}(e,i.label),i.hasSelectionHandle&&function(e,t){const i=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),i=new Vh;return i.set("content",'<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>'),i.render(),t.appendChild(i.element),t}));t.insert(t.createPositionAt(e,0),i),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),i_(e,t),e}function e_(e,t,i){if(t.classes&&i.addClass(No(t.classes),e),t.attributes)for(const o in t.attributes)i.setAttribute(o,t.attributes[o],e)}function t_(e,t,i){if(t.classes&&i.removeClass(No(t.classes),e),t.attributes)for(const o in t.attributes)i.removeAttribute(o,e)}function i_(e,t,i=e_,o=t_){const n=new Gk;n.on("change:top",((t,n)=>{n.oldDescriptor&&o(e,n.oldDescriptor,n.writer),n.newDescriptor&&i(e,n.newDescriptor,n.writer)})),t.setCustomProperty("addHighlight",((e,t,i)=>n.add(t,i)),e),t.setCustomProperty("removeHighlight",((e,t,i)=>n.remove(t,i)),e)}function o_(e,t,i={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),t.setAttribute("role","textbox",e),t.setAttribute("tabindex","-1",e),i.label&&t.setAttribute("aria-label",i.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",((i,o,n)=>{t.setAttribute("contenteditable",n?"false":"true",e)})),e.on("change:isFocused",((i,o,n)=>{n?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)})),i_(e,t),e}function n_(e,t){const i=e.getSelectedElement();if(i){const o=c_(e);if(o)return t.createRange(t.createPositionAt(i,o))}return t.schema.findOptimalInsertionRange(e)}function r_(){return null}function s_(e){const t=e=>{const{width:t,paddingLeft:i,paddingRight:o}=e.ownerDocument.defaultView.getComputedStyle(e);return parseFloat(t)-(parseFloat(i)||0)-(parseFloat(o)||0)},i=e.parentElement;if(!i)return 0;let o=t(i),n=0,r=i;for(;isNaN(o);){if(r=r.parentElement,++n>5)return 0;o=t(r)}return o}const a_="widget-type-around";function l_(e,t,i){return!!e&&Jk(e)&&!i.isInline(t)}function c_(e){return e.getAttribute(a_)}var d_=n(6021),u_={attributes:{"data-cke":!0}};u_.setAttributes=Wn(),u_.insert=Un().bind(null,"head"),u_.domAPI=Fn(),u_.insertStyleElement=qn(),Ln()(d_.A,u_),d_.A&&d_.A.locals&&d_.A.locals;const h_=["before","after"],m_=(new DOMParser).parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',"image/svg+xml").firstChild,g_="ck-widget__type-around_disabled";class p_ extends er{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[Hk,Ak]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",((i,o,n)=>{t.change((e=>{for(const i of t.document.roots)n?e.removeClass(g_,i):e.addClass(g_,i)})),n||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 i=this.editor,o=i.editing.view,n=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:n}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,((...e)=>{this.isEnabled&&i(...e)}),o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=c_(e);if(!t)return!1;const i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,i=e.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",((e,n,r)=>{const s=r.mapper.toViewElement(n.item);s&&l_(s,n.item,t)&&(!function(e,t,i){const o=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const i=this.toDomElement(e);return function(e,t){for(const i of h_){const o=new fn({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i],"aria-hidden":"true"},children:[e.ownerDocument.importNode(m_,!0)]});e.appendChild(o.render())}}(i,t),function(e){const t=new fn({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(i),i}));e.insert(e.createPositionAt(i,"end"),o)}(r.writer,o,s),s.getCustomProperty("widgetLabel").push((()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):"")))}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,i=t.document.selection,o=t.schema,n=e.editing.view;function r(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(n.document,"arrowKey",((e,t)=>{this._handleArrowKeyPress(e,t)}),{context:[Jk,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",((t,i)=>{i.directChange&&e.model.change((e=>{e.removeSelectionAttribute(a_)}))})),this._listenToIfEnabled(t.document,"change:data",(()=>{const t=i.getSelectedElement();t&&l_(e.editing.mapper.toViewElement(t),t,o)||e.model.change((e=>{e.removeSelectionAttribute(a_)}))})),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",((e,t,i)=>{const n=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(n.removeClass(h_.map(r),e),this._currentFakeCaretModelElement=null)}const s=t.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!l_(a,s,o))return;const l=c_(t.selection);l&&(n.addClass(r(l),a),this._currentFakeCaretModelElement=s)})),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",((t,i,o)=>{o||e.model.change((e=>{e.removeSelectionAttribute(a_)}))}))}_handleArrowKeyPress(e,t){const i=this.editor,o=i.model,n=o.document.selection,r=o.schema,s=i.editing.view,a=function(e,t){const i=Oo(e,t);return"down"===i||"right"===i}(t.keyCode,i.locale.contentLanguageDirection),l=s.document.selection.getSelectedElement();let c;l_(l,i.editing.mapper.toModelElement(l),r)?c=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed?c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(c=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),c&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,i=c_(t.document.selection);return t.change((t=>i?i!==(e?"after":"before")&&(t.removeSelectionAttribute(a_),!0):(t.setSelectionAttribute(a_,e?"after":"before"),!0)))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,i=t.model,o=i.schema,n=t.plugins.get("Widget"),r=n._getObjectElementNextToSelection(e);return!!l_(t.editing.mapper.toViewElement(r),r,o)&&(i.change((t=>{n._setSelectionOverElement(r),t.setSelectionAttribute(a_,e?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,i=t.model,o=i.schema,n=t.editing.mapper,r=i.document.selection,s=e?r.getLastPosition().nodeBefore:r.getFirstPosition().nodeAfter;return!!l_(n.toViewElement(s),s,o)&&(i.change((t=>{t.setSelection(s,"on"),t.setSelectionAttribute(a_,e?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",((i,o)=>{const n=o.domTarget.closest(".ck-widget__type-around__button");if(!n)return;const r=n.classList.contains("ck-widget__type-around__button_before")?"before":"after",s=function(e,t){const i=e.closest(".ck-widget");return t.mapDomToView(i)}(n,t.domConverter),a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r),o.preventDefault(),i.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",((i,o)=>{if("atTarget"!=i.eventPhase)return;const n=t.getSelectedElement(),r=e.editing.mapper.toViewElement(n),s=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:l_(r,n,s)&&(this._insertParagraph(n,o.isSoft?"before":"after"),a=!0),a&&(o.preventDefault(),i.stop())}),{context:Jk})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=e.selection)}),{priority:"high"}),s.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,i=e.model,o=i.schema;this._listenToIfEnabled(t.document,"delete",((t,n)=>{if("atTarget"!=t.eventPhase)return;const r=c_(i.document.selection);if(!r)return;const s=n.direction,a=i.document.selection.getSelectedElement(),l="forward"==s;if("before"===r===l)e.execute("delete",{selection:i.createSelection(a,"on")});else{const t=o.getNearestSelectionRange(i.createPositionAt(a,r),s);if(t)if(t.isCollapsed){const n=i.createSelection(t.start);if(i.modifySelection(n,{direction:s}),n.focus.isEqual(t.start)){const e=function(e,t){let i=t;for(const o of t.getAncestors({parentFirst:!0})){if(o.childCount>1||e.isLimit(o))break;i=o}return i}(o,t.start.parent);i.deleteContent(i.createSelection(e,"on"),{doNotAutoparagraph:!0})}else i.change((i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")}))}else i.change((i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")}))}n.preventDefault(),t.stop()}),{context:Jk})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",((e,[o,n])=>{if(n&&!n.is("documentSelection"))return;const r=c_(i);return r?(e.stop(),t.change((e=>{const n=i.getSelectedElement(),s=t.createPositionAt(n,r),a=e.createSelection(s),l=t.insertContent(o,a);return e.setSelection(a),l}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",((e,i)=>{const[,o,n={}]=i;if(o&&!o.is("documentSelection"))return;const r=c_(t);r&&(n.findOptimalPosition=r,i[3]=n)}),{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",((e,[i])=>{i&&!i.is("documentSelection")||c_(t)&&e.stop()}),{priority:"high"})}}function f_(e,t,i){const o=e.schema,n=e.createRangeIn(t.root),r="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:e,item:s,type:a}of n.getWalker({startPosition:t,direction:i})){if(o.isLimit(s)&&!o.isInline(s))return e;if(a==r&&o.isBlock(s))return null}return null}function b_(e,t,i){const o="backward"==i?t.end:t.start;if(e.checkChild(o,"$text"))return o;for(const{nextPosition:o}of t.getWalker({direction:i}))if(e.checkChild(o,"$text"))return o;return null}var k_=n(9974),__={attributes:{"data-cke":!0}};__.setAttributes=Wn(),__.insert=Un().bind(null,"head"),__.domAPI=Fn(),__.insertStyleElement=qn(),Ln()(k_.A,__),k_.A&&k_.A.locals&&k_.A.locals;class w_ extends er{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[p_,Ak]}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",((t,i,o)=>{const n=o.writer,r=i.selection;if(r.isCollapsed)return;const s=r.getSelectedElement();if(!s)return;const a=e.editing.mapper.toViewElement(s);var l;Jk(a)&&o.consumable.consume(r,"selection")&&n.setSelection(n.createRangeOn(a),{fake:!0,label:(l=a,l.getCustomProperty("widgetLabel").reduce(((e,t)=>"function"==typeof t?e?e+". "+t():t():e?e+". "+t:t),""))})})),this.editor.editing.downcastDispatcher.on("selection",((e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const o=i.writer,n=o.document.selection;let r=null;for(const e of n.getRanges())for(const t of e){const e=t.item;Jk(e)&&(s=e,!(a=r)||!Array.from(s.getAncestors()).includes(a))&&(o.addClass(Qk,e),this._previouslySelected.add(e),r=e)}var s,a}),{priority:"low"}),t.addObserver(au),this.listenTo(i,"mousedown",((...e)=>this._onMousedown(...e))),this.listenTo(i,"arrowKey",((...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)}),{context:[Jk,"$text"]}),this.listenTo(i,"arrowKey",((...e)=>{this._preventDefaultOnArrowKeyPress(...e)}),{context:"$root"}),this.listenTo(i,"arrowKey",function(e){const t=e.model;return(i,o)=>{const n=o.keyCode==Eo.arrowup,r=o.keyCode==Eo.arrowdown,s=o.shiftKey,a=t.document.selection;if(!n&&!r)return;const l=r;if(s&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(a,l))return;const c=function(e,t,i){const o=e.model;if(i){const e=t.isCollapsed?t.focus:t.getLastPosition(),i=f_(o,e,"forward");if(!i)return null;const n=o.createRange(e,i),r=b_(o.schema,n,"backward");return r?o.createRange(e,r):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),i=f_(o,e,"backward");if(!i)return null;const n=o.createRange(i,e),r=b_(o.schema,n,"forward");return r?o.createRange(r,e):null}}(e,a,l);if(c){if(c.isCollapsed){if(a.isCollapsed)return;if(s)return}(c.isCollapsed||function(e,t,i){const o=e.model,n=e.view.domConverter;if(i){const e=o.createSelection(t.start);o.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=o.createRange(e.focus,t.end))}const r=e.mapper.toViewRange(t),s=n.viewRangeToDom(r),a=Qi.getDomRangeRects(s);let l;for(const e of a)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,c,l))&&(t.change((e=>{const i=l?c.end:c.start;if(s){const o=t.createSelection(a.anchor);o.setFocus(i),e.setSelection(o)}else e.setSelection(i)})),i.stop(),o.preventDefault(),o.stopPropagation())}}}(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",((e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())}),{context:"$root"}),this.listenTo(i,"tab",((e,t)=>{"atTarget"==e.eventPhase&&(t.shiftKey||this._selectFirstNestedEditable()&&(t.preventDefault(),e.stop()))}),{context:Jk,priority:"low"}),this.listenTo(i,"tab",((e,t)=>{t.shiftKey&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())}),{priority:"low"}),this.listenTo(i,"keydown",((e,t)=>{t.keystroke==Eo.esc&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())}),{priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const i=this.editor,o=i.editing.view,n=o.document;let r=t.target;if(!r)return;if(t.domEvent.detail>=3)return void(this._selectBlockContent(r)&&t.preventDefault());if(!Jk(r)){const e=function(e){let t=e;for(;t;){if(t.is("editableElement")||Jk(t))return t;t=t.parent}return null}(r);if(!e)return;if(Jk(e))r=e;else{const e=function(e,t){const i=qi(t.domEvent);let o=null;if(o=i?e.domConverter.domRangeToView(i):e.createRange(e.createPositionAt(t.target,0)),!o)return null;const n=o.start;if(!n.parent)return null;let r=n.parent;return n.parent.is("editableElement")&&(n.isAtEnd&&n.nodeBefore?r=n.nodeBefore:n.isAtStart&&n.nodeAfter&&(r=n.nodeAfter)),r.is("$text")?r.parent:r}(o,t);if(!e||!Jk(e))return;r=e}}s.isAndroid&&t.preventDefault(),n.isFocused||o.focus();const a=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(a)}_selectBlockContent(e){const t=this.editor,i=t.model,o=t.editing.mapper,n=i.schema,r=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),s=function(e,t){for(const i of e.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(i,"$text"))return i;if(t.isLimit(i)&&!t.isObject(i))break}return null}(o.toModelElement(r),i.schema);return!!s&&(i.change((e=>{const t=n.isLimit(s)?null:function(e,t){const i=new hl({startPosition:e});for(const{item:e}of i){if(t.isLimit(e)||!e.is("element"))return null;if(t.checkChild(e,"$text"))return e}return null}(e.createPositionAfter(s),n),i=e.createPositionAt(s,0),o=t?e.createPositionAt(t,0):e.createPositionAt(s,"end");e.setSelection(e.createRange(i,o))})),!0)}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode,o=this.editor.model,n=o.schema,r=o.document.selection,s=r.getSelectedElement(),a=Oo(i,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,c="up"==a||"down"==a;if(s&&n.isObject(s)){const i=l?r.getLastPosition():r.getFirstPosition(),s=n.getNearestSelectionRange(i,l?"forward":"backward");return void(s&&(o.change((e=>{e.setSelection(s)})),t.preventDefault(),e.stop()))}if(!r.isCollapsed&&!t.shiftKey){const i=r.getFirstPosition(),s=r.getLastPosition(),a=i.nodeAfter,c=s.nodeBefore;return void((a&&n.isObject(a)||c&&n.isObject(c))&&(o.change((e=>{e.setSelection(l?s:i)})),t.preventDefault(),e.stop()))}if(!r.isCollapsed)return;const d=this._getObjectElementNextToSelection(l);if(d&&n.isObject(d)){if(n.isInline(d)&&c)return;this._setSelectionOverElement(d),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t))return;if(!t.isCollapsed)return;const i=this._getObjectElementNextToSelection(e);return i?(this.editor.model.change((e=>{let o=t.anchor.parent;for(;o.isEmpty;){const t=o;o=t.parent,e.remove(t)}this._setSelectionOverElement(i)})),!0):void 0}_setSelectionOverElement(e){this.editor.model.change((t=>{t.setSelection(t.createRangeOn(e))}))}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema,o=t.document.selection,n=t.createSelection(o);if(t.modifySelection(n,{direction:e?"forward":"backward"}),n.isEqual(o))return null;const r=e?n.focus.nodeBefore:n.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Qk,t);this._previouslySelected.clear()}_selectFirstNestedEditable(){const e=this.editor,t=this.editor.editing.view.document;for(const i of t.selection.getFirstRange().getItems())if(i.is("editableElement")){const t=e.editing.mapper.toModelElement(i);if(!t)continue;const o=e.model.createPositionAt(t,0),n=e.model.schema.getNearestSelectionRange(o,"forward");return e.model.change((e=>{e.setSelection(n)})),!0}return!1}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,o=(i.is("$text")?i.parent:i).findAncestor(Jk);if(!o)return!1;const n=t.toModelElement(o);return!!n&&(e.model.change((e=>{e.setSelection(n,"on")})),!0)}}class v_ extends er{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[Jf]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}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||!Jk(t))})(e.editing.view.document.selection)&&t.stop()}),{priority:"high"})}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:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container"}){if(!i.length)return void C("widget-toolbar-no-items",{toolbarId:e});const r=this.editor,s=r.t,a=new Wg(r.locale);if(a.ariaLabel=t||s("Widget toolbar"),this._toolbarDefinitions.has(e))throw new A("widget-toolbar-duplicated",this,{toolbarId:e});const l={view:a,getRelatedElement:o,balloonClassName:n,itemsConfig:i,initialized:!1};r.ui.addToolbar(a,{isContextual:!0,beforeFocus:()=>{const e=o(r.editing.view.document.selection);e&&this._showToolbar(l,e)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(e,l)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const o of this._toolbarDefinitions.values()){const n=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&n)if(this.editor.ui.focusTracker.isFocused){const r=n.getAncestors().length;r>e&&(e=r,t=n,i=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?y_(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:x_(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);y_(this.editor,t)}})))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function y_(e,t){const i=e.plugins.get("ContextualBalloon"),o=x_(e,t);i.updatePosition(o)}function x_(e,t){const i=e.editing.view,o=Ig.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast,o.viewportStickyNorth]}}class A_ extends(Z()){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,i){const o=new Qi(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)if(e.classList.contains(`ck-widget__resizer__handle-${i}`))return i}(e),this._referenceCoordinates=function(e,t){const i=new Qi(e),o=t.split("-"),n={x:"right"==o[1]?i.right:i.left,y:"bottom"==o[0]?i.bottom:i.top};return n.x+=e.ownerDocument.defaultView.scrollX,n.y+=e.ownerDocument.defaultView.scrollY,n}(t,function(e){const t=e.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}(this.activeHandlePosition)),this._originalWidth=o.width,this._originalHeight=o.height,this._aspectRatio=o.width/o.height;const n=i.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(n):this._originalWidthPercents=function(e,t=new Qi(e)){const i=s_(e);return i?t.width/i*100:0}(i,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}class C_ extends Kn{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,i,o)=>"px"===e.unit?`${t}×${i}`:`${o}%`)),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",((e,t,i)=>t<50||i<50?"above-center":e))}_dismiss(){this.unbind(),this._isVisible=!1}}class T_ extends(Z()){constructor(e){super(),this._viewResizerWrapper=null,this._options=e,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((i=>{const o=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const i=this.toDomElement(t);return e._appendHandles(i),e._appendSizeUI(i),i}));i.insert(i.createPositionAt(t,"end"),o),i.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=o,this.isVisible||this.hide()})),this.on("change:isVisible",(()=>{this.isVisible?(this.show(),this.redraw()):this.hide()}))}begin(e){this._state=new A_(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 i=this._options.unit||"%",o=("%"===i?t.widthPercents:t.width)+i;e.setStyle("width",o,this._options.viewElement)}));const i=this._getHandleHost(),o=new Qi(i),n=Math.round(o.width),r=Math.round(o.height),s=new Qi(i);t.width=Math.round(s.width),t.height=Math.round(s.height),this.redraw(o),this.state.update({...t,handleHostWidth:n,handleHostHeight:r})}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(!((i=t)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const o=t.parentElement,n=this._getHandleHost(),r=this._viewResizerWrapper,s=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let a;if(o.isSameNode(n)){const t=e||new Qi(n);a=[t.width+"px",t.height+"px",void 0,void 0]}else a=[n.offsetWidth+"px",n.offsetHeight+"px",n.offsetLeft+"px",n.offsetTop+"px"];"same"!==te(s,a)&&this._options.editor.editing.view.change((e=>{e.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},r)}))}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,i=(n=e).pageX,o=n.pageY;var n;const r=!this._options.isCentered||this._options.isCentered(this),s={x:t._referenceCoordinates.x-(i+t.originalWidth),y:o-t.originalHeight-t._referenceCoordinates.y};r&&t.activeHandlePosition.endsWith("-right")&&(s.x=i-(t._referenceCoordinates.x+t.originalWidth)),r&&(s.x*=2);let a=Math.abs(t.originalWidth+s.x),l=Math.abs(t.originalHeight+s.y);return"width"==(a/t.aspectRatio>l?"width":"height")?l=a/t.aspectRatio:a=l*t.aspectRatio,{width:Math.round(a),height:Math.round(l),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*a*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 o of t)e.appendChild(new fn({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=o,`ck-widget__resizer__handle-${i}`)}}).render());var i}_appendSizeUI(e){this._sizeView=new C_,this._sizeView.render(),e.appendChild(this._sizeView.element)}}var E_=n(6926),S_={attributes:{"data-cke":!0}};S_.setAttributes=Wn(),S_.insert=Un().bind(null,"head"),S_.domAPI=Fn(),S_.insertStyleElement=qn(),Ln()(E_.A,S_),E_.A&&E_.A.locals&&E_.A.locals;class P_ extends er{constructor(){super(...arguments),this._resizers=new Map}static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.editing,i=t.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(au),this._observer=new(Ui()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(i,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(i,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=Zu((()=>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(t.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 T_(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){const e=i.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 o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==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 i=t.domTarget;T_.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}const I_=ro("px");class M_ extends Kn{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",(e=>!e))],style:{left:e.to("left",(e=>I_(e))),top:e.to("top",(e=>I_(e))),width:e.to("width",(e=>I_(e)))}}})}}class O_ extends er{constructor(){super(...arguments),this.removeDropMarkerDelayed=ln((()=>this.removeDropMarker()),40),this._updateDropMarkerThrottled=Zu((e=>this._updateDropMarker(e)),40),this._reconvertMarkerThrottled=Zu((()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")}),0),this._dropTargetLineView=new M_,this._domEmitter=new(Ui()),this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,o,n,r){this.removeDropMarkerDelayed.cancel();const s=V_(this.editor,e,t,i,o,n,r);if(s)return r&&r.containsRange(s)?this.removeDropMarker():void this._updateDropMarkerThrottled(s)}getFinalDropRange(e,t,i,o,n,r){const s=V_(this.editor,e,t,i,o,n,r);return this.removeDropMarker(),s}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change((e=>{e.removeMarker("drop-target")}))}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),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:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,i=t.model.markers;t.model.change((t=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})}))}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(e){const t=this.toDomElement(e);return t.append("⁠",e.createElement("span"),"⁠"),t}))}_updateDropTargetLine(e){const i=this.editor.editing,o=e.start.nodeBefore,n=e.start.nodeAfter,r=e.start.parent,s=o?i.mapper.toViewElement(o):null,a=s?i.view.domConverter.mapViewToDom(s):null,l=n?i.mapper.toViewElement(n):null,c=l?i.view.domConverter.mapViewToDom(l):null,d=i.mapper.toViewElement(r);if(!d)return;const u=i.view.domConverter.mapViewToDom(d),h=this._getScrollableRect(d),{scrollX:m,scrollY:g}=t.window,p=a?new Qi(a):null,f=c?new Qi(c):null,b=new Qi(u).excludeScrollbarsAndBorders(),k=p?p.bottom:b.top,_=f?f.top:b.bottom,w=t.window.getComputedStyle(u),v=k<=_?(k+_)/2:_;if(h.top<v&&v<h.bottom){const e=b.left+parseFloat(w.paddingLeft),t=b.right-parseFloat(w.paddingRight),i=Math.max(e+m,h.left),o=Math.min(t+m,h.right);this._dropTargetLineView.set({isVisible:!0,left:i,top:v+g,width:o-i})}else this._dropTargetLineView.isVisible=!1}_getScrollableRect(e){const i=e.root.rootName;let o;if(this._scrollables.has(i))o=this._scrollables.get(i).domElement;else{o=function(e){let i=e;do{i=i.parentElement;const e=t.window.getComputedStyle(i).overflowY;if("auto"==e||"scroll"==e)break}while("BODY"!=i.tagName);return i}(this.editor.editing.view.domConverter.mapViewToDom(e)),this._domEmitter.listenTo(o,"scroll",this._reconvertMarkerThrottled,{usePassive:!0});const n=new oo(o,this._reconvertMarkerThrottled);this._scrollables.set(i,{domElement:o,resizeObserver:n})}return new Qi(o).excludeScrollbarsAndBorders()}}function V_(e,t,i,o,n,r,s){const a=e.model,l=e.editing.mapper;let c=D_(e,t);for(;c;){if(!r)if(a.schema.checkChild(c,"$text")){if(i){const t=i[0].start,r=l.toModelPosition(t);if(!s||Array.from(s.getItems({shallow:!0})).every((e=>a.schema.checkChild(r,e)))){if(a.schema.checkChild(r,"$text"))return a.createRange(r);if(t)return R_(e,D_(e,t.parent),o,n)}}}else if(a.schema.isInline(c))return R_(e,c,o,n);if(a.schema.isBlock(c))return R_(e,c,o,n);if(a.schema.checkChild(c,"$block")){const t=Array.from(c.getChildren()).filter((t=>t.is("element")&&!N_(e,t)));let i=0,r=t.length;if(0==r)return a.createRange(a.createPositionAt(c,"end"));for(;i<r-1;){const s=Math.floor((i+r)/2);"before"==B_(e,t[s],o,n)?r=s:i=s}return R_(e,t[i],o,n)}c=c.parent}return null}function N_(e,i){const o=e.editing.mapper,n=e.editing.view.domConverter,r=o.toViewElement(i);if(!r)return!0;const s=n.mapViewToDom(r);return"none"!=t.window.getComputedStyle(s).float}function R_(e,t,i,o){const n=e.model;return n.createRange(n.createPositionAt(t,B_(e,t,i,o)))}function B_(e,t,i,o){const n=e.editing.mapper,r=e.editing.view.domConverter,s=n.toViewElement(t),a=r.mapViewToDom(s),l=new Qi(a);return e.model.schema.isInline(t)?i<(l.left+l.right)/2?"before":"after":o<(l.top+l.bottom)/2?"before":"after"}function D_(e,t){const i=e.editing.mapper,o=e.editing.view,n=i.toModelElement(t);if(n)return n;const r=o.createPositionBefore(t),s=i.findMappedViewAncestor(r);return i.toModelElement(s)}class L_ extends er{constructor(){super(...arguments),this._isBlockDragging=!1,this._domEmitter=new(Ui())}static get pluginName(){return"DragDropBlockToolbar"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(this.listenTo(e,"change:isReadOnly",((e,t,i)=>{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")})),s.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const i=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(i,"dragstart",((e,t)=>this._handleBlockDragStart(t))),this._domEmitter.listenTo(t.document,"dragover",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(t.document,"drop",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(t.document,"dragend",(()=>this._handleBlockDragEnd()),{useCapture:!0}),this.isEnabled&&i.setAttribute("draggable","true"),this.on("change:isEnabled",((e,t,o)=>{i.setAttribute("draggable",o?"true":"false")}))}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,i=t.document.selection,o=this.editor.editing.view,n=Array.from(i.getSelectedBlocks()),r=t.createRange(t.createPositionBefore(n[0]),t.createPositionAfter(n[n.length-1]));t.change((e=>e.setSelection(r))),this._isBlockDragging=!0,o.focus(),o.getObserver(Zb).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+("ltr"==this.editor.locale.contentLanguageDirection?100:-100),i=e.clientY,o=document.elementFromPoint(t,i),n=this.editor.editing.view;o&&o.closest(".ck-editor__editable")&&n.getObserver(Zb).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:o,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}var z_=n(6356),F_={attributes:{"data-cke":!0}};F_.setAttributes=Wn(),F_.insert=Un().bind(null,"head"),F_.domAPI=Fn(),F_.insertStyleElement=qn(),Ln()(z_.A,F_),z_.A&&z_.A.locals&&z_.A.locals;class j_ extends er{constructor(){super(...arguments),this._clearDraggableAttributesDelayed=ln((()=>this._clearDraggableAttributes()),40),this._blockMode=!1,this._domEmitter=new(Ui())}static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[ak,w_,O_,L_]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(Zb),t.addObserver(au),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((e,t,i)=>{i||this._finalizeDragging(!1)})),s.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,i=e.model,o=e.editing.view,n=o.document,r=e.plugins.get(O_);this.listenTo(n,"dragstart",((e,t)=>{if(t.target&&t.target.is("editableElement"))return void t.preventDefault();if(this._prepareDraggedRange(t.target),!this._draggedRange)return void t.preventDefault();this._draggingUid=v(),t.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",t.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const o=i.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(t.dataTransfer,o,"dragstart");const{dataTransfer:n,domTarget:r,domEvent:s}=t,{clientX:a}=s;this._updatePreview({dataTransfer:n,domTarget:r,clientX:a}),t.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(n,"dragend",((e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)}),{priority:"low"}),this._domEmitter.listenTo(t.document,"dragend",(()=>{this._blockMode=!1}),{useCapture:!0}),this.listenTo(n,"dragenter",(()=>{this.isEnabled&&o.focus()})),this.listenTo(n,"dragleave",(()=>{r.removeDropMarkerDelayed()})),this.listenTo(n,"dragging",((e,t)=>{if(!this.isEnabled)return void(t.dataTransfer.dropEffect="none");const{clientX:i,clientY:o}=t.domEvent;r.updateDropMarker(t.target,t.targetRanges,i,o,this._blockMode,this._draggedRange),this._draggedRange||(t.dataTransfer.dropEffect="copy"),s.isGecko||("copy"==t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect="copy":["all","copyMove"].includes(t.dataTransfer.effectAllowed)&&(t.dataTransfer.dropEffect="move")),e.stop()}),{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get(O_);this.listenTo(t,"clipboardInput",((t,o)=>{if("drop"!=o.method)return;const{clientX:n,clientY:r}=o.domEvent,s=i.getFinalDropRange(o.target,o.targetRanges,n,r,this._blockMode,this._draggedRange);return s?(this._draggedRange&&this._draggingUid!=o.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),"move"==U_(o.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(s,!0)?(this._finalizeDragging(!1),void t.stop()):void(o.targetRanges=[e.editing.mapper.toViewRange(s)])):(this._finalizeDragging(!1),void t.stop())}),{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(ak);e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i=t.targetRanges.map((e=>this.editor.editing.mapper.toModelRange(e)));this.editor.model.change((e=>e.setSelection(i)))}),{priority:"high"}),e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i="move"==U_(t.dataTransfer),o=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(o&&i)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"mousedown",((o,n)=>{if(s.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let r=H_(n.target);if(s.isBlink&&!e.isReadOnly&&!r&&!i.selection.isCollapsed){const e=i.selection.getSelectedElement();e&&Jk(e)||(r=i.selection.editableElement)}r&&(t.change((e=>{e.setAttribute("draggable","true",r)})),this._draggableElement=e.editing.mapper.toModelElement(r))})),this.listenTo(i,"mouseup",(()=>{s.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}))}_finalizeDragging(e){const t=this.editor,i=t.model;t.plugins.get(O_).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change((e=>{const t=i.createSelection(this._draggedRange);i.deleteContent(t,{doNotAutoparagraph:!0});const o=t.getFirstPosition().parent;o.isEmpty&&!i.schema.checkChild(o,"$text")&&i.schema.checkChild(o,"paragraph")&&e.insertElement("paragraph",o,0)})),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,i=t.model,o=i.document.selection,n=e?H_(e):null;if(n){const e=t.editing.mapper.toModelElement(n);return this._draggedRange=Bl.fromRange(i.createRangeOn(e)),this._blockMode=i.schema.isBlock(e),void(t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop"))}if(o.isCollapsed&&!o.getFirstPosition().parent.isEmpty)return;const r=Array.from(o.getSelectedBlocks()),s=o.getFirstRange();if(0==r.length)return void(this._draggedRange=Bl.fromRange(s));const a=W_(i,r);if(r.length>1)this._draggedRange=Bl.fromRange(a),this._blockMode=!0;else if(1==r.length){const e=s.start.isTouching(a.start)&&s.end.isTouching(a.end);this._draggedRange=Bl.fromRange(e?a:s),this._blockMode=e}i.change((e=>e.setSelection(this._draggedRange.toRange())))}_updatePreview({dataTransfer:e,domTarget:i,clientX:o}){const n=this.editor.editing.view,r=n.document.selection.editableElement,a=n.domConverter.mapViewToDom(r),l=t.window.getComputedStyle(a);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=be(t.document,"div",{style:"position: fixed; left: -999999px;"}),t.document.body.appendChild(this._previewContainer));const c=new Qi(a);if(a.contains(i))return;const d=parseFloat(l.paddingLeft),u=be(t.document,"div");u.className="ck ck-content",u.style.width=l.width,u.style.paddingLeft=`${c.left-o+d}px`,s.isiOS&&(u.style.backgroundColor="white"),n.domConverter.setContentOf(u,e.getData("text/html")),e.setDragImage(u,0,0),this._previewContainer.appendChild(u)}}function U_(e){return s.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function H_(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(Jk);if(Jk(e))return e;const t=e.findAncestor((e=>Jk(e)||e.is("editableElement")));return Jk(t)?t:null}function W_(e,t){const i=t[0],o=t[t.length-1],n=i.getCommonAncestor(o),r=e.createPositionBefore(i),s=e.createPositionAfter(o);if(n&&n.is("element")&&!e.schema.isLimit(n)){const t=e.createRangeOn(n),i=r.isTouching(t.start),o=s.isTouching(t.end);if(i&&o)return W_(e,[n])}return e.createRange(r,s)}class $_ extends er{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[ak]}init(){const e=this.editor,t=e.model,i=e.editing.view,o=t.document.selection;i.addObserver(Zb),e.plugins.get(ak).on("contentInsertion",((e,i)=>{(function(e,t){let i=t.createRangeIn(e);if(1==e.childCount){const o=e.getChild(0);o.is("element")&&t.schema.isBlock(o)&&!t.schema.isObject(o)&&!t.schema.isLimit(o)&&(i=t.createRangeIn(o))}for(const e of i.getItems()){if(!t.schema.isInline(e))return!1;if(Array.from(e.getAttributeKeys()).find((e=>t.schema.getAttributeProperties(e).isFormatting)))return!1}return!0})(i.content,t)&&t.change((e=>{const n=Array.from(o.getAttributes()).filter((([e])=>t.schema.getAttributeProperties(e).isFormatting));o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0}),n.push(...o.getAttributes());const r=e.createRangeIn(i.content);for(const i of r.getItems())for(const o of n)t.schema.checkAttribute(i,o[0])&&e.setAttribute(o[0],o[1],i)}))}))}}class q_ extends er{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[sk,ak,j_,$_]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class Z_ extends ir{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!G_(e.schema,i))do{if(i=i.parent,!i)return}while(!G_(e.schema,i));e.change((e=>{e.setSelection(i,"in")}))}}function G_(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const K_=Io("Ctrl+A");class Y_ extends er{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new Z_(e)),this.listenTo(i,"keydown",((t,i)=>{Po(i)===K_&&(e.execute("selectAll"),i.preventDefault())})),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class Q_ extends er{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",(()=>{const e=this._createButton(Dh);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:selectAll",(()=>this._createButton(dm)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("selectAll"),n=new e(t.locale),r=i.t;return n.set({label:r("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A"}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),n}}class J_ extends er{static get requires(){return[Y_,Q_]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}class X_ extends ir{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",((e,t)=>{t[1]={...t[1]};const i=t[1];i.batchType||(i.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}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){const o=this.editor.model,n=o.document,r=[],s=e.map((e=>e.getTransformedByOperations(i))),a=s.flat();for(const e of s){const t=e.filter((e=>e.root!=n.graveyard)).filter((e=>!tw(e,a)));t.length&&(ew(t),r.push(t[0]))}r.length&&o.change((e=>{e.setSelection(r,{backward:t})}))}_undo(e,t){const i=this.editor.model,o=i.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(o.history.getOperations(n)),s=md([e.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let n of s){const r=n.affectedSelectable;r&&!i.canEditAt(r)&&(n=new od(n.baseVersion)),t.addOperation(n),i.applyOperation(n),o.history.setOperationAsUndone(e,n)}}}}function ew(e){e.sort(((e,t)=>e.start.isBefore(t.start)?-1:1));for(let t=1;t<e.length;t++){const i=e[t-1].getJoined(e[t],!0);i&&(t--,e.splice(t,2,i))}}function tw(e,t){return t.some((t=>t!==e&&t.containsRange(e,!0)))}class iw extends X_{execute(e=null){const t=e?this._stack.findIndex((t=>t.batch==e)):this._stack.length-1,i=this._stack.splice(t,1)[0],o=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(o,(()=>{this._undo(i.batch,o);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e)})),this.fire("revert",i.batch,o),this.refresh()}}class ow extends X_{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,(()=>{const i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)})),this.refresh()}}class nw extends er{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;this._undoCommand=new iw(e),this._redoCommand=new ow(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",((e,t)=>{const i=t[0];if(!i.isDocumentOperation)return;const o=i.batch,n=this._redoCommand.createdBatches.has(o),r=this._undoCommand.createdBatches.has(o);this._batchRegistry.has(o)||(this._batchRegistry.add(o),o.isUndoable&&(n?this._undoCommand.addBatch(o):r||(this._undoCommand.addBatch(o),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((e,t,i)=>{this._redoCommand.addBatch(i)})),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class rw extends er{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,o="ltr"==t.uiLanguageDirection?Eh:Th,n="ltr"==t.uiLanguageDirection?Th:Eh;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",o),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",n)}_addButtonsToFactory(e,t,i,o){const n=this.editor;n.ui.componentFactory.add(e,(()=>{const n=this._createButton(Dh,e,t,i,o);return n.set({tooltip:!0}),n})),n.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton(dm,e,t,i,o)))}_createButton(e,t,i,o,n){const r=this.editor,s=r.locale,a=r.commands.get(t),l=new e(s);return l.set({label:i,icon:n,keystroke:o}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",(()=>{r.execute(t),r.editing.view.focus()})),l}}class sw extends er{static get requires(){return[nw,rw]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}class aw extends ir{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=Xo(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&lw(t,e.schema)}execute(e={}){const t=this.editor.model,i=t.document,o=e.selection||i.selection;t.canEditAt(o)&&t.change((e=>{const i=o.getSelectedBlocks();for(const o of i)!o.is("element","paragraph")&&lw(o,t.schema)&&e.rename(o,"paragraph")}))}}function lw(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class cw extends ir{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,i=e.attributes;let o=e.position;return t.canEditAt(o)?t.change((e=>{if(o=this._findPositionToInsertParagraph(o,e),!o)return null;const n=e.createElement("paragraph");return i&&t.schema.setAllowedAttributes(n,i,e),t.insertContent(n,o),e.setSelection(n,"in"),e.createPositionAt(n,0)})):null}_findPositionToInsertParagraph(e,t){const i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;const o=i.schema.findAllowedParent(e,"paragraph");if(!o)return null;const n=e.parent,r=i.schema.checkChild(n,"$text");return n.isEmpty||r&&e.isAtEnd?i.createPositionAfter(n):!n.isEmpty&&r&&e.isAtStart?i.createPositionBefore(n):t.split(e,o).position}}class dw extends er{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new aw(e)),e.commands.add("insertParagraph",new cw(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>dw.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}dw.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);const uw=dw;class hw extends ir{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,o=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(i.isCollapsed)o?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const n=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of n)o?e.setAttribute(this.attributeKey,o,t):e.removeAttribute(this.attributeKey,t)}}))}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const e of i.getRanges())for(const i of e.getItems())if(t.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const mw="bold";class gw extends er{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:mw}),e.model.schema.setAttributeProperties(mw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:mw,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t&&("bold"==t||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(mw,new hw(e,mw)),e.keystrokes.set("CTRL+B",mw),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}}function pw({editor:e,commandName:t,plugin:i,icon:o,label:n,keystroke:r}){return s=>{const a=e.commands.get(t),l=new s(e.locale);return l.set({label:n,icon:o,keystroke:r,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof dm?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),i.listenTo(l,"execute",(()=>{e.execute(t),e.editing.view.focus()})),l}}const fw="bold";class bw extends er{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=pw({editor:e,commandName:fw,plugin:this,icon:ph,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(fw,(()=>i(Dh))),e.ui.componentFactory.add("menuBar:"+fw,(()=>i(dm)))}}var kw=n(7930),_w={attributes:{"data-cke":!0}};_w.setAttributes=Wn(),_w.insert=Un().bind(null,"head"),_w.domAPI=Fn(),_w.insertStyleElement=qn(),Ln()(kw.A,_w),kw.A&&kw.A.locals&&kw.A.locals;const ww="italic";class vw extends er{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:ww}),e.model.schema.setAttributeProperties(ww,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:ww,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(ww,new hw(e,ww)),e.keystrokes.set("CTRL+I",ww),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}}const yw="italic";class xw extends er{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=pw({editor:e,commandName:yw,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",label:t("Italic")});e.ui.componentFactory.add(yw,(()=>i(Dh))),e.ui.componentFactory.add("menuBar:"+yw,(()=>i(dm)))}}const Aw="strikethrough";class Cw extends er{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Aw}),e.model.schema.setAttributeProperties(Aw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Aw,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(Aw,new hw(e,Aw)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const Tw="strikethrough";class Ew extends er{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=pw({editor:e,commandName:Tw,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>',keystroke:"CTRL+SHIFT+X",label:t("Strikethrough")});e.ui.componentFactory.add(Tw,(()=>i(Dh))),e.ui.componentFactory.add("menuBar:"+Tw,(()=>i(dm)))}}const Sw="underline";class Pw extends er{static get pluginName(){return"UnderlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Sw}),e.model.schema.setAttributeProperties(Sw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Sw,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(Sw,new hw(e,Sw)),e.keystrokes.set("CTRL+U","underline"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Underline text"),keystroke:"CTRL+U"}]})}}const Iw="underline";class Mw extends er{static get pluginName(){return"UnderlineUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=pw({editor:e,commandName:Iw,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z"/></svg>',label:t("Underline"),keystroke:"CTRL+U"});e.ui.componentFactory.add(Iw,(()=>i(Dh))),e.ui.componentFactory.add("menuBar:"+Iw,(()=>i(dm)))}}const Ow="removeFormat";class Vw extends er{static get pluginName(){return"RemoveFormatUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add(Ow,(()=>{const e=this._createButton(Dh);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add(`menuBar:${Ow}`,(()=>this._createButton(dm)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get(Ow),n=new e(t.locale),r=i.t;return n.set({label:r("Remove Format"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z"/></svg>'}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute(Ow),t.editing.view.focus()})),n}}class Nw extends ir{refresh(){const e=this.editor.model;this.isEnabled=!!Xo(this._getFormattingItems(e.document.selection,e.schema))}execute(){const e=this.editor.model,t=e.schema;e.change((i=>{for(const o of this._getFormattingItems(e.document.selection,t))if(o.is("selection"))for(const e of this._getFormattingAttributes(o,t))i.removeSelectionAttribute(e);else{const e=i.createRangeOn(o);for(const n of this._getFormattingAttributes(o,t))i.removeAttribute(n,e)}}))}*_getFormattingItems(e,t){const i=e=>!!Xo(this._getFormattingAttributes(e,t));for(const o of e.getRanges())for(const e of o.getItems())!t.isBlock(e)&&i(e)&&(yield e);for(const t of e.getSelectedBlocks())i(t)&&(yield t);i(e)&&(yield e)}*_getFormattingAttributes(e,t){for(const[i]of e.getAttributes()){const e=t.getAttributeProperties(i);e&&e.isFormatting&&(yield i)}}}class Rw extends er{static get pluginName(){return"RemoveFormatEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.commands.add("removeFormat",new Nw(e))}}class Bw extends ir{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,o=e.value,n=e.batch,r=e=>{if(i.isCollapsed)o?e.setSelectionAttribute(this.attributeKey,o):e.removeSelectionAttribute(this.attributeKey);else{const n=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of n)o?e.setAttribute(this.attributeKey,o,t):e.removeAttribute(this.attributeKey,t)}};n?t.enqueueChange(n,(e=>{r(e)})):t.change((e=>{r(e)}))}}const Dw="fontSize",Lw="fontFamily",zw="fontColor",Fw="fontBackgroundColor";function jw(e,t){const i={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t)i.model.values.push(e.model),i.view[e.model]=e.view,e.upcastAlso&&(i.upcastAlso[e.model]=e.upcastAlso);return i}function Uw(e){return t=>t.getStyle(e).replace(/\s/g,"")}function Hw(e){return(t,{writer:i})=>i.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class Ww extends Bw{constructor(e){super(e,Lw)}}function $w(e){return e.map(qw).filter((e=>void 0!==e))}function qw(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),i=t[0],o=t.map(Zw).join(", ");return{title:i,model:o,view:{name:"span",styles:{"font-family":o},priority:7}}}(e):void 0}function Zw(e){return(e=e.trim()).indexOf(" ")>0&&(e=`'${e}'`),e}class Gw extends er{static get pluginName(){return"FontFamilyEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(Lw,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Lw}),e.model.schema.setAttributeProperties(Lw,{isFormatting:!0,copyOnEnter:!0});const t=$w(e.config.get("fontFamily.options")).filter((e=>e.model)),i=jw(Lw,t);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(Lw,new Ww(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:Lw,view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:Lw,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:Lw,value:e=>e.getAttribute("face")}})}}const Kw='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.03 3h6.149a.75.75 0 1 1 0 1.5h-5.514L11.03 3zm1.27 3h4.879a.75.75 0 1 1 0 1.5h-4.244L12.3 6zm1.27 3h3.609a.75.75 0 1 1 0 1.5h-2.973L13.57 9zm-2.754 2.5L8.038 4.785 5.261 11.5h5.555zm.62 1.5H4.641l-1.666 4.028H1.312l5.789-14h1.875l5.789 14h-1.663L11.436 13z"/></svg>';class Yw extends er{static get pluginName(){return"FontFamilyUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=this._getLocalizedOptions(),o=e.commands.get(Lw),n=t("Font Family"),r=function(e,t){const i=new Jo;for(const o of e){const e={type:"button",model:new qf({commandName:Lw,commandParam:o.model,label:o.title,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(e=>e===o.model||!(!e||!o.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===o.model.toLowerCase())),o.view&&"string"!=typeof o.view&&o.view.styles&&e.model.set("labelStyle",`font-family: ${o.view.styles["font-family"]}`),i.add(e)}return i}(i,o);e.ui.componentFactory.add(Lw,(t=>{const i=tp(t);return np(i,r,{role:"menu",ariaLabel:n}),i.buttonView.set({label:n,icon:Kw,tooltip:!0}),i.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),i.bind("isEnabled").to(o),this.listenTo(i,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),i})),e.ui.componentFactory.add(`menuBar:${Lw}`,(t=>{const i=new Vb(t);i.buttonView.set({label:n,icon:Kw}),i.bind("isEnabled").to(o);const s=new Nb(t);for(const o of r){const n=new yf(t,i),r=new dm(t);r.set({role:"menuitemradio",isToggleable:!0}),r.bind(...Object.keys(o.model)).to(o.model),r.delegate("execute").to(i),r.on("execute",(()=>{e.execute(o.model.commandName,{value:o.model.commandParam}),e.editing.view.focus()})),n.children.add(r),s.items.add(n)}return i.panelView.children.add(s),i}))}_getLocalizedOptions(){const e=this.editor,t=e.t;return $w(e.config.get(Lw).options).map((e=>("Default"===e.title&&(e.title=t("Default")),e)))}}class Qw extends Bw{constructor(e){super(e,Dw)}}function Jw(e){return e.map((e=>function(e){if("number"==typeof e&&(e=String(e)),"object"==typeof e&&((t=e).title&&t.model&&t.view))return ev(e);var t;const i=function(e){return"string"==typeof e?Xw[e]:Xw[e.model]}(e);return i?ev(i):"default"===e?{model:void 0,title:"Default"}:function(e){let t;if("object"==typeof e){if(!e.model)throw new A("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e)?void 0:function(e){return"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`}),e.view={name:"span",styles:{"font-size":e.model}},ev(e)}(e)}(e))).filter((e=>void 0!==e))}const Xw={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function ev(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}const tv=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class iv extends er{static get pluginName(){return"FontSizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(Dw,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Dw}),e.model.schema.setAttributeProperties(Dw,{isFormatting:!0,copyOnEnter:!0});const t=e.config.get("fontSize.supportAllValues"),i=Jw(this.editor.config.get("fontSize.options")).filter((e=>e.model)),o=jw(Dw,i);t?(this._prepareAnyValueConverters(o),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(o),e.commands.add(Dw,new Qw(e))}_prepareAnyValueConverters(e){const t=this.editor,i=e.model.values.filter((e=>!vu(String(e))&&!xu(String(e))));if(i.length)throw new A("font-size-invalid-use-of-named-presets",null,{presets:i});t.conversion.for("downcast").attributeToElement({model:Dw,view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").elementToAttribute({model:{key:Dw,value:e=>e.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:Dw,value:e=>{const t=e.getAttribute("size"),i="-"===t[0]||"+"===t[0];let o=parseInt(t,10);i&&(o=3+o);const n=tv.length-1,r=Math.min(Math.max(o,0),n);return tv[r]}}})}}var ov=n(1263),nv={attributes:{"data-cke":!0}};nv.setAttributes=Wn(),nv.insert=Un().bind(null,"head"),nv.domAPI=Fn(),nv.insertStyleElement=qn(),Ln()(ov.A,nv),ov.A&&ov.A.locals&&ov.A.locals;const rv='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.816 11.5 7.038 4.785 4.261 11.5h5.555zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13zm7.55 2.279.779-.779.707.707-2.265 2.265-2.193-2.265.707-.707.765.765V4.825c0-.042 0-.083.002-.123l-.77.77-.707-.707L17.207 2.5l2.265 2.265-.707.707-.782-.782c.002.043.003.089.003.135v10.454z"/></svg>';class sv extends er{static get pluginName(){return"FontSizeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=this._getLocalizedOptions(),o=e.commands.get(Dw),n=t("Font Size"),r=function(e,t){const i=new Jo;for(const o of e){const e={type:"button",model:new qf({commandName:Dw,commandParam:o.model,label:o.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};o.view&&"string"!=typeof o.view&&(o.view.styles&&e.model.set("labelStyle",`font-size:${o.view.styles["font-size"]}`),o.view.classes&&e.model.set("class",`${e.model.class} ${o.view.classes}`)),e.model.bind("isOn").to(t,"value",(e=>e===o.model)),i.add(e)}return i}(i,o);e.ui.componentFactory.add(Dw,(t=>{const i=tp(t);return np(i,r,{role:"menu",ariaLabel:n}),i.buttonView.set({label:n,icon:rv,tooltip:!0}),i.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),i.bind("isEnabled").to(o),this.listenTo(i,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),i})),e.ui.componentFactory.add(`menuBar:${Dw}`,(t=>{const i=new Vb(t);i.buttonView.set({label:n,icon:rv}),i.bind("isEnabled").to(o);const s=new Nb(t);for(const o of r){const n=new yf(t,i),r=new dm(t);r.set({role:"menuitemradio",isToggleable:!0}),r.bind(...Object.keys(o.model)).to(o.model),r.delegate("execute").to(i),r.on("execute",(()=>{e.execute(o.model.commandName,{value:o.model.commandParam}),e.editing.view.focus()})),n.children.add(r),s.items.add(n)}return i.panelView.children.add(s),i}))}_getLocalizedOptions(){const e=this.editor,t=e.t,i={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};return Jw(e.config.get(Dw).options).map((e=>{const t=i[e.title];return t&&t!=e.title&&(e=Object.assign({},e,{title:t})),e}))}}class av extends Bw{constructor(e){super(e,zw)}}class lv extends er{static get pluginName(){return"FontColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(zw,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:zw,value:Uw("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:zw,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:zw,view:Hw("color")}),e.commands.add(zw,new av(e)),e.model.schema.extend("$text",{allowAttributes:zw}),e.model.schema.setAttributeProperties(zw,{isFormatting:!0,copyOnEnter:!0})}}class cv extends er{constructor(e,{commandName:t,componentName:i,icon:o,dropdownLabel:n}){super(e),this.commandName=t,this.componentName=i,this.icon=o,this.dropdownLabel=n,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,t=e.locale,i=t.t,o=e.commands.get(this.commandName),n=e.config.get(this.componentName),r=Om(t,Vm(n.colors)),s=n.documentColors,a=!1!==n.colorPicker;e.ui.componentFactory.add(this.componentName,(t=>{const l=tp(t);let c=!1;const d=function({dropdownView:e,colors:t,columns:i,removeButtonLabel:o,colorPickerLabel:n,documentColorsLabel:r,documentColorsCount:s,colorPickerViewConfig:a}){const l=e.locale,c=new Yp(l,{colors:t,columns:i,removeButtonLabel:o,colorPickerLabel:n,documentColorsLabel:r,documentColorsCount:s,colorPickerViewConfig:a});return e.colorSelectorView=c,e.panelView.children.add(c),c}({dropdownView:l,colors:r.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:0!==s?i("Document colors"):"",documentColorsCount:void 0===s?this.columns:s,colorPickerViewConfig:!!a&&(n.colorPicker||{})});return d.bind("selectedColor").to(o,"value"),l.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),l.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),l.bind("isEnabled").to(o),d.on("execute",((t,i)=>{l.isOpen&&e.execute(this.commandName,{value:i.value,batch:this._undoStepBatch}),"colorPicker"!==i.source&&e.editing.view.focus(),"colorPickerSaveButton"===i.source&&(l.isOpen=!1)})),d.on("colorPicker:show",(()=>{this._undoStepBatch=e.model.createBatch()})),d.on("colorPicker:cancel",(()=>{this._undoStepBatch.operations.length&&(l.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()})),l.on("change:isOpen",((t,i,o)=>{c||(c=!0,l.colorSelectorView.appendUI()),o&&(0!==s&&d.updateDocumentColors(e.model,this.componentName),d.updateSelectedColors(),d.showColorGridsFragment())})),sp(l,(()=>l.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find((e=>e.isOn)))),l})),e.ui.componentFactory.add(`menuBar:${this.componentName}`,(t=>{const n=new Vb(t);n.buttonView.set({label:this.dropdownLabel,icon:this.icon}),n.bind("isEnabled").to(o);let a=!1;const l=new Yp(t,{colors:r.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:0!==s?i("Document colors"):"",documentColorsCount:void 0===s?this.columns:s,colorPickerViewConfig:!1});return l.bind("selectedColor").to(o,"value"),l.delegate("execute").to(n),l.on("execute",((t,i)=>{e.execute(this.commandName,{value:i.value,batch:this._undoStepBatch}),e.editing.view.focus()})),n.on("change:isOpen",((t,i,o)=>{a||(a=!0,l.appendUI()),o&&(0!==s&&l.updateDocumentColors(e.model,this.componentName),l.updateSelectedColors(),l.showColorGridsFragment())})),n.panelView.children.add(l),n}))}}class dv extends cv{constructor(e){const t=e.locale.t;super(e,{commandName:zw,componentName:zw,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z"/></svg>',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class uv extends Bw{constructor(e){super(e,Fw)}}class hv extends er{static get pluginName(){return"FontBackgroundColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(Fw,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(Ru),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:Fw,value:Uw("background-color")}}),e.conversion.for("downcast").attributeToElement({model:Fw,view:Hw("background-color")}),e.commands.add(Fw,new uv(e)),e.model.schema.extend("$text",{allowAttributes:Fw}),e.model.schema.setAttributeProperties(Fw,{isFormatting:!0,copyOnEnter:!0})}}class mv extends cv{constructor(e){const t=e.locale.t;super(e,{commandName:Fw,componentName:Fw,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z"/></svg>',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}const gv=["left","right","center","justify"];function pv(e){return gv.includes(e)}function fv(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}function bv(e){const t=e.map((e=>{let t;return t="string"==typeof e?{name:e}:e,t})).filter((e=>{const t=gv.includes(e.name);return t||C("alignment-config-name-not-recognized",{option:e}),t})),i=t.filter((e=>Boolean(e.className))).length;if(i&&i<t.length)throw new A("alignment-config-classnames-are-missing",{configuredOptions:e});return t.forEach(((t,i,o)=>{const n=o.slice(i+1);if(n.some((e=>e.name==t.name)))throw new A("alignment-config-name-already-defined",{option:t,configuredOptions:e});if(t.className&&n.some((e=>e.className==t.className)))throw new A("alignment-config-classname-already-defined",{option:t,configuredOptions:e})})),t}const kv="alignment";class _v extends ir{refresh(){const e=this.editor.locale,t=Xo(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=Boolean(t)&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,i=t.locale,o=t.model,n=o.document,r=e.value;o.change((e=>{const t=Array.from(n.selection.getSelectedBlocks()).filter((e=>this._canBeAligned(e))),o=t[0].getAttribute("alignment");fv(r,i)||o===r||!r?function(e,t){for(const i of e)t.removeAttribute(kv,i)}(t,e):function(e,t,i){for(const o of e)t.setAttribute(kv,i,o)}(t,e,r)}))}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,kv)}}class wv extends er{static get pluginName(){return"AlignmentEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("alignment",{options:gv.map((e=>({name:e})))})}init(){const e=this.editor,t=e.locale,i=e.model.schema,o=bv(e.config.get("alignment.options")).filter((e=>pv(e.name)&&!fv(e.name,t))),n=o.some((e=>!!e.className));i.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),n?e.conversion.attributeToAttribute(function(e){const t={};for(const i of e)t[i.name]={key:"class",value:i.className};return{model:{key:"alignment",values:e.map((e=>e.name))},view:t}}(o)):e.conversion.for("downcast").attributeToAttribute(function(e){const t={};for(const{name:i}of e)t[i]={key:"style",value:{"text-align":i}};return{model:{key:"alignment",values:e.map((e=>e.name))},view:t}}(o));const r=function(e){const t=[];for(const{name:i}of e)t.push({view:{key:"style",value:{"text-align":i}},model:{key:"alignment",value:i}});return t}(o);for(const t of r)e.conversion.for("upcast").attributeToAttribute(t);const s=function(e){const t=[];for(const{name:i}of e)t.push({view:{key:"align",value:i},model:{key:"alignment",value:i}});return t}(o);for(const t of s)e.conversion.for("upcast").attributeToAttribute(t);e.commands.add("alignment",new _v(e))}}const vv=(()=>new Map([["left",kh],["right",'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>'],["center",'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>'],["justify",'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>']]))();class yv extends er{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}static get isOfficialPlugin(){return!0}init(){const e=bv(this.editor.config.get("alignment.options"));e.map((e=>e.name)).filter(pv).forEach((e=>this._addButton(e))),this._addToolbarDropdown(e),this._addMenuBarMenu(e)}_addButton(e){this.editor.ui.componentFactory.add(`alignment:${e}`,(t=>this._createButton(t,e)))}_createButton(e,t,i={}){const o=this.editor,n=o.commands.get("alignment"),r=new Dh(e);return r.set({label:this.localizedOptionTitles[t],icon:vv.get(t),tooltip:!0,isToggleable:!0,...i}),r.bind("isEnabled").to(n),r.bind("isOn").to(n,"value",(e=>e===t)),this.listenTo(r,"execute",(()=>{o.execute("alignment",{value:t}),o.editing.view.focus()})),r}_addToolbarDropdown(e){const t=this.editor;t.ui.componentFactory.add("alignment",(i=>{const o=tp(i),n="rtl"===i.uiLanguageDirection?"w":"e",r=i.t;ip(o,(()=>e.map((e=>this._createButton(i,e.name,{tooltipPosition:n})))),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:r("Text alignment toolbar")}),o.buttonView.set({label:r("Text alignment"),tooltip:!0}),o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===i.contentLanguageDirection?vv.get("right"):vv.get("left"),a=t.commands.get("alignment");return o.buttonView.bind("icon").to(a,"value",(e=>vv.get(e)||s)),o.bind("isEnabled").to(a,"isEnabled"),this.listenTo(o,"execute",(()=>{t.editing.view.focus()})),o}))}_addMenuBarMenu(e){const t=this.editor;t.ui.componentFactory.add("menuBar:alignment",(i=>{const o=t.commands.get("alignment"),n=i.t,r=new Vb(i),s=new Nb(i);r.bind("isEnabled").to(o),s.set({ariaLabel:n("Text alignment"),role:"menu"}),r.buttonView.set({label:n("Text alignment")});for(const n of e){const e=new yf(i,r),a=new dm(i);a.delegate("execute").to(r),a.set({label:this.localizedOptionTitles[n.name],icon:vv.get(n.name),role:"menuitemcheckbox",isToggleable:!0}),a.on("execute",(()=>{t.execute("alignment",{value:n.name}),t.editing.view.focus()})),a.bind("isOn").to(o,"value",(e=>e===n.name)),a.bind("isEnabled").to(o,"isEnabled"),e.children.add(a),s.items.add(e)}return r.panelView.children.add(s),r}))}}function xv(e,t,i,o,n=1){null!=t&&null!=n&&t>n?o.setAttribute(e,t,i):o.removeAttribute(e,i)}function Av(e,t,i={}){const o=e.createElement("tableCell",i);return e.insertElement("paragraph",o),e.insert(o,t),o}function Cv(e,t){const i=t.parent.parent,o=parseInt(i.getAttribute("headingColumns")||"0"),{column:n}=e.getCellLocation(t);return!!o&&n<o}function Tv(e){const t=e.getSelectedElement();return t&&t.is("element","table")?t:e.getFirstPosition().findAncestor("table")}function Ev(e){return t=>{t.on(`element:${e}`,((e,t,{writer:i})=>{if(!t.modelRange)return;const o=t.modelRange.start.nodeAfter,n=i.createPositionAt(o,0);if(t.viewItem.isEmpty)return void i.insertElement("paragraph",n);const r=Array.from(o.getChildren());if(r.every((e=>e.is("element","$marker")))){const e=i.createElement("paragraph");i.insert(e,i.createPositionAt(o,0));for(const t of r)i.move(i.createRangeOn(t),i.createPositionAt(e,"end"))}}),{priority:"low"})}}function Sv(e){let t=0,i=0;const o=Array.from(e.getChildren()).filter((e=>"th"===e.name||"td"===e.name));for(;i<o.length&&"th"===o[i].name;){const e=o[i];t+=parseInt(e.getAttribute("colspan")||"1"),i++}return t}class Pv{constructor(e,t={}){this._jumpedToStartRow=!1,this._table=e,this._startRow=void 0!==t.row?t.row:t.startRow||0,this._endRow=void 0!==t.row?t.row:t.endRow,this._startColumn=void 0!==t.column?t.column:t.startColumn||0,this._endColumn=void 0!==t.column?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){this._canJumpToStartRow()&&this._jumpToNonSpannedRowClosestToStartRow();const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0,value:void 0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(i.cell,i.row,i.column));else{const i=e.getChild(this._cellIndex);if(!i)return this._advanceToNextRow();const o=parseInt(i.getAttribute("colspan")||"1"),n=parseInt(i.getAttribute("rowspan")||"1");(o>1||n>1)&&this._recordSpans(i,n,o),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,i=this._column){return{done:!1,value:new Iv(this,e,t,i)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._row<this._startRow,i=this._column<this._startColumn,o=void 0!==this._endColumn&&this._column>this._endColumn;return e||t||i||o}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,i){const o={cell:e,row:this._row,column:this._column};for(let e=this._row;e<this._row+t;e++)for(let t=this._column;t<this._column+i;t++)e==this._row&&t==this._column||this._markSpannedCell(e,t,o)}_markSpannedCell(e,t,i){this._spannedCells.has(e)||this._spannedCells.set(e,new Map),this._spannedCells.get(e).set(t,i)}_canJumpToStartRow(){return!!this._startRow&&this._startRow>0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}}class Iv{constructor(e,t,i,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=i,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function Mv(e,t){return(i,{writer:o})=>{const n=i.getAttribute("headingRows")||0,r=o.createContainerElement("table",null,[]),s=o.createContainerElement("figure",{class:"table"},r);n>0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("thead",null,o.createSlot((e=>e.is("element","tableRow")&&e.index<n)))),n<e.getRows(i)&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("tbody",null,o.createSlot((e=>e.is("element","tableRow")&&e.index>=n))));for(const{positionOffset:e,filter:i}of t.additionalSlots)o.insert(o.createPositionAt(r,e),o.createSlot(i));return o.insert(o.createPositionAt(r,"after"),o.createSlot((e=>!e.is("element","tableRow")&&!t.additionalSlots.some((({filter:t})=>t(e)))))),t.asWidget?function(e,t){return t.setCustomProperty("table",!0,e),Xk(e,t,{hasSelectionHandle:!0})}(s,o):s}}function Ov(e={}){return(t,{writer:i})=>{const o=t.parent,n=o.parent,r=n.getChildIndex(o),s=new Pv(n,{row:r}),a=n.getAttribute("headingRows")||0,l=n.getAttribute("headingColumns")||0;let c=null;for(const o of s)if(o.cell==t){const t=o.row<a||o.column<l?"th":"td";c=e.asWidget?o_(i.createEditableElement(t),i):i.createContainerElement(t);break}return c}}function Vv(e={}){return(t,{writer:i})=>{if(!t.parent.is("element","tableCell"))return null;if(!Nv(t))return null;if(e.asWidget)return i.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const e=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,e),e}}}function Nv(e){return 1==e.parent.childCount&&!function(e){for(const t of e.getAttributeKeys())if(!t.startsWith("selection:")&&"htmlEmptyBlock"!=t)return!0;return!1}(e)}class Rv extends ir{refresh(){const e=this.editor.model,t=e.document.selection,i=e.schema;this.isEnabled=function(e,t){const i=e.getFirstPosition().parent,o=i===i.root?i:i.parent;return t.checkChild(o,"table")}(t,i)}execute(e={}){const t=this.editor,i=t.model,o=t.plugins.get("TableUtils"),n=t.config.get("table.defaultHeadings.rows"),r=t.config.get("table.defaultHeadings.columns");void 0===e.headingRows&&n&&(e.headingRows=n),void 0===e.headingColumns&&r&&(e.headingColumns=r),i.change((t=>{const n=o.createTable(t,e);i.insertObject(n,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(n.getNodeByPath([0,0,0]),0))}))}}class Bv extends ir{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o="above"===this.order,n=i.getSelectionAffectedTableCells(t),r=i.getRowIndexes(n),s=o?r.first:r.last,a=n[0].findAncestor("table");i.insertRows(a,{at:o?s:s+1,copyStructureFromAbove:!o})}}class Dv extends ir{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o="left"===this.order,n=i.getSelectionAffectedTableCells(t),r=i.getColumnIndexes(n),s=o?r.first:r.last,a=n[0].findAncestor("table");i.insertColumns(a,{columns:1,at:o?s:s+1})}}class Lv extends ir{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}function zv(e,t,i){const{startRow:o,startColumn:n,endRow:r,endColumn:s}=t,a=i.createElement("table"),l=r-o+1;for(let e=0;e<l;e++)i.insertElement("tableRow",a,"end");const c=[...new Pv(e,{startRow:o,endRow:r,startColumn:n,endColumn:s,includeAllSlots:!0})];for(const{row:e,column:t,cell:l,isAnchor:d,cellAnchorRow:u,cellAnchorColumn:h}of c){const c=e-o,m=a.getChild(c);if(d){const o=i.cloneElement(l);i.append(o,m),Wv(o,e,t,r,s,i)}else(u<o||h<n)&&Av(i,i.createPositionAt(m,"end"))}return function(e,t,i,o,n){const r=parseInt(t.getAttribute("headingRows")||"0");r>0&&xv("headingRows",r-i,e,n,0);const s=parseInt(t.getAttribute("headingColumns")||"0");s>0&&xv("headingColumns",s-o,e,n,0)}(a,e,o,n,i),a}function Fv(e,t,i=0){const o=[],n=new Pv(e,{startRow:i,endRow:t-1});for(const e of n){const{row:i,cellHeight:n}=e;i<t&&t<=i+n-1&&o.push(e)}return o}function jv(e,t,i){const o=e.parent,n=o.parent,r=o.index,s=t-r,a={},l=parseInt(e.getAttribute("rowspan"))-s;l>1&&(a.rowspan=l);const c=parseInt(e.getAttribute("colspan")||"1");c>1&&(a.colspan=c);const d=r+s,u=[...new Pv(n,{startRow:r,endRow:d,includeAllSlots:!0})];let h,m=null;for(const t of u){const{row:o,column:n,cell:r}=t;r===e&&void 0===h&&(h=n),void 0!==h&&h===n&&o===d&&(m=Av(i,t.getPositionBefore(),a))}return xv("rowspan",s,e,i),m}function Uv(e,t){const i=[],o=new Pv(e);for(const e of o){const{column:o,cellWidth:n}=e;o<t&&t<=o+n-1&&i.push(e)}return i}function Hv(e,t,i,o){const n=i-t,r={},s=parseInt(e.getAttribute("colspan"))-n;s>1&&(r.colspan=s);const a=parseInt(e.getAttribute("rowspan")||"1");a>1&&(r.rowspan=a);const l=Av(o,o.createPositionAfter(e),r);return xv("colspan",n,e,o),l}function Wv(e,t,i,o,n,r){const s=parseInt(e.getAttribute("colspan")||"1"),a=parseInt(e.getAttribute("rowspan")||"1");i+s-1>n&&xv("colspan",n-i+1,e,r,1),t+a-1>o&&xv("rowspan",o-t+1,e,r,1)}function $v(e,t){const i=t.getColumns(e),o=new Array(i).fill(0);for(const{column:t}of new Pv(e))o[t]++;const n=o.reduce(((e,t,i)=>t?e:[...e,i]),[]);if(n.length>0){const i=n[n.length-1];return t.removeColumns(e,{at:i}),!0}return!1}function qv(e,t){const i=[],o=t.getRows(e);for(let t=0;t<o;t++)e.getChild(t).isEmpty&&i.push(t);if(i.length>0){const o=i[i.length-1];return t.removeRows(e,{at:o}),!0}return!1}function Zv(e,t){$v(e,t)||qv(e,t)}function Gv(e,t){const i=Array.from(new Pv(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(i.every((({cellHeight:e})=>1===e)))return t.lastRow;const o=i[0].cellHeight-1;return t.lastRow+o}function Kv(e,t){const i=Array.from(new Pv(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(i.every((({cellWidth:e})=>1===e)))return t.lastColumn;const o=i[0].cellWidth-1;return t.lastColumn+o}class Yv extends ir{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,i=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],o=this.value,n=this.direction;e.change((e=>{const t="right"==n||"down"==n,r=t?i:o,s=t?o:i,a=s.parent;!function(e,t,i){Qv(e)||(Qv(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}(s,r,e);const l=this.isHorizontal?"colspan":"rowspan",c=parseInt(i.getAttribute(l)||"1"),d=parseInt(o.getAttribute(l)||"1");e.setAttribute(l,c+d,r),e.setSelection(e.createRangeIn(r));const u=this.editor.plugins.get("TableUtils");Zv(a.findAncestor("table"),u)}))}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),i=t.getTableCellsContainingSelection(e.selection)[0];if(!i)return;const o=this.isHorizontal?function(e,t,i){const o=e.parent.parent,n="right"==t?e.nextSibling:e.previousSibling,r=(o.getAttribute("headingColumns")||0)>0;if(!n)return;const s="right"==t?e:n,a="right"==t?n:e,{column:l}=i.getCellLocation(s),{column:c}=i.getCellLocation(a),d=parseInt(s.getAttribute("colspan")||"1"),u=Cv(i,s),h=Cv(i,a);return r&&u!=h?void 0:l+d===c?n:void 0}(i,this.direction,t):function(e,t,i){const o=e.parent,n=o.parent,r=n.getChildIndex(o);if("down"==t&&r===i.getRows(n)-1||"up"==t&&0===r)return null;const s=parseInt(e.getAttribute("rowspan")||"1"),a=n.getAttribute("headingRows")||0;if(a&&("down"==t&&r+s===a||"up"==t&&r===a))return null;const l=parseInt(e.getAttribute("rowspan")||"1"),c="down"==t?r+l:r,d=[...new Pv(n,{endRow:c})],u=d.find((t=>t.cell===e)).column,h=d.find((({row:e,cellHeight:i,column:o})=>o===u&&("down"==t?e===c:c===e+i)));return h&&h.cell?h.cell:null}(i,this.direction,t);if(!o)return;const n=this.isHorizontal?"rowspan":"colspan",r=parseInt(i.getAttribute(n)||"1");return parseInt(o.getAttribute(n)||"1")===r?o:void 0}}function Qv(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class Jv extends ir{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const o=i.findAncestor("table"),n=e.getRows(o)-1,r=e.getRowIndexes(t),s=0===r.first&&r.last===n;this.isEnabled=!s}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0],r=n.findAncestor("table"),s=t.getCellLocation(n).column;e.change((e=>{const i=o.last-o.first+1;t.removeRows(r,{at:o.first,rows:i});const n=function(e,t,i,o){const n=e.getChild(Math.min(t,o-1));let r=n.getChild(0),s=0;for(const e of n.getChildren()){if(s>i)return r;r=e,s+=parseInt(e.getAttribute("colspan")||"1")}return r}(r,o.first,s,t.getRows(r));e.setSelection(e.createPositionAt(n,0))}))}}class Xv extends ir{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const o=i.findAncestor("table"),n=e.getColumns(o),{first:r,last:s}=e.getColumnIndexes(t);this.isEnabled=s-r<n-1}else this.isEnabled=!1}execute(){const e=this.editor.plugins.get("TableUtils"),[t,i]=function(e,t){const i=t.getSelectionAffectedTableCells(e),o=i[0],n=i.pop(),r=[o,n];return o.isBefore(n)?r:r.reverse()}(this.editor.model.document.selection,e),o=t.parent.parent,n=[...new Pv(o)],r={first:n.find((e=>e.cell===t)).column,last:n.find((e=>e.cell===i)).column},s=function(e,t,i,o){return parseInt(i.getAttribute("colspan")||"1")>1?i:t.previousSibling||i.nextSibling?i.nextSibling||t.previousSibling:o.first?e.reverse().find((({column:e})=>e<o.first)).cell:e.reverse().find((({column:e})=>e>o.last)).cell}(n,t,i,r);this.editor.model.change((t=>{const i=r.last-r.first+1;e.removeColumns(o,{at:r.first,columns:i}),t.setSelection(t.createPositionAt(s,0))}))}}class ey extends ir{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),o=i.length>0;this.isEnabled=o,this.value=o&&i.every((e=>this._isInHeading(e,e.parent.parent)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:r,last:s}=t.getRowIndexes(o),a=this.value?r:s+1,l=n.getAttribute("headingRows")||0;i.change((e=>{if(a){const t=Fv(n,a,a>l?l:0);for(const{cell:i}of t)jv(i,a,e)}xv("headingRows",a,n,e,0)}))}_isInHeading(e,t){const i=parseInt(t.getAttribute("headingRows")||"0");return!!i&&e.parent.index<i}}class ty extends ir{refresh(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=i.length>0;this.isEnabled=o,this.value=o&&i.every((e=>Cv(t,e)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:r,last:s}=t.getColumnIndexes(o),a=this.value?r:s+1;i.change((e=>{if(a){const t=Uv(n,a);for(const{cell:i,column:o}of t)Hv(i,o,a,e)}xv("headingColumns",a,n,e,0)}))}}function iy(e){const t=function(e){if(e.is("element","tableColumnGroup"))return e;const t=e.getChildren();return Array.from(t).find((e=>e.is("element","tableColumnGroup")))}(e);return t?Array.from(t.getChildren()):[]}class oy extends er{static get pluginName(){return"TableUtils"}static get isOfficialPlugin(){return!0}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,i=t.parent,o=i.getChildIndex(t),n=new Pv(i,{row:o});for(const{cell:t,row:i,column:o}of n)if(t===e)return{row:i,column:o}}createTable(e,t){const i=e.createElement("table"),o=t.rows||2,n=t.columns||2;return ny(e,i,0,o,n),t.headingRows&&xv("headingRows",Math.min(t.headingRows,o),i,e,0),t.headingColumns&&xv("headingColumns",Math.min(t.headingColumns,n),i,e,0),i}insertRows(e,t={}){const i=this.editor.model,o=t.at||0,n=t.rows||1,r=void 0!==t.copyStructureFromAbove,s=t.copyStructureFromAbove?o-1:o,a=this.getRows(e),l=this.getColumns(e);if(o>a)throw new A("tableutils-insertrows-insert-out-of-range",this,{options:t});i.change((t=>{const i=e.getAttribute("headingRows")||0;if(i>o&&xv("headingRows",i+n,e,t,0),!r&&(0===o||o===a))return void ny(t,e,o,n,l);const c=r?Math.max(o,s):o,d=new Pv(e,{endRow:c}),u=new Array(l).fill(1);for(const{row:e,column:i,cellHeight:a,cellWidth:l,cell:c}of d){const d=e+a-1,h=e<=s&&s<=d;e<o&&o<=d?(t.setAttribute("rowspan",a+n,c),u[i]=-l):r&&h&&(u[i]=l)}for(let i=0;i<n;i++){const i=t.createElement("tableRow");t.insert(i,e,o);for(let e=0;e<u.length;e++){const o=u[e],n=t.createPositionAt(i,"end");o>0&&Av(t,n,o>1?{colspan:o}:void 0),e+=Math.abs(o)-1}}}))}insertColumns(e,t={}){const i=this.editor.model,o=t.at||0,n=t.columns||1;i.change((t=>{const i=e.getAttribute("headingColumns");o<i&&t.setAttribute("headingColumns",i+n,e);const r=this.getColumns(e);if(0===o||r===o){for(const i of e.getChildren())i.is("element","tableRow")&&ry(n,t,t.createPositionAt(i,o?"end":0));return}const s=new Pv(e,{column:o,includeAllSlots:!0});for(const e of s){const{row:i,cell:r,cellAnchorColumn:a,cellAnchorRow:l,cellWidth:c,cellHeight:d}=e;if(a<o){t.setAttribute("colspan",c+n,r);const e=l+d-1;for(let t=i;t<=e;t++)s.skipRow(t)}else ry(n,t,e.getPositionBefore())}}))}removeRows(e,t){const i=this.editor.model,o=t.rows||1,n=this.getRows(e),r=t.at,s=r+o-1;if(s>n-1)throw new A("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});i.change((t=>{const i={first:r,last:s},{cellsToMove:o,cellsToTrim:n}=function(e,{first:t,last:i}){const o=new Map,n=[];for(const{row:r,column:s,cellHeight:a,cell:l}of new Pv(e,{endRow:i})){const e=r+a-1;if(r>=t&&r<=i&&e>i){const e=a-(i-r+1);o.set(s,{cell:l,rowspan:e})}if(r<t&&e>=t){let o;o=e>=i?i-t+1:e-t+1,n.push({cell:l,rowspan:a-o})}}return{cellsToMove:o,cellsToTrim:n}}(e,i);o.size&&function(e,t,i,o){const n=[...new Pv(e,{includeAllSlots:!0,row:t})],r=e.getChild(t);let s;for(const{column:e,cell:t,isAnchor:a}of n)if(i.has(e)){const{cell:t,rowspan:n}=i.get(e),a=s?o.createPositionAfter(s):o.createPositionAt(r,0);o.move(o.createRangeOn(t),a),xv("rowspan",n,t,o),s=t}else a&&(s=t)}(e,s+1,o,t);for(let i=s;i>=r;i--)t.remove(e.getChild(i));for(const{rowspan:e,cell:i}of n)xv("rowspan",e,i,t);!function(e,{first:t,last:i},o){const n=e.getAttribute("headingRows")||0;t<n&&xv("headingRows",i<n?n-(i-t+1):t,e,o,0)}(e,i,t),$v(e,this)||qv(e,this)}))}removeColumns(e,t){const i=this.editor.model,o=t.at,n=t.columns||1,r=t.at+n-1;i.change((t=>{!function(e,t,i){const o=e.getAttribute("headingColumns")||0;if(o&&t.first<o){const n=Math.min(o-1,t.last)-t.first+1;i.setAttribute("headingColumns",o-n,e)}}(e,{first:o,last:r},t);const i=iy(e);for(let n=r;n>=o;n--){for(const{cell:i,column:o,cellWidth:r}of[...new Pv(e)])o<=n&&r>1&&o+r>n?xv("colspan",r-1,i,t):o===n&&t.remove(i);if(i[n]){const e=0===n?i[1]:i[n-1],o=parseFloat(i[n].getAttribute("columnWidth")),r=parseFloat(e.getAttribute("columnWidth"));t.remove(i[n]),t.setAttribute("columnWidth",o+r+"%",e)}}qv(e,this)||$v(e,this)}))}splitCellVertically(e,t=2){const i=this.editor.model,o=e.parent.parent,n=parseInt(e.getAttribute("rowspan")||"1"),r=parseInt(e.getAttribute("colspan")||"1");i.change((i=>{if(r>1){const{newCellsSpan:o,updatedSpan:s}=sy(r,t);xv("colspan",s,e,i);const a={};o>1&&(a.colspan=o),n>1&&(a.rowspan=n),ry(r>t?t-1:r-1,i,i.createPositionAfter(e),a)}if(r<t){const s=t-r,a=[...new Pv(o)],{column:l}=a.find((({cell:t})=>t===e)),c=a.filter((({cell:t,cellWidth:i,column:o})=>t!==e&&o===l||o<l&&o+i>l));for(const{cell:e,cellWidth:t}of c)i.setAttribute("colspan",t+s,e);const d={};n>1&&(d.rowspan=n),ry(s,i,i.createPositionAfter(e),d);const u=o.getAttribute("headingColumns")||0;u>l&&xv("headingColumns",u+s,o,i)}}))}splitCellHorizontally(e,t=2){const i=this.editor.model,o=e.parent,n=o.parent,r=n.getChildIndex(o),s=parseInt(e.getAttribute("rowspan")||"1"),a=parseInt(e.getAttribute("colspan")||"1");i.change((i=>{if(s>1){const o=[...new Pv(n,{startRow:r,endRow:r+s-1,includeAllSlots:!0})],{newCellsSpan:l,updatedSpan:c}=sy(s,t);xv("rowspan",c,e,i);const{column:d}=o.find((({cell:t})=>t===e)),u={};l>1&&(u.rowspan=l),a>1&&(u.colspan=a);let h=0;for(const e of o){const{column:t,row:o}=e,n=t===d;h>=l&&n&&(h=0),o>=r+c&&n&&(h||ry(1,i,e.getPositionBefore(),u),h++)}}if(s<t){const o=t-s,l=[...new Pv(n,{startRow:0,endRow:r})];for(const{cell:t,cellHeight:n,row:s}of l)if(t!==e&&s+n>r){const e=n+o;i.setAttribute("rowspan",e,t)}const c={};a>1&&(c.colspan=a),ny(i,n,r+1,o,1,c);const d=n.getAttribute("headingRows")||0;d>r&&xv("headingRows",d+o,n,i)}}))}getColumns(e){return[...e.getChild(0).getChildren()].filter((e=>e.is("element","tableCell"))).reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}getRows(e){return Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0)}createTableWalker(e,t={}){return new Pv(e,t)}getSelectedTableCells(e){const t=[];for(const i of this.sortRanges(e.getRanges())){const e=i.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}getTableCellsContainingSelection(e){const t=[];for(const i of e.getRanges()){const e=i.start.findAncestor("tableCell");e&&t.push(e)}return t}getSelectionAffectedTableCells(e){const t=this.getSelectedTableCells(e);return t.length?t:this.getTableCellsContainingSelection(e)}getRowIndexes(e){const t=e.map((e=>e.parent.index));return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),i=[...new Pv(t)].filter((t=>e.includes(t.cell))).map((e=>e.column));return this._getFirstLastIndexesObject(i)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,i=new Set;let o=0;for(const n of e){const{row:e,column:r}=this.getCellLocation(n),s=parseInt(n.getAttribute("rowspan"))||1,a=parseInt(n.getAttribute("colspan"))||1;t.add(e),i.add(r),s>1&&t.add(e+s-1),a>1&&i.add(r+a-1),o+=s*a}const n=function(e,t){const i=Array.from(e.values()),o=Array.from(t.values());return(Math.max(...i)-Math.min(...i)+1)*(Math.max(...o)-Math.min(...o)+1)}(t,i);return n==o}sortRanges(e){return Array.from(e).sort(ay)}_getFirstLastIndexesObject(e){const t=e.sort(((e,t)=>e-t));return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),i=this.getRowIndexes(e),o=parseInt(t.getAttribute("headingRows"))||0;if(!this._areIndexesInSameSection(i,o))return!1;const n=this.getColumnIndexes(e),r=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameSection(n,r)}_areIndexesInSameSection({first:e,last:t},i){return e<i==t<i}}function ny(e,t,i,o,n,r={}){for(let s=0;s<o;s++){const o=e.createElement("tableRow");e.insert(o,t,i),ry(n,e,e.createPositionAt(o,"end"),r)}}function ry(e,t,i,o={}){for(let n=0;n<e;n++)Av(t,i,o)}function sy(e,t){if(e<t)return{newCellsSpan:1,updatedSpan:1};const i=Math.floor(e/t);return{newCellsSpan:i,updatedSpan:e-i*t+i}}function ay(e,t){const i=e.start,o=t.start;return i.isBefore(o)?-1:1}class ly extends ir{refresh(){const e=this.editor.plugins.get(oy),t=e.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=e.isSelectionRectangular(t)}execute(){const e=this.editor.model,t=this.editor.plugins.get(oy);e.change((i=>{const o=t.getSelectedTableCells(e.document.selection),n=o.shift(),{mergeWidth:r,mergeHeight:s}=function(e,t,i){let o=0,n=0;for(const e of t){const{row:t,column:r}=i.getCellLocation(e);o=uy(e,r,o,"colspan"),n=uy(e,t,n,"rowspan")}const{row:r,column:s}=i.getCellLocation(e);return{mergeWidth:o-s,mergeHeight:n-r}}(n,o,t);xv("colspan",r,n,i),xv("rowspan",s,n,i);for(const e of o)cy(e,n,i);Zv(n.findAncestor("table"),t),i.setSelection(n,"in")}))}}function cy(e,t,i){dy(e)||(dy(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function dy(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}function uy(e,t,i,o){const n=parseInt(e.getAttribute(o)||"1");return Math.max(i,t+n)}class hy extends ir{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0].findAncestor("table"),r=[];for(let t=o.first;t<=o.last;t++)for(const i of n.getChild(t).getChildren())r.push(e.createRangeOn(i));e.change((e=>{e.setSelection(r)}))}}class my extends ir{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),o=i[0],n=i.pop(),r=o.findAncestor("table"),s=e.getCellLocation(o),a=e.getCellLocation(n),l=Math.min(s.column,a.column),c=Math.max(s.column,a.column),d=[];for(const e of new Pv(r,{startColumn:l,endColumn:c}))d.push(t.createRangeOn(e.cell));t.change((e=>{e.setSelection(d)}))}}function gy(e,t){let i=!1;const o=function(e){const t=parseInt(e.getAttribute("headingRows")||"0"),i=Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0),o=[];for(const{row:n,cell:r,cellHeight:s}of new Pv(e)){if(s<2)continue;const e=n<t?t:i;if(n+s>e){const t=e-n;o.push({cell:r,rowspan:t})}}return o}(e);if(o.length){i=!0;for(const e of o)xv("rowspan",e.rowspan,e.cell,t,1)}return i}function py(e,t){let i=!1;const o=function(e){const t=new Array(e.childCount).fill(0);for(const{rowIndex:i}of new Pv(e,{includeAllSlots:!0}))t[i]++;return t}(e),n=[];for(const[t,i]of o.entries())!i&&e.getChild(t).is("element","tableRow")&&n.push(t);if(n.length){i=!0;for(const i of n.reverse())t.remove(e.getChild(i)),o.splice(i,1)}const r=o.filter(((t,i)=>e.getChild(i).is("element","tableRow"))),s=r[0];if(!r.every((e=>e===s))){const o=r.reduce(((e,t)=>t>e?t:e),0);for(const[n,s]of r.entries()){const r=o-s;if(r){for(let i=0;i<r;i++)Av(t,t.createPositionAt(e.getChild(n),"end"));i=!0}}}return i}function fy(e){if("attribute"!==e.type)return!1;const t=e.attributeKey;return"headingRows"===t||"colspan"===t||"rowspan"===t}function by(e,t){let i=!1;for(const o of e.getChildren())o.is("element","tableRow")&&(i=ky(o,t)||i);return i}function ky(e,t){let i=!1;for(const o of e.getChildren())i=_y(o,t)||i;return i}function _y(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;const i=Array.from(e.getChildren()).filter((e=>e.is("$text")));for(const e of i)t.wrap(t.createRangeOn(e),"paragraph");return!!i.length}function wy(e){return!!e.position.parent.is("element","tableCell")&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}function vy(e,t){if(!e.is("element","paragraph"))return!1;const i=t.toViewElement(e);return!!i&&Nv(e)!==i.is("element","span")}var yy=n(1674),xy={attributes:{"data-cke":!0}};xy.setAttributes=Wn(),xy.insert=Un().bind(null,"head"),xy.domAPI=Fn(),xy.insertStyleElement=qn(),Ln()(yy.A,xy),yy.A&&yy.A.locals&&yy.A.locals;class Ay extends er{static get pluginName(){return"TableEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[oy]}constructor(e){super(e),this._additionalSlots=[]}init(){const e=this.editor,t=e.model,i=t.schema,o=e.conversion,n=e.plugins.get(oy);i.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add((e=>{e.on("element:figure",((e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:!0,classes:"table"}))return;const o=function(e){for(const t of e.getChildren())if(t.is("element","table"))return t}(t.viewItem);if(!o||!i.consumable.test(o,{name:!0}))return;i.consumable.consume(t.viewItem,{name:!0,classes:"table"});const n=Xo(i.convertItem(o,t.modelCursor).modelRange.getItems());n?(i.convertChildren(t.viewItem,i.writer.createPositionAt(n,"end")),i.updateConversionResult(n,t)):i.consumable.revert(t.viewItem,{name:!0,classes:"table"})}))})),o.for("upcast").add((e=>{e.on("element:table",((e,t,i)=>{const o=t.viewItem;if(!i.consumable.test(o,{name:!0}))return;const{rows:n,headingRows:r,headingColumns:s}=function(e){let t,i=0;const o=[],n=[];let r;for(const s of Array.from(e.getChildren())){if("tbody"!==s.name&&"thead"!==s.name&&"tfoot"!==s.name)continue;"thead"!==s.name||r||(r=s);const e=Array.from(s.getChildren()).filter((e=>e.is("element","tr")));let a=null;for(const l of e){const e=Array.from(l.getChildren()).filter((e=>e.is("element","td")||e.is("element","th")));if(r&&s===r||"tbody"===s.name&&e.length>0&&(null===a||e.length===a)&&e.every((e=>e.is("element","th"))))i++,o.push(l);else{n.push(l);const e=Sv(l);(!t||e<t)&&(t=e)}a=Math.max(a||0,e.length)}}return{headingRows:i,headingColumns:t||0,rows:[...o,...n]}}(o),a={};s&&(a.headingColumns=s),r&&(a.headingRows=r);const l=i.writer.createElement("table",a);if(i.safeInsert(l,t.modelCursor)){if(i.consumable.consume(o,{name:!0}),n.forEach((e=>i.convertItem(e,i.writer.createPositionAt(l,"end")))),i.convertChildren(o,i.writer.createPositionAt(l,"end")),l.isEmpty){const e=i.writer.createElement("tableRow");i.writer.insert(e,i.writer.createPositionAt(l,"end")),Av(i.writer,i.writer.createPositionAt(e,"end"))}i.updateConversionResult(l,t)}}))})),o.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:Mv(n,{asWidget:!0,additionalSlots:this._additionalSlots})}),o.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:Mv(n,{additionalSlots:this._additionalSlots})}),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add((e=>{e.on("element:tr",((e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()}),{priority:"high"})})),o.for("downcast").elementToElement({model:"tableRow",view:(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(Ev("td")),o.for("upcast").add(Ev("th")),o.for("editingDowncast").elementToElement({model:"tableCell",view:Ov({asWidget:!0})}),o.for("dataDowncast").elementToElement({model:"tableCell",view:Ov()}),o.for("editingDowncast").elementToElement({model:"paragraph",view:Vv({asWidget:!0}),converterPriority:"high"}),o.for("dataDowncast").elementToElement({model:"paragraph",view:Vv(),converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:Cy("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:Cy("rowspan")},view:"rowspan"}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new Rv(e)),e.commands.add("insertTableRowAbove",new Bv(e,{order:"above"})),e.commands.add("insertTableRowBelow",new Bv(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new Dv(e,{order:"left"})),e.commands.add("insertTableColumnRight",new Dv(e,{order:"right"})),e.commands.add("removeTableRow",new Jv(e)),e.commands.add("removeTableColumn",new Xv(e)),e.commands.add("splitTableCellVertically",new Lv(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new Lv(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new ly(e)),e.commands.add("mergeTableCellRight",new Yv(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Yv(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Yv(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Yv(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new ty(e)),e.commands.add("setTableRowHeader",new ey(e)),e.commands.add("selectTableRow",new hy(e)),e.commands.add("selectTableColumn",new my(e)),function(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.differ.getChanges();let o=!1;const n=new Set;for(const t of i){let i=null;"insert"==t.type&&"table"==t.name&&(i=t.position.nodeAfter),"insert"!=t.type&&"remove"!=t.type||"tableRow"!=t.name&&"tableCell"!=t.name||(i=t.position.findAncestor("table")),fy(t)&&(i=t.range.start.findAncestor("table")),i&&!n.has(i)&&(o=gy(i,e)||o,o=py(i,e)||o,n.add(i))}return o}(t,e)))}(t),function(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.differ.getChanges();let o=!1;for(const t of i)"insert"==t.type&&"table"==t.name&&(o=by(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableRow"==t.name&&(o=ky(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableCell"==t.name&&(o=_y(t.position.nodeAfter,e)||o),"remove"!=t.type&&"insert"!=t.type||!wy(t)||(o=_y(t.position.parent,e)||o);return o}(t,e)))}(t),this.listenTo(t.document,"change:data",(()=>{!function(e,t){const i=e.document.differ;for(const e of i.getChanges()){let i,o=!1;if("attribute"==e.type){const t=e.range.start.nodeAfter;if(!t||!t.is("element","table"))continue;if("headingRows"!=e.attributeKey&&"headingColumns"!=e.attributeKey)continue;i=t,o="headingRows"==e.attributeKey}else"tableRow"!=e.name&&"tableCell"!=e.name||(i=e.position.findAncestor("table"),o="tableRow"==e.name);if(!i)continue;const n=i.getAttribute("headingRows")||0,r=i.getAttribute("headingColumns")||0,s=new Pv(i);for(const e of s){const i=e.row<n||e.column<r?"th":"td",s=t.mapper.toViewElement(e.cell);s&&s.is("element")&&s.name!=i&&t.reconvertItem(o?e.cell.parent:e.cell)}}}(t,e.editing),function(e,t){const i=e.document.differ,o=new Set;for(const e of i.getChanges()){const t="attribute"==e.type?e.range.start.parent:e.position.parent;t.is("element","tableCell")&&o.add(t)}for(const e of o.values()){const i=Array.from(e.getChildren()).filter((e=>vy(e,t.mapper)));for(const e of i)t.reconvertItem(e)}}(t,e.editing)}))}registerAdditionalSlot(e){this._additionalSlots.push(e)}}function Cy(e){return t=>{const i=parseInt(t.getAttribute(e));return Number.isNaN(i)||i<=0?null:i}}var Ty=n(3437),Ey={attributes:{"data-cke":!0}};Ey.setAttributes=Wn(),Ey.insert=Un().bind(null,"head"),Ey.domAPI=Fn(),Ey.insertStyleElement=qn(),Ln()(Ty.A,Ey),Ty.A&&Ty.A.locals&&Ty.A.locals;class Sy extends Kn{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new rn,this.focusTracker=new en,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",((e,t)=>`${t} × ${e}`)),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to((e=>{e.preventDefault()})),click:t.to((()=>{this.fire("execute")}))}}),this.on("boxover",((e,t)=>{const{row:i,column:o}=t.target.dataset;this.items.get(10*(parseInt(i,10)-1)+(parseInt(o,10)-1)).focus()})),this.focusTracker.on("change:focusedElement",((e,t,i)=>{if(!i)return;const{row:o,column:n}=i.dataset;this.set({rows:parseInt(o),columns:parseInt(n)})})),this.on("change:columns",(()=>this._highlightGridBoxes())),this.on("change:rows",(()=>this._highlightGridBoxes()))}render(){super.render(),Xn({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}reset(){this.set({rows:1,columns:1})}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map(((i,o)=>{const n=Math.floor(o/10)<e&&o%10<t;i.set("isOn",n)}))}_createGridButton(e,t,i,o){const n=new Dh(e);return n.set({label:o,class:"ck-insert-table-dropdown-grid-box"}),n.extendTemplate({attributes:{"data-row":t,"data-column":i}}),n}_createGridCollection(){const e=[];for(let t=0;t<100;t++){const i=Math.floor(t/10),o=t%10,n=`${i+1} × ${o+1}`;e.push(this._createGridButton(this.locale,i+1,o+1,n))}return this.createCollection(e)}}class Py extends er{static get pluginName(){return"TableUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t,i="ltr"===e.locale.contentLanguageDirection;e.ui.componentFactory.add("insertTable",(i=>{const o=e.commands.get("insertTable"),n=tp(i);let r;return n.bind("isEnabled").to(o),n.buttonView.set({icon:Ph,label:t("Insert table"),tooltip:!0}),n.on("change:isOpen",(()=>{r||(r=new Sy(i),n.panelView.children.add(r),r.delegate("execute").to(n),n.on("execute",(()=>{e.execute("insertTable",{rows:r.rows,columns:r.columns}),e.editing.view.focus()})))})),n})),e.ui.componentFactory.add("menuBar:insertTable",(i=>{const o=e.commands.get("insertTable"),n=new Vb(i),r=new Sy(i);return r.delegate("execute").to(n),n.on("change:isOpen",((e,t,i)=>{i||r.reset()})),r.on("execute",(()=>{e.execute("insertTable",{rows:r.rows,columns:r.columns}),e.editing.view.focus()})),n.buttonView.set({label:t("Table"),icon:Ph}),n.panelView.children.add(r),n.bind("isEnabled").to(o),n})),e.ui.componentFactory.add("tableColumn",(e=>{const o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>',o,e)})),e.ui.componentFactory.add("tableRow",(e=>{const i=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>',i,e)})),e.ui.componentFactory.add("mergeTableCells",(e=>{const o=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>',o,e)}))}_prepareDropdown(e,t,i,o){const n=this.editor,r=tp(o),s=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:e,icon:t,tooltip:!0}),r.bind("isEnabled").toMany(s,"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(r,"execute",(e=>{n.execute(e.source.commandName),e.source instanceof xm||n.editing.view.focus()})),r}_prepareMergeSplitButtonDropdown(e,t,i,o){const n=this.editor,r=tp(o,Yg),s="mergeTableCells",a=n.commands.get(s),l=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),r.bind("isEnabled").toMany([a,...l],"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(r.buttonView,"execute",(()=>{n.execute(s),n.editing.view.focus()})),this.listenTo(r,"execute",(e=>{n.execute(e.source.commandName),n.editing.view.focus()})),r}_fillDropdownWithListOptions(e,t){const i=this.editor,o=[],n=new Jo;for(const e of t)Iy(e,i,o,n);return np(e,n),o}}function Iy(e,t,i,o){if("button"===e.type||"switchbutton"===e.type){const o=e.model=new qf(e.model),{commandName:n,bindIsOn:r}=e.model,s=t.commands.get(n);i.push(s),o.set({commandName:n}),o.bind("isEnabled").to(s),r&&o.bind("isOn").to(s,"value"),o.set({withText:!0})}o.add(e)}var My=n(892),Oy={attributes:{"data-cke":!0}};Oy.setAttributes=Wn(),Oy.insert=Un().bind(null,"head"),Oy.domAPI=Fn(),Oy.insertStyleElement=qn(),Ln()(My.A,Oy),My.A&&My.A.locals&&My.A.locals;class Vy extends er{static get pluginName(){return"TableSelection"}static get isOfficialPlugin(){return!0}static get requires(){return[oy,oy]}init(){const e=this.editor,t=e.model,i=e.editing.view;this.listenTo(t,"deleteContent",((e,t)=>this._handleDeleteContent(e,t)),{priority:"high"}),this.listenTo(i.document,"insertText",((e,t)=>this._handleInsertTextEvent(e,t)),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get(oy),t=this.editor.model.document.selection,i=e.getSelectedTableCells(t);return 0==i.length?null:i}getSelectionAsFragment(){const e=this.editor.plugins.get(oy),t=this.getSelectedTableCells();return t?this.editor.model.change((i=>{const o=i.createDocumentFragment(),{first:n,last:r}=e.getColumnIndexes(t),{first:s,last:a}=e.getRowIndexes(t),l=t[0].findAncestor("table");let c=a,d=r;if(e.isSelectionRectangular(t)){const e={firstColumn:n,lastColumn:r,firstRow:s,lastRow:a};c=Gv(l,e),d=Kv(l,e)}const u=zv(l,{startRow:s,startColumn:n,endRow:c,endColumn:d},i);return i.insert(u,o,0),o})):null}setCellSelection(e,t){const i=this._getCellsToSelect(e,t);this.editor.model.change((e=>{e.setSelection(i.cells.map((t=>e.createRangeOn(t))),{backward:i.backward})}))}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=Xo(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add((e=>e.on("selection",((e,i,o)=>{const n=o.writer;!function(e){for(const i of t)e.removeClass("ck-editor__editable_selected",i);t.clear()}(n);const r=this.getSelectedTableCells();if(!r)return;for(const e of r){const i=o.mapper.toViewElement(e);n.addClass("ck-editor__editable_selected",i),t.add(i)}const s=o.mapper.toViewElement(r[r.length-1]);n.setSelection(s,0)}),{priority:"lowest"})))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",(()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change((i=>{const o=i.createPositionAt(t[0],0),n=e.model.schema.getNearestSelectionRange(o);i.setSelection(n)}))}}))}_handleDeleteContent(e,t){const i=this.editor.plugins.get(oy),o=t[0],n=t[1],r=this.editor.model,s=!n||"backward"==n.direction,a=i.getSelectedTableCells(o);a.length&&(e.stop(),r.change((e=>{const t=a[s?a.length-1:0];r.change((e=>{for(const t of a)r.deleteContent(e.createSelection(t,"in"))}));const i=r.schema.getNearestSelectionRange(e.createPositionAt(t,0));o.is("documentSelection")?e.setSelection(i):o.setTo(i)})))}_handleInsertTextEvent(e,t){const i=this.editor,o=this.getSelectedTableCells();if(!o)return;const n=i.editing.view,r=i.editing.mapper,s=o.map((e=>n.createRangeOn(r.toViewElement(e))));t.selection=n.createSelection(s)}_getCellsToSelect(e,t){const i=this.editor.plugins.get("TableUtils"),o=i.getCellLocation(e),n=i.getCellLocation(t),r=Math.min(o.row,n.row),s=Math.max(o.row,n.row),a=Math.min(o.column,n.column),l=Math.max(o.column,n.column),c=new Array(s-r+1).fill(null).map((()=>[])),d={startRow:r,endRow:s,startColumn:a,endColumn:l};for(const{row:t,cell:i}of new Pv(e.findAncestor("table"),d))c[t-r].push(i);const u=n.row<o.row,h=n.column<o.column;return u&&c.reverse(),h&&c.forEach((e=>e.reverse())),{cells:c.flat(),backward:u||h}}}class Ny extends er{static get pluginName(){return"TableClipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[sk,ak,Vy,oy]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",((e,t)=>this._onCopyCut(e,t))),this.listenTo(t,"cut",((e,t)=>this._onCopyCut(e,t))),this.listenTo(e.model,"insertContent",((e,[t,i])=>this._onInsertContent(e,t,i)),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const i=this.editor.editing.view,o=this.editor.plugins.get(Vy),n=this.editor.plugins.get(sk);o.getSelectedTableCells()&&("cut"!=e.name||this.editor.model.canEditAt(this.editor.model.document.selection))&&(t.preventDefault(),e.stop(),this.editor.model.enqueueChange({isUndoable:"cut"===e.name},(()=>{const r=n._copySelectedFragmentWithMarkers(e.name,this.editor.model.document.selection,(()=>o.getSelectionAsFragment()));i.document.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:this.editor.data.toView(r),method:e.name})})))}_onInsertContent(e,t,i){if(i&&!i.is("documentSelection"))return;const o=this.editor.model,n=this.editor.plugins.get(oy),r=this.editor.plugins.get(sk),s=this.getTableIfOnlyTableInContent(t,o);if(!s)return;const a=n.getSelectionAffectedTableCells(o.document.selection);a.length?(e.stop(),t.is("documentFragment")?r._pasteMarkersIntoTransformedElement(t.markers,(e=>this._replaceSelectedCells(s,a,e))):this.editor.model.change((e=>{this._replaceSelectedCells(s,a,e)}))):Zv(s,n)}_replaceSelectedCells(e,t,i){const o=this.editor.plugins.get(oy),n={width:o.getColumns(e),height:o.getRows(e)},r=function(e,t,i,o){const n=e[0].findAncestor("table"),r=o.getColumnIndexes(e),s=o.getRowIndexes(e),a={firstColumn:r.first,lastColumn:r.last,firstRow:s.first,lastRow:s.last},l=1===e.length;return l&&(a.lastRow+=t.height-1,a.lastColumn+=t.width-1,function(e,t,i,o){const n=o.getColumns(e),r=o.getRows(e);i>n&&o.insertColumns(e,{at:n,columns:i-n}),t>r&&o.insertRows(e,{at:r,rows:t-r})}(n,a.lastRow+1,a.lastColumn+1,o)),l||!o.isSelectionRectangular(e)?function(e,t,i){const{firstRow:o,lastRow:n,firstColumn:r,lastColumn:s}=t,a={first:o,last:n},l={first:r,last:s};By(e,r,a,i),By(e,s+1,a,i),Ry(e,o,l,i),Ry(e,n+1,l,i,o)}(n,a,i):(a.lastRow=Gv(n,a),a.lastColumn=Kv(n,a)),a}(t,n,i,o),s=r.lastRow-r.firstRow+1,a=r.lastColumn-r.firstColumn+1;e=zv(e,{startRow:0,startColumn:0,endRow:Math.min(s,n.height)-1,endColumn:Math.min(a,n.width)-1},i);const l=t[0].findAncestor("table"),c=this._replaceSelectedCellsWithPasted(e,n,l,r,i);if(this.editor.plugins.get("TableSelection").isEnabled){const e=o.sortRanges(c.map((e=>i.createRangeOn(e))));i.setSelection(e)}else i.setSelection(c[0],0);return l}_replaceSelectedCellsWithPasted(e,t,i,o,n){const{width:r,height:s}=t,a=function(e,t,i){const o=new Array(i).fill(null).map((()=>new Array(t).fill(null)));for(const{column:t,row:i,cell:n}of new Pv(e))o[i][t]=n;return o}(e,r,s),l=[...new Pv(i,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],c=[];let d;for(const e of l){const{row:t,column:i}=e;i===o.firstColumn&&(d=e.getPositionBefore());const l=t-o.firstRow,u=i-o.firstColumn,h=a[l%s][u%r],m=h?n.cloneElement(h):null,g=this._replaceTableSlotCell(e,m,d,n);g&&(Wv(g,t,i,o.lastRow,o.lastColumn,n),c.push(g),d=n.createPositionAfter(g))}const u=parseInt(i.getAttribute("headingRows")||"0"),h=parseInt(i.getAttribute("headingColumns")||"0"),m=o.firstRow<u&&u<=o.lastRow,g=o.firstColumn<h&&h<=o.lastColumn;if(m){const e=Ry(i,u,{first:o.firstColumn,last:o.lastColumn},n,o.firstRow);c.push(...e)}if(g){const e=By(i,h,{first:o.firstRow,last:o.lastRow},n);c.push(...e)}return c}_replaceTableSlotCell(e,t,i,o){const{cell:n,isAnchor:r}=e;return r&&o.remove(n),t?(o.insert(t,i),t):null}getTableIfOnlyTableInContent(e,t){if(!e.is("documentFragment")&&!e.is("element"))return null;if(e.is("element","table"))return e;if(1==e.childCount&&e.getChild(0).is("element","table"))return e.getChild(0);const i=t.createRangeIn(e);for(const e of i.getItems())if(e.is("element","table")){const o=t.createRange(i.start,t.createPositionBefore(e));if(t.hasContent(o,{ignoreWhitespaces:!0}))return null;const n=t.createRange(t.createPositionAfter(e),i.end);return t.hasContent(n,{ignoreWhitespaces:!0})?null:e}return null}}function Ry(e,t,i,o,n=0){if(!(t<1))return Fv(e,t,n).filter((({column:e,cellWidth:t})=>Dy(e,t,i))).map((({cell:e})=>jv(e,t,o)))}function By(e,t,i,o){if(!(t<1))return Uv(e,t).filter((({row:e,cellHeight:t})=>Dy(e,t,i))).map((({cell:e,column:i})=>Hv(e,i,t,o)))}function Dy(e,t,i){const o=e+t-1,{first:n,last:r}=i;return e>=n&&e<=r||e<n&&o>=n}class Ly extends er{static get pluginName(){return"TableKeyboard"}static get isOfficialPlugin(){return!0}static get requires(){return[Vy,oy]}init(){const e=this.editor,t=e.editing.view.document,i=e.t;this.listenTo(t,"arrowKey",((...e)=>this._onArrowKey(...e)),{context:"table"}),this.listenTo(t,"tab",((...e)=>this._handleTabOnSelectedTable(...e)),{context:"figure"}),this.listenTo(t,"tab",((...e)=>this._handleTab(...e)),{context:["th","td"]}),e.accessibility.addKeystrokeInfoGroup({id:"table",label:i("Keystrokes that can be used in a table cell"),keystrokes:[{label:i("Move the selection to the next cell"),keystroke:"Tab"},{label:i("Move the selection to the previous cell"),keystroke:"Shift+Tab"},{label:i("Insert a new table row (when in the last cell of a table)"),keystroke:"Tab"},{label:i("Navigate through the table"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]}]})}_handleTabOnSelectedTable(e,t){const i=this.editor,o=i.model.document.selection.getSelectedElement();o&&o.is("element","table")&&(t.preventDefault(),t.stopPropagation(),e.stop(),i.model.change((e=>{e.setSelection(e.createRangeIn(o.getChild(0).getChild(0)))})))}_handleTab(e,t){const i=this.editor,o=this.editor.plugins.get(oy),n=this.editor.plugins.get("TableSelection"),r=i.model.document.selection,s=!t.shiftKey;let a=o.getTableCellsContainingSelection(r)[0];if(a||(a=n.getFocusCell()),!a)return;t.preventDefault(),t.stopPropagation(),e.stop();const l=a.parent,c=l.parent,d=c.getChildIndex(l),u=l.getChildIndex(a),h=0===u;if(!s&&h&&0===d)return void i.model.change((e=>{e.setSelection(e.createRangeOn(c))}));const m=u===l.childCount-1,g=d===o.getRows(c)-1;if(s&&g&&m&&(i.execute("insertTableRowBelow"),d===o.getRows(c)-1))return void i.model.change((e=>{e.setSelection(e.createRangeOn(c))}));let p;if(s&&m){const e=c.getChild(d+1);p=e.getChild(0)}else if(!s&&h){const e=c.getChild(d-1);p=e.getChild(e.childCount-1)}else p=l.getChild(u+(s?1:-1));i.model.change((e=>{e.setSelection(e.createRangeIn(p))}))}_onArrowKey(e,t){const i=this.editor,o=Oo(t.keyCode,i.locale.contentLanguageDirection);this._handleArrowKeys(o,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const i=this.editor.plugins.get(oy),o=this.editor.plugins.get("TableSelection"),n=this.editor.model,r=n.document.selection,s=["right","down"].includes(e),a=i.getSelectedTableCells(r);if(a.length){let i;return i=t?o.getFocusCell():s?a[a.length-1]:a[0],this._navigateFromCellInDirection(i,e,t),!0}const l=r.focus.findAncestor("tableCell");if(!l)return!1;if(!r.isCollapsed)if(t){if(r.isBackward==s&&!r.containsEntireContent(l))return!1}else{const e=r.getSelectedElement();if(!e||!n.schema.isObject(e))return!1}return!!this._isSelectionAtCellEdge(r,l,s)&&(this._navigateFromCellInDirection(l,e,t),!0)}_isSelectionAtCellEdge(e,t,i){const o=this.editor.model,n=this.editor.model.schema,r=i?e.getLastPosition():e.getFirstPosition();if(!n.getLimitElement(r).is("element","tableCell"))return o.createPositionAt(t,i?"end":0).isTouching(r);const s=o.createSelection(r);return o.modifySelection(s,{direction:i?"forward":"backward"}),r.isEqual(s.focus)}_navigateFromCellInDirection(e,t,i=!1){const o=this.editor.model,n=e.findAncestor("table"),r=[...new Pv(n,{includeAllSlots:!0})],{row:s,column:a}=r[r.length-1],l=r.find((({cell:t})=>t==e));let{row:c,column:d}=l;switch(t){case"left":d--;break;case"up":c--;break;case"right":d+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>s||d<0&&c<=0||d>a&&c>=s)return void o.change((e=>{e.setSelection(e.createRangeOn(n))}));d<0?(d=i?0:a,c--):d>a&&(d=i?a:0,c++);const u=r.find((e=>e.row==c&&e.column==d)).cell,h=["right","down"].includes(t),m=this.editor.plugins.get("TableSelection");if(i&&m.isEnabled){const t=m.getAnchorCell()||e;m.setCellSelection(t,u)}else{const e=o.createPositionAt(u,h?0:"end");o.change((t=>{t.setSelection(e)}))}}}class zy extends va{constructor(){super(...arguments),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class Fy extends er{static get pluginName(){return"TableMouse"}static get isOfficialPlugin(){return!0}static get requires(){return[Vy,oy]}init(){this.editor.editing.view.addObserver(zy),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get(oy);let i=!1;const o=e.plugins.get(Vy);this.listenTo(e.editing.view.document,"mousedown",((n,r)=>{const s=e.model.document.selection;if(!this.isEnabled||!o.isEnabled)return;if(!r.domEvent.shiftKey)return;const a=o.getAnchorCell()||t.getTableCellsContainingSelection(s)[0];if(!a)return;const l=this._getModelTableCellFromDomEvent(r);l&&jy(a,l)&&(i=!0,o.setCellSelection(a,l),r.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{i=!1})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{i&&e.stop()}),{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,i,o=!1,n=!1;const r=e.plugins.get(Vy);this.listenTo(e.editing.view.document,"mousedown",((e,i)=>{this.isEnabled&&r.isEnabled&&(i.domEvent.shiftKey||i.domEvent.ctrlKey||i.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(i)))})),this.listenTo(e.editing.view.document,"mousemove",((e,s)=>{if(!s.domEvent.buttons)return;if(!t)return;const a=this._getModelTableCellFromDomEvent(s);a&&jy(t,a)&&(i=a,o||i==t||(o=!0)),o&&(n=!0,r.setCellSelection(t,i),s.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{o=!1,n=!1,t=null,i=null})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{n&&e.stop()}),{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,i=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}}function jy(e,t){return e.parent.parent==t.parent.parent}var Uy=n(2524),Hy={attributes:{"data-cke":!0}};function Wy(e){return $y(e)||qy(e)}function $y(e){const t=e.getSelectedElement();return t&&Zy(t)?t:null}function qy(e){const t=e.getFirstPosition();if(!t)return null;let i=t.parent;for(;i;){if(i.is("element")&&Zy(i))return i;i=i.parent}return null}function Zy(e){return!!e.getCustomProperty("table")&&Jk(e)}Hy.setAttributes=Wn(),Hy.insert=Un().bind(null,"head"),Hy.domAPI=Fn(),Hy.insertStyleElement=qn(),Ln()(Uy.A,Hy),Uy.A&&Uy.A.locals&&Uy.A.locals;var Gy=n(173),Ky={attributes:{"data-cke":!0}};Ky.setAttributes=Wn(),Ky.insert=Un().bind(null,"head"),Ky.domAPI=Fn(),Ky.insertStyleElement=qn(),Ln()(Gy.A,Ky),Gy.A&&Gy.A.locals&&Gy.A.locals;class Yy extends Kn{constructor(e,t){super(e),this.set("value",""),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isEmpty",!0),this.options=t,this.focusTracker=new en,this._focusables=new pn,this.dropdownView=this._createDropdownView(),this.inputView=this._createInputTextView(),this.keystrokes=new rn,this._stillTyping=!1,this.focusCycler=new Uh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-input-color"]},children:[this.dropdownView,this.inputView]}),this.on("change:value",((e,t,i)=>this._setInputValue(i)))}render(){super.render(),[this.inputView,this.dropdownView.buttonView].forEach((e=>{this.focusTracker.add(e.element),this._focusables.add(e)})),this.keystrokes.listenTo(this.element)}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createDropdownView(){const e=this.locale,t=e.t,i=this.bindTemplate,o=this._createColorSelector(e),n=tp(e),r=new Kn;return r.setTemplate({tag:"span",attributes:{class:["ck","ck-input-color__button__preview"],style:{backgroundColor:i.to("value")}},children:[{tag:"span",attributes:{class:["ck","ck-input-color__button__preview__no-color-indicator",i.if("value","ck-hidden",(e=>""!=e))]}}]}),n.buttonView.extendTemplate({attributes:{class:"ck-input-color__button"}}),n.buttonView.children.add(r),n.buttonView.label=t("Color picker"),n.buttonView.tooltip=!0,n.panelPosition="rtl"===e.uiLanguageDirection?"se":"sw",n.panelView.children.add(o),n.bind("isEnabled").to(this,"isReadOnly",(e=>!e)),n.on("change:isOpen",((e,t,i)=>{i&&(o.updateSelectedColors(),o.showColorGridsFragment())})),n}_createInputTextView(){const e=this.locale,t=new Xm(e);return t.extendTemplate({on:{blur:t.bindTemplate.to("blur")}}),t.value=this.value,t.bind("isReadOnly","hasError").to(this),this.bind("isFocused","isEmpty").to(t),t.on("input",(()=>{const e=t.element.value,i=this.options.colorDefinitions.find((t=>e===t.label));this._stillTyping=!0,this.value=i&&i.color||e})),t.on("blur",(()=>{this._stillTyping=!1,this._setInputValue(t.element.value)})),t.delegate("input").to(this),t}_createColorSelector(e){const t=e.t,i=this.options.defaultColorValue||"",o=t(i?"Restore default":"Remove color"),n=new Yp(e,{colors:this.options.colorDefinitions,columns:this.options.columns,removeButtonLabel:o,colorPickerLabel:t("Color picker"),colorPickerViewConfig:!1!==this.options.colorPickerConfig&&{...this.options.colorPickerConfig,hideInput:!0}});n.appendUI(),n.on("execute",((e,t)=>{"colorPickerSaveButton"!==t.source?(this.value=t.value||i,this.fire("input"),"colorPicker"!==t.source&&(this.dropdownView.isOpen=!1)):this.dropdownView.isOpen=!1}));let r=this.value;return n.on("colorPicker:cancel",(()=>{this.value=r,this.fire("input"),this.dropdownView.isOpen=!1})),n.colorGridsFragmentView.colorPickerButtonView.on("execute",(()=>{r=this.value})),n.bind("selectedColor").to(this,"value"),n}_setInputValue(e){if(!this._stillTyping){const t=Qy(e),i=this.options.colorDefinitions.find((e=>t===Qy(e.color)));this.inputView.value=i?i.label:e||""}}}function Qy(e){return e.replace(/([(,])\s+/g,"$1").replace(/^\s+|\s+(?=[),\s]|$)/g,"").replace(/,|\s/g," ")}const Jy=e=>""===e;function Xy(e){return{none:e("None"),solid:e("Solid"),dotted:e("Dotted"),dashed:e("Dashed"),double:e("Double"),groove:e("Groove"),ridge:e("Ridge"),inset:e("Inset"),outset:e("Outset")}}function ex(e){return e=e.trim().toLowerCase(),Jy(e)||bu(e)}function tx(e){return e=e.trim(),Jy(e)||rx(e)||vu(e)||xu(e)}function ix(e){return e=e.trim(),Jy(e)||rx(e)||vu(e)}const ox=[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}];function nx(e){return(t,i,o)=>{const n=new Yy(t.locale,{colorDefinitions:(r=e.colorConfig,r.map((e=>({color:e.model,label:e.label,options:{hasBorder:e.hasBorder}})))),columns:e.columns,defaultColorValue:e.defaultColorValue,colorPickerConfig:e.colorPickerConfig});var r;return n.inputView.set({id:i,ariaDescribedById:o}),n.bind("isReadOnly").to(t,"isEnabled",(e=>!e)),n.bind("hasError").to(t,"errorText",(e=>!!e)),n.on("input",(()=>{t.errorText=null})),t.bind("isEmpty","isFocused").to(n),n}}function rx(e){const t=parseFloat(e);return!Number.isNaN(t)&&e===String(t)}var sx=n(1834),ax={attributes:{"data-cke":!0}};ax.setAttributes=Wn(),ax.insert=Un().bind(null,"head"),ax.domAPI=Fn(),ax.insertStyleElement=qn(),Ln()(sx.A,ax),sx.A&&sx.A.locals&&sx.A.locals;class lx extends Kn{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 cx=n(1928),dx={attributes:{"data-cke":!0}};dx.setAttributes=Wn(),dx.insert=Un().bind(null,"head"),dx.domAPI=Fn(),dx.insertStyleElement=qn(),Ln()(cx.A,dx),cx.A&&cx.A.locals&&cx.A.locals;var ux=n(786),hx={attributes:{"data-cke":!0}};hx.setAttributes=Wn(),hx.insert=Un().bind(null,"head"),hx.domAPI=Fn(),hx.insertStyleElement=qn(),Ln()(ux.A,hx),ux.A&&ux.A.locals&&ux.A.locals;var mx=n(9311),gx={attributes:{"data-cke":!0}};gx.setAttributes=Wn(),gx.insert=Un().bind(null,"head"),gx.domAPI=Fn(),gx.insertStyleElement=qn(),Ln()(mx.A,gx),mx.A&&mx.A.locals&&mx.A.locals;const px=(()=>[Ig.defaultPositions.northArrowSouth,Ig.defaultPositions.northArrowSouthWest,Ig.defaultPositions.northArrowSouthEast,Ig.defaultPositions.southArrowNorth,Ig.defaultPositions.southArrowNorthWest,Ig.defaultPositions.southArrowNorthEast,Ig.defaultPositions.viewportStickyNorth])();function fx(e,t){const i=e.plugins.get("ContextualBalloon"),o=e.editing.view.document.selection;let n;"cell"===t?qy(o)&&(n=function(e){const t=e.editing.mapper,i=e.editing.view.domConverter,o=e.model.document.selection;if(o.rangeCount>1)return{target:()=>function(e,t){const i=t.editing.mapper,o=t.editing.view.domConverter,n=Array.from(e).map((e=>{const t=kx(e.start),n=i.toViewElement(t);return new Qi(o.mapViewToDom(n))}));return Qi.getBoundingRect(n)}(o.getRanges(),e),positions:px};const n=kx(o.getFirstPosition()),r=t.toViewElement(n);return{target:i.mapViewToDom(r),positions:px}}(e)):Wy(o)&&(n=bx(e)),n&&i.updatePosition(n)}function bx(e){const t=Tv(e.model.document.selection),i=e.editing.mapper.toViewElement(t);return{target:e.editing.view.domConverter.mapViewToDom(i),positions:px}}function kx(e){return e.nodeAfter&&e.nodeAfter.is("element","tableCell")?e.nodeAfter:e.findAncestor("tableCell")}function _x(e){if(!e||!F(e))return e;const{top:t,right:i,bottom:o,left:n}=e;return t==i&&i==o&&o==n?t:void 0}function wx(e,t){const i=parseFloat(e);return Number.isNaN(i)||String(i)!==String(e)?e:`${i}${t}`}function vx(e,t){return function(e,t={}){const i={borderStyle:"none",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",...e};return t.includeAlignmentProperty&&!i.alignment&&(i.alignment="center"),t.includePaddingProperty&&!i.padding&&(i.padding=""),t.includeVerticalAlignmentProperty&&!i.verticalAlignment&&(i.verticalAlignment="middle"),t.includeHorizontalAlignmentProperty&&!i.horizontalAlignment&&(i.horizontalAlignment=t.isRightToLeftContent?"right":"left"),i}({borderStyle:"double",borderColor:"hsl(0, 0%, 70%)",borderWidth:"1px",...e},t)}function yx(e,t){const{modelAttribute:i,styleName:o,viewElement:n,defaultValue:r,reduceBoxSides:s=!1,shouldUpcast:a=()=>!0}=t;e.for("upcast").attributeToAttribute({view:{name:n,styles:{[o]:/[\s\S]+/}},model:{key:i,value:e=>{if(!a(e))return;const t=e.getNormalizedStyle(o),i=s?Ax(t):t;return r!==i?i:void 0}}})}function xx(e,t){const{modelAttribute:i,styleName:o}=t;e.for("downcast").add((e=>e.on(`attribute:${i}:table`,((e,t,i)=>{const{item:n,attributeNewValue:r}=t,{mapper:s,writer:a}=i;if(!i.consumable.consume(t.item,e.name))return;const l=[...s.toViewElement(n).getChildren()].find((e=>e.is("element","table")));r?a.setStyle(o,r,l):a.removeStyle(o,l)}))))}function Ax(e){if(!e)return;const t=["top","right","bottom","left"];if(!t.every((t=>e[t])))return e;const i=e.top;return t.every((t=>e[t]===i))?i:e}class Cx extends ir{constructor(e,t,i){super(e),this.attributeName=t,this._defaultValue=i}refresh(){const e=Tv(this.editor.model.document.selection);this.isEnabled=!!e,this.value=this._getValue(e)}execute(e={}){const t=this.editor.model,i=t.document.selection,{value:o,batch:n}=e,r=Tv(i),s=this._getValueToSet(o);t.enqueueChange(n,(e=>{s?e.setAttribute(this.attributeName,s,r):e.removeAttribute(this.attributeName,r)}))}_getValue(e){if(!e)return;const t=e.getAttribute(this.attributeName);return t!==this._defaultValue?t:void 0}_getValueToSet(e){if(e!==this._defaultValue)return e}}class Tx extends Cx{constructor(e,t){super(e,"tableBackgroundColor",t)}}class Ex extends Cx{constructor(e,t){super(e,"tableBorderColor",t)}_getValue(e){if(!e)return;const t=_x(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class Sx extends Cx{constructor(e,t){super(e,"tableBorderStyle",t)}_getValue(e){if(!e)return;const t=_x(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class Px extends Cx{constructor(e,t){super(e,"tableBorderWidth",t)}_getValue(e){if(!e)return;const t=_x(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}_getValueToSet(e){const t=wx(e,"px");if(t!==this._defaultValue)return t}}class Ix extends Cx{constructor(e,t){super(e,"tableWidth",t)}_getValueToSet(e){if((e=wx(e,"px"))!==this._defaultValue)return e}}class Mx extends Cx{constructor(e,t){super(e,"tableHeight",t)}_getValueToSet(e){if((e=wx(e,"px"))!==this._defaultValue)return e}}class Ox extends Cx{constructor(e,t){super(e,"tableAlignment",t)}}const Vx=/^(left|center|right)$/,Nx=/^(left|none|right)$/;class Rx extends er{static get pluginName(){return"TablePropertiesEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ay]}init(){const e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableProperties.defaultProperties",{});const o=vx(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0});e.data.addStyleProcessorRules(Bu),function(e,t,i){const o={width:"tableBorderWidth",color:"tableBorderColor",style:"tableBorderStyle"};e.extend("table",{allowAttributes:Object.values(o)}),function(e,t,i,o){e.for("upcast").add((e=>e.on("element:table",((e,t,n)=>{if(!t.modelRange)return;const r=["border-top-width","border-top-color","border-top-style","border-bottom-width","border-bottom-color","border-bottom-style","border-right-width","border-right-color","border-right-style","border-left-width","border-left-color","border-left-style"].filter((e=>t.viewItem.hasStyle(e)));if(!r.length)return;const s={styles:r};if(!n.consumable.test(t.viewItem,s))return;const a=[...t.modelRange.getItems({shallow:!0})].pop();n.consumable.consume(t.viewItem,s);const l={style:t.viewItem.getNormalizedStyle("border-style"),color:t.viewItem.getNormalizedStyle("border-color"),width:t.viewItem.getNormalizedStyle("border-width")},c={style:Ax(l.style),color:Ax(l.color),width:Ax(l.width)};c.style!==o.style&&n.writer.setAttribute(i.style,c.style,a),c.color!==o.color&&n.writer.setAttribute(i.color,c.color,a),c.width!==o.width&&n.writer.setAttribute(i.width,c.width,a)}))))}(t,0,o,i),xx(t,{modelAttribute:o.color,styleName:"border-color"}),xx(t,{modelAttribute:o.style,styleName:"border-style"}),xx(t,{modelAttribute:o.width,styleName:"border-width"})}(t,i,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableBorderColor",new Ex(e,o.borderColor)),e.commands.add("tableBorderStyle",new Sx(e,o.borderStyle)),e.commands.add("tableBorderWidth",new Px(e,o.borderWidth)),function(e,t,i){e.extend("table",{allowAttributes:["tableAlignment"]}),t.for("downcast").attributeToAttribute({model:{name:"table",key:"tableAlignment"},view:e=>({key:"style",value:{float:"center"===e?"none":e}}),converterPriority:"high"}),t.for("upcast").attributeToAttribute({view:{name:/^(table|figure)$/,styles:{float:Nx}},model:{key:"tableAlignment",value:e=>{let t=e.getStyle("float");return"none"===t&&(t="center"),t===i?null:t}}}).attributeToAttribute({view:{attributes:{align:Vx}},model:{name:"table",key:"tableAlignment",value:e=>{const t=e.getAttribute("align");return t===i?null:t}}})}(t,i,o.alignment),e.commands.add("tableAlignment",new Ox(e,o.alignment)),Bx(t,i,{modelAttribute:"tableWidth",styleName:"width",defaultValue:o.width}),e.commands.add("tableWidth",new Ix(e,o.width)),Bx(t,i,{modelAttribute:"tableHeight",styleName:"height",defaultValue:o.height}),e.commands.add("tableHeight",new Mx(e,o.height)),e.data.addStyleProcessorRules(Ru),function(e,t,i){const{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),yx(t,{viewElement:"table",...i}),xx(t,i)}(t,i,{modelAttribute:"tableBackgroundColor",styleName:"background-color",defaultValue:o.backgroundColor}),e.commands.add("tableBackgroundColor",new Tx(e,o.backgroundColor))}}function Bx(e,t,i){const{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),yx(t,{viewElement:/^(table|figure)$/,shouldUpcast:e=>!("table"==e.name&&"figure"==e.parent.name),...i}),function(e,t){const{modelElement:i,modelAttribute:o,styleName:n}=t;e.for("downcast").attributeToAttribute({model:{name:i,key:o},view:e=>({key:"style",value:{[n]:e}})})}(t,{modelElement:"table",...i})}var Dx=n(4703),Lx={attributes:{"data-cke":!0}};Lx.setAttributes=Wn(),Lx.insert=Un().bind(null,"head"),Lx.domAPI=Fn(),Lx.insertStyleElement=qn(),Ln()(Dx.A,Lx),Dx.A&&Dx.A.locals&&Dx.A.locals;class zx extends Kn{constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",alignment:""}),this.options=t;const{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:r}=this._createBorderFields(),{backgroundRowLabel:s,backgroundInput:a}=this._createBackgroundFields(),{widthInput:l,operatorLabel:c,heightInput:d,dimensionsLabel:u}=this._createDimensionFields(),{alignmentToolbar:h,alignmentLabel:m}=this._createAlignmentFields();this.focusTracker=new en,this.keystrokes=new rn,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.widthInput=l,this.heightInput=d,this.alignmentToolbar=h;const{saveButtonView:g,cancelButtonView:p}=this._createActionButtons();this.saveButtonView=g,this.cancelButtonView=p,this._focusables=new pn,this._focusCycler=new Uh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.add(new jh(e,{label:this.t("Table properties")})),this.children.add(new lx(e,{labelView:r,children:[r,i,n,o],class:"ck-table-form__border-row"})),this.children.add(new lx(e,{labelView:s,children:[s,a],class:"ck-table-form__background-row"})),this.children.add(new lx(e,{children:[new lx(e,{labelView:u,children:[u,l,c,d],class:"ck-table-form__dimensions-row"}),new lx(e,{labelView:m,children:[m,h],class:"ck-table-properties-form__alignment-row"})]})),this.children.add(new lx(e,{children:[this.saveButtonView,this.cancelButtonView],class:"ck-table-form__action-row"})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Jn({view:this}),[this.borderColorInput,this.backgroundInput].forEach((e=>{this._focusCycler.chain(e.fieldView.focusCycler)})),[this.borderStyleDropdown,this.borderColorInput,this.borderWidthInput,this.backgroundInput,this.widthInput,this.heightInput,this.alignmentToolbar,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()}_createBorderFields(){const e=this.options.defaultTableProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=nx({colorConfig:this.options.borderColors,columns:5,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,r=n("Style"),s=new mm(o);s.text=n("Border");const a=Xy(n),l=new Gm(o,up);l.set({label:r,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",(e=>a[e||"none"])),l.fieldView.on("execute",(e=>{this.borderStyle=e.source._borderStyleValue})),l.bind("isEmpty").to(this,"borderStyle",(e=>!e)),np(l.fieldView,function(e,t){const i=new Jo,o=Xy(e.t);for(const n in o){const r={type:"button",model:new qf({_borderStyleValue:n,label:o[n],role:"menuitemradio",withText:!0})};"none"===n?r.model.bind("isOn").to(e,"borderStyle",(e=>"none"===t?!e:e===n)):r.model.bind("isOn").to(e,"borderStyle",(e=>e===n)),i.add(r)}return i}(this,t.style),{role:"menu",ariaLabel:r});const c=new Gm(o,cp);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",Fx),c.fieldView.on("input",(()=>{this.borderWidth=c.fieldView.element.value}));const d=new Gm(o,i);return d.set({label:n("Color"),class:"ck-table-form__border-color"}),d.fieldView.bind("value").to(this,"borderColor"),d.bind("isEnabled").to(this,"borderStyle",Fx),d.fieldView.on("input",(()=>{this.borderColor=d.fieldView.value})),this.on("change:borderStyle",((e,i,o,n)=>{Fx(o)||(this.borderColor="",this.borderWidth=""),Fx(n)||(this.borderColor=t.color,this.borderWidth=t.width)})),{borderRowLabel:s,borderStyleDropdown:l,borderColorInput:d,borderWidthInput:c}}_createBackgroundFields(){const e=this.locale,t=this.t,i=new mm(e);i.text=t("Background");const o=nx({colorConfig:this.options.backgroundColors,columns:5,defaultColorValue:this.options.defaultTableProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new Gm(e,o);return n.set({label:t("Color"),class:"ck-table-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",(()=>{this.backgroundColor=n.fieldView.value})),{backgroundRowLabel:i,backgroundInput:n}}_createDimensionFields(){const e=this.locale,t=this.t,i=new mm(e);i.text=t("Dimensions");const o=new Gm(e,cp);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",(()=>{this.width=o.fieldView.element.value}));const n=new Kn(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"×"}]});const r=new Gm(e,cp);return r.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),r.fieldView.bind("value").to(this,"height"),r.fieldView.on("input",(()=>{this.height=r.fieldView.element.value})),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:r}}_createAlignmentFields(){const e=this.locale,t=this.t,i=new mm(e);i.text=t("Alignment");const o=new Wg(e);return o.set({role:"radiogroup",isCompact:!0,ariaLabel:t("Table alignment toolbar")}),function(e){const{view:t,icons:i,toolbar:o,labels:n,propertyName:r,nameToValue:s,defaultValue:a}=e;for(const e in n){const l=new Dh(t.locale);l.set({role:"radio",isToggleable:!0,label:n[e],icon:i[e],tooltip:n[e]});const c=s?s(e):e;l.bind("isOn").to(t,r,(e=>{let t=e;return""===e&&a&&(t=a),c===t})),l.on("execute",(()=>{t[r]=c})),o.items.add(l)}}({view:this,icons:{left:_h,center:wh,right:vh},toolbar:o,labels:this._alignmentLabels,propertyName:"alignment",defaultValue:this.options.defaultTableProperties.alignment}),{alignmentLabel:i,alignmentToolbar:o}}_createActionButtons(){const e=this.locale,t=this.t,i=new Dh(e),o=new Dh(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.widthInput,this.heightInput];return i.set({label:t("Save"),icon:bh,class:"ck-button-save",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",((...e)=>e.every((e=>!e)))),o.set({label:t("Cancel"),icon:fh,class:"ck-button-cancel",withText:!0}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}get _alignmentLabels(){const e=this.locale,t=this.t,i=t("Align table to the left"),o=t("Center table"),n=t("Align table to the right");return"rtl"===e.uiLanguageDirection?{right:n,center:o,left:i}:{left:i,center:o,right:n}}}function Fx(e){return"none"!==e}const jx={borderStyle:"tableBorderStyle",borderColor:"tableBorderColor",borderWidth:"tableBorderWidth",backgroundColor:"tableBackgroundColor",width:"tableWidth",height:"tableHeight",alignment:"tableAlignment"};class Ux extends er{static get requires(){return[Jf]}static get pluginName(){return"TablePropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.view=null,e.config.define("table.tableProperties",{borderColors:ox,backgroundColors:ox})}init(){const e=this.editor,t=e.t;this._defaultTableProperties=vx(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),this._balloon=e.plugins.get(Jf),e.ui.componentFactory.add("tableProperties",(i=>{const o=new Dh(i);o.set({label:t("Table properties"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z"/></svg>',tooltip:!0}),this.listenTo(o,"execute",(()=>this._showView()));const n=Object.values(jx).map((t=>e.commands.get(t)));return o.bind("isEnabled").toMany(n,"isEnabled",((...e)=>e.some((e=>e)))),o}))}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(){const e=this.editor,t=e.config.get("table.tableProperties"),i=Vm(t.borderColors),o=Om(e.locale,i),n=Vm(t.backgroundColors),r=Om(e.locale,n),s=!1!==t.colorPicker,a=new zx(e.locale,{borderColors:o,backgroundColors:r,defaultTableProperties:this._defaultTableProperties,colorPickerConfig:!!s&&(t.colorPicker||{})}),l=e.t;a.render(),this.listenTo(a,"submit",(()=>{this._hideView()})),this.listenTo(a,"cancel",(()=>{this._undoStepBatch.operations.length&&e.execute("undo",this._undoStepBatch),this._hideView()})),a.keystrokes.set("Esc",((e,t)=>{this._hideView(),t()})),Yn({emitter:a,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});const c=function(e){return e('The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".')}(l),d=function(e){return e('The value is invalid. Try "10px" or "2em" or simply "2".')}(l);return a.on("change:borderStyle",this._getPropertyChangeCallback("tableBorderStyle")),a.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:a.borderColorInput,commandName:"tableBorderColor",errorText:c,validator:ex})),a.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:a.borderWidthInput,commandName:"tableBorderWidth",errorText:d,validator:ix})),a.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:a.backgroundInput,commandName:"tableBackgroundColor",errorText:c,validator:ex})),a.on("change:width",this._getValidatedPropertyChangeCallback({viewField:a.widthInput,commandName:"tableWidth",errorText:d,validator:tx})),a.on("change:height",this._getValidatedPropertyChangeCallback({viewField:a.heightInput,commandName:"tableHeight",errorText:d,validator:tx})),a.on("change:alignment",this._getPropertyChangeCallback("tableAlignment")),a}_fillViewFormFromCommandValues(){const e=this.editor.commands,t=e.get("tableBorderStyle");Object.entries(jx).map((([t,i])=>{const o=t,n=this._defaultTableProperties[o]||"";return[o,e.get(i).value||n]})).forEach((([e,i])=>{("borderColor"!==e&&"borderWidth"!==e||"none"!==t.value)&&this.view.set(e,i)})),this._isReady=!0}_showView(){const e=this.editor;this.view||(this.view=this._createPropertiesView()),this.listenTo(e.ui,"update",(()=>{this._updateView()})),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:bx(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){const e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){const e=this.editor;Wy(e.editing.view.document.selection)?this._isViewVisible&&fx(e,"table"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){const{commandName:t,viewField:i,validator:o,errorText:n}=e,r=Na((()=>{i.errorText=n}),500);return(e,n,s)=>{r.cancel(),this._isReady&&(o(s)?(this.editor.execute(t,{value:s,batch:this._undoStepBatch}),i.errorText=null):r())}}}var Hx=n(4412),Wx={attributes:{"data-cke":!0}};Wx.setAttributes=Wn(),Wx.insert=Un().bind(null,"head"),Wx.domAPI=Fn(),Wx.insertStyleElement=qn(),Ln()(Hx.A,Wx),Hx.A&&Hx.A.locals&&Hx.A.locals;var $x=n(7642),qx={attributes:{"data-cke":!0}};qx.setAttributes=Wn(),qx.insert=Un().bind(null,"head"),qx.domAPI=Fn(),qx.insertStyleElement=qn(),Ln()($x.A,qx),$x.A&&$x.A.locals&&$x.A.locals;class Zx extends ir{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=function(e,t,i){const o=function(e,t){const i=n_(e,t).start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}(e,i);return t.checkChild(o,"pageBreak")}(i,t,e)}execute(){const e=this.editor.model;e.change((t=>{const i=t.createElement("pageBreak");e.insertObject(i,null,null,{setSelection:"after"})}))}}var Gx=n(3537),Kx={attributes:{"data-cke":!0}};Kx.setAttributes=Wn(),Kx.insert=Un().bind(null,"head"),Kx.domAPI=Fn(),Kx.insertStyleElement=qn(),Ln()(Gx.A,Kx),Gx.A&&Gx.A.locals&&Gx.A.locals;class Yx extends er{static get pluginName(){return"PageBreakEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion;t.register("pageBreak",{inheritAllFrom:"$blockObject"}),o.for("dataDowncast").elementToStructure({model:"pageBreak",view:(e,{writer:t})=>t.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},t.createContainerElement("span",{style:"display: none"}))}),o.for("editingDowncast").elementToStructure({model:"pageBreak",view:(e,{writer:t})=>{const o=i("Page break"),n=t.createContainerElement("div"),r=t.createRawElement("span",{class:"page-break__label"},(function(e){e.innerText=i("Page break")}));return t.addClass("page-break",n),t.insert(t.createPositionAt(n,0),r),function(e,t,i){return t.setCustomProperty("pageBreak",!0,e),Xk(e,t,{label:i})}(n,t,o)}}),o.for("upcast").elementToElement({view:e=>{const t="always"==e.getStyle("page-break-before"),i="always"==e.getStyle("page-break-after");if(!t&&!i)return null;if(1==e.childCount){const t=e.getChild(0);if(!t.is("element","span")||"none"!=t.getStyle("display"))return null}else if(e.childCount>1)return null;return{name:!0}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new Zx(e))}}class Qx extends er{static get pluginName(){return"PageBreakUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("pageBreak",(()=>{const e=this._createButton(Dh);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:pageBreak",(()=>this._createButton(dm)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("pageBreak"),n=new e(t.locale),r=i.t;return n.set({label:r("Page break"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3.598.687h1.5v5h-1.5zm14.5 0h1.5v5h-1.5z"/><path d="M19.598 4.187v1.5h-16v-1.5zm-16 14.569h1.5v-5h-1.5zm14.5 0h1.5v-5h-1.5z"/><path d="M19.598 15.256v-1.5h-16v1.5zM5.081 9h6v2h-6zm8 0h6v2h-6zm-9.483 1L0 12.5v-5z"/></svg>'}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("pageBreak"),t.editing.view.focus()})),n}}class Jx extends ir{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.schema,o=t.document.selection,n=Array.from(o.getSelectedBlocks()),r=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(r){const t=n.filter((e=>Xx(e)||tA(i,e)));this._applyQuote(e,t)}else this._removeQuote(e,n.filter(Xx))}))}_getValue(){const e=Xo(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Xx(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=Xo(e.getSelectedBlocks());return!!i&&tA(t,i)}_removeQuote(e,t){eA(e,t).reverse().forEach((t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);return void e.move(t,i)}t.end.isAtEnd||e.split(t.end);const i=e.createPositionAfter(t.end.parent);e.move(t,i)}))}_applyQuote(e,t){const i=[];eA(e,t).reverse().forEach((t=>{let o=Xx(t.start);o||(o=e.createElement("blockQuote"),e.wrap(t,o)),i.push(o)})),i.reverse().reduce(((t,i)=>t.nextSibling==i?(e.merge(e.createPositionAfter(t)),t):i))}}function Xx(e){return"blockQuote"==e.parent.name?e.parent:null}function eA(e,t){let i,o=0;const n=[];for(;o<t.length;){const r=t[o],s=t[o+1];i||(i=e.createPositionBefore(r)),s&&r.nextSibling==s||(n.push(e.createRange(i,e.createPositionAfter(r))),i=null),o++}return n}function tA(e,t){const i=e.checkChild(t.parent,"blockQuote"),o=e.checkChild(["$root","blockQuote"],t);return i&&o}class iA extends er{static get pluginName(){return"BlockQuoteEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Hk,Ak]}init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new Jx(e)),t.register("blockQuote",{inheritAllFrom:"$container"}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer((i=>{const o=e.model.document.differ.getChanges();for(const e of o)if("insert"==e.type){const o=e.position.nodeAfter;if(!o)continue;if(o.is("element","blockQuote")&&o.isEmpty)return i.remove(o),!0;if(o.is("element","blockQuote")&&!t.checkChild(e.position,o))return i.unwrap(o),!0;if(o.is("element")){const e=i.createRangeIn(o);for(const o of e.getItems())if(o.is("element","blockQuote")&&!t.checkChild(i.createPositionBefore(o),o))return i.unwrap(o),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return i.remove(t),!0}return!1}));const i=this.editor.editing.view.document,o=e.model.document.selection,n=e.commands.get("blockQuote");this.listenTo(i,"enter",((t,i)=>{o.isCollapsed&&n.value&&o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"}),this.listenTo(i,"delete",((t,i)=>{if("backward"!=i.direction||!o.isCollapsed||!n.value)return;const r=o.getLastPosition().parent;r.isEmpty&&!r.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"})}}var oA=n(1487),nA={attributes:{"data-cke":!0}};nA.setAttributes=Wn(),nA.insert=Un().bind(null,"head"),nA.domAPI=Fn(),nA.insertStyleElement=qn(),Ln()(oA.A,nA),oA.A&&oA.A.locals&&oA.A.locals;class rA extends er{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("blockQuote",(()=>{const e=this._createButton(Dh);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:blockQuote",(()=>{const e=this._createButton(dm);return e.set({role:"menuitemcheckbox"}),e}))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("blockQuote"),n=new e(t.locale),r=i.t;return n.set({label:r("Block quote"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>',isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value"),this.listenTo(n,"execute",(()=>{t.execute("blockQuote"),t.editing.view.focus()})),n}}function sA(e){const t=e.t,i=e.config.get("codeBlock.languages");for(const e of i)"Plain text"===e.label&&(e.label=t("Plain text")),void 0===e.class&&(e.class=`language-${e.language}`);return i}function aA(e,t,i){const o={};for(const n of e)"class"===t?o[n[t].split(" ").shift()]=n[i]:o[n[t]]=n[i];return o}function lA(e){return e.data.match(/^(\s*)/)[0]}function cA(e){const t=e.document.selection,i=[];if(t.isCollapsed)return[t.anchor];const o=t.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:t}of o){let o=t.is("$textProxy")?t.textNode:t;const n=o.parent;if(!n.is("element","codeBlock")||o.is("element","softBreak"))continue;for(;o.previousSibling&&!o.previousSibling.is("element","softBreak");)o=o.previousSibling;const r=o.is("$text")?o.startOffset+lA(o).length:o.startOffset,s=e.createPositionAt(n,r);i.every((e=>!e.isEqual(s)))&&i.push(s)}return i}function dA(e){const t=Xo(e.getSelectedBlocks());return!!t&&t.is("element","codeBlock")}function uA(e,t){return!t.is("rootElement")&&!e.isLimit(t)&&e.checkChild(t.parent,"codeBlock")}function hA(e,t,i,o){const n=aA(t,"language","label"),r=i.getAttribute("language");if(r in n){return e("enter"===o?"Entering %0 code snippet":"Leaving %0 code snippet",n[r])}return e("enter"===o?"Entering code snippet":"Leaving code snippet")}function mA(e,t){for(e.textNode&&(e=t.createPositionBefore(e.textNode));e.nodeBefore&&!e.nodeBefore.is("element","softBreak");)e=t.createPositionBefore(e.nodeBefore);const i=e.nodeAfter;return i&&i.is("$text")?i:null}class gA extends ir{constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor,i=t.model,o=i.document.selection,n=sA(t)[0],r=Array.from(o.getSelectedBlocks()),s=null==e.forceValue?!this.value:e.forceValue,a=function(e,t,i){return e.language?e.language:e.usePreviousLanguageChoice&&t?t:i}(e,this._lastLanguage,n.language);i.change((e=>{s?this._applyCodeBlock(e,r,a):this._removeCodeBlock(e,r)}))}_getValue(){const e=Xo(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!e.is("element","codeBlock"))&&e.getAttribute("language")}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=Xo(e.getSelectedBlocks());return!!i&&uA(t,i)}_applyCodeBlock(e,t,i){this._lastLanguage=i;const o=this.editor.model.schema,n=t.filter((e=>uA(o,e)));for(const t of n)e.rename(t,"codeBlock"),e.setAttribute("language",i,t),o.removeDisallowedAttributes([t],e),Array.from(t.getChildren()).filter((e=>!o.checkChild(t,e))).forEach((t=>e.remove(t)));n.reverse().forEach(((t,i)=>{const o=n[i+1];t.previousSibling===o&&(e.appendElement("softBreak",o),e.merge(e.createPositionBefore(t)))}))}_removeCodeBlock(e,t){const i=t.filter((e=>e.is("element","codeBlock")));for(const t of i){const i=e.createRangeOn(t);for(const t of Array.from(i.getItems()).reverse())if(t.is("element","softBreak")&&t.parent.is("element","codeBlock")){const{position:i}=e.split(e.createPositionBefore(t)),o=i.nodeAfter;e.rename(o,"paragraph"),e.removeAttribute("language",o),e.remove(t)}e.rename(t,"paragraph"),e.removeAttribute("language",t)}}}class pA extends ir{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 i=cA(e);for(const o of i){const i=t.createText(this._indentSequence);e.insertContent(i,o)}}))}_checkEnabled(){return!!this._indentSequence&&dA(this.editor.model.document.selection)}}class fA extends ir{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=cA(e);for(const i of t){const t=bA(e,i,this._indentSequence);t&&e.deleteContent(e.createSelection(t))}}))}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return!!dA(e.document.selection)&&cA(e).some((t=>bA(e,t,this._indentSequence)))}}function bA(e,t,i){const o=mA(t,e);if(!o)return null;const n=lA(o),r=n.lastIndexOf(i);if(r+i.length!==n.length)return null;if(-1===r)return null;const{parent:s,startOffset:a}=o;return e.createRange(e.createPositionAt(s,a+r),e.createPositionAt(s,a+r+i.length))}function kA(e,t,i=!1){const o=aA(t,"language","class"),n=aA(t,"language","label");return(t,r,s)=>{const{writer:a,mapper:l,consumable:c}=s;if(!c.consume(r.item,"insert"))return;const d=r.item.getAttribute("language"),u=l.toViewPosition(e.createPositionBefore(r.item)),h={};i&&(h["data-language"]=n[d],h.spellcheck="false");const m=o[d]?{class:o[d]}:void 0,g=a.createContainerElement("code",m),p=a.createContainerElement("pre",h,g);a.insert(u,p),l.bindElements(r.item,g)}}const _A="paragraph";class wA extends er{static get pluginName(){return"CodeBlockEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Zk]}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,i=e.model,o=e.editing.view,n=sA(e);e.commands.add("codeBlock",new gA(e)),e.commands.add("indentCodeBlock",new pA(e)),e.commands.add("outdentCodeBlock",new fA(e)),this.listenTo(o.document,"tab",((t,i)=>{const o=i.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(o).isEnabled&&(e.execute(o),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"pre"}),t.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",disallowChildren:"$inlineObject",allowAttributes:["language"],allowAttributesOf:"$listItem",isBlock:!0}),t.addAttributeCheck(((e,i)=>{const o=e.getItem(e.length-2);if(t.getAttributeProperties(i).isFormatting&&o&&"codeBlock"==o.name)return!1})),e.editing.downcastDispatcher.on("insert:codeBlock",kA(i,n,!0)),e.data.downcastDispatcher.on("insert:codeBlock",kA(i,n)),e.data.downcastDispatcher.on("insert:softBreak",function(e){return(t,i,o)=>{if("codeBlock"!==i.item.parent.name)return;const{writer:n,mapper:r,consumable:s}=o;if(!s.consume(i.item,"insert"))return;const a=r.toViewPosition(e.createPositionBefore(i.item));n.insert(a,n.createText("\n"))}}(i),{priority:"high"}),e.data.upcastDispatcher.on("element:code",function(e,t){const i=aA(t,"class","language"),o=t[0].language;return(e,t,n)=>{const r=t.viewItem,s=r.parent;if(!s||!s.is("element","pre"))return;if(t.modelCursor.findAncestor("codeBlock"))return;const{consumable:a,writer:l}=n;if(!a.test(r,{name:!0}))return;const c=l.createElement("codeBlock"),d=[...r.getClassNames()];d.length||d.push("");for(const e of d){const t=i[e];if(t){l.setAttribute("language",t,c);break}}c.hasAttribute("language")||l.setAttribute("language",o,c),n.convertChildren(r,c),n.safeInsert(c,t.modelCursor)&&(a.consume(r,{name:!0}),n.updateConversionResult(c,t))}}(0,n)),e.data.upcastDispatcher.on("text",((e,t,{consumable:i,writer:o})=>{let n=t.modelCursor;if(!i.test(t.viewItem))return;if(!n.findAncestor("codeBlock"))return;i.consume(t.viewItem);const r=t.viewItem.data.split("\n").map((e=>o.createText(e))),s=r[r.length-1];for(const e of r)if(o.insert(e,n),n=n.getShiftedBy(e.offsetSize),e!==s){const e=o.createElement("softBreak");o.insert(e,n),n=o.createPositionAfter(e)}t.modelRange=o.createRange(t.modelCursor,n),t.modelCursor=n})),e.data.upcastDispatcher.on("element:pre",((e,t,{consumable:i})=>{const o=t.viewItem;if(o.findAncestor("pre"))return;const n=Array.from(o.getChildren()),r=n.find((e=>e.is("element","code")));if(r)for(const e of n)e!==r&&e.is("$text")&&i.consume(e,{name:!0})}),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,o)=>{let n=i.createRange(i.document.selection.anchor);if(o.targetRanges&&(n=e.editing.mapper.toModelRange(o.targetRanges[0])),!n.start.parent.is("element","codeBlock"))return;const r=o.dataTransfer.getData("text/plain"),s=new cu(e.editing.view.document);o.content=function(e,t){const i=e.createDocumentFragment(),o=t.split("\n"),n=o.reduce(((t,i,n)=>(t.push(i),n<o.length-1&&t.push(e.createElement("br")),t)),[]);return e.appendChild(n,i),i}(s,r)})),e.plugins.has("ClipboardPipeline")&&e.plugins.get(ak).on("contentInsertion",((i,o)=>{const n=e.model,r=n.document.selection;r.anchor.parent.is("element","codeBlock")&&n.change((e=>{const i=e.createRangeIn(o.content);for(const o of[...i.getItems()])o.is("node")&&!t.checkChild(r.anchor,o)&&e.remove(o)}))})),this.listenTo(i,"getSelectedContent",((e,[o])=>{const n=o.anchor;!o.isCollapsed&&n.parent.is("element","codeBlock")&&n.hasSameParentAs(o.focus)&&i.change((i=>{const r=e.return;if(n.parent.is("element")&&(r.childCount>1||o.containsEntireContent(n.parent))){const t=i.createElement("codeBlock",n.parent.getAttributes());i.append(r,t);const o=i.createDocumentFragment();return i.append(t,o),void(e.return=o)}const s=r.getChild(0);t.checkAttribute(s,"code")&&i.setAttribute("code",!0,s)}))}))}afterInit(){const e=this.editor,t=e.commands,i=t.get("indent"),o=t.get("outdent");i&&i.registerChildCommand(t.get("indentCodeBlock"),{priority:"highest"}),o&&o.registerChildCommand(t.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",((t,i)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(function(e,t){const i=e.model.document,o=e.editing.view,n=i.selection.getLastPosition(),r=n.nodeAfter;return!(t||!i.selection.isCollapsed||!n.isAtStart)&&(!!yA(r)&&(e.model.change((t=>{e.execute("enter");const o=i.selection.anchor.parent.previousSibling;t.rename(o,_A),t.setSelection(o,"in"),e.model.schema.removeDisallowedAttributes([o],t),t.remove(r)})),o.scrollToTheSelection(),!0))}(e,i.isSoft)||function(e,t){const i=e.model,o=i.document,n=e.editing.view,r=o.selection.getLastPosition(),s=r.nodeBefore;let a;if(t||!o.selection.isCollapsed||!r.isAtEnd||!s||!s.previousSibling)return!1;if(yA(s)&&yA(s.previousSibling))a=i.createRange(i.createPositionBefore(s.previousSibling),i.createPositionAfter(s));else if(vA(s)&&yA(s.previousSibling)&&yA(s.previousSibling.previousSibling))a=i.createRange(i.createPositionBefore(s.previousSibling.previousSibling),i.createPositionAfter(s));else{if(!(vA(s)&&yA(s.previousSibling)&&vA(s.previousSibling.previousSibling)&&s.previousSibling.previousSibling&&yA(s.previousSibling.previousSibling.previousSibling)))return!1;a=i.createRange(i.createPositionBefore(s.previousSibling.previousSibling.previousSibling),i.createPositionAfter(s))}return e.model.change((t=>{t.remove(a),e.execute("enter");const i=o.selection.anchor.parent;t.rename(i,_A),e.model.schema.removeDisallowedAttributes([i],t)})),n.scrollToTheSelection(),!0}(e,i.isSoft)||function(e){const t=e.model,i=t.document;let o;const n=mA(i.selection.getLastPosition(),t);n&&n.is("$text")&&(o=lA(n)),e.model.change((t=>{e.execute("shiftEnter"),o&&t.insertText(o,i.selection.anchor)}))}(e),i.preventDefault(),t.stop())}),{context:"pre"}),this._initAriaAnnouncements()}_initAriaAnnouncements(){const{model:e,ui:t,t:i}=this.editor,o=sA(this.editor);let n=null;e.document.selection.on("change:range",(()=>{const r=e.document.selection.focus.parent;t&&n!==r&&r.is("element")&&(n&&n.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(hA(i,o,n,"leave")),r.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(hA(i,o,r,"enter")),n=r)}))}}function vA(e){return e&&e.is("$text")&&!e.data.match(/\S/)}function yA(e){return e&&e.is("element","softBreak")}var xA=n(3605),AA={attributes:{"data-cke":!0}};AA.setAttributes=Wn(),AA.insert=Un().bind(null,"head"),AA.domAPI=Fn(),AA.insertStyleElement=qn(),Ln()(xA.A,AA),xA.A&&xA.A.locals&&xA.A.locals;class CA extends er{static get pluginName(){return"CodeBlockUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.ui.componentFactory,o=sA(e),n=this._getLanguageListItemDefinitions(o),r=e.commands.get("codeBlock");i.add("codeBlock",(i=>{const o=tp(i,Yg),s=o.buttonView,a=t("Insert code block");return s.set({label:a,tooltip:!0,icon:Sh,isToggleable:!0}),s.bind("isOn").to(r,"value",(e=>!!e)),s.on("execute",(()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()})),o.on("execute",(t=>{e.execute("codeBlock",{language:t.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()})),o.class="ck-code-block-dropdown",o.bind("isEnabled").to(r),np(o,n,{role:"menu",ariaLabel:a}),o})),i.add("menuBar:codeBlock",(i=>{const o=new Vb(i);o.buttonView.set({role:"menuitem",label:t("Code block"),icon:Sh}),o.bind("isEnabled").to(r);const s=new Nb(i);s.set({ariaLabel:t("Insert code block")});for(const t of n){const n=new yf(i,o),a=new dm(i);a.bind(...Object.keys(t.model)).to(t.model),a.set({isToggleable:!0,role:"menuitemcheckbox"}),a.delegate("execute").to(o),a.on("execute",(()=>{e.execute("codeBlock",{language:t.model._codeBlockLanguage,forceValue:r.value!=t.model._codeBlockLanguage}),e.editing.view.focus()})),n.children.add(a),s.items.add(n)}return o.panelView.children.add(s),o}))}_getLanguageListItemDefinitions(e){const t=this.editor.commands.get("codeBlock"),i=new Jo;for(const o of e){const e={type:"button",model:new qf({_codeBlockLanguage:o.language,label:o.label,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(t=>t===e.model._codeBlockLanguage)),i.add(e)}return i}}class TA{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 o=i.writer,n=o.document.selection;for(const e of this._definitions){const r=o.createAttributeElement("a",e.attributes,{priority:5});e.classes&&o.addClass(e.classes,r);for(const t in e.styles)o.setStyle(t,e.styles[t],r);o.setCustomProperty("link",!0,r),e.callback(t.attributeNewValue)?t.item.is("selection")?o.wrap(n.getFirstRange(),r):o.wrap(i.mapper.toViewRange(t.range),r):o.unwrap(i.mapper.toViewRange(t.range),r)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",((e,t,{writer:i,mapper:o})=>{const n=o.toViewElement(t.item),r=Array.from(n.getChildren()).find((e=>e.is("element","a")));if(r)for(const e of this._definitions){const o=sn(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of o)"class"===e?i.addClass(t,r):i.setAttribute(e,t,r);e.classes&&i.addClass(e.classes,r);for(const t in e.styles)i.setStyle(t,e.styles[t],r)}else{for(const[e,t]of o)"class"===e?i.removeClass(t,r):i.removeAttribute(e,r);e.classes&&i.removeClass(e.classes,r);for(const t in e.styles)i.removeStyle(t,r)}}}))}}}var EA=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const SA=function(e){return EA.test(e)};var PA="\\ud800-\\udfff",IA="["+PA+"]",MA="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",OA="\\ud83c[\\udffb-\\udfff]",VA="[^"+PA+"]",NA="(?:\\ud83c[\\udde6-\\uddff]){2}",RA="[\\ud800-\\udbff][\\udc00-\\udfff]",BA="(?:"+MA+"|"+OA+")?",DA="[\\ufe0e\\ufe0f]?",LA=DA+BA+"(?:\\u200d(?:"+[VA,NA,RA].join("|")+")"+DA+BA+")*",zA="(?:"+[VA+MA+"?",MA,NA,RA,IA].join("|")+")",FA=RegExp(OA+"(?="+OA+")|"+zA+LA,"g");const jA=function(e){return SA(e)?function(e){return e.match(FA)||[]}(e):function(e){return e.split("")}(e)},UA=function(e){e=vr(e);var t,i,o,n,r=SA(e)?jA(e):void 0,s=r?r[0]:e.charAt(0),a=r?(t=r,i=1,n=t.length,o=void 0===o?n:o,!i&&o>=n?t:Zr(t,i,o)).join(""):e.slice(1);return s.toUpperCase()+a},HA=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,WA=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,$A=/^((\w+:(\/{2,})?)|(\W))/i,qA=["https?","ftps?","mailto"],ZA="Ctrl+K";function GA(e,{writer:t}){const i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function KA(e,t=qA){const i=String(e),o=t.join("|");return function(e,t){return!!e.replace(HA,"").match(t)}(i,new RegExp(`${"^(?:(?:<protocols>):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("<protocols>",o)}`,"i"))?i:"#"}function YA(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function QA(e,t){const i=(o=e,WA.test(o)?"mailto:":t);var o;const n=!!i&&!JA(e);return e&&n?i+e:e}function JA(e){return $A.test(e)}function XA(e){window.open(e,"_blank","noopener")}function eC(e){const t=e.plugins.has("BookmarkEditing")?e.plugins.get("BookmarkEditing"):null;return{isScrollableToTarget:function(e){return!!e&&e.startsWith("#")&&!!t&&!!t.getElementForBookmarkId(e.slice(1))},scrollToTarget:function(i){const o=i.slice(1),n=t.getElementForBookmarkId(o);e.model.change((e=>{e.setSelection(n,"on")})),e.editing.view.scrollToTheSelection({alignToTop:!0,forceScroll:!0})}}}class tC extends ir{constructor(){super(...arguments),this.manualDecorators=new Jo,this.automaticDecorators=new TA}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||Xo(t.getSelectedBlocks());YA(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const i=this.editor.model,o=i.document.selection,n=[],r=[];for(const e in t)t[e]?n.push(e):r.push(e);i.change((t=>{if(o.isCollapsed){const s=o.getFirstPosition();if(o.hasAttribute("linkHref")){const a=iC(o);let l=Bk(s,"linkHref",o.getAttribute("linkHref"),i);o.getAttribute("linkHref")===a&&(l=this._updateLinkContent(i,t,l,e)),t.setAttribute("linkHref",e,l),n.forEach((e=>{t.setAttribute(e,!0,l)})),r.forEach((e=>{t.removeAttribute(e,l)})),t.setSelection(t.createPositionAfter(l.end.nodeBefore))}else if(""!==e){const r=sn(o.getAttributes());r.set("linkHref",e),n.forEach((e=>{r.set(e,!0)}));const{end:a}=i.insertContent(t.createText(e,r),s);t.setSelection(a)}["linkHref",...n,...r].forEach((e=>{t.removeSelectionAttribute(e)}))}else{const s=i.schema.getValidRanges(o.getRanges(),"linkHref"),a=[];for(const e of o.getSelectedBlocks())i.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const l=a.slice();for(const e of s)this._isRangeToUpdate(e,a)&&l.push(e);for(const s of l){let a=s;if(1===l.length){const n=iC(o);o.getAttribute("linkHref")===n&&(a=this._updateLinkContent(i,t,s,e),t.setSelection(t.createSelection(a)))}t.setAttribute("linkHref",e,a),n.forEach((e=>{t.setAttribute(e,!0,a)})),r.forEach((e=>{t.removeAttribute(e,a)}))}}}))}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,o=i.getSelectedElement();return YA(o,t.schema)?o.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}_updateLinkContent(e,t,i,o){const n=t.createText(o,{linkHref:o});return e.insertContent(n,i)}}function iC(e){if(e.isCollapsed){const t=e.getFirstPosition();return t.textNode&&t.textNode.data}{const t=Array.from(e.getFirstRange().getItems());if(t.length>1)return null;const i=t[0];return i.is("$text")||i.is("$textProxy")?i.data:null}}class oC extends ir{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();YA(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,o=e.commands.get("link");t.change((e=>{const n=i.isCollapsed?[Bk(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of n)if(e.removeAttribute("linkHref",t),o)for(const i of o.manualDecorators)e.removeAttribute(i.id,t)}))}}class nC extends(Z()){constructor({id:e,label:t,attributes:i,classes:o,styles:n,defaultValue:r}){super(),this.id=e,this.set("value",void 0),this.defaultValue=r,this.label=t,this.attributes=i,this.classes=o,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var rC=n(278),sC={attributes:{"data-cke":!0}};sC.setAttributes=Wn(),sC.insert=Un().bind(null,"head"),sC.domAPI=Fn(),sC.insertStyleElement=qn(),Ln()(rC.A,sC),rC.A&&rC.A.locals&&rC.A.locals;const aC="automatic",lC=/^(https?:)?\/\//;class cC extends er{static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Sk,mk,ak]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:GA}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,i)=>GA(KA(e,t),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new tC(e)),e.commands.add("unlink",new oC(e));const i=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach((e=>("label"in e&&i[e.label]&&(e.label=i[e.label]),e))),t}(e.t,function(e){const t=[];if(e)for(const[i,o]of Object.entries(e)){const e=Object.assign({},o,{id:`link${UA(i)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter((e=>e.mode===aC))),this._enableManualDecorators(i.filter((e=>"manual"===e.mode))),e.plugins.get(Sk).registerAttribute("linkHref"),function(e,t,i,o){const n=e.editing.view,r=new Set;n.document.registerPostFixer((i=>{const n=e.model.document.selection;let s=!1;if(n.hasAttribute(t)){const a=Bk(n.getFirstPosition(),t,n.getAttribute(t),e.model),l=e.editing.mapper.toViewRange(a);for(const e of l.getItems())e.is("element","a")&&!e.hasClass(o)&&(i.addClass(o,e),r.add(e),s=!0)}return s})),e.conversion.for("editingDowncast").add((e=>{function t(){n.change((e=>{for(const t of r.values())e.removeClass(o,t),r.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"})}))}(e,"linkHref",0,"ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:aC,callback:e=>!!e&&lC.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});const o=new nC(e);i.add(o),t.conversion.for("downcast").attributeToElement({model:o.id,view:(e,{writer:t,schema:i},{item:n})=>{if((n.is("selection")||i.isInline(n))&&e){const e=t.createAttributeElement("a",o.attributes,{priority:5});o.classes&&t.addClass(o.classes,e);for(const i in o.styles)t.setStyle(i,o.styles[i],e);return t.setCustomProperty("link",!0,e),e}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...o._createPattern()},model:{key:o.id}})}))}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,i=eC(e);function o(e){i.isScrollableToTarget(e)?i.scrollToTarget(e):XA(e)}this.listenTo(t,"click",((e,t)=>{if(!(s.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(),o(n))}),{context:"$capture"}),this.listenTo(t,"keydown",((t,i)=>{const n=e.commands.get("link").value;n&&i.keyCode===Eo.enter&&i.altKey&&(t.stop(),o(n))}))}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",((i,{attributeKeys:o})=>{o.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change((t=>{var i;!function(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}(t,(i=e.schema,i.getDefinition("$text").allowAttributes.filter((e=>e.startsWith("link")))))}))}))}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",((e,o)=>{t.change((e=>{const t=e.createRangeIn(o.content);for(const o of t.getItems())if(o.hasAttribute("linkHref")){const t=QA(o.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,o)}}))}))}}var dC=n(7817),uC={attributes:{"data-cke":!0}};uC.setAttributes=Wn(),uC.insert=Un().bind(null,"head"),uC.domAPI=Fn(),uC.insertStyleElement=qn(),Ln()(dC.A,uC),dC.A&&dC.A.locals&&dC.A.locals;var hC=n(9392),mC={attributes:{"data-cke":!0}};mC.setAttributes=Wn(),mC.insert=Un().bind(null,"head"),mC.domAPI=Fn(),mC.insertStyleElement=qn(),Ln()(hC.A,mC),hC.A&&hC.A.locals&&hC.A.locals;class gC extends Kn{constructor(e,t,i){super(e),this.focusTracker=new en,this.keystrokes=new rn,this._focusables=new pn;const o=e.t;this._validators=i,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(o("Save"),bh,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(o("Cancel"),fh,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new Uh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const n=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&n.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:n,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((e,t)=>(e[t.name]=t.isOn,e)),{})}render(){super.render(),Jn({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()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createUrlInput(){const e=this.locale.t,t=new Gm(this.locale,cp);return t.fieldView.inputMode="url",t.label=e("Link URL"),t}_createButton(e,t,i,o){const n=new Dh(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const o=new xm(this.locale);o.set({name:i.id,label:i.label,withText:!0}),o.bind("isOn").toMany([i,e],"value",((e,t)=>void 0===t&&void 0===e?!!i.defaultValue:!!e)),o.on("execute",(()=>{i.set("value",!o.isOn)})),t.add(o)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new Kn;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}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}var pC=n(1893),fC={attributes:{"data-cke":!0}};fC.setAttributes=Wn(),fC.insert=Un().bind(null,"head"),fC.domAPI=Fn(),fC.insertStyleElement=qn(),Ln()(pC.A,fC),pC.A&&pC.A.locals&&pC.A.locals;class bC extends Kn{constructor(e,t={},i){super(e),this.focusTracker=new en,this.keystrokes=new rn,this._focusables=new pn;const o=e.t;this._options=i,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(o("Unlink"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>',"unlink"),this.editButtonView=this._createButton(o("Edit link"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z"/></svg>',"edit"),this.set("href",void 0),this._linkConfig=t,this._focusCycler=new Uh({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 o=new Dh(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.delegate("execute").to(this,i),o}_createPreviewButton(){const e=new Dh(this.locale),t=this.bindTemplate,i=this.t;return e.set({withText:!0}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",(e=>e&&KA(e,this._linkConfig.allowedProtocols))),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to((e=>{this._options&&this._options.isScrollableToTarget(this.href)?(e.preventDefault(),this._options.scrollToTarget(this.href)):XA(this.href)}))}}),e.bind("tooltip").to(this,"href",(e=>this._options&&this._options.isScrollableToTarget(e)?i("Scroll to target"):i("Open link in new tab"))),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}}const kC="link-ui";class _C extends er{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[Jf]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.editing.view.addObserver(su),this._balloon=e.plugins.get(Jf),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:kC,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:kC,view:(e,{writer:t})=>{if(!e.markerRange.isCollapsed)return null;const i=t.createUIElement("span");return t.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],i),i}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:ZA},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}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 bC(e.locale,e.config.get("link"),eC(e)),i=e.commands.get("link"),o=e.commands.get("unlink");return t.bind("href").to(i,"value"),t.editButtonView.bind("isEnabled").to(i),t.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(t,"edit",(()=>{this._addFormView()})),this.listenTo(t,"unlink",(()=>{e.execute("unlink"),this._hideUI()})),t.keystrokes.set("Esc",((e,t)=>{this._hideUI(),t()})),t.keystrokes.set(ZA,((e,t)=>{this._addFormView(),t()})),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),i=e.config.get("link.defaultProtocol"),o=new(Qn(gC))(e.locale,t,function(e){const t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[e=>{if(!i&&!e.url.length)return t("Link URL must not be empty.")}]}(e));return o.urlInputView.fieldView.bind("value").to(t,"value"),o.urlInputView.bind("isEnabled").to(t,"isEnabled"),o.saveButtonView.bind("isEnabled").to(t,"isEnabled"),this.listenTo(o,"submit",(()=>{if(o.isValid()){const{value:t}=o.urlInputView.fieldView.element,n=QA(t,i);e.execute("link",n,o.getDecoratorSwitchesState()),this._closeFormView()}})),this.listenTo(o.urlInputView,"change:errorText",(()=>{e.ui.update()})),this.listenTo(o,"cancel",(()=>{this._closeFormView()})),o.keystrokes.set("Esc",((e,t)=>{this._closeFormView(),t()})),o}_createToolbarLinkButton(){const e=this.editor;e.ui.componentFactory.add("link",(()=>{const e=this._createButton(Dh);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:link",(()=>{const e=this._createButton(dm);return e.set({role:"menuitemcheckbox"}),e}))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("link"),n=new e(t.locale),r=i.t;return n.set({label:r("Link"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>',keystroke:ZA,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"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(ZA,((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())})),Yn({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.formView.resetFormStatus(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_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.formView.urlInputView.fieldView.reset(),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(),o=r();const n=()=>{const e=this._getSelectedLinkElement(),t=r();i&&!e||!i&&t!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,o=t};function r(){return t.selection.focus.getAncestors().reverse().find((e=>e.is("element")))}this.listenTo(e.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,i=e.document;let o;if(t.markers.has(kC)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(kC)),i=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));o=e.domConverter.viewRangeToDom(i)}else o=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(i.selection.getFirstRange())};return{target:o}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&Jk(i))return wC(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),o=wC(i.start),n=wC(i.end);return o&&o==n&&e.createRangeIn(o).getTrimmed().isEqual(i)?o:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(kC))t.updateMarker(kC,{range:i});else if(i.start.isAtEnd){const o=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(kC,{usingOperation:!1,affectsData:!1,range:t.createRange(o,i.end)})}else t.addMarker(kC,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(kC)&&e.change((e=>{e.removeMarker(kC)}))}}function wC(e){return e.getAncestors().find((e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t}))||null}const vC=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 yC extends er{static get requires(){return[Ak,cC]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}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(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?Bk(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const i=this.editor.model,o=i.document.selection,n=o.getFirstPosition(),r=o.getLastPosition();let s=t.getJoined(this._expandLinkRange(i,n)||t);s&&(s=s.getJoined(this._expandLinkRange(i,r)||t)),s&&(s.start.isBefore(n)||s.end.isAfter(r))&&e.setSelection(s)}_enablePasteLinking(){const e=this.editor,t=e.model,i=t.document.selection,o=e.plugins.get("ClipboardPipeline"),n=e.commands.get("link");o.on("inputTransformation",((e,o)=>{if(!this.isEnabled||!n.isEnabled||i.isCollapsed||"paste"!==o.method)return;if(i.rangeCount>1)return;const r=i.getFirstRange(),s=o.dataTransfer.getData("text/plain");if(!s)return;const a=s.match(vC);a&&a[2]===s&&(t.change((e=>{this._selectEntireLinks(e,r),n.execute(s)})),e.stop())}),{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new Ek(e.model,(e=>{let t=e;if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(t))return;t=t.slice(0,-1),"!.:,;?".includes(t[t.length-1])&&(t=t.slice(0,-1));const i=xC(t);return i?{url:i,removedTrailingCharacters:e.length-t.length}:void 0}));t.on("matched:data",((t,i)=>{const{batch:o,range:n,url:r,removedTrailingCharacters:s}=i;if(!o.isTyping)return;const a=n.end.getShiftedBy(-s),l=a.getShiftedBy(-r.length),c=e.model.createRange(l,a);this._applyAutoLink(r,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:o}=Tk(e,t),n=xC(i);if(n){const e=t.createRange(o.end.getShiftedBy(-n.length),o.end);this._applyAutoLink(n,e)}}_applyAutoLink(e,t){const i=this.editor.model,o=QA(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&JA(o)&&!function(e){const t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(o,t)}_persistAutoLink(e,t){const i=this.editor.model,o=this.editor.plugins.get("Delete");i.enqueueChange((n=>{n.setAttribute("linkHref",e,t),i.enqueueChange((()=>{o.requestUndoOnBackspace()}))}))}}function xC(e){const t=vC.exec(e);return t?t[2]:null}var AC=n(6355),CC={attributes:{"data-cke":!0}};function TC(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot("children")])}function EC(e,t){const i=e.plugins.get("ImageUtils"),o=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>i.isInlineImageView(e)?o&&("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:n(e):null;function n(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function SC(e,t){const i=Xo(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}function PC(e){return e&&e.endsWith("px")?parseInt(e):null}function IC(e){const t=PC(e.getStyle("width")),i=PC(e.getStyle("height"));return!(!t||!i)}CC.setAttributes=Wn(),CC.insert=Un().bind(null,"head"),CC.domAPI=Fn(),CC.insertStyleElement=qn(),Ln()(AC.A,CC),AC.A&&AC.A.locals&&AC.A.locals;const MC=/^(image|image-inline)$/;class OC extends er{constructor(){super(...arguments),this._domEmitter=new(Ui())}static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}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,o={}){const n=this.editor,r=n.model,s=r.document.selection,a=VC(n,t||s,i);e={...Object.fromEntries(s.getAttributes()),...e};for(const t in e)r.schema.checkAttribute(a,t)||delete e[t];return r.change((i=>{const{setImageSizes:n=!0}=o,s=i.createElement(a,e);return r.insertObject(s,t,null,{setSelection:"on",findOptimalPosition:t||"imageInline"==a?void 0:"auto"}),s.parent?(n&&this.setImageNaturalSizeAttributes(s),s):null}))}setImageNaturalSizeAttributes(e){const i=e.getAttribute("src");i&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change((o=>{const n=new t.window.Image;this._domEmitter.listenTo(n,"load",(()=>{e.getAttribute("width")||e.getAttribute("height")||this.editor.model.enqueueChange(o.batch,(t=>{t.setAttribute("width",n.naturalWidth,e),t.setAttribute("height",n.naturalHeight,e)})),this._domEmitter.stopListening(n,"load")})),n.src=i})))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let o=t.parent;for(;o;){if(o.is("element")&&this.isImageWidget(o))return o;o=o.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:MC})}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){if("imageBlock"==VC(e,t,null)){const i=function(e,t){const i=n_(e,t).start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}(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){return t.setCustomProperty("image",!0,e),Xk(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&Jk(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}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function VC(e,t,i){const o=e.model.schema,n=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===n?"imageInline":"auto"!==n?"imageBlock":t.is("selection")?SC(o,t):o.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}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 NC extends ir{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"),o=t.model,n=i.getClosestSelectedImageElement(o.document.selection);o.change((t=>{t.setAttribute("alt",e.newValue,n)}))}}class RC extends er{static get requires(){return[OC]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new NC(this.editor))}}var BC=n(3644),DC={attributes:{"data-cke":!0}};DC.setAttributes=Wn(),DC.insert=Un().bind(null,"head"),DC.domAPI=Fn(),DC.insertStyleElement=qn(),Ln()(BC.A,DC),BC.A&&BC.A.locals&&BC.A.locals;class LC extends Kn{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new en,this.keystrokes=new rn,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),bh,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),fh,"ck-button-cancel","cancel"),this._focusables=new pn,this._focusCycler=new Uh({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]})}render(){super.render(),this.keystrokes.listenTo(this.element),Jn({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,o){const n=new Dh(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createLabeledInputView(){const e=this.locale.t,t=new Gm(this.locale,cp);return t.label=e("Text alternative"),t}}function zC(e){const t=e.editing.view,i=Ig.defaultPositions,o=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(o.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class FC extends er{static get requires(){return[Jf]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",(i=>{const o=e.commands.get("imageTextAlternative"),n=new Dh(i);return n.set({label:t("Change image text alternative"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3.035 1C2.446 1 2 1.54 2 2.098V10.5h1.5v-8h13v8H18V2.098C18 1.539 17.48 1 16.9 1H3.035Zm10.453 2.61a1.885 1.885 0 0 0-1.442.736 1.89 1.89 0 0 0 1.011 2.976 1.903 1.903 0 0 0 2.253-1.114 1.887 1.887 0 0 0-1.822-2.598ZM7.463 8.163a.611.611 0 0 0-.432.154L5.071 10.5h5.119L7.88 8.348a.628.628 0 0 0-.417-.185Zm6.236 1.059a.62.62 0 0 0-.42.164L12.07 10.5h2.969l-.92-1.113a.618.618 0 0 0-.42-.165ZM.91 11.5a.91.91 0 0 0-.91.912v6.877c0 .505.405.91.91.91h18.178a.91.91 0 0 0 .912-.91v-6.877a.908.908 0 0 0-.912-.912H.91ZM3.668 13h1.947l2.135 5.7H5.898l-.28-.946H3.601l-.278.945H1.516L3.668 13Zm4.947 0h1.801v4.3h2.7v1.4h-4.5V13h-.001Zm4.5 0h5.4v1.4h-1.798v4.3h-1.701v-4.3h-1.9V13h-.001Zm-8.517 1.457-.614 2.059h1.262l-.648-2.059Z"/></svg>',tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>{this._showForm()})),n}))}_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(Qn(LC))(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=zC(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),Yn({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:zC(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){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 jC extends er{static get requires(){return[RC,FC]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function UC(e,t){const i=(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const n=o.writer,r=o.mapper.toViewElement(i.item),s=e.findViewImgElement(r);null===i.attributeNewValue?(n.removeAttribute("srcset",s),n.removeAttribute("sizes",s)):i.attributeNewValue&&(n.setAttribute("srcset",i.attributeNewValue,s),n.setAttribute("sizes","100vw",s))};return e=>{e.on(`attribute:srcset:${t}`,i)}}function HC(e,t,i){const o=(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const n=o.writer,r=o.mapper.toViewElement(i.item),s=e.findViewImgElement(r);n.setAttribute(i.attributeKey,i.attributeNewValue||"",s)};return e=>{e.on(`attribute:${i}:${t}`,o)}}class WC extends ba{observe(e){this.listenTo(e,"load",((e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)}),{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class $C extends ir{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&C("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&C("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=No(e.source),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach(((t,r)=>{const s=i.getSelectedElement();if("string"==typeof t&&(t={src:t}),r&&s&&o.isImage(s)){const i=this.editor.model.createPositionAfter(s);o.insertImage({...t,...n},i,e.imageType)}else e.breakBlock?o.insertImage({...t,...n},i.getFirstPosition(),e.imageType):o.insertImage({...t,...n},null,e.imageType)}))}}class qC extends ir{constructor(e){super(e),this.decorate("cleanupImage")}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(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change((o=>{o.setAttribute("src",e.source,t),this.cleanupImage(o,t),i.setImageNaturalSizeAttributes(t)}))}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class ZC extends er{static get requires(){return[OC]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(WC),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new $C(e),o=new qC(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",o),e.commands.add("imageInsert",i)}}class GC extends er{static get requires(){return[OC]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils"),o="imageBlock"===e?"figure":"img";function n(t,o,n,r,s=!1){t.on(`attribute:${o}:${e}`,((t,o,a)=>{if(!a.consumable.consume(o.item,t.name))return;const l=a.writer,c=a.mapper.toViewElement(o.item),d=i.findViewImgElement(c);null!==o.attributeNewValue?l.setAttribute(n,o.attributeNewValue,d):l.removeAttribute(n,d);const u=o.item.getAttribute("width"),h=o.item.getAttribute("height"),m=u&&h;if(m&&s&&l.setAttribute("loading","lazy",d),o.item.hasAttribute("sources"))return;const g=o.item.hasAttribute("resizedWidth");("imageInline"!==e||g||r)&&m&&l.setStyle("aspect-ratio",`${u}/${h}`,d)}))}t.conversion.for("upcast").attributeToAttribute({view:{name:o,styles:{width:/.+/}},model:{key:"width",value:e=>IC(e)?PC(e.getStyle("width")):null}}).attributeToAttribute({view:{name:o,key:"width"},model:"width"}).attributeToAttribute({view:{name:o,styles:{height:/.+/}},model:{key:"height",value:e=>IC(e)?PC(e.getStyle("height")):null}}).attributeToAttribute({view:{name:o,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add((e=>{n(e,"width","width",!0,!0),n(e,"height","height",!0,!0)})),t.conversion.for("dataDowncast").add((e=>{n(e,"width","width",!1),n(e,"height","height",!1)}))}}class KC extends ir{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(e={}){const t=this.editor,i=this.editor.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection),r=Object.fromEntries(n.getAttributes());return r.src||r.uploadId?i.change((t=>{const{setImageSizes:s=!0}=e,a=Array.from(i.markers).filter((e=>e.getRange().containsItem(n))),l=o.insertImage(r,i.createSelection(n,"on"),this._modelElementName,{setImageSizes:s});if(!l)return null;const c=t.createRangeOn(l);for(const e of a){const i=e.getRange(),o="$graveyard"!=i.root.rootName?i.getJoined(c,!0):c;t.updateMarker(e,{range:o})}return{oldElement:n,newElement:l}})):null}}var YC=n(9025),QC={attributes:{"data-cke":!0}};QC.setAttributes=Wn(),QC.insert=Un().bind(null,"head"),QC.domAPI=Fn(),QC.insertStyleElement=qn(),Ln()(YC.A,QC),YC.A&&YC.A.locals&&YC.A.locals;class JC extends er{static get requires(){return[OC]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add((e=>{e.on("attribute:placeholder",((e,t,o)=>{if(!o.consumable.test(t.item,e.name))return;if(!t.item.is("element","imageBlock")&&!t.item.is("element","imageInline"))return;o.consumable.consume(t.item,e.name);const n=o.writer,r=o.mapper.toViewElement(t.item),s=i.findViewImgElement(r);t.attributeNewValue?(n.addClass("image_placeholder",s),n.setStyle("background-image",`url(${t.attributeNewValue})`,s),n.setCustomProperty("editingPipeline:doNotReuseOnce",!0,s)):(n.removeClass("image_placeholder",s),n.removeStyle("background-image",s))}))}))}_setupLoadListener(){const e=this.editor,t=e.model,i=e.editing,o=i.view,n=e.plugins.get("ImageUtils");o.addObserver(WC),this.listenTo(o.document,"imageLoaded",((e,r)=>{const s=o.domConverter.mapDomToView(r.target);if(!s)return;const a=n.getImageWidgetFromImageView(s);if(!a)return;const l=i.mapper.toModelElement(a);l&&l.hasAttribute("placeholder")&&t.enqueueChange({isUndoable:!1},(e=>{e.removeAttribute("placeholder",l)}))}))}}class XC extends er{static get requires(){return[ZC,GC,OC,JC,ak]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}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 KC(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>TC(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>o.toImageWidget(TC(i),i,t("image widget"))}),i.for("downcast").add(HC(o,"imageBlock","src")).add(HC(o,"imageBlock","alt")).add(UC(o,"imageBlock")),i.for("upcast").elementToElement({view:EC(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)}).add(function(e){const t=(t,i,o)=>{if(!o.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const n=e.findViewImgElement(i.viewItem);if(!n||!o.consumable.test(n,{name:!0}))return;o.consumable.consume(i.viewItem,{name:!0,classes:"image"});const r=Xo(o.convertItem(n,i.modelCursor).modelRange.getItems());r?(o.convertChildren(i.viewItem,r),o.updateConversionResult(r,i)):o.consumable.revert(i.viewItem,{name:!0,classes:"image"})};return e=>{e.on("element:figure",t)}}(o))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",((n,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(o.isInlineImageView))return;a=r.targetRanges?e.editing.mapper.toModelRange(r.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===SC(t.schema,l)){const e=new cu(i.document),t=s.map((t=>e.createElement("figure",{class:"image"},t)));r.content=e.createDocumentFragment(t)}})),this.listenTo(n,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageBlock")&&o.setImageNaturalSizeAttributes(e)}))}))}}var eT=n(219),tT={attributes:{"data-cke":!0}};tT.setAttributes=Wn(),tT.insert=Un().bind(null,"head"),tT.domAPI=Fn(),tT.insertStyleElement=qn(),Ln()(eT.A,tT),eT.A&&eT.A.locals&&eT.A.locals;class iT extends Kn{constructor(e,t=[]){super(e),this.focusTracker=new en,this.keystrokes=new rn,this._focusables=new pn,this.children=this.createCollection(),this._focusCycler=new Uh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const e of t)this.children.add(e),this._focusables.add(e),e instanceof Mm&&this._focusables.addMany(e.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),Jn({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class oT extends er{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[OC]}constructor(e){super(e),this._integrations=new Map,e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",(()=>{this.isImageSelected=i.isImage(t.getSelectedElement())}));const o=e=>this._createToolbarComponent(e);e.ui.componentFactory.add("insertImage",o),e.ui.componentFactory.add("imageInsert",o),e.ui.componentFactory.add("menuBar:insertImage",(e=>this._createMenuBarComponent(e)))}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:o,menuBarButtonViewCreator:n,requiresForm:r=!1,override:s=!1}){this._integrations.has(e)&&!s&&C("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:n,formViewCreator:o,requiresForm:r})}_createToolbarComponent(e){const t=this.editor,i=e.t,o=this._prepareIntegrations();if(!o.length)return null;let n;const r=o[0];if(1==o.length){if(!r.requiresForm)return r.buttonViewCreator(!0);n=r.buttonViewCreator(!0)}else{const t=r.buttonViewCreator(!1);n=new Yg(e,t),n.tooltip=!0,n.bind("label").to(this,"isImageSelected",(e=>i(e?"Replace image":"Insert image")))}const s=this.dropdownView=tp(e,n),a=o.map((({observable:e})=>"function"==typeof e?e():e));return s.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),s.once("change:isOpen",(()=>{const e=o.flatMap((({formViewCreator:e})=>e(1==o.length))),i=new iT(t.locale,e);s.panelView.children.add(i)})),s}_createMenuBarComponent(e){const t=e.t,i=this._prepareIntegrations();if(!i.length)return null;const o=i.flatMap((({menuBarButtonViewCreator:e})=>e(1==i.length))),n=new Vb(e),r=new Nb(e);n.panelView.children.add(r),n.buttonView.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.66 9.118a.693.693 0 0 1 .956.032l3.65 3.411 2.422-2.238a.695.695 0 0 1 .945 0L17.5 13.6V2.5h-15v11.1l4.16-4.482ZM17.8 1c.652 0 1.2.47 1.2 1.1v14.362c0 .64-.532 1.038-1.184 1.038H2.184C1.532 17.5 1 17.103 1 16.462V2.1C1 1.47 1.537 1 2.2 1h15.6Zm-5.655 6a2.128 2.128 0 0 1 .157-2.364A2.133 2.133 0 1 1 12.145 7Z"/></svg>',label:t("Image")});for(const t of o){const i=new yf(e,n);i.children.add(t),r.items.add(i),t.delegate("execute").to(n)}return n}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return C("image-insert-integrations-not-specified"),t;for(const i of e)this._integrations.has(i)?t.push(this._integrations.get(i)):["upload","assetManager","url"].includes(i)||C("image-insert-unknown-integration",{item:i});return t.length||C("image-insert-integrations-not-registered"),t}}var nT=n(1468),rT={attributes:{"data-cke":!0}};rT.setAttributes=Wn(),rT.insert=Un().bind(null,"head"),rT.domAPI=Fn(),rT.insertStyleElement=qn(),Ln()(nT.A,rT),nT.A&&nT.A.locals&&nT.A.locals;class sT extends er{static get requires(){return[XC,w_,jC,oT]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class aT extends er{static get requires(){return[ZC,GC,OC,JC,ak]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new KC(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,o=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})=>o.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(HC(o,"imageInline","src")).add(HC(o,"imageInline","alt")).add(UC(o,"imageInline")),i.for("upcast").elementToElement({view:EC(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",((n,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(o.isBlockImageView))return;a=r.targetRanges?e.editing.mapper.toModelRange(r.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===SC(t.schema,l)){const e=new cu(i.document),t=s.map((t=>1===t.childCount?(Array.from(t.getAttributes()).forEach((i=>e.setAttribute(...i,o.findViewImgElement(t)))),t.getChild(0)):t));r.content=e.createDocumentFragment(t)}})),this.listenTo(n,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageInline")&&o.setImageNaturalSizeAttributes(e)}))}))}}class lT extends er{static get requires(){return[aT,w_,jC,oT]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class cT extends er{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[OC]}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 dT extends ir{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(XC))return this.isEnabled=!1,void(this.value=!1);const o=e.model.document.selection,n=o.getSelectedElement();if(!n){const e=t.getCaptionFromModelSelection(o);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=i.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,o=this.editor.plugins.get("ImageCaptionEditing"),n=this.editor.plugins.get("ImageUtils");let r=i.getSelectedElement();const s=o._getSavedCaption(r);n.isInlineImage(r)&&(this.editor.execute("imageTypeBlock"),r=i.getSelectedElement());const a=s||e.createElement("caption");e.append(a,r),t&&e.setSelection(a,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),n=t.plugins.get("ImageCaptionUtils");let r,s=i.getSelectedElement();s?r=n.getCaptionFromImageModelElement(s):(r=n.getCaptionFromModelSelection(i),s=r.parent),o._saveCaption(s,r),e.setSelection(s,"on"),e.remove(r)}}class uT extends er{static get requires(){return[OC,cT]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}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 dT(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils"),n=e.t;e.conversion.for("upcast").elementToElement({view:e=>o.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:o})=>{if(!i.isBlockImage(e.parent))return null;const r=o.createEditableElement("figcaption");o.setCustomProperty("imageCaption",!0,r),r.placeholder=n("Enter image caption"),Mr({view:t,element:r,keepOnFocus:!0});const s=e.parent.getAttribute("alt");return o_(r,o,{label:s?n("Caption for image: %0",[s]):n("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),o=e.commands.get("imageTypeInline"),n=e.commands.get("imageTypeBlock"),r=e=>{if(!e.return)return;const{oldElement:o,newElement:n}=e.return;if(!o)return;if(t.isBlockImage(o)){const e=i.getCaptionFromImageModelElement(o);if(e)return void this._saveCaption(n,e)}const r=this._getSavedCaption(o);r&&this._saveCaption(n,r)};o&&this.listenTo(o,"execute",r,{priority:"low"}),n&&this.listenTo(n,"execute",r,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?$l.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"),o=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",(()=>{const n=t.document.differ.getChanges();for(const t of n){if("alt"!==t.attributeKey)continue;const n=t.range.start.nodeAfter;if(i.isBlockImage(n)){const t=o.getCaptionFromImageModelElement(n);if(!t)return;e.editing.reconvertItem(t)}}}))}}class hT extends er{static get requires(){return[cT]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",(n=>{const r=e.commands.get("toggleImageCaption"),s=new Dh(n);return s.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z"/><path d="M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z" fill-opacity=".6"/></svg>',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.bind("label").to(r,"value",(e=>o(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(s,"execute",(()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const o=i.getCaptionFromModelSelection(e.model.document.selection);if(o){const i=e.editing.mapper.toViewElement(o);t.scrollToTheSelection(),t.change((e=>{e.addClass("image__caption_highlighted",i)}))}e.editing.view.focus()})),s}))}}var mT=n(5212),gT={attributes:{"data-cke":!0}};function pT(e){const t=e.map((e=>e.replace("+","\\+")));return new RegExp(`^image\\/(${t.join("|")})$`)}function fT(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}gT.setAttributes=Wn(),gT.insert=Un().bind(null,"head"),gT.domAPI=Fn(),gT.insertStyleElement=qn(),Ln()(mT.A,gT),mT.A&&mT.A.locals&&mT.A.locals;class bT extends er{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("uploadImage",(()=>this._createToolbarButton())),e.ui.componentFactory.add("imageUpload",(()=>this._createToolbarButton())),e.ui.componentFactory.add("menuBar:uploadImage",(()=>this._createMenuBarButton("standalone"))),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("uploadImage"),n=t.config.get("image.upload.types"),r=pT(n),s=new e(t.locale),a=i.t;return s.set({acceptedType:n.map((e=>`image/${e}`)).join(","),allowMultipleFiles:!0,label:a("Upload from computer"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M1.201 1C.538 1 0 1.47 0 2.1v14.363c0 .64.534 1.037 1.186 1.037h9.494a2.97 2.97 0 0 1-.414-.287 2.998 2.998 0 0 1-1.055-2.03 3.003 3.003 0 0 1 .693-2.185l.383-.455-.02.018-3.65-3.41a.695.695 0 0 0-.957-.034L1.5 13.6V2.5h15v5.535a2.97 2.97 0 0 1 1.412.932l.088.105V2.1c0-.63-.547-1.1-1.2-1.1H1.202Zm11.713 2.803a2.146 2.146 0 0 0-2.049 1.992 2.14 2.14 0 0 0 1.28 2.096 2.13 2.13 0 0 0 2.644-3.11 2.134 2.134 0 0 0-1.875-.978Z"/><path d="M15.522 19.1a.79.79 0 0 0 .79-.79v-5.373l2.059 2.455a.79.79 0 1 0 1.211-1.015l-3.352-3.995a.79.79 0 0 0-.995-.179.784.784 0 0 0-.299.221l-3.35 3.99a.79.79 0 1 0 1.21 1.017l1.936-2.306v5.185c0 .436.353.79.79.79Z"/><path d="M15.522 19.1a.79.79 0 0 0 .79-.79v-5.373l2.059 2.455a.79.79 0 1 0 1.211-1.015l-3.352-3.995a.79.79 0 0 0-.995-.179.784.784 0 0 0-.299.221l-3.35 3.99a.79.79 0 1 0 1.21 1.017l1.936-2.306v5.185c0 .436.353.79.79.79Z"/></svg>'}),s.bind("isEnabled").to(o),s.on("done",((e,i)=>{const o=Array.from(i).filter((e=>r.test(e.type)));o.length&&(t.execute("uploadImage",{file:o}),t.editing.view.focus())})),s}_createToolbarButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),o=this._createButton(Am);return o.tooltip=!0,o.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",((t,i)=>e(i?t?"Replace image from computer":"Upload image from computer":"You have no image upload permissions."))),o}_createDropdownButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(Am);return i.withText=!0,i.bind("label").to(t,"isImageSelected",(t=>e(t?"Replace from computer":"Upload from computer"))),i.on("execute",(()=>{t.dropdownView.isOpen=!1})),i}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createButton(Bb);switch(i.withText=!0,e){case"standalone":i.label=t("Image from computer");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("From computer")}return i}}class kT extends(Z()){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(((i,o)=>{t.onload=()=>{const e=t.result;this._data=e,i(e)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)}))}abort(){this._reader.abort()}}class _T extends er{constructor(){super(...arguments),this.loaders=new Jo,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[gh]}init(){this.loaders.on("change",(()=>this._updatePendingAction())),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 C("filerepository-no-upload-adapter"),null;const t=new wT(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 wT?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach(((e,i)=>{e===t&&this._loadersMap.delete(i)}))}_updatePendingAction(){const e=this.editor.plugins.get(gh);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,i=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}}class wT extends(Z()){constructor(e,t){super(),this.id=v(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new kT,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 A("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 A("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(((i,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then((e=>{t.isFulfilled=!0,i(e)})).catch((e=>{t.isFulfilled=!0,o(e)}))})),t}}var vT=n(8034),yT={attributes:{"data-cke":!0}};yT.setAttributes=Wn(),yT.insert=Un().bind(null,"head"),yT.domAPI=Fn(),yT.insertStyleElement=qn(),Ln()(vT.A,yT),vT.A&&vT.A.locals&&vT.A.locals;var xT=n(4484),AT={attributes:{"data-cke":!0}};AT.setAttributes=Wn(),AT.insert=Un().bind(null,"head"),AT.domAPI=Fn(),AT.insertStyleElement=qn(),Ln()(xT.A,AT),xT.A&&xT.A.locals&&xT.A.locals;var CT=n(6802),TT={attributes:{"data-cke":!0}};TT.setAttributes=Wn(),TT.insert=Un().bind(null,"head"),TT.domAPI=Fn(),TT.insertStyleElement=qn(),Ln()(CT.A,TT),CT.A&&CT.A.locals&&CT.A.locals;class ET extends er{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.uploadStatusChange=(e,t,i)=>{const o=this.editor,n=t.item,r=n.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const s=o.plugins.get("ImageUtils"),a=o.plugins.get(_T),l=r?t.attributeNewValue:null,c=this.placeholder,d=o.editing.mapper.toViewElement(n),u=i.writer;if("reading"==l)return ST(d,u),void PT(s,c,d,u);if("uploading"==l){const e=a.loaders.get(r);return ST(d,u),void(e?(IT(d,u),function(e,t,i,o){const n=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"),n),i.on("change:uploadedPercent",((e,t,i)=>{o.change((e=>{e.setStyle("width",i+"%",n)}))}))}(d,u,e,o.editing.view),function(e,t,i,o){if(o.data){const n=e.findViewImgElement(t);i.setAttribute("src",o.data,n)}}(s,d,u,e)):PT(s,c,d,u))}"complete"==l&&a.loaders.get(r)&&function(e,t,i){const o=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),o),setTimeout((()=>{i.change((e=>e.remove(e.createRangeOn(o))))}),3e3)}(d,u,o.editing.view),function(e,t){OT(e,t,"progressBar")}(d,u),IT(d,u),function(e,t){t.removeClass("ck-appear",e)}(d,u)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function ST(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function PT(e,t,i,o){i.hasClass("ck-image-upload-placeholder")||o.addClass("ck-image-upload-placeholder",i);const n=e.findViewImgElement(i);n.getAttribute("src")!==t&&o.setAttribute("src",t,n),MT(i,"placeholder")||o.insert(o.createPositionAfter(n),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(o))}function IT(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),OT(e,t,"placeholder")}function MT(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function OT(e,t,i){const o=MT(e,i);o&&t.remove(t.createRangeOn(o))}class VT extends ir{constructor(e){super(e),this.set("isAccessAllowed",!0)}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=No(e.file),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const r=i.getSelectedElement();if(t&&r&&o.isImage(r)){const t=this.editor.model.createPositionAfter(r);this._uploadImage(e,n,t)}else this._uploadImage(e,n)}))}_uploadImage(e,t,i){const o=this.editor,n=o.plugins.get(_T).createLoader(e),r=o.plugins.get("ImageUtils");n&&r.insertImage({...t,uploadId:n.id},i)}}class NT extends er{static get requires(){return[_T,$f,ak,OC]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this._uploadedImages=new Map,e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,i=e.model.document,o=e.conversion,n=e.plugins.get(_T),r=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),a=pT(e.config.get("image.upload.types")),l=new VT(e);e.commands.add("uploadImage",l),e.commands.add("imageUpload",l),o.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add((e=>e.on("element:img",((e,t,i)=>{if(!i.consumable.test(t.viewItem,{attributes:["data-ck-upload-id"]}))return;const o=t.viewItem.getAttribute("data-ck-upload-id");if(!o)return;const[r]=Array.from(t.modelRange.getItems({shallow:!0})),s=n.loaders.get(o);r&&(i.writer.setAttribute("uploadId",o,r),i.consumable.consume(t.viewItem,{attributes:["data-ck-upload-id"]}),s&&s.data&&i.writer.setAttribute("uploadStatus",s.status,r))}),{priority:"low"}))),this.listenTo(e.editing.view.document,"clipboardInput",((t,i)=>{if(o=i.dataTransfer,Array.from(o.types).includes("text/html")&&""!==o.getData("text/html"))return;var o;const n=Array.from(i.dataTransfer.files).filter((e=>!!e&&a.test(e.type)));if(n.length&&(t.stop(),e.model.change((t=>{i.targetRanges&&t.setSelection(i.targetRanges.map((t=>e.editing.mapper.toModelRange(t)))),e.execute("uploadImage",{file:n})})),!e.commands.get("uploadImage").isAccessAllowed)){const t=e.plugins.get("Notification"),i=e.locale.t;t.showWarning(i("You have no image upload permissions."),{namespace:"image"})}})),this.listenTo(s,"inputTransformation",((i,o)=>{const s=Array.from(e.editing.view.createRangeIn(o.content)).map((e=>e.item)).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))}(r,e)&&!e.getAttribute("uploadProcessed"))).map((e=>{return{promise:(i=e,new Promise(((e,o)=>{const n=i.getAttribute("src");fetch(n).then((e=>e.blob())).then((t=>{const i=fT(t,n),o=i.replace("image/",""),r=new File([t],`image.${o}`,{type:i});e(r)})).catch((i=>i&&"TypeError"===i.name?function(e){return function(e){return new Promise(((i,o)=>{const n=t.document.createElement("img");n.addEventListener("load",(()=>{const e=t.document.createElement("canvas");e.width=n.width,e.height=n.height,e.getContext("2d").drawImage(n,0,0),e.toBlob((e=>e?i(e):o()))})),n.addEventListener("error",(()=>o())),n.src=e}))}(e).then((t=>{const i=fT(t,e),o=i.replace("image/","");return new File([t],`image.${o}`,{type:i})}))}(n).then(e).catch(o):o(i)))}))),imageElement:e};var i}));if(!s.length)return;const a=new cu(e.editing.view.document);for(const e of s){a.setAttribute("uploadProcessed",!0,e.imageElement);const t=n.createLoader(e.promise);t&&(a.setAttribute("src","",e.imageElement),a.setAttribute("uploadId",t.id,e.imageElement))}})),e.editing.view.document.on("dragover",((e,t)=>{t.preventDefault()})),i.on("change",(()=>{const t=i.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),o=new Set;for(const i of t)if("insert"==i.type&&"$text"!=i.name){const t=i.position.nodeAfter,r="$graveyard"==i.position.root.rootName;for(const i of RT(e,t)){const t=i.getAttribute("uploadId");if(!t)continue;const s=n.loaders.get(t);s?r?o.has(t)||Array.from(this._uploadImageElements.get(t)).every((e=>"$graveyard"==e.root.rootName))&&s.abort():(o.add(t),this._uploadImageElements.has(t)?this._uploadImageElements.get(t).add(i):this._uploadImageElements.set(t,new Set([i])),"idle"==s.status&&this._readAndUpload(s)):!r&&this._uploadedImages.has(t)&&e.model.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","complete",i),this.fire("uploadComplete",{data:this._uploadedImages.get(t),imageElement:i})}))}}})),this.on("uploadComplete",((e,{imageElement:t,data:i})=>{const o=i.urls?i.urls:i;this.editor.model.change((e=>{e.setAttribute("src",o.default,t),this._parseAndSetSrcsetAttributeOnImage(o,t,e),r.setImageNaturalSizeAttributes(t)}))}),{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){const t=this.editor,i=t.model,o=t.locale.t,n=t.plugins.get(_T),r=t.plugins.get($f),a=t.plugins.get("ImageUtils"),l=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},(t=>{const i=l.get(e.id);for(const e of i)t.setAttribute("uploadStatus","reading",e)})),e.read().then((()=>{const n=e.upload();t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Uploading image"));for(const o of l.get(e.id)){if(s.isSafari){const e=t.editing.mapper.toViewElement(o),i=a.findViewImgElement(e);t.editing.view.once("render",(()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const o=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=o}))}i.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","uploading",o)}))}return n})).then((n=>{i.enqueueChange({isUndoable:!1},(i=>{for(const t of l.get(e.id))i.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:n,imageElement:t});t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Image upload complete")),this._uploadedImages.set(e.id,n)})),c()})).catch((n=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Error during image upload")),"error"!==e.status&&"aborted"!==e.status)throw n;"error"==e.status&&n&&r.showWarning(n,{title:o("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},(t=>{for(const i of l.get(e.id))"$graveyard"!==i.root.rootName&&t.remove(i)})),c()}));function c(){i.enqueueChange({isUndoable:!1},(t=>{for(const i of l.get(e.id))t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i);l.delete(e.id)})),n.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let o=0;const n=Object.keys(e).filter((e=>{const t=parseInt(e,10);if(!isNaN(t))return o=Math.max(o,t),!0})).map((t=>`${e[t]} ${t}w`)).join(", ");if(""!=n){const e={srcset:n};t.hasAttribute("width")||t.hasAttribute("height")||(e.width=o),i.setAttributes(e,t)}}_registerConverters(e){const{conversion:t,plugins:i}=this.editor,o=i.get(_T),n=i.get(OC);t.for("dataDowncast").add((t=>{t.on(`attribute:uploadId:${e}`,((e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const r=o.loaders.get(t.attributeNewValue);if(!r||!r.data)return null;const s=i.mapper.toViewElement(t.item),a=n.findViewImgElement(s);a&&(i.consumable.consume(t.item,e.name),i.writer.setAttribute("data-ck-upload-id",r.id,a))}))}))}}function RT(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 BT extends er{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[NT,bT,ET]}}class DT extends Kn{constructor(e){super(e),this.set("imageURLInputValue",""),this.set("isImageSelected",!1),this.set("isEnabled",!0),this.keystrokes=new rn,this.urlInputView=this._createUrlInputView(),this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-url"],tabindex:"-1"},children:[this.urlInputView,{tag:"div",attributes:{class:["ck","ck-image-insert-url__action-row"]}}]})}render(){super.render(),Jn({view:this}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}_createUrlInputView(){const e=this.locale,t=e.t,i=new Gm(e,cp);return i.bind("label").to(this,"isImageSelected",(e=>t(e?"Update image URL":"Insert image via URL"))),i.bind("isEnabled").to(this),i.fieldView.inputMode="url",i.fieldView.placeholder="https://example.com/image.png",i.fieldView.bind("value").to(this,"imageURLInputValue",(e=>e||"")),i.fieldView.on("input",(()=>{this.imageURLInputValue=i.fieldView.element.value.trim()})),i}focus(){this.urlInputView.focus()}}class LT extends er{static get pluginName(){return"ImageInsertViaUrlUI"}static get isOfficialPlugin(){return!0}static get requires(){return[oT,om]}init(){this.editor.ui.componentFactory.add("insertImageViaUrl",(()=>this._createToolbarButton())),this.editor.ui.componentFactory.add("menuBar:insertImageViaUrl",(()=>this._createMenuBarButton("standalone")))}afterInit(){this._imageInsertUI=this.editor.plugins.get("ImageInsertUI"),this._imageInsertUI.registerIntegration({name:"url",observable:()=>this.editor.commands.get("insertImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createInsertUrlButton(e){const t=new e(this.editor.locale);return t.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M1.201 1C.538 1 0 1.47 0 2.1v14.363c0 .64.534 1.037 1.186 1.037h7.029a5.401 5.401 0 0 1 .615-4.338l.762-1.232-2.975-2.78a.696.696 0 0 0-.957-.033L1.5 13.6V2.5h15v6.023c.449.131.887.32 1.307.573l.058.033c.046.028.09.057.135.086V2.1c0-.63-.547-1.1-1.2-1.1H1.202Zm11.713 2.803a2.15 2.15 0 0 0-1.611.834 2.118 2.118 0 0 0-.438 1.158 2.14 2.14 0 0 0 1.277 2.096 2.132 2.132 0 0 0 2.645-3.11 2.13 2.13 0 0 0-1.873-.978Z"/><path d="M16.63 10.294a3.003 3.003 0 0 0-4.142.887l-.117.177a.647.647 0 0 0-.096.492.664.664 0 0 0 .278.418.7.7 0 0 0 .944-.234 1.741 1.741 0 0 1 2.478-.463 1.869 1.869 0 0 1 .476 2.55.637.637 0 0 0-.071.5.646.646 0 0 0 .309.396.627.627 0 0 0 .869-.19l.027-.041a3.226 3.226 0 0 0-.956-4.492Zm-6.061 3.78-.044.066a3.228 3.228 0 0 0 .82 4.403 3.005 3.005 0 0 0 4.275-.798l.13-.197a.626.626 0 0 0 .092-.475.638.638 0 0 0-.268-.402.713.713 0 0 0-.99.26l-.018.029a1.741 1.741 0 0 1-2.477.461 1.87 1.87 0 0 1-.475-2.55l.029-.047a.647.647 0 0 0 .086-.485.66.66 0 0 0-.275-.408l-.04-.027a.609.609 0 0 0-.845.17Z"/><path d="M15.312 13.925c.24-.36.154-.838-.19-1.067-.346-.23-.82-.124-1.059.236l-1.268 1.907c-.239.36-.153.838.192 1.067.345.23.818.123 1.057-.236l1.268-1.907Z"/></svg>',t.on("execute",(()=>{this._showModal()})),t}_createToolbarButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(Dh);return t.tooltip=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",(t=>e(t?"Update image URL":"Insert image via URL"))),t}_createDropdownButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(Dh);return t.withText=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",(t=>e(t?"Update image URL":"Insert via URL"))),t}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createInsertUrlButton(dm);switch(i.withText=!0,e){case"standalone":i.label=t("Image via URL");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("Via URL")}return i}_createInsertUrlView(){const e=this.editor,t=e.locale,i=e.commands.get("replaceImageSource"),o=e.commands.get("insertImage"),n=new DT(t);return n.bind("isImageSelected").to(this._imageInsertUI),n.bind("isEnabled").toMany([o,i],"isEnabled",((...e)=>e.some((e=>e)))),n}_showModal(){const e=this.editor,t=e.locale.t,i=e.plugins.get("Dialog");this._formView||(this._formView=this._createInsertUrlView(),this._formView.on("submit",(()=>this._handleSave())));const o=e.commands.get("replaceImageSource");this._formView.imageURLInputValue=o.value||"",i.show({id:"insertImageViaUrl",title:this._imageInsertUI.isImageSelected?t("Update image URL"):t("Insert image via URL"),isModal:!0,content:this._formView,actionButtons:[{label:t("Cancel"),withText:!0,onExecute:()=>i.hide()},{label:t("Accept"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSave()}]})}_handleSave(){this.editor.commands.get("replaceImageSource").isEnabled?this.editor.execute("replaceImageSource",{source:this._formView.imageURLInputValue}):this.editor.execute("insertImage",{source:this._formView.imageURLInputValue}),this.editor.plugins.get("Dialog").hide()}}class zT extends er{static get pluginName(){return"ImageInsertViaUrl"}static get isOfficialPlugin(){return!0}static get requires(){return[LT,oT]}}const FT=(jT=Jb,function(e,t){if(null==e)return e;if(!Ot(e))return jT(e,t);for(var i=e.length,o=-1,n=Object(e);++o<i&&!1!==t(n[o],o,n););return e});var jT;const UT=function(e,t){var i=-1,o=Ot(e)?Array(e.length):[];return FT(e,(function(e,n,r){o[++i]=t(e,n,r)})),o},HT=function(e,t){return(ge(e)?br:UT)(e,rk(t))};class WT extends ir{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("resizedWidth")?this.value={width:t.getAttribute("resizedWidth"),height:null}:this.value=null}execute(e){const t=this.editor,i=t.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},n&&i.change((t=>{t.setAttribute("resizedWidth",e.width,n),t.removeAttribute("resizedHeight",n),o.setImageNaturalSizeAttributes(n)}))}}class $T extends er{static get requires(){return[OC]}static get pluginName(){return"ImageResizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{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 WT(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add((t=>t.on(`attribute:resizedWidth:${e}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(o.setStyle("width",t.attributeNewValue,n),o.addClass("image_resized",n)):(o.removeStyle("width",n),o.removeClass("image_resized",n))})))),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:e=>({key:"style",value:{height:e}})}),t.conversion.for("editingDowncast").add((t=>t.on(`attribute:resizedHeight:${e}`,((t,o,n)=>{if(!n.consumable.consume(o.item,t.name))return;const r=n.writer,s=n.mapper.toViewElement(o.item),a="imageInline"===e?i.findViewImgElement(s):s;null!==o.attributeNewValue?r.setStyle("height",o.attributeNewValue,a):r.removeStyle("height",a)})))),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:e=>IC(e)?null:e.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:e=>IC(e)?null:e.getStyle("height")}})}}const qT=(()=>({small:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 16.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1ZM1 15v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 13v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 11v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 9v1H0V9h1Zm19 0v1h-1V9h1ZM1 7v1H0V7h1Zm19 0v1h-1V7h1ZM1 5v1H0V5h1Zm19 0v1h-1V5h1Zm0-2v1h-1V3h1ZM1 3v1H0V3h1Zm13.5-1.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm-8 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm8 0v1h-1v-1h1Zm-10 0v1h-1v-1h1Z"/><path d="M7 9.5H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2ZM7 11a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4A.5.5 0 0 1 2 11h5Z"/></svg>',medium:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 16.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1ZM1 15v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 13v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 11v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 9v1H0V9h1Zm19 0v1h-1V9h1ZM1 7v1H0V7h1Zm19 0v1h-1V7h1ZM1 5v1H0V5h1Zm19 0v1h-1V5h1Zm0-2v1h-1V3h1ZM1 3v1H0V3h1Zm13.5-1.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm-8 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm8 0v1h-1v-1h1Zm-10 0v1h-1v-1h1Z"/><path d="M10 7.5H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2ZM10 9a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6A.5.5 0 0 1 2 9h8Z"/></svg>',large:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 16.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1ZM1 15v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 13v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 11v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 9v1H0V9h1Zm19 0v1h-1V9h1ZM1 7v1H0V7h1Zm19 0v1h-1V7h1ZM1 5v1H0V5h1Zm19 0v1h-1V5h1Zm0-2v1h-1V3h1ZM1 3v1H0V3h1Zm13.5-1.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm-8 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm8 0v1h-1v-1h1Zm-10 0v1h-1v-1h1Z"/><path d="M13 5.5H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2ZM13 7a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-8A.5.5 0 0 1 2 7h11Z"/></svg>',custom:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:v="https://vecta.io/nano" viewBox="0 0 20 20"><path d="M.95 1.43a.95.95 0 0 0-.95.95v3.1a.95.95 0 0 0 .95.95h.75v6.3H.95a.95.95 0 0 0-.95.95v3.1a.95.95 0 0 0 .95.95h3.1a.95.95 0 0 0 .95-.95v-.65h1.932l1.539-1.5H5v-.95a.95.95 0 0 0-.95-.95H3.2v-6.3h.85A.95.95 0 0 0 5 5.48v-.55h10v.55a.95.95 0 0 0 .95.95h3.1a.95.95 0 0 0 .95-.95v-3.1a.95.95 0 0 0-.95-.95h-3.1a.95.95 0 0 0-.95.95v1.05H5V2.38a.95.95 0 0 0-.95-.95H.95zm.55 3.5v-2h2v2h-2zm0 9.3v2h2v-2h-2zm15-11.3v2h2v-2h-2z"/><path d="M8.139 20.004v-2.388l7.045-7.048 2.391 2.391-7.046 7.046h-2.39zm11.421-9.101a.64.64 0 0 1-.138.206l-1.165 1.168-2.391-2.391 1.167-1.163a.63.63 0 0 1 .206-.138.635.635 0 0 1 .243-.049.63.63 0 0 1 .449.187l1.491 1.488c.059.059.108.129.138.206s.049.16.049.243a.6.6 0 0 1-.049.243z"/></svg>',original:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z"/></svg>'}))();class ZT extends er{static get requires(){return[$T]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}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:o,icon:n}=e;t.ui.componentFactory.add(i,(i=>{const r=new Dh(i),s=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!qT[n])throw new A("imageresizebuttons-missing-icon",t,e);if(r.set({label:a,icon:qT[n],tooltip:a,isToggleable:!0}),r.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&GT(e)){const e=t.plugins.get("ImageCustomResizeUI");this.listenTo(r,"execute",(()=>{e._showForm(this._resizeUnit)}))}else{const e=o?o+this._resizeUnit:null;r.bind("isOn").to(s,"value",KT(e)),this.listenTo(r,"execute",(()=>{t.execute("resizeImage",{width:e})}))}return r}))}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,o=e.find((e=>!e.value)),n=n=>{const r=t.commands.get("resizeImage"),s=tp(n,lg),a=s.buttonView,l=i("Resize image");return a.set({tooltip:l,commandValue:o.value,icon:qT.medium,isToggleable:!0,label:this._getOptionLabelValue(o),withText:!0,class:"ck-resize-image-button",ariaLabel:l,ariaLabelledBy:void 0}),a.bind("label").to(r,"value",(e=>e&&e.width?e.width:this._getOptionLabelValue(o))),s.bind("isEnabled").to(this),np(s,(()=>this._getResizeDropdownListItemDefinitions(e,r)),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(s,"execute",(e=>{"onClick"in e.source?e.source.onClick():(t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus())})),s};t.ui.componentFactory.add("resizeImage",n),t.ui.componentFactory.add("imageResize",n)}_getOptionLabelValue(e,t=!1){const i=this.editor.t;return e.label?e.label:t?GT(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):GT(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const{editor:i}=this,o=new Jo,n=e.map((e=>GT(e)?{...e,valueWithUnits:"custom"}:e.value?{...e,valueWithUnits:`${e.value}${this._resizeUnit}`}:{...e,valueWithUnits:null}));for(const e of n){let r=null;if(i.plugins.has("ImageCustomResizeUI")&&GT(e)){const o=i.plugins.get("ImageCustomResizeUI");r={type:"button",model:new qf({label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{o._showForm(this._resizeUnit)}})};const s=HT(n,"valueWithUnits");r.model.bind("isOn").to(t,"value",YT(s))}else r={type:"button",model:new qf({commandName:"resizeImage",commandValue:e.valueWithUnits,label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null})},r.model.bind("isOn").to(t,"value",KT(e.valueWithUnits));r.model.bind("isEnabled").to(t,"isEnabled"),o.add(r)}return o}}function GT(e){return"custom"===e.value}function KT(e){return t=>null===e&&t===e||null!==t&&t.width===e}function YT(e){return t=>!e.some((e=>KT(e)(t)))}const QT="image_resized";class JT extends er{static get requires(){return[P_,OC]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(WC),this.listenTo(t.document,"imageLoaded",((o,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 r=e.editing.view.domConverter,s=r.domToView(n.target),a=i.getImageWidgetFromImageView(s);let l=this.editor.plugins.get(P_).getResizerByViewElement(a);if(l)return void l.redraw();const c=e.editing.mapper,d=c.toModelElement(a);l=e.plugins.get(P_).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:d,viewElement:a,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>r.mapViewToDom(c.toViewElement(d)),isCentered:()=>"alignCenter"==d.getAttribute("imageStyle"),onCommit(i){t.change((e=>{e.removeClass(QT,a)})),e.execute("resizeImage",{width:i})}}),l.on("updateSize",(()=>{a.hasClass(QT)||t.change((e=>{e.addClass(QT,a)}));const e="imageInline"===d.name?s:a;e.getStyle("height")&&t.change((t=>{t.removeStyle("height",e)}))})),l.bind("isEnabled").to(this)}))}}function XT(e){if(!e)return null;const[,t,i]=e.trim().match(/([.,\d]+)(%|px)$/)||[],o=Number.parseFloat(t);return Number.isNaN(o)?null:{value:o,unit:i}}function eE(e,t,i){return"px"===i?{value:t.value,unit:"px"}:{value:t.value/e*100,unit:"%"}}function tE(e){const{editing:t}=e,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);if(!i)return null;const o=t.mapper.toViewElement(i);return{model:i,view:o,dom:t.view.domConverter.mapViewToDom(o)}}var iE=n(3111),oE={attributes:{"data-cke":!0}};oE.setAttributes=Wn(),oE.insert=Un().bind(null,"head"),oE.domAPI=Fn(),oE.insertStyleElement=qn(),Ln()(iE.A,oE),iE.A&&iE.A.locals&&iE.A.locals;class nE extends Kn{constructor(e,t,i){super(e);const o=this.locale.t;this.focusTracker=new en,this.keystrokes=new rn,this.unit=t,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(o("Save"),bh,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(o("Cancel"),fh,"ck-button-cancel","cancel"),this._focusables=new pn,this._validators=i,this._focusCycler=new Uh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),Jn({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,o){const n=new Dh(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createLabeledInputView(){const e=this.locale.t,t=new Gm(this.locale,dp);return t.label=e("Resize image (in %0)",this.unit),t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(null===e)return null;const t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){const{parsedSize:e,unit:t}=this;return null===e?null:`${e}${t}`}}class rE extends er{static get requires(){return[Jf]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Qn(nE))(t.locale,e,function(e){const t=e.t;return[e=>""===e.rawSize.trim()?t("The value must not be empty."):null===e.parsedSize?t("The value should be a plain number."):void 0]}(t)),this._form.render(),this.listenTo(this._form,"submit",(()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))})),this.listenTo(this._form.labeledInput,"change:errorText",(()=>{t.ui.update()})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),Yn({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:zC(t)});const o=function(e,t){const i=tE(e);if(!i)return null;const o=XT(i.model.getAttribute("resizedWidth")||null);return o?o.unit===t?o:eE(s_(i.dom),{unit:"px",value:new Qi(i.dom).width},t):null}(t,e),n=o?o.value.toFixed(1):"",r=function(e,t){const i=tE(e);if(!i)return null;const o=s_(i.dom),n=XT(window.getComputedStyle(i.dom).minWidth)||{value:1,unit:"px"};return{unit:t,lower:Math.max(.1,eE(o,n,t).value),upper:"px"===t?o:100}}(t,e);i.fieldView.value=i.fieldView.element.value=n,r&&Object.assign(i.fieldView,{min:r.lower.toFixed(1),max:Math.ceil(r.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){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)}}var sE=n(1240),aE={attributes:{"data-cke":!0}};aE.setAttributes=Wn(),aE.insert=Un().bind(null,"head"),aE.domAPI=Fn(),aE.insertStyleElement=qn(),Ln()(sE.A,aE),sE.A&&sE.A.locals&&sE.A.locals;class lE extends ir{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,o=t.plugins.get("ImageUtils");i.change((t=>{const n=e.value,{setImageSizes:r=!0}=e;let s=o.getClosestSelectedImageElement(i.document.selection);n&&this.shouldConvertImageType(n,s)&&(this.editor.execute(o.isBlockImage(s)?"imageTypeInline":"imageTypeBlock",{setImageSizes:r}),s=o.getClosestSelectedImageElement(i.document.selection)),!n||this._styles.get(n).isDefault?t.removeAttribute("imageStyle",s):t.setAttribute("imageStyle",n,s),r&&o.setImageNaturalSizeAttributes(s)}))}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const cE={get inline(){return{name:"inline",title:"In line",icon:yh,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:_h,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:xh,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:wh,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:vh,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Ah,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:wh,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:vh,modelElements:["imageBlock"],className:"image-style-side"}}},dE=(()=>({full:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1zm-1.505.5H3.504V12h12.991V7.5z"/></svg>',left:xh,right:Ah,center:wh,inlineLeft:_h,inlineRight:vh,inline:yh}))(),uE=[{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 hE(e){C("image-style-configuration-definition-invalid",e)}const mE={normalizeStyles:function(e){return(e.configuredStyles.options||[]).map((e=>{return"string"==typeof(t="string"==typeof(t=e)?cE[t]?{...cE[t]}:{name:t}:function(e,t){const i={...t};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);return i}(cE[t.name],t)).icon&&(t.icon=dE[t.icon]||t.icon),t;var t})).filter((t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:o,name:n}=e;if(!(o&&o.length&&n))return hE({style:e}),!1;{const n=[t?"imageBlock":null,i?"imageInline":null];if(!o.some((e=>n.includes(e))))return C("image-style-missing-dependency",{style:e,missingPlugins:o.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")?[...uE]:[]},warnInvalidStyle:hE,DEFAULT_OPTIONS:cE,DEFAULT_ICONS:dE,DEFAULT_DROPDOWN_DEFINITIONS:uE};function gE(e,t){for(const i of t)if(i.name===e)return i}class pE extends er{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[OC]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=mE,i=this.editor,o=i.plugins.has("ImageBlockEditing"),n=i.plugins.has("ImageInlineEditing");i.config.define("image.styles",t(o,n)),this.normalizedStyles=e({configuredStyles:i.config.get("image.styles"),isBlockPluginLoaded:o,isInlinePluginLoaded:n}),this._setupConversion(o,n),this._setupPostFixer(),i.commands.add("imageStyle",new lE(i,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,o=i.model.schema,n=(r=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=gE(t.attributeNewValue,r),n=gE(t.attributeOldValue,r),s=i.mapper.toViewElement(t.item),a=i.writer;n&&a.removeClass(n.className,s),o&&a.addClass(o.className,s)});var r;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,o)=>{if(!i.modelRange)return;const n=i.viewItem,r=Xo(i.modelRange.getItems());if(r&&o.schema.checkAttribute(r,"imageStyle"))for(const e of t[r.name])o.consumable.consume(n,{classes:e.className})&&o.writer.setAttribute("imageStyle",e.name,r)}}(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",n),i.data.downcastDispatcher.on("attribute:imageStyle",n),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(o.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(OC),o=new Map(this.normalizedStyles.map((e=>[e.name,e])));t.registerPostFixer((e=>{let n=!1;for(const r of t.differ.getChanges())if("insert"==r.type||"attribute"==r.type&&"imageStyle"==r.attributeKey){let t="insert"==r.type?r.position.nodeAfter:r.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 a=o.get(s);a&&a.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),n=!0)}return n}))}}var fE=n(3885),bE={attributes:{"data-cke":!0}};bE.setAttributes=Wn(),bE.insert=Un().bind(null,"head"),bE.domAPI=Fn(),bE.insertStyleElement=qn(),Ln()(fE.A,bE),fE.A&&fE.A.locals&&fE.A.locals;class kE extends er{static get requires(){return[pE]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}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=_E(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of i)this._createButton(e);const o=_E([...t.filter(F),...mE.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const e of o)this._createDropdown(e,i)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,(o=>{let n;const{defaultItem:r,items:s,title:a}=e,l=s.filter((e=>t.find((({name:t})=>wE(t)===e)))).map((e=>{const t=i.create(e);return e===r&&(n=t),t}));s.length!==l.length&&mE.warnInvalidStyle({dropdown:e});const c=tp(o,Yg),d=c.buttonView,u=d.arrowView;return ip(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),d.set({label:vE(a,n.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:a}),d.bind("icon").toMany(l,"isOn",((...e)=>{const t=e.findIndex(Fo);return t<0?n.icon:l[t].icon})),d.bind("label").toMany(l,"isOn",((...e)=>{const t=e.findIndex(Fo);return vE(a,t<0?n.label:l[t].label)})),d.bind("isOn").toMany(l,"isOn",((...e)=>e.some(Fo))),d.bind("class").toMany(l,"isOn",((...e)=>e.some(Fo)?"ck-splitbutton_flatten":void 0)),d.on("execute",(()=>{l.some((({isOn:e})=>e))?c.isOpen=!c.isOpen:n.fire("execute")})),c.bind("isEnabled").toMany(l,"isEnabled",((...e)=>e.some(Fo))),this.listenTo(c,"execute",(()=>{this.editor.editing.view.focus()})),c}))}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(wE(t),(i=>{const o=this.editor.commands.get("imageStyle"),n=new Dh(i);return n.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>e===t)),n.on("execute",this._executeCommand.bind(this,t)),n}))}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function _E(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function wE(e){return`imageStyle:${e}`}function vE(e,t){return(e?e+": ":"")+t}function yE(e,t){const i=(i,o,n)=>{if(!n.consumable.consume(o.item,i.name))return;const r=o.attributeNewValue,s=n.writer,a=n.mapper.toViewElement(o.item),l=[...a.getChildren()].find((e=>e.getCustomProperty("media-content")));s.remove(l);const c=e.getMediaViewElement(s,r,t);s.insert(s.createPositionAt(a,0),c)};return e=>{e.on("attribute:url:media",i)}}function xE(e,t,i,o){return e.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(e,i,o),e.createSlot()])}function AE(e){const t=e.getSelectedElement();return t&&t.is("element","media")?t:null}function CE(e,t,i,o){e.change((n=>{const r=n.createElement("media",{url:t});e.insertObject(r,i,null,{setSelection:"on",findOptimalPosition:o?"auto":void 0})}))}class TE extends ir{refresh(){const e=this.editor.model,t=e.document.selection,i=AE(t);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=function(e){const t=e.getSelectedElement();return!!t&&"media"===t.name}(t)||function(e,t){let i=n_(e,t).start.parent;return i.isEmpty&&!t.schema.isLimit(i)&&(i=i.parent),t.schema.checkChild(i,"media")}(t,e)}execute(e){const t=this.editor.model,i=t.document.selection,o=AE(i);o?t.change((t=>{t.setAttribute("url",e,o)})):CE(t,e,i,!0)}}class EE{constructor(e,t){const i=t.providers,o=t.extraProviders||[],n=new Set(t.removeProviders),r=i.concat(o).filter((e=>{const t=e.name;return t?!n.has(t):(C("media-embed-no-provider-name",{provider:e}),!1)}));this.locale=e,this.providerDefinitions=r}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e)return new SE(this.locale);e=e.trim();for(const t of this.providerDefinitions){const i=t.html,o=No(t.url);for(const t of o){const o=this._getUrlMatches(e,t);if(o)return new SE(this.locale,e,o,i)}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i)return i;let o=e.replace(/^https?:\/\//,"");return i=o.match(t),i||(o=o.replace(/^www\./,""),i=o.match(t),i||null)}}class SE{constructor(e,t,i,o){this.url=this._getValidUrl(t),this._locale=e,this._match=i,this._previewRenderer=o}getViewElement(e,t){const i={};let o;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),t.renderForEditingView&&(i.class="ck-media__wrapper");const n=this._getPreviewHtml(t);o=e.createRawElement("div",i,((e,t)=>{t.setContentOf(e,n)}))}else this.url&&(i.url=this.url),o=e.createEmptyElement(t.elementName,i);return e.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new Vh,t=this._locale.t;return e.content='<svg viewBox="0 0 64 42" xmlns="http://www.w3.org/2000/svg"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z"/></svg>',e.viewBox="0 0 64 42",new fn({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}var PE=n(4861),IE={attributes:{"data-cke":!0}};IE.setAttributes=Wn(),IE.insert=Un().bind(null,"head"),IE.domAPI=Fn(),IE.insertStyleElement=qn(),Ln()(PE.A,IE),PE.A&&PE.A.locals&&PE.A.locals;class ME extends er{static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const t=e[1],i=e[2];return`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${t}${i?`?start=${i}`:""}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.com/]},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new EE(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion,n=e.config.get("mediaEmbed.previewsInData"),r=e.config.get("mediaEmbed.elementName"),s=this.registry;e.commands.add("mediaEmbed",new TE(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),o.for("dataDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const i=e.getAttribute("url");return xE(t,s,i,{elementName:r,renderMediaPreview:!!i&&n})}}),o.for("dataDowncast").add(yE(s,{elementName:r,renderMediaPreview:n})),o.for("editingDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const o=e.getAttribute("url");return function(e,t,i){return t.setCustomProperty("media",!0,e),Xk(e,t,{label:i})}(xE(t,s,o,{elementName:r,renderForEditingView:!0}),t,i("media widget"))}}),o.for("editingDowncast").add(yE(s,{elementName:r,renderForEditingView:!0})),o.for("upcast").elementToElement({view:e=>["oembed",r].includes(e.name)&&e.getAttribute("url")?{name:!0}:null,model:(e,{writer:t})=>{const i=e.getAttribute("url");return s.hasMedia(i)?t.createElement("media",{url:i}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(e,{writer:t})=>{const i=e.getAttribute("data-oembed-url");return s.hasMedia(i)?t.createElement("media",{url:i}):null}}).add((e=>{e.on("element:figure",((e,t,i)=>{if(!i.consumable.consume(t.viewItem,{name:!0,classes:"media"}))return;const{modelRange:o,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=o,t.modelCursor=n,Xo(o.getItems())||i.consumable.revert(t.viewItem,{name:!0,classes:"media"})}))}))}}const OE=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class VE extends er{static get requires(){return[q_,Ak,sw]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,i=e.model.document,o=e.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",(()=>{const e=i.selection.getFirstRange(),t=vd.fromPosition(e.start);t.stickiness="toPrevious";const o=vd.fromPosition(e.end);o.stickiness="toNext",i.once("change:data",(()=>{this._embedMediaBetweenPositions(t,o),t.detach(),o.detach()}),{priority:"high"})})),e.commands.get("undo").on("execute",(()=>{this._timeoutId&&(t.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedMediaBetweenPositions(e,i){const o=this.editor,n=o.plugins.get(ME).registry,r=new Bl(e,i),s=r.getWalker({ignoreElementEnd:!0});let a="";for(const e of s)e.item.is("$textProxy")&&(a+=e.item.data);a=a.trim(),a.match(OE)&&n.hasMedia(a)&&o.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=vd.fromPosition(e),this._timeoutId=t.window.setTimeout((()=>{o.model.change((e=>{this._timeoutId=null,e.remove(r),r.detach();let t=null;"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert),CE(o.model,a,t,!1),this._positionToInsert.detach(),this._positionToInsert=null})),o.plugins.get(Ak).requestUndoOnBackspace()}),100)):r.detach()}}var NE=n(986),RE={attributes:{"data-cke":!0}};RE.setAttributes=Wn(),RE.insert=Un().bind(null,"head"),RE.domAPI=Fn(),RE.insertStyleElement=qn(),Ln()(NE.A,RE),NE.A&&NE.A.locals&&NE.A.locals;class BE extends Kn{constructor(e,t){super(t),this.focusTracker=new en,this.keystrokes=new rn,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),Jn({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Gm(this.locale,cp),i=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,i.inputMode="url",i.on("input",(()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()})),t}}class DE extends er{static get requires(){return[ME,om]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",(()=>{const e=this.editor.locale.t,t=this._createDialogButton(Dh);return t.tooltip=!0,t.label=e("Insert media"),t})),e.ui.componentFactory.add("menuBar:mediaEmbed",(()=>{const e=this.editor.locale.t,t=this._createDialogButton(dm);return t.label=e("Media"),t}))}_createDialogButton(e){const t=this.editor,i=new e(t.locale),o=t.commands.get("mediaEmbed"),n=this.editor.plugins.get("Dialog");return i.icon='<svg viewBox="0 0 22 20" xmlns="http://www.w3.org/2000/svg"><path d="M1.587 1.5c-.612 0-.601-.029-.601.551v14.84c0 .59-.01.559.591.559h18.846c.602 0 .591.03.591-.56V2.052c0-.58.01-.55-.591-.55H1.587Zm.701.971h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-14.24 1h13.008v12H4.467l.029-12Zm-2.208 1h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h1.003l-.029 1h-.974v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h.974v1h-.974v-1Zm16.448 0h1.003v1h-1.003v-1Z"/><path d="M8.374 6.648a.399.399 0 0 1 .395-.4.402.402 0 0 1 .2.049l5.148 2.824a.4.4 0 0 1 0 .7l-5.148 2.824a.403.403 0 0 1-.595-.35V6.648Z"/></svg>',i.bind("isEnabled").to(o,"isEnabled"),i.on("execute",(()=>{"mediaEmbed"===n.id?n.hide():this._showDialog()})),i}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.commands.get("mediaEmbed"),o=e.locale.t;if(!this._formView){const t=e.plugins.get(ME).registry;this._formView=new(Qn(BE))(function(e,t){return[t=>{if(!t.url.length)return e("The URL must not be empty.")},i=>{if(!t.hasMedia(i.url))return e("This media URL is not supported.")}]}(e.t,t),e.locale),this._formView.on("submit",(()=>this._handleSubmitForm()))}t.show({id:"mediaEmbed",title:o("Insert media"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=i.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:o("Cancel"),withText:!0,onExecute:()=>t.hide()},{label:o("Accept"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,t=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),t.hide(),e.editing.view.focus())}}var LE=n(7693),zE={attributes:{"data-cke":!0}};function FE(e){if(e.is("$text")||e.is("$textProxy"))return e.data;const t=e;let i="",o=null;for(const e of t.getChildren()){const t=FE(e);o&&o.is("element")&&(i+="\n"),i+=t,o=e}return i}zE.setAttributes=Wn(),zE.insert=Un().bind(null,"head"),zE.domAPI=Fn(),zE.insertStyleElement=qn(),Ln()(LE.A,zE),LE.A&&LE.A.locals&&LE.A.locals;const jE={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let UE;const HE=new Uint8Array(16),WE=[];for(let e=0;e<256;++e)WE.push((e+256).toString(16).slice(1));const $E=function(e,t,i){if(jE.randomUUID&&!t&&!e)return jE.randomUUID();const o=(e=e||{}).random??e.rng?.()??function(){if(!UE){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");UE=crypto.getRandomValues.bind(crypto)}return UE(HE)}();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){if((i=i||0)<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[i+e]=o[e];return t}return function(e,t=0){return(WE[e[t+0]]+WE[e[t+1]]+WE[e[t+2]]+WE[e[t+3]]+"-"+WE[e[t+4]]+WE[e[t+5]]+"-"+WE[e[t+6]]+WE[e[t+7]]+"-"+WE[e[t+8]]+WE[e[t+9]]+"-"+WE[e[t+10]]+WE[e[t+11]]+WE[e[t+12]]+WE[e[t+13]]+WE[e[t+14]]+WE[e[t+15]]).toLowerCase()}(o)};class qE extends ir{constructor(){super(...arguments),this.input=null}async execute(){var e,t,i;const o=this.editor,n=o.config.get("allowFile")||!1,r=null!==(e=o.config.get("fileUploadLimit"))&&void 0!==e?e:null,s=null!==(t=o.config.get("fileUploadMaxSize"))&&void 0!==t?t:null,a=null!==(i=o.config.get("fileUploadExtension"))&&void 0!==i?i:null;!1!==n?(this.input||(this.input=document.createElement("input"),this.input.type="file",this.input.accept="*/*",this.input.style.display="none",this.input.addEventListener("change",(async()=>{var e,t,i;const n=Array.from((null===(e=this.input)||void 0===e?void 0:e.files)||[]);if(0!==n.length){if(r&&((null===(t=o._fileStore)||void 0===t?void 0:t.length)||0)+n.length>r)return void alert(`파일은 최대 ${r}개까지 첨부 가능합니다.`);for(const e of n)try{const t=null===(i=e.name.split(".").pop())||void 0===i?void 0:i.toLowerCase(),n=e.size/1024;if(s&&n>s){const e=s/1024,t=e>=1?`${e.toFixed(1)}MB`:`${s}KB`;alert(`첨부 파일 크기가 ${t}를 초과합니다.`);continue}if(a&&(!t||!a.includes(t))){alert(`허용되지 않은 확장자입니다: ${t}`);continue}const r=$E();o._fileStore&&o._fileStore.push({uuid:r,name:e.name,size:n,extension:t||"",file:e}),o.model.change((t=>{let i=o.model.document.selection.getFirstPosition();if(!i)throw new Error("파일 삽입 위치를 찾을 수 없습니다.");const s=i.parent;s.is("element","paragraph")&&(i=t.createPositionAfter(s));const a=t.createElement("fileEmbed",{uuid:r,name:e.name,size:(n/1024).toFixed(2)});o.model.insertContent(a,i),t.setSelection(a,"after"),o.execute("enter")}))}catch(e){alert(e.message);continue}this.input&&(this.input.value="")}}))),this.input&&this.input.click()):alert("파일 첨부 기능이 비활성화되어 있습니다.")}}class ZE{constructor(e){this.loader=e}abort(){console.log("File Upload aborted")}async upload(){const e=await this.loader.file;return new Promise(((t,i)=>{const o=new FileReader;o.onload=()=>{t({default:o.result})},o.onerror=e=>{i(e)},o.readAsDataURL(e)}))}}const GE='<?xml version="1.0" encoding="utf-8"?>\r\n\x3c!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --\x3e\n<svg width="800px" height="800px" viewBox="0 -0.5 17 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="si-glyph si-glyph-file-download">\r\n \r\n <title>1157</title>\r\n \r\n <defs>\n\r</defs>\r\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\r\n <g transform="translate(1.000000, 1.000000)" fill="#434343">\r\n <path d="M14.031,8.016 L14.031,12.016 L2,12.016 L2,8.016 L0,8.016 L0,15 L15.938,15 L15.938,8.016 L14.031,8.016 Z" class="si-glyph-fill">\n\r</path>\r\n <path d="M8.072,8.947 L10.982,5.071 L8.968,5.05 L8.968,0.065 L7.03,0.065 L7.03,5.05 L5.03,5.05 L8.072,8.947 Z" class="si-glyph-fill">\n\r</path>\r\n </g>\r\n </g>\r\n</svg>';class KE extends ir{constructor(e,t){super(e),this.align=t}execute(){const e=this.editor.model,t=e.document.selection.getSelectedElement();t&&t.is("element","fileEmbed")&&e.change((e=>{e.setAttribute("fileAlign",this.align,t)}))}refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=!!e&&e.is("element","fileEmbed")}}class YE extends ir{execute(){const e=this.editor.model.document.selection.getSelectedElement();if(e&&e.is("element","fileEmbed")){const t=e.getAttribute("uuid");t&&this.editor._fileStore&&(this.editor._fileStore=this.editor._fileStore.filter((e=>e.uuid!==t))),this.editor.model.change((t=>{t.remove(e)}))}}}function QE(e,t){e.ui.componentFactory.add(t.name,(i=>{const o=new Dh(i);o.set({label:t.label,tooltip:!0,icon:t.svgIcon});const n=e.commands.get(t.name);return o.bind("isOn","isEnabled").to(n,"value","isEnabled"),o.on("execute",(()=>{e.execute(t.commandName)})),o}))}class JE{constructor(e,t){this.loader=e,this.editor=t.editor,this.allowImage=t.allowImage,this.imageUploadLimit=t.imageUploadLimit,this.imageUploadMaxSize=t.imageUploadMaxSize}abort(){console.log("Image Upload aborted")}async upload(){if(!this.allowImage)return alert("Image upload is not allowed."),Promise.reject();if(!this.editor.commands.get("imageUpload"))return alert("Image upload command not found."),Promise.reject();this.editor._imageStore||(this.editor._imageStore=[]);const e=await this.loader.file;if(!e)return alert("File not found."),Promise.reject();const t=1024*this.imageUploadMaxSize;if(e.size>t)return alert(`이미지 용량은 최대 ${(t/1048576).toFixed(1)}MB를 초과할 수 없습니다.`),Promise.reject();const i=this.editor.model.document.getRoot();if(!i)return alert("Root element not found in the document."),Promise.reject();const o=this.editor.model.createRangeIn(i);return Array.from(o.getItems()).filter((e=>e.is("element","imageBlock")||e.is("element","imageInline"))).length>this.imageUploadLimit?(alert(`이미지는 최대 ${this.imageUploadLimit}개까지 허용됩니다.`),Promise.reject()):new Promise(((t,i)=>{const o=new FileReader;o.onload=()=>{const i=o.result,n={src:i,name:e.name,size:Math.round(e.size/1024),type:e.type,extension:e.name.split(".").pop()||"",image:e};this.editor._imageStore=this.editor._imageStore||[],this.editor._imageStore.push(n),t(Object.assign({default:i},n))},o.onerror=e=>{i(e)},o.readAsDataURL(e)}))}}class XE extends $b{static async create(e,t={}){const i=Object.assign(Object.assign({},{licenseKey:"GPL",language:"ko",placeholder:"내용을 입력해주세요.",fontFamily:{options:["default","돋움","굴림","바탕","궁서","Arial","Tahoma","Verdana","Calibri"]},fontSize:{options:["11","13","15","16","19","24","28","30","34","38"]},image:{toolbar:["imageStyle:inline","imageStyle:block","imageStyle:side","|","toggleImageCaption","imageTextAlternative"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},mediaEmbed:{previewsInData:!0}}),t);i.toolbar=["FontFamilyLabel","FontSizeLabel","|","bold","italic","underline","strikethrough","fontColor","fontBackgroundColor","|","alignment","insertTable","pageBreak","|","blockQuote","codeBlock","removeFormat","|","link",...i.allowImage?["imageUpload"]:[],...i.allowMedia?["mediaEmbed"]:[],...i.allowFile?["fileUpload"]:[],"|","showModal"],i.removePlugins=[],(null==i?void 0:i.allowImage)||i.removePlugins.push("ImageUpload","ImageInsert","ImageToolbar","ImageCaption","ImageStyle","ImageResize"),(null==i?void 0:i.allowMedia)||i.removePlugins.push("MediaEmbed"),(null==i?void 0:i.allowFile)||i.removePlugins.push("FileUploadPlugin");const o=await super.create(e,i);return o._fileStore=[],o}}XE.builtinPlugins=[class extends er{static get requires(){return[Gw,Yw]}static get pluginName(){return"FontFamily"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[iv,sv]}static get pluginName(){return"FontSize"}static get isOfficialPlugin(){return!0}normalizeSizeOptions(e){return Jw(e)}},class extends er{init(){this.editor.ui.componentFactory.add("FontFamilyLabel",(()=>{const e=this.editor,t=e.commands.get("fontFamily"),i=e.ui.componentFactory.create("fontFamily");return i.buttonView.set("withText",!0),i.buttonView.set("icon",!1),i.buttonView.bind("label").to(t,"value",(e=>e||"Default")),i}))}},class extends er{init(){this.editor.ui.componentFactory.add("FontSizeLabel",(()=>{const e=this.editor,t=e.commands.get("fontSize"),i=e.ui.componentFactory.create("fontSize");return i.buttonView.set("withText",!0),i.buttonView.set("icon",!1),i.buttonView.bind("label").to(t,"value",(e=>e?e.replace(/px$/,""):"13")),i}))}},class extends er{static get requires(){return[_m,q_,Hk,J_,Zk,Ck,sw]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}},uw,class extends er{static get requires(){return[gw,bw]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[vw,xw]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[Pw,Mw]}static get pluginName(){return"Underline"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[Cw,Ew]}static get pluginName(){return"Strikethrough"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[lv,dv]}static get pluginName(){return"FontColor"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[hv,mv]}static get pluginName(){return"FontBackgroundColor"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[wv,yv]}static get pluginName(){return"Alignment"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[Ay,Py,Vy,Fy,Ly,Ny,w_]}static get pluginName(){return"Table"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[v_]}static get pluginName(){return"TableToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(v_),o=e.config.get("table.contentToolbar"),n=e.config.get("table.tableToolbar");o&&i.register("tableContent",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:qy}),n&&i.register("table",{ariaLabel:t("Table toolbar"),items:n,getRelatedElement:$y})}},class extends er{static get pluginName(){return"TableProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[Rx,Ux]}},class extends er{static get requires(){return[Yx,Qx,w_]}static get pluginName(){return"PageBreak"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[iA,rA]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[wA,CA]}static get pluginName(){return"CodeBlock"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[Rw,Vw]}static get pluginName(){return"RemoveFormat"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[cC,_C,yC]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[sT,lT]}static get pluginName(){return"Image"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[v_,OC]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(v_),o=e.plugins.get("ImageUtils");var n;i.register("image",{ariaLabel:t("Image toolbar"),items:(n=e.config.get("image.toolbar")||[],n.map((e=>F(e)?e.name:e))),getRelatedElement:e=>o.getClosestSelectedImageWidget(e)})}},BT,class extends er{static get requires(){return[uT,hT]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[pE,kE]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}},class extends er{static get requires(){return[$T,JT,rE,ZT]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}},class extends er{static get pluginName(){return"ImageInsert"}static get isOfficialPlugin(){return!0}static get requires(){return[BT,zT,oT]}},class extends er{static get requires(){return[ME,DE,VE,w_]}static get pluginName(){return"MediaEmbed"}static get isOfficialPlugin(){return!0}},w_,v_,p_,class extends er{static get requires(){return[w_,v_,p_,vb]}static get pluginName(){return"FileUploadPlugin"}init(){const e=this.editor;var t,i;e._fileStore||(e._fileStore=[]),e.model.schema.register("fileEmbed",{allowIn:"$root",isObject:!0,isBlock:!0,isSelectable:!0,allowAttributes:["uuid","name","size","fileAlign","hash"]}),e.conversion.for("editingDowncast").elementToElement({model:"fileEmbed",view:(e,{writer:t})=>{const i=e.getAttribute("uuid")||"",o=e.getAttribute("name")||"",n=e.getAttribute("size")||"",r=e.getAttribute("hash")||"",s=e.getAttribute("fileAlign")||"center",a=t.createContainerElement("section",{class:`file-embed image-style-align-${s}`,"data-uuid":i,"data-name":o,"data-size":n,"data-hash":r}),l=t.createContainerElement("span",{class:"file-label"}),c=t.createRawElement("span",{class:"file-icon"},(e=>{e.innerHTML=GE}));t.insert(t.createPositionAt(l,0),c);const d=t.createText(` ${o} (${n} MB)`);return t.insert(t.createPositionAfter(c),d),t.insert(t.createPositionAt(a,0),l),Xk(a,t,{label:o.toString()})}}),e.conversion.for("editingDowncast").attributeToAttribute({model:{name:"fileEmbed",key:"fileAlign"},view:e=>({key:"class",value:["file-embed",e?`image-style-align-${e}`:"image-style-align-center"]})}),e.conversion.for("dataDowncast").elementToElement({model:"fileEmbed",view:(e,{writer:t})=>{const i=e.getAttribute("uuid")||"",o=e.getAttribute("name")||"",n=e.getAttribute("size")||"",r=e.getAttribute("fileAlign")||"center",s=e.getAttribute("hash"),a=t.createContainerElement("section",{class:`file-embed image-style-align-${r}`,"data-uuid":i,"data-name":o,"data-size":n,"data-hash":s,contenteditable:"false"}),l=t.createContainerElement("span",{class:"file-label"}),c=t.createRawElement("span",{class:"file-icon"},(e=>{e.innerHTML=GE}));t.insert(t.createPositionAt(l,0),c);const d=t.createText(` ${o} (${n} MB)`);return t.insert(t.createPositionAfter(c),d),t.insert(t.createPositionAt(a,0),l),a}}),e.conversion.for("upcast").elementToElement({view:{name:"section",classes:"file-embed"},model:(e,{writer:t})=>{const i=(["left","center","right"].map((e=>`image-style-align-${e}`)).find((t=>e.hasClass(t)))||"image-style-align-center").split("-").pop();return t.createElement("fileEmbed",{uuid:e.getAttribute("data-uuid")||"",name:e.getAttribute("data-name")||"",size:e.getAttribute("data-size")||"",hash:e.getAttribute("data-hash")||"",alignment:i})}}),e.plugins.get("FileRepository").createUploadAdapter=e=>new ZE(e),!!e.config.get("allowFile")&&QE(e,{name:"fileUpload",label:"파일 첨부",svgIcon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',commandName:"fileUpload"}),QE(e,{name:"fileEmbedStyle:alignLeft",label:"왼쪽 정렬",svgIcon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',commandName:"fileEmbedStyle:alignLeft"}),QE(e,{name:"fileEmbedStyle:alignCenter",label:"가운데 정렬",svgIcon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z"/></svg>',commandName:"fileEmbedStyle:alignCenter"}),QE(e,{name:"fileEmbedStyle:alignRight",label:"오른쪽 정렬",svgIcon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',commandName:"fileEmbedStyle:alignRight"}),QE(e,{name:"deleteFileEmbed",label:"삭제",svgIcon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.2 7h9.2c.6 0 1 .4 1 1v9.9c0 .5-.4 1-1 1H5.2a1 1 0 0 1-1-1V8c0-.6.4-1 1-1Zm1 1.5c-.3 0-.5.2-.5.5v8c0 .3.2.5.5.5h.5c.2 0 .5-.2.5-.5V9c0-.3-.3-.5-.5-.5h-.5Zm3.2 0c-.2 0-.5.2-.5.5v8c0 .3.3.5.5.5h.5c.3 0 .5-.2.5-.5V9c0-.3-.2-.5-.5-.5h-.5Zm3.5 0c-.2 0-.5.2-.5.5v8c0 .3.3.5.5.5h.5c.3 0 .5-.2.5-.5V9c0-.3-.2-.5-.5-.5h-.5Zm-1.4-7.1H8.3L6.5 3.6H3.8c-.5 0-.7.3-.7.8s.2.7.7.7h12c.6 0 .9-.2.9-.7 0-.5-.3-.8-1-.8h-2.4l-1.8-2.2Z"/></svg>',commandName:"deleteFileEmbed"}),e.commands.add("fileUpload",new qE(e)),e.commands.add("fileEmbedStyle:alignLeft",new KE(e,"left")),e.commands.add("fileEmbedStyle:alignCenter",new KE(e,"center")),e.commands.add("fileEmbedStyle:alignRight",new KE(e,"right")),e.commands.add("deleteFileEmbed",new YE(e)),e.plugins.get("WidgetToolbarRepository").register("fileEmbedToolbar",{ariaLabel:"File toolbar",items:["fileEmbedStyle:alignLeft","fileEmbedStyle:alignCenter","fileEmbedStyle:alignRight","|","deleteFileEmbed"],getRelatedElement:e=>{const t=e.getSelectedElement();return t&&"section"===t.name&&t.hasClass("file-embed")?t:null}}),e.editing.mapper.on("viewToModelPosition",(t=e.model,i=e=>e.hasClass("file-embed"),(e,o)=>{const{mapper:n,viewPosition:r}=o,s=n.findMappedViewAncestor(r);if(!i(s))return;const a=n.toModelElement(s);o.modelPosition=t.createPositionAt(a,r.isAtStart?"before":"after")})),e.model.document.on("change:data",(()=>{const t=e._fileStore||[];if(!t.length)return;const i=e.model.document.getRoot();if(!i)throw new Error("Root element not found in the document.");const o=new Set;for(const{item:t}of e.model.createRangeIn(i))if(t.is("element","fileEmbed")){const e=t.getAttribute("uuid");e&&o.add(e)}e._fileStore=t.filter((e=>o.has(e.uuid)))}))}},vb,class extends er{get requires(){return[om]}init(){this.editor.ui.componentFactory.add("showModal",(e=>{const t=new Dh(e);return t.set({label:"안내문",tooltip:!0,withText:!1,icon:'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --\x3e\n<svg width="800px" height="800px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" version="1.1">\n\n <defs>\n <mask id="mask_circle">\n <circle cx="50" cy="50" r="50" fill="white"/>\n <circle cx="50" cy="50" r="12" fill="#000000"/>\n </mask>\n <linearGradient x1="20" y1="60" x2="60" y2="40" id="Gradient" gradientUnits="userSpaceOnUse">\n <stop style="stop-color:#C07F00;stop-opacity:1" offset="0" />\n <stop style="stop-color:#FFB85B;stop-opacity:1" offset="1" />\n </linearGradient>\n </defs>\n \n <path style="fill:none;stroke:#DC9B1D;stroke-width:3;" d="M 96,81 61,12 C 57,2.7 43,2.7 39,12 39,12 5.4,78 3.4,83 c -2,5 0,12 8.6,12 l 71,0 c 12,0 17,-5 13,-14 z"/>\n <path style="fill:url(#Gradient);stroke:#444444;stroke-width:7" d="M 91,80 58,16 C 54,7.1 46,7.1 42,16 42,16 11,77 9,81 6.2,86 5.8,91 14,91 l 67,0 c 12,0 14,-3 10,-11 z"/>\n\n <path style="fill:#333333;" d="M 46,63 43,35 57,35 54,63 z"/>\n <circle cx="50" cy="73" r="7" style="fill:#333333"/>\n\n</svg>'}),t.on("execute",(()=>{const i=this.editor.plugins.get("Dialog");if(t.isOn)return i.hide(),void(t.isOn=!1);t.isOn=!0;const o=new Kn(e);o.setTemplate({tag:"div",attributes:{style:{padding:"var(--ck-spacing-large)",whiteSpace:"initial",width:"100%",maxWidth:"500px"},tabindex:-1},children:[{tag:"h2",children:["반드시 아래 사항을 숙지하시기 바랍니다."]},{tag:"p",children:["본 사이트는 헌법 제21조에 따른 표현의 자유를 존중합니다. 다만, 타인의 인격권, 명예, 사생활 보호 및 사회적 공공질서 유지를 위해 아래 사항을 반드시 준수해 주시기 바랍니다."]},{tag:"section",children:[{tag:"h3",children:["타인에 대한 존중"]},{tag:"p",children:["다른 이용자에게 모욕적이거나 명예를 훼손하는 표현은 사용하지 마십시오."]}]},{tag:"section",children:[{tag:"h3",children:["사실관계 확인"]},{tag:"p",children:["허위 사실이나 근거 없는 정보 유포를 삼가해 주시기 바랍니다."]}]},{tag:"section",children:[{tag:"h3",children:["불법행위 금지"]},{tag:"p",children:["법령에 위배되거나 불법적인 행위를 조장하는 내용은 게시할 수 없습니다."]}]},{tag:"section",children:[{tag:"h3",children:["광고 금지"]},{tag:"p",children:["상업적 광고나 도배 게시물은 금지됩니다."]}]},{tag:"small",children:["※글 작성 시, 위 내용을 충분히 숙지하시고 책임 있는 표현을 부탁드립니다."]}]}),i.show({id:"minimalistic-modal",isModal:!0,title:"글 작성 시 주의사항",content:o,actionButtons:[{label:"확인",class:"ck-button-action",withText:!0,onExecute:()=>i.hide()}],onHide(){t.isOn=!1}})})),t}))}},class extends er{constructor(e){super(e),this.set("characters",0),this.set("words",0),Object.defineProperties(this,{characters:{get(){return this.characters=this._getCharacters(this._getText())}},words:{get(){return this.words=this._getWords(this._getText())}}}),this.set("_wordsLabel",void 0),this.set("_charactersLabel",void 0),this._config=e.config.get("wordCount")||{},this._outputView=void 0,this._wordsMatchRegExp=s.features.isRegExpUnicodePropertySupported?new RegExp("([\\p{L}\\p{N}]+\\S?)+","gu"):/([a-zA-Z0-9À-ž]+\S?)+/gu}static get pluginName(){return"WordCount"}static get isOfficialPlugin(){return!0}init(){this.editor.model.document.on("change:data",Zu(this._refreshStats.bind(this),250)),"function"==typeof this._config.onUpdate&&this.on("update",((e,t)=>{this._config.onUpdate(t)})),Ri(this._config.container)&&this._config.container.appendChild(this.wordCountContainer)}destroy(){this._outputView&&(this._outputView.element.remove(),this._outputView.destroy()),super.destroy()}get wordCountContainer(){const e=this.editor,t=e.t,i=e.config.get("wordCount.displayWords"),o=e.config.get("wordCount.displayCharacters"),n=fn.bind(this,this),r=[];return this._outputView||(this._outputView=new Kn,(i||void 0===i)&&(this.bind("_wordsLabel").to(this,"words",(e=>t("Words: %0",e))),r.push({tag:"div",children:[{text:[n.to("_wordsLabel")]}],attributes:{class:"ck-word-count__words"}})),(o||void 0===o)&&(this.bind("_charactersLabel").to(this,"characters",(e=>t("Characters: %0",e))),r.push({tag:"div",children:[{text:[n.to("_charactersLabel")]}],attributes:{class:"ck-word-count__characters"}})),this._outputView.setTemplate({tag:"div",attributes:{class:["ck","ck-word-count"]},children:r}),this._outputView.render()),this._outputView.element}_getText(){let e="";for(const t of this.editor.model.document.getRoots())""!==e&&(e+="\n"),e+=FE(t);return e}_getCharacters(e){return e.replace(/\n/g,"").length}_getWords(e){return(e.match(this._wordsMatchRegExp)||[]).length}_refreshStats(){const e=this._getText(),t=this.words=this._getWords(e),i=this.characters=this._getCharacters(e);this.fire("update",{words:t,characters:i})}},class extends er{init(){const e=this.editor,t=e.config.get("maxWordCount")||1/0;let i="";e.model.document.on("change:data",(()=>{const o=e.getData();o.replace(/<[^>]+>/g,"").length>t?(alert(`최대 입력 가능한 내용을 초과했습니다. (${t}자)`),e.setData(i)):i=o}))}},class extends er{static get pluginName(){return"ExtendedImageUpload"}static get requires(){return["FileRepository","ImageUploadEditing"]}init(){const e=this.editor;e.plugins.get("FileRepository").createUploadAdapter=t=>{var i,o,n;const r=null!==(i=e.config.get("allowImage"))&&void 0!==i&&i,s=null!==(o=e.config.get("imageUploadLimit"))&&void 0!==o?o:1/0,a=null!==(n=e.config.get("imageUploadMaxSize"))&&void 0!==n?n:1/0;return new JE(t,{editor:e,allowImage:r,imageUploadLimit:s,imageUploadMaxSize:a})},e.model.document.on("change:data",(()=>{const t=e.model.document.getRoot();if(!t)throw new Error("Root element not found in the document.");const i=new Set;for(const{item:o}of e.model.createRangeIn(t))if(o.is("element","imageBlock")||o.is("element","imageInline")){const e=o.getAttribute("src");e&&i.add(e)}Array.isArray(e._imageStore)?e._imageStore=e._imageStore.filter((e=>i.has(e.src))):e._imageStore=[]})),e.editing.view.document.on("clipboardInput",(async(t,i)=>{const o=i.dataTransfer.getData("text/html");if(!o)return;const n=(new DOMParser).parseFromString(o,"text/html").querySelectorAll("img");t.stop();for(const t of Array.from(n)){const i=t.getAttribute("src");if(null==i?void 0:i.startsWith("http"))try{const t=await fetch("https://localhost:5000/api/forum/proxy/image?url="+encodeURIComponent(i));if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const o=await t.blob(),n=crypto.randomUUID(),r=o.type.split("/").pop(),s=new File([o],`${n}.${r}`,{type:o.type});e.execute("uploadImage",{file:s})}catch(e){console.warn("Image Load Failed:",i,e)}}}),{priority:"high"});const t=e.model.schema,i=["data-name","data-extension","data-size","data-type","data-width","data-height"];t.extend("imageBlock",{allowAttributes:i}),t.extend("imageInline",{allowAttributes:i}),i.forEach((t=>{e.conversion.for("upcast").attributeToAttribute({view:t,model:t})}));const o=(e,t,i)=>{const o=i.writer,n=i.mapper.toViewElement(t.item);if(!n)return;let r=n.is("element","img")?n:Array.from(n.getChildren()).find((e=>e.is("element","img")));r&&o.setAttribute(t.attributeKey,t.attributeNewValue,r)};i.forEach((t=>{e.conversion.for("dataDowncast").add((e=>{e.on(`attribute:${t}:imageBlock`,o),e.on(`attribute:${t}:imageInline`,o)})),e.conversion.for("editingDowncast").add((e=>{e.on(`attribute:${t}:imageBlock`,o),e.on(`attribute:${t}:imageInline`,o)}))})),e.plugins.get("ImageUploadEditing").on("uploadComplete",((t,{data:i,imageElement:o})=>{e.model.change((e=>{e.setAttribute("data-name",i.name,o),e.setAttribute("data-extension",i.extension,o),e.setAttribute("data-size",i.size,o),e.setAttribute("data-type",i.type,o)}))}))}},class extends er{static get pluginName(){return"ExtendedMediaEmbed"}static get requires(){return[ME]}init(){var e,t;const i=this.editor,o=null!==(e=i.config.get("allowMedia"))&&void 0!==e&&e,n=null!==(t=i.config.get("mediaUploadLimit"))&&void 0!==t?t:1/0;if(!o)return;const r=i.commands.get("mediaEmbed");if(!r)return;const s=r.execute;r.execute=function(e){const t=(()=>{var e;const t=i.model.document.getRoot();if(!t)throw new Error("Root element not found in the document.");let o=0;for(const{item:n}of i.model.createRangeIn(t))(null===(e=n.is)||void 0===e?void 0:e.call(n,"element","media"))&&o++;return o})();if(!(t>=n))return i._mediaStore=i._mediaStore||[],i._mediaStore.push({url:e}),s.call(this,e);alert(`동영상은 최대 ${n}개까지 허용됩니다.`)},i.plugins.get("ClipboardPipeline").on("inputTransformation",((e,t)=>{var i;const o=null===(i=t.dataTransfer.getData("text/plain"))||void 0===i?void 0:i.trim(),n=/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\//.test(o);o&&n&&(e.stop(),r.execute(o))})),i.model.document.on("change:data",(()=>{const e=i.model.document.getRoot();if(!e)throw new Error("Root element not found in the document.");const t=new Set;for(const{item:o}of i.model.createRangeIn(e))if(o.is("element","media")){const e=o.getAttribute("url");e&&t.add(e)}Array.isArray(i._mediaStore)?i._mediaStore=i._mediaStore.filter((e=>t.has(e.url))):i._mediaStore=[]}))}},q_],XE.EditorWatchdog=Qu,window.Editor=XE;const eS=XE})(),r})()));