@ckeditor/ckeditor5-html-support 46.1.1 → 47.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/html-support.js +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
- package/src/fullpage.d.ts +9 -0
- package/src/fullpage.js +13 -0
package/build/html-support.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
/*!
|
|
3
3
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
4
|
* For licensing, see LICENSE.md.
|
|
5
|
-
*/(()=>{var t={212:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(r){t.setAttribute(r,e[r])})}},237:t=>{"use strict";t.exports=CKEditor5.dll},272:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r="",i=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),i&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),i&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r}).join("")},e.i=function(t,r,i,o,n){"string"==typeof t&&(t=[[null,t,void 0]]);var l={};if(i)for(var s=0;s<this.length;s++){var a=this[s][0];null!=a&&(l[a]=!0)}for(var m=0;m<t.length;m++){var c=[].concat(t[m]);i&&l[c[0]]||(void 0!==n&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=n),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),e.push(c))}},e}},507:t=>{"use strict";var e={};t.exports=function(t,r){var i=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}},520:t=>{"use strict";var e=[];function r(t){for(var r=-1,i=0;i<e.length;i++)if(e[i].identifier===t){r=i;break}return r}function i(t,i){for(var n={},l=[],s=0;s<t.length;s++){var a=t[s],m=i.base?a[0]+i.base:a[0],c=n[m]||0,u="".concat(m," ").concat(c);n[m]=c+1;var d=r(u),h={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)e[d].references++,e[d].updater(h);else{var f=o(h,i);i.byIndex=s,e.splice(s,0,{identifier:u,updater:f,references:1})}l.push(u)}return l}function o(t,e){var r=e.domAPI(e);r.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,o){var n=i(t=t||[],o=o||{});return function(t){t=t||[];for(var l=0;l<n.length;l++){var s=r(n[l]);e[s].references--}for(var a=i(t,o),m=0;m<n.length;m++){var c=r(n[m]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}n=a}}},584:(t,e,r)=>{t.exports=r(237)("./src/utils.js")},692:t=>{"use strict";var e,r=(e=[],function(t,r){return e[t]=r,e.filter(Boolean).join("\n")});function i(t,e,i,o){var n;if(i)n="";else{n="",o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var l=void 0!==o.layer;l&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,l&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}")}if(t.styleSheet)t.styleSheet.cssText=r(e,n);else{var s=document.createTextNode(n),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(s,a[e]):t.appendChild(s)}}var o={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=o.singletonCounter++,r=o.singleton||(o.singleton=t.insertStyleElement(t));return{update:function(t){i(r,e,!1,t)},remove:function(t){i(r,e,!0,t)}}}},695:t=>{"use strict";t.exports=function(t){return t[1]}},701:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(695),o=r.n(i),n=r(272),l=r.n(n)()(o());l.push([t.id,":root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}",""]);const s=l},782:(t,e,r)=>{t.exports=r(237)("./src/core.js")},783:(t,e,r)=>{t.exports=r(237)("./src/engine.js")},888:(t,e,r)=>{t.exports=r(237)("./src/enter.js")},901:(t,e,r)=>{t.exports=r(237)("./src/widget.js")},964:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}}},e={};function r(i){var o=e[i];if(void 0!==o)return o.exports;var n=e[i]={id:i,exports:{}};return t[i](n,n.exports,r),n.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";r.r(i),r.d(i,{CodeBlockElementSupport:()=>Pt,CustomElementSupport:()=>Xt,DataFilter:()=>Et,DataSchema:()=>mt,DualContentModelElementSupport:()=>Ft,EmptyBlock:()=>ie,FullPage:()=>te,GeneralHtmlSupport:()=>Qt,HeadingElementSupport:()=>It,HorizontalLineElementSupport:()=>Kt,HtmlComment:()=>Jt,HtmlPageDataProcessor:()=>Zt,ImageElementSupport:()=>Tt,ListElementSupport:()=>Wt,MediaEmbedElementSupport:()=>Bt,ScriptElementSupport:()=>xt,StyleElementSupport:()=>Vt,TableElementSupport:()=>Ht,_HTML_SUPPORT_SCHEMA_DEFINITIONS:()=>et,_attributeToInlineHtmlSupportConverter:()=>J,_createObjectHtmlSupportView:()=>X,_emptyInlineModelElementToViewHtmlSupportConverter:()=>Y,_getHtmlSupportAttributeName:()=>q,_getHtmlSupportDescendantElement:()=>$t,_mergeHtmlSupportViewElementAttributes:()=>L,_modelToViewBlockAttributeHtmlSupportConverter:()=>tt,_modifyHtmlSupportGhsAttribute:()=>U,_removeHtmlSupportViewAttributes:()=>M,_setHtmlSupportViewAttributes:()=>N,_toHtmlSupportPascalCase:()=>W,_toObjectWidgetHtmlSupportConverter:()=>K,_updateHtmlSupportViewAttributes:()=>V,_viewToAttributeInlineHtmlSupportConverter:()=>Q,_viewToModelBlockAttributeHtmlSupportConverter:()=>Z,_viewToModelObjectContentHtmlSupportConverter:()=>G});var t=r(782),e=r(584),o=r(783),n=r(901);function l(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function s(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const a="[object RegExp]",m="[object String]",c="[object Number]",u="[object Boolean]",d="[object Arguments]",h="[object Symbol]",f="[object Date]",g="[object Map]",b="[object Set]",p="[object Array]",w="[object ArrayBuffer]",A="[object Object]",y="[object DataView]",v="[object Uint8Array]",E="[object Uint8ClampedArray]",S="[object Uint16Array]",k="[object Uint32Array]",O="[object Int8Array]",C="[object Int16Array]",j="[object Int32Array]",P="[object Float32Array]",F="[object Float64Array]";function _(t){return null==t||"object"!=typeof t&&"function"!=typeof t}function I(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function $(t,e,r,i=new Map,o=void 0){const n=o?.(t,e,r,i);if(null!=n)return n;if(_(t))return t;if(i.has(t))return i.get(t);if(Array.isArray(t)){const e=new Array(t.length);i.set(t,e);for(let n=0;n<t.length;n++)e[n]=$(t[n],n,r,i,o);return Object.hasOwn(t,"index")&&(e.index=t.index),Object.hasOwn(t,"input")&&(e.input=t.input),e}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,e}if(t instanceof Map){const e=new Map;i.set(t,e);for(const[n,l]of t)e.set(n,$(l,n,r,i,o));return e}if(t instanceof Set){const e=new Set;i.set(t,e);for(const n of t)e.add($(n,void 0,r,i,o));return e}if("undefined"!=typeof Buffer&&Buffer.isBuffer(t))return t.subarray();if(I(t)){const e=new(Object.getPrototypeOf(t).constructor)(t.length);i.set(t,e);for(let n=0;n<t.length;n++)e[n]=$(t[n],n,r,i,o);return e}if(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const e=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return i.set(t,e),T(e,t,r,i,o),e}if("undefined"!=typeof File&&t instanceof File){const e=new File([t],t.name,{type:t.type});return i.set(t,e),T(e,t,r,i,o),e}if(t instanceof Blob){const e=new Blob([t],{type:t.type});return i.set(t,e),T(e,t,r,i,o),e}if(t instanceof Error){const e=new t.constructor;return i.set(t,e),e.message=t.message,e.name=t.name,e.stack=t.stack,e.cause=t.cause,T(e,t,r,i,o),e}if("object"==typeof t&&function(t){switch(s(t)){case d:case p:case w:case y:case u:case f:case P:case F:case O:case C:case j:case g:case c:case A:case a:case b:case m:case h:case v:case E:case S:case k:return!0;default:return!1}}(t)){const e=Object.create(Object.getPrototypeOf(t));return i.set(t,e),T(e,t,r,i,o),e}return t}function T(t,e,r=t,i,o){const n=[...Object.keys(e),...l(e)];for(let l=0;l<n.length;l++){const s=n[l],a=Object.getOwnPropertyDescriptor(t,s);(null==a||a.writable)&&(t[s]=$(e[s],s,r,i,o))}}function B(t,e){return function(t,e){return $(t,void 0,t,new Map,e)}(t,(r,i,o,n)=>{const l=e?.(r,i,o,n);if(null!=l)return l;if("object"==typeof t)switch(Object.prototype.toString.call(t)){case c:case m:case u:{const e=new t.constructor(t?.valueOf());return T(e,t),e}case d:{const e={};return T(e,t),e.length=t.length,e[Symbol.iterator]=t[Symbol.iterator],e}default:return}})}function x(t){return B(t)}const D=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function H(t){if(null==t)return"";if("string"==typeof t)return t;if(Array.isArray(t))return t.map(H).join(",");const e=String(t);return"0"===e&&Object.is(Number(t),-0)?"-0":e}function R(t){const e=function(t){return Array.from(t.match(D)??[])}(function(t){return"string"!=typeof t&&(t=H(t)),t.replace(/['\u2019]/g,"")}(t).trim());let r="";for(let t=0;t<e.length;t++){const i=e[t];r&&(r+=" "),i===i.toUpperCase()?r+=i:r+=i[0].toUpperCase()+i.slice(1).toLowerCase()}return r}function V(t,e,r,i){e&&M(t,e,i),r&&N(t,r,i)}function N(t,e,r){if(e.attributes)for(const[i,o]of Object.entries(e.attributes))t.setAttribute(i,o,r);e.styles&&t.setStyle(e.styles,r),e.classes&&t.addClass(e.classes,r)}function M(t,e,r){if(e.attributes)for(const[i]of Object.entries(e.attributes))t.removeAttribute(i,r);if(e.styles)for(const i of Object.keys(e.styles))t.removeStyle(i,r);e.classes&&t.removeClass(e.classes,r)}function L(t,e){const r=x(t);let i="attributes";for(i in e)r[i]="classes"==i?Array.from(new Set([...t[i]||[],...e[i]])):{...t[i],...e[i]};return r}function U(t,e,r,i,o){const n=e.getAttribute(r),l={};for(const t of["attributes","styles","classes"]){if(t!=i){n&&n[t]&&(l[t]=n[t]);continue}if("classes"==i){const e=new Set(n&&n.classes||[]);o(e),e.size&&(l[t]=Array.from(e));continue}const e=new Map(Object.entries(n&&n[t]||{}));o(e),e.size&&(l[t]=Object.fromEntries(e))}Object.keys(l).length?e.is("documentSelection")?t.setSelectionAttribute(r,l):t.setAttribute(r,l,e):n&&(e.is("documentSelection")?t.removeSelectionAttribute(r):t.removeAttribute(r,e))}function z(t,e,r){for(const i of e.getItems({shallow:!0})){const e=i.getAttribute(t);e&&e.attributes&&Object.keys(e.attributes).length?Object.keys(e).length>1&&r.setAttribute(t,{attributes:e.attributes},i):r.removeAttribute(t,i)}}function W(t){return R(t).replace(/ /g,"")}function q(t){return`html${W(t)}Attributes`}function G({model:t}){return(e,r)=>r.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function K(t,{view:e,isInline:r}){const i=t.t;return(t,{writer:o})=>{const l=i("HTML object"),s=X(e,t,o),a=t.getAttribute(q(e));o.addClass("html-object-embed__content",s),a&&N(o,a,s);const m=o.createContainerElement(r?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},s);return(0,n.toWidget)(m,o,{label:l})}}function X(t,e,r){return r.createRawElement(t,null,(t,r)=>{r.setContentOf(t,e.getAttribute("htmlContent"))})}function Q({view:t,model:e,allowEmpty:r},i){return e=>{e.on(`element:${t}`,(t,e,n)=>{let l=i.processViewAttributes(e.viewItem,n);if(l||n.consumable.test(e.viewItem,{name:!0})){if(l=l||{},n.consumable.consume(e.viewItem,{name:!0}),e.modelRange||(e=Object.assign(e,n.convertChildren(e.viewItem,e.modelCursor))),r&&e.modelRange.isCollapsed&&Object.keys(l).length){const t=n.writer.createElement("htmlEmptyElement");if(!n.safeInsert(t,e.modelCursor))return;const r=n.getSplitParts(t);return e.modelRange=n.writer.createRange(e.modelRange.start,n.writer.createPositionAfter(r[r.length-1])),n.updateConversionResult(t,e),void o(t,l,n)}for(const t of e.modelRange.getItems())o(t,l,n)}},{priority:"low"})};function o(t,r,i){if(i.schema.checkAttribute(t,e)){const o=L(r,t.getAttribute(e)||{});i.writer.setAttribute(e,o,t)}}}function Y({model:t,view:e},r){return(i,{writer:o,consumable:l})=>{if(!i.hasAttribute(t))return null;const s=o.createContainerElement(e),a=i.getAttribute(t);return l.consume(i,`attribute:${t}`),N(o,a,s),s.getFillerOffset=()=>null,r?(0,n.toWidget)(s,o):s}}function J({priority:t,view:e}){return(r,i)=>{if(!r)return;const{writer:o}=i,n=o.createAttributeElement(e,null,{priority:t});return N(o,r,n),n}}function Z({view:t},e){return r=>{r.on(`element:${t}`,(t,r,i)=>{if(!r.modelRange||r.modelRange.isCollapsed)return;const o=e.processViewAttributes(r.viewItem,i);o&&i.writer.setAttribute(q(r.viewItem.name),o,r.modelRange)},{priority:"low"})}}function tt({view:t,model:e}){return r=>{r.on(`attribute:${q(t)}:${e}`,(t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e;V(r.writer,i,o,r.mapper.toViewElement(e.item))})}}const et={block:[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"horizontalLine",view:"hr"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlHr",view:"hr",isEmpty:!0,modelSchema:{inheritAllFrom:"$blockObject"}}],inline:[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{isFormatting:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}]};function rt(t){return"__proto__"===t}function it(t){return null!==t&&"object"==typeof t&&"[object Arguments]"===s(t)}function ot(t){return"object"==typeof t&&null!==t}function nt(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==Object.prototype.toString.call(t)){const e=t[Symbol.toStringTag];if(null==e)return!1;return!!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable&&t.toString()===`[object ${e}]`}let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function lt(t){return I(t)}function st(t,...e){const r=e.slice(0,-1),i=e[e.length-1];let o=t;for(let t=0;t<r.length;t++){o=at(o,r[t],i,new Map)}return o}function at(t,e,r,i){if(_(t)&&(t=Object(t)),null==e||"object"!=typeof e)return t;if(i.has(e))return function(t){if(_(t))return t;if(Array.isArray(t)||I(t)||t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t),r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const e=new r(t);return e.lastIndex=t.lastIndex,e}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){const e=new r(t.message);return e.stack=t.stack,e.name=t.name,e.cause=t.cause,e}if("undefined"!=typeof File&&t instanceof File)return new r([t],t.name,{type:t.type,lastModified:t.lastModified});if("object"==typeof t){const r=Object.create(e);return Object.assign(r,t)}return t}(i.get(e));if(i.set(e,t),Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]=e[t]??void 0}const o=[...Object.keys(e),...l(e)];for(let n=0;n<o.length;n++){const l=o[n];if(rt(l))continue;let s=e[l],a=t[l];if(it(s)&&(s={...s}),it(a)&&(a={...a}),"undefined"!=typeof Buffer&&Buffer.isBuffer(s)&&(s=x(s)),Array.isArray(s))if("object"==typeof a&&null!=a){const t=[],e=Reflect.ownKeys(a);for(let r=0;r<e.length;r++){const i=e[r];t[i]=a[i]}a=t}else a=[];const m=r(a,s,l,t,e,i);null!=m?t[l]=m:Array.isArray(s)||ot(a)&&ot(s)?t[l]=at(a,s,r,i):null==a&&nt(s)?t[l]=at({},s,r,i):null==a&<(s)?t[l]=x(s):void 0!==a&&void 0===s||(t[l]=s)}return t}class mt extends t.Plugin{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const t of et.block)this.registerBlockElement(t);for(const t of et.inline)this.registerInlineElement(t)}registerBlockElement(t){this._definitions.push({...t,isBlock:!0})}registerInlineElement(t){this._definitions.push({...t,isInline:!0})}extendBlockElement(t){this._extendDefinition({...t,isBlock:!0})}extendInlineElement(t){this._extendDefinition({...t,isInline:!0})}getDefinitionsForView(t,e=!1){const r=new Set;for(const i of this._getMatchingViewDefinitions(t)){if(e)for(const t of this._getReferences(i.model))r.add(t);r.add(i)}return r}getDefinitionsForModel(t){return this._definitions.filter(e=>e.model==t)}_getMatchingViewDefinitions(t){return this._definitions.filter(e=>e.view&&function(t,e){if("string"==typeof t)return t===e;if(t instanceof RegExp)return t.test(e);return!1}(t,e.view))}*_getReferences(t){const r=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],i=this._definitions.filter(e=>e.model==t);for(const{modelSchema:o}of i)if(o)for(const i of r)for(const r of(0,e.toArray)(o[i]||[])){const e=this._definitions.filter(t=>t.model==r);for(const i of e)r!==t&&(yield*this._getReferences(i.model),yield i)}}_extendDefinition(t){const e=Array.from(this._definitions.entries()).filter(([,e])=>e.model==t.model);if(0!=e.length)for(const[r,i]of e)this._definitions[r]=st({},i,t,(t,e)=>Array.isArray(t)?t.concat(e):void 0);else this._definitions.push(t)}}var ct=r(520),ut=r.n(ct),dt=r(692),ht=r.n(dt),ft=r(507),gt=r.n(ft),bt=r(212),pt=r.n(bt),wt=r(964),At=r.n(wt),yt=r(701),vt={attributes:{"data-cke":!0}};vt.setAttributes=pt(),vt.insert=gt().bind(null,"head"),vt.domAPI=ht(),vt.insertStyleElement=At();ut()(yt.A,vt);yt.A&&yt.A.locals&&yt.A.locals;class Et extends t.Plugin{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(t){super(t),this._dataSchema=t.plugins.get("DataSchema"),this._allowedAttributes=new o.Matcher,this._disallowedAttributes=new o.Matcher,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[mt,n.Widget]}loadAllowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=jt(e);this.allowElement(t),r.forEach(t=>this.allowAttributes(t))}}loadDisallowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=jt(e);0==r.length?this.disallowElement(t):r.forEach(t=>this.disallowAttributes(t))}}loadAllowedEmptyElementsConfig(t){for(const e of t)this.allowEmptyElement(e)}allowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!0))this._addAllowedElement(e),this._coupledAttributes=null}disallowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!1))this._disallowedElements.add(e.view)}allowEmptyElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!0))e.isInline&&this._dataSchema.extendInlineElement({...e,allowEmpty:!0})}allowAttributes(t){this._allowedAttributes.add(t)}disallowAttributes(t){this._disallowedAttributes.add(t)}processViewAttributes(t,e){const{consumable:r}=e;return St(t,this._disallowedAttributes,r),function(t,{attributes:e,classes:r,styles:i}){if(!e.length&&!r.length&&!i.length)return null;return{...e.length&&{attributes:kt(t,e)},...i.length&&{styles:Ot(t,i)},...r.length&&{classes:r}}}(t,St(t,this._allowedAttributes,r))}_addAllowedElement(t){if(!this._allowedElements.has(t)){if(this._allowedElements.add(t),"appliesToBlock"in t&&"string"==typeof t.appliesToBlock)for(const e of this._dataSchema.getDefinitionsForModel(t.appliesToBlock))e.isBlock&&this._addAllowedElement(e);this._dataInitialized&&this.editor.data.once("set",()=>{this._fireRegisterEvent(t)},{priority:e.priorities.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",()=>{this._dataInitialized=!0;for(const t of this._allowedElements)this._fireRegisterEvent(t)},{priority:e.priorities.highest+1})}_registerElementHandlers(){this.on("register",(t,r)=>{const i=this.editor.model.schema;if(r.isObject&&!i.isRegistered(r.model))this._registerObjectElement(r);else if(r.isBlock)this._registerBlockElement(r);else{if(!r.isInline)throw new e.CKEditorError("data-filter-invalid-definition",null,r);this._registerInlineElement(r)}t.stop()},{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const t=this.editor.model,e=t.document.selection;t.document.registerPostFixer(e=>{const r=t.document.differ.getChanges();let i=!1;const o=this._getCoupledAttributesMap();for(const t of r){if("attribute"!=t.type||null!==t.attributeNewValue)continue;const r=o.get(t.attributeKey);if(r)for(const{item:o}of t.range.getWalker())for(const t of r)o.hasAttribute(t)&&(e.removeAttribute(t,o),i=!0)}return i}),this.listenTo(e,"change:attribute",(r,{attributeKeys:i})=>{const o=new Set,n=this._getCoupledAttributesMap();for(const t of i){if(e.hasAttribute(t))continue;const r=n.get(t);if(r)for(const t of r)e.hasAttribute(t)&&o.add(t)}0!=o.size&&t.change(t=>{for(const e of o)t.removeSelectionAttribute(e)})})}_registerAssociatedHtmlAttributesPostFixer(){const t=this.editor.model;t.document.registerPostFixer(e=>{const r=t.document.differ.getChanges();let i=!1;for(const o of r)if("insert"===o.type&&"$text"!==o.name)for(const r of o.attributes.keys())r.startsWith("html")&&r.endsWith("Attributes")&&(t.schema.checkAttribute(o.name,r)||(e.removeAttribute(r,o.position.nodeAfter),i=!0));return i})}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const t of this._allowedElements)if(t.coupledAttribute&&t.model){const e=this._coupledAttributes.get(t.coupledAttribute);e?e.push(t.model):this._coupledAttributes.set(t.coupledAttribute,[t.model])}return this._coupledAttributes}_fireRegisterEvent(t){t.view&&this._disallowedElements.has(t.view)||this.fire(t.view?`register:${t.view}`:"register",t)}_registerObjectElement(t){const r=this.editor,i=r.model.schema,o=r.conversion,{view:n,model:l}=t;i.register(l,t.modelSchema),n&&(i.extend(t.model,{allowAttributes:[q(n),"htmlContent"]}),r.data.registerRawContentMatcher({name:n}),o.for("upcast").elementToElement({view:n,model:G(t),converterPriority:e.priorities.low+2}),o.for("upcast").add(Z(t,this)),o.for("editingDowncast").elementToStructure({model:{name:l,attributes:[q(n)]},view:K(r,t)}),o.for("dataDowncast").elementToElement({model:l,view:(t,{writer:e})=>X(n,t,e)}),o.for("dataDowncast").add(tt(t)))}_registerBlockElement(t){const r=this.editor,i=r.model.schema,o=r.conversion,{view:n,model:l}=t;if(!i.isRegistered(t.model)){if(!t.modelSchema)return;if(i.register(t.model,t.modelSchema),!n)return;o.for("upcast").elementToElement({model:l,view:n,converterPriority:e.priorities.low+2}),o.for("downcast").elementToElement({model:l,view:(e,{writer:r})=>t.isEmpty?r.createEmptyElement(n):r.createContainerElement(n)})}n&&(i.extend(t.model,{allowAttributes:q(n)}),o.for("upcast").add(Z(t,this)),o.for("downcast").add(tt(t)))}_registerInlineElement(t){const e=this.editor,r=e.model.schema,i=e.conversion,o=t.model;if(!t.appliesToBlock&&(r.extend("$text",{allowAttributes:o}),t.attributeProperties&&r.setAttributeProperties(o,t.attributeProperties),i.for("upcast").add(Q(t,this)),i.for("downcast").attributeToElement({model:o,view:J(t)}),t.allowEmpty)){if(r.setAttributeProperties(o,{copyFromObject:!1}),!r.isRegistered("htmlEmptyElement")){r.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"});const t=t=>Array.from(t.getAttributeKeys()).some(t=>t.startsWith("html"));e.model.document.registerPostFixer(r=>{const i=e.model.document.differ.getChanges(),o=new Set;for(const e of i)if("remove"!==e.type){if("attribute"===e.type&&null===e.attributeNewValue)for(const{item:r}of e.range)r.is("element","htmlEmptyElement")&&!t(r)&&o.add(r);if("insert"===e.type&&e.position.nodeAfter){const i=e.position.nodeAfter;for(const{item:e}of r.createRangeOn(i))e.is("element","htmlEmptyElement")&&!t(e)&&o.add(e)}}for(const t of o)r.remove(t);return o.size>0})}e.data.htmlProcessor.domConverter.registerInlineObjectMatcher(e=>e.name==t.view&&e.isEmpty&&Array.from(e.getAttributeKeys()).length?{name:!0}:null),i.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:Y(t,!0)}),i.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:Y(t)})}}}function St(t,e,r){const i=e.matchAll(t)||[],o=t.document.stylesProcessor;return i.reduce((e,{match:i})=>{for(const[n,l]of i.attributes||[])if("style"==n){const i=l,n=o.getRelatedStyles(i).filter(t=>t.split("-").length>i.split("-").length).sort((t,e)=>e.split("-").length-t.split("-").length);for(const i of n)r.consume(t,{styles:[i]})&&e.styles.push(i);r.consume(t,{styles:[i]})&&e.styles.push(i)}else if("class"==n){const i=l;r.consume(t,{classes:[i]})&&e.classes.push(i)}else r.consume(t,{attributes:[n]})&&e.attributes.push(n);return e},{attributes:[],classes:[],styles:[]})}function kt(t,r){const i={};for(const o of r){const r=t.getAttribute(o);void 0!==r&&(0,e.isValidAttributeName)(o)&&(i[o]=r)}return i}function Ot(t,e){const r=new o.StylesMap(t.document.stylesProcessor);for(const i of e){const e=t.getStyle(i);void 0!==e&&r.set(i,e)}return Object.fromEntries(r.getStylesEntries())}function Ct(t,e){const{name:r}=t,i=t[e];return nt(i)?Object.entries(i).map(([t,i])=>({name:r,[e]:{[t]:i}})):Array.isArray(i)?i.map(t=>({name:r,[e]:[t]})):[t]}function jt(t){const{name:e,attributes:r,classes:i,styles:o}=t,n=[];return r&&n.push(...Ct({name:e,attributes:r},"attributes")),i&&n.push(...Ct({name:e,classes:i},"classes")),o&&n.push(...Ct({name:e,styles:o},"styles")),n}class Pt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const t=this.editor.plugins.get(Et);t.on("register:pre",(e,r)=>{if("codeBlock"!==r.model)return;const i=this.editor,o=i.model.schema,n=i.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),n.for("upcast").add(function(t){return e=>{e.on("element:code",(e,r,i)=>{const o=r.viewItem,n=o.parent;function l(e,o){const n=t.processViewAttributes(e,i);n&&i.writer.setAttribute(o,n,r.modelRange)}n&&n.is("element","pre")&&(l(n,"htmlPreAttributes"),l(o,"htmlContentAttributes"))},{priority:"low"})}}(t)),n.for("downcast").add(t=>{t.on("attribute:htmlPreAttributes:codeBlock",(t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=r.mapper.toViewElement(e.item).parent;V(r.writer,i,o,n)}),t.on("attribute:htmlContentAttributes:codeBlock",(t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=r.mapper.toViewElement(e.item);V(r.writer,i,o,n)})}),e.stop()})}}class Ft extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(Et).on("register",(t,r)=>{const i=r,o=this.editor,n=o.model.schema,l=o.conversion;if(!i.paragraphLikeModel)return;if(n.isRegistered(i.model)||n.isRegistered(i.paragraphLikeModel))return;const s={model:i.paragraphLikeModel,view:i.view};n.register(i.model,i.modelSchema),n.register(s.model,{inheritAllFrom:"$block"}),l.for("upcast").elementToElement({view:i.view,model:(t,{writer:e})=>this._hasBlockContent(t)?e.createElement(i.model):e.createElement(s.model),converterPriority:e.priorities.low+.5}),l.for("downcast").elementToElement({view:i.view,model:i.model}),this._addAttributeConversion(i),l.for("downcast").elementToElement({view:s.view,model:s.model}),this._addAttributeConversion(s),t.stop()})}_hasBlockContent(t){const e=this.editor.editing.view,r=e.domConverter.blockElements;for(const i of e.createRangeIn(t).getItems())if(i.is("element")&&r.includes(i.name))return!0;return!1}_addAttributeConversion(t){const e=this.editor,r=e.conversion,i=e.plugins.get(Et);e.model.schema.extend(t.model,{allowAttributes:q(t.view)}),r.for("upcast").add(Z(t,i)),r.for("downcast").add(tt(t))}}var _t=r(888);class It extends t.Plugin{static get requires(){return[mt,_t.Enter]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("HeadingEditing"))return;const e=t.config.get("heading.options");this.registerHeadingElements(t,e)}registerHeadingElements(t,e){const r=t.plugins.get(mt),i=[];for(const t of e)"model"in t&&"view"in t&&(r.registerBlockElement({view:t.view,model:t.model}),i.push(t.model));r.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:i}}),r.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:i}})}}function $t(t,e,r){const i=t.createRangeOn(e);for(const{item:t}of i.getWalker())if(t.is("element",r))return t}class Tt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("ImageInlineEditing")&&!t.plugins.has("ImageBlockEditing"))return;const e=t.model.schema,r=t.conversion,i=t.plugins.get(Et);i.on("register:figure",()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",(e,r,i)=>{const o=r.viewItem;if(!r.modelRange||!o.hasClass("image"))return;const n=t.processViewAttributes(o,i);n&&i.writer.setAttribute("htmlFigureAttributes",n,r.modelRange)},{priority:"low"})}}(i))}),i.on("register:img",(o,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:img",(e,r,i)=>{if(!r.modelRange)return;const o=r.viewItem,n=t.processViewAttributes(o,i);n&&i.writer.setAttribute("htmlImgAttributes",n,r.modelRange)},{priority:"low"})}}(i)),r.for("downcast").add(t=>{function e(e){t.on(`attribute:${e}:imageInline`,(t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=r.mapper.toViewElement(e.item);V(r.writer,i,o,n)},{priority:"low"})}function r(e,r){t.on(`attribute:${r}:imageBlock`,(t,r,i)=>{if(!i.consumable.test(r.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=r,l=i.mapper.toViewElement(r.item),s=$t(i.writer,l,e);s&&(V(i.writer,o,n,s),i.consumable.consume(r.item,t.name))},{priority:"low"}),"a"===e&&t.on("attribute:linkHref:imageBlock",(t,e,r)=>{if(!r.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock"))return;const i=r.mapper.toViewElement(e.item),o=$t(r.writer,i,"a");N(r.writer,e.item.getAttribute("htmlLinkAttributes"),o)},{priority:"low"})}e("htmlImgAttributes"),r("img","htmlImgAttributes"),r("figure","htmlFigureAttributes"),r("a","htmlLinkAttributes")}),t.plugins.has("LinkImage")&&r.for("upcast").add(function(t,e){const r=e.plugins.get("ImageUtils");return e=>{e.on("element:a",(e,i,o)=>{const n=i.viewItem;if(!r.findViewImgElement(n))return;const l=i.modelCursor.parent;if(!l.is("element","imageBlock"))return;const s=t.processViewAttributes(n,o);s&&o.writer.setAttribute("htmlLinkAttributes",s,l)},{priority:"low"})}}(i,t)),o.stop())})}}class Bt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("MediaEmbed")||t.config.get("mediaEmbed.previewsInData"))return;const e=t.model.schema,r=t.conversion,i=this.editor.plugins.get(Et),o=this.editor.plugins.get(mt),n=t.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:n}),i.on("register:figure",()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",(e,r,i)=>{const o=r.viewItem;if(!r.modelRange||!o.hasClass("media"))return;const n=t.processViewAttributes(o,i);n&&i.writer.setAttribute("htmlFigureAttributes",n,r.modelRange)},{priority:"low"})}}(i))}),i.on(`register:${n}`,(t,o)=>{"media"===o.model&&(e.extend("media",{allowAttributes:[q(n),"htmlFigureAttributes"]}),r.for("upcast").add(function(t,e){const r=(r,i,o)=>{function n(e,r){const n=t.processViewAttributes(e,o);n&&o.writer.setAttribute(r,n,i.modelRange)}n(i.viewItem,q(e))};return t=>{t.on(`element:${e}`,r,{priority:"low"})}}(i,n)),r.for("dataDowncast").add(function(t){return e=>{function r(t,r){e.on(`attribute:${r}:media`,(e,r,i)=>{if(!i.consumable.consume(r.item,e.name))return;const{attributeOldValue:o,attributeNewValue:n}=r,l=i.mapper.toViewElement(r.item),s=$t(i.writer,l,t);V(i.writer,o,n,s)})}r(t,q(t)),r("figure","htmlFigureAttributes")}}(n)),t.stop())})}}class xt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Et);t.on("register:script",(e,r)=>{const i=this.editor,o=i.model.schema,n=i.conversion;o.register("htmlScript",r.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"script"}),n.for("upcast").elementToElement({view:"script",model:G(r)}),n.for("upcast").add(Z(r,t)),n.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>X("script",t,e)}),n.for("downcast").add(tt(r)),e.stop()})}}const Dt=["width","max-width","min-width","height","min-height","max-height"];class Ht extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("TableEditing"))return;const e=t.model.schema,r=t.conversion,i=t.plugins.get(Et),o=t.plugins.get("TableUtils");i.on("register:figure",()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",(e,r,i)=>{const o=r.viewItem;if(!r.modelRange||!o.hasClass("table"))return;const n=t.processViewAttributes(o,i);n&&i.writer.setAttribute("htmlFigureAttributes",n,r.modelRange)},{priority:"low"})}}(i))}),i.on("register:table",(n,l)=>{"table"===l.model&&(e.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:table",(e,r,i)=>{if(!r.modelRange)return;const o=r.viewItem;n(o,"htmlTableAttributes");for(const t of o.getChildren())t.is("element","thead")&&n(t,"htmlTheadAttributes"),t.is("element","tbody")&&n(t,"htmlTbodyAttributes");function n(e,o){const n=t.processViewAttributes(e,i);n&&i.writer.setAttribute(o,n,r.modelRange)}},{priority:"low"})}}(i)),r.for("downcast").add(t=>{function e(e,r){t.on(`attribute:${r}:table`,(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;const n=o.mapper.toViewElement(i.item),l=$t(o.writer,n,e);if(l)if(o.consumable.consume(i.item,t.name),"htmlTableAttributes"===r&&n!==l){const t=Rt(i.attributeOldValue),e=Rt(i.attributeNewValue);V(o.writer,t.tableAttributes,e.tableAttributes,l),V(o.writer,t.figureAttributes,e.figureAttributes,n)}else V(o.writer,i.attributeOldValue,i.attributeNewValue,l)})}e("table","htmlTableAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes")}),t.model.document.registerPostFixer(function(t,e){return r=>{const i=t.document.differ.getChanges();let o=!1;for(const t of i){if("attribute"!=t.type||"headingRows"!=t.attributeKey)continue;const i=t.range.start.nodeAfter,n=i.getAttribute("htmlTheadAttributes"),l=i.getAttribute("htmlTbodyAttributes");n&&!t.attributeNewValue?(r.removeAttribute("htmlTheadAttributes",i),o=!0):l&&t.attributeNewValue==e.getRows(i)&&(r.removeAttribute("htmlTbodyAttributes",i),o=!0)}return o}}(t.model,o)),n.stop())})}}function Rt(t){const e={},r={...t};if(!t||!("styles"in t))return{figureAttributes:e,tableAttributes:r};r.styles={};for(const[i,o]of Object.entries(t.styles))Dt.includes(i)?e.styles={...e.styles,[i]:o}:r.styles={...r.styles,[i]:o};return{figureAttributes:e,tableAttributes:r}}class Vt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Et);t.on("register:style",(e,r)=>{const i=this.editor,o=i.model.schema,n=i.conversion;o.register("htmlStyle",r.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"style"}),n.for("upcast").elementToElement({view:"style",model:G(r)}),n.for("upcast").add(Z(r,t)),n.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>X("style",t,e)}),n.for("downcast").add(tt(r)),e.stop()})}}function Nt(t){if(!t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e))&&"[object Object]"===Object.prototype.toString.call(t)}function Mt(t,e,r,i,o,n,l){const s=l(t,e,r,i,o,n);if(void 0!==s)return s;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===e;case"number":return t===e||Object.is(t,e);case"object":return Lt(t,e,n,l)}return Lt(t,e,n,l)}function Lt(t,e,r,i){if(Object.is(t,e))return!0;let o=s(t),n=s(e);if(o===d&&(o=A),n===d&&(n=A),o!==n)return!1;switch(o){case m:return t.toString()===e.toString();case c:{const r=t.valueOf(),i=e.valueOf();return(_=r)===(I=i)||Number.isNaN(_)&&Number.isNaN(I)}case u:case f:case h:return Object.is(t.valueOf(),e.valueOf());case a:return t.source===e.source&&t.flags===e.flags;case"[object Function]":return t===e}var _,I;const $=(r=r??new Map).get(t),T=r.get(e);if(null!=$&&null!=T)return $===e;r.set(t,e),r.set(e,t);try{switch(o){case g:if(t.size!==e.size)return!1;for(const[o,n]of t.entries())if(!e.has(o)||!Mt(n,e.get(o),o,t,e,r,i))return!1;return!0;case b:{if(t.size!==e.size)return!1;const o=Array.from(t.values()),n=Array.from(e.values());for(let l=0;l<o.length;l++){const s=o[l],a=n.findIndex(o=>Mt(s,o,void 0,t,e,r,i));if(-1===a)return!1;n.splice(a,1)}return!0}case p:case v:case E:case S:case k:case"[object BigUint64Array]":case O:case C:case j:case"[object BigInt64Array]":case P:case F:if("undefined"!=typeof Buffer&&Buffer.isBuffer(t)!==Buffer.isBuffer(e))return!1;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!Mt(t[o],e[o],o,t,e,r,i))return!1;return!0;case w:return t.byteLength===e.byteLength&&Lt(new Uint8Array(t),new Uint8Array(e),r,i);case y:return t.byteLength===e.byteLength&&t.byteOffset===e.byteOffset&&Lt(new Uint8Array(t),new Uint8Array(e),r,i);case"[object Error]":return t.name===e.name&&t.message===e.message;case A:{if(!(Lt(t.constructor,e.constructor,r,i)||Nt(t)&&Nt(e)))return!1;const o=[...Object.keys(t),...l(t)],n=[...Object.keys(e),...l(e)];if(o.length!==n.length)return!1;for(let n=0;n<o.length;n++){const l=o[n],s=t[l];if(!Object.hasOwn(e,l))return!1;if(!Mt(s,e[l],l,t,e,r,i))return!1}return!0}default:return!1}}finally{r.delete(t),r.delete(e)}}function Ut(){}function zt(t,e){return function(t,e,r){return Mt(t,e,void 0,void 0,void 0,void 0,r)}(t,e,Ut)}class Wt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("ListEditing"))return;const e=t.model.schema,r=t.conversion,i=t.plugins.get(Et),o=t.plugins.get("ListEditing"),n=t.plugins.get("ListUtils"),l=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:N}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:N}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:N}),i.on("register",(t,o)=>{if(!l.includes(o.view))return;if(t.stop(),e.checkAttribute("$block","htmlLiAttributes"))return;const n=l.map(t=>q(t));e.extend("$listItem",{allowAttributes:n}),r.for("upcast").add(t=>{t.on("element:ul",qt("htmlUlAttributes",i),{priority:"low"}),t.on("element:ol",qt("htmlOlAttributes",i),{priority:"low"}),t.on("element:li",qt("htmlLiAttributes",i),{priority:"low"})})}),o.on("postFixer",(t,{listNodes:e,writer:r})=>{for(const{node:i,previousNodeInList:o}of e)if(o){if(o.getAttribute("listType")==i.getAttribute("listType")){const e=Gt(o.getAttribute("listType")),n=o.getAttribute(e);!zt(i.getAttribute(e),n)&&r.model.schema.checkAttribute(i,e)&&(r.setAttribute(e,n,i),t.return=!0)}if(o.getAttribute("listItemId")==i.getAttribute("listItemId")){const e=o.getAttribute("htmlLiAttributes");!zt(i.getAttribute("htmlLiAttributes"),e)&&r.model.schema.checkAttribute(i,"htmlLiAttributes")&&(r.setAttribute("htmlLiAttributes",e,i),t.return=!0)}}}),o.on("postFixer",(t,{listNodes:e,writer:r})=>{for(const{node:i}of e){const e=i.getAttribute("listType");!n.isNumberedListType(e)&&i.getAttribute("htmlOlAttributes")&&(r.removeAttribute("htmlOlAttributes",i),t.return=!0),n.isNumberedListType(e)&&i.getAttribute("htmlUlAttributes")&&(r.removeAttribute("htmlUlAttributes",i),t.return=!0)}})}afterInit(){const t=this.editor;if(!t.commands.get("indentList"))return;const e=t.commands.get("indentList");this.listenTo(e,"afterExecute",(e,r)=>{t.model.change(e=>{for(const i of r){const r=Gt(i.getAttribute("listType"));t.model.schema.checkAttribute(i,r)&&e.setAttribute(r,{},i)}})})}}function qt(t,e){return(r,i,o)=>{const n=i.viewItem;i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor));const l=e.processViewAttributes(n,o);for(const e of i.modelRange.getItems({shallow:!0}))e.hasAttribute("listItemId")&&(e.hasAttribute("htmlUlAttributes")||e.hasAttribute("htmlOlAttributes")||o.writer.model.schema.checkAttribute(e,t)&&o.writer.setAttribute(t,l||{},e))}}function Gt(t){return"numbered"===t||"customNumbered"==t?"htmlOlAttributes":"htmlUlAttributes"}class Kt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"HorizontalLineElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("HorizontalLineEditing"))return;const e=t.model.schema,r=t.conversion,i=t.plugins.get(Et);i.on("register:hr",(t,o)=>{"horizontalLine"===o.model&&(e.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),r.for("upcast").add(Z(o,i)),r.for("downcast").add(t=>{t.on("attribute:htmlHrAttributes:horizontalLine",(t,e,r)=>{if(!r.consumable.test(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=r.mapper.toViewElement(e.item),l=$t(r.writer,n,"hr");l&&(V(r.writer,i,o,l),r.consumable.consume(e.item,t.name))},{priority:"low"})}),t.stop())})}}class Xt extends t.Plugin{static get requires(){return[Et,mt]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Et),e=this.editor.plugins.get(mt);t.on("register:$customElement",(r,i)=>{r.stop();const n=this.editor,l=n.model.schema,s=n.conversion,a=n.editing.view.domConverter.unsafeElements,m=n.data.htmlProcessor.domConverter.preElements;l.register(i.model,i.modelSchema),l.extend(i.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),n.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),s.for("upcast").elementToElement({view:/.*/,model:(r,l)=>{if("$comment"==r.name)return null;if(!function(t){try{document.createElement(t)}catch{return!1}return!0}(r.name))return null;if(e.getDefinitionsForView(r.name).size)return null;a.includes(r.name)||a.push(r.name),m.includes(r.name)||m.push(r.name);const s=l.writer.createElement(i.model,{htmlElementName:r.name}),c=t.processViewAttributes(r,l);let u;if(c&&l.writer.setAttribute("htmlCustomElementAttributes",c,s),r.is("element","template")&&r.getCustomProperty("$rawContent"))u=r.getCustomProperty("$rawContent");else{const t=new o.ViewUpcastWriter(r.document).createDocumentFragment(r),e=n.data.htmlProcessor.domConverter.viewToDom(t),i=e.firstChild;for(;i.firstChild;)e.appendChild(i.firstChild);i.remove(),u=n.data.htmlProcessor.htmlWriter.getHtml(e)}l.writer.setAttribute("htmlContent",u,s);for(const{item:t}of n.editing.view.createRangeIn(r))l.consumable.consume(t,{name:!0});return s},converterPriority:"low"}),s.for("editingDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),i=e.createRawElement(r);return t.hasAttribute("htmlCustomElementAttributes")&&N(e,t.getAttribute("htmlCustomElementAttributes"),i),i}}),s.for("dataDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),i=t.getAttribute("htmlContent"),o=e.createRawElement(r,null,(t,e)=>{e.setContentOf(t,i)});return t.hasAttribute("htmlCustomElementAttributes")&&N(e,t.getAttribute("htmlCustomElementAttributes"),o),o}})})}}class Qt extends t.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[Et,Pt,Ft,It,Tt,Bt,xt,Ht,Vt,Wt,Kt,Xt]}init(){const t=this.editor,e=t.plugins.get(Et);e.loadAllowedEmptyElementsConfig(t.config.get("htmlSupport.allowEmpty")||[]),e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}afterInit(){const t=this.editor.commands.get("removeFormat");t?.registerCustomAttribute(t=>t.startsWith("html")&&t.endsWith("Attributes"),z)}getGhsAttributeNameForElement(t){const e=this.editor.plugins.get("DataSchema"),r=Array.from(e.getDefinitionsForView(t,!1)),i=r.find(t=>t.isInline&&!r[0].isObject);return i?i.model:q(t)}addModelHtmlClass(t,r,i){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change(t=>{for(const l of Yt(o,i,n))U(t,l,n,"classes",t=>{for(const i of(0,e.toArray)(r))t.add(i)})})}removeModelHtmlClass(t,r,i){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change(t=>{for(const l of Yt(o,i,n))U(t,l,n,"classes",t=>{for(const i of(0,e.toArray)(r))t.delete(i)})})}setModelHtmlAttributes(t,e,r){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change(t=>{for(const n of Yt(i,r,o))U(t,n,o,"attributes",t=>{for(const[r,i]of Object.entries(e))t.set(r,i)})})}removeModelHtmlAttributes(t,r,i){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change(t=>{for(const l of Yt(o,i,n))U(t,l,n,"attributes",t=>{for(const i of(0,e.toArray)(r))t.delete(i)})})}setModelHtmlStyles(t,e,r){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change(t=>{for(const n of Yt(i,r,o))U(t,n,o,"styles",t=>{for(const[r,i]of Object.entries(e))t.set(r,i)})})}removeModelHtmlStyles(t,r,i){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change(t=>{for(const l of Yt(o,i,n))U(t,l,n,"styles",t=>{for(const i of(0,e.toArray)(r))t.delete(i)})})}}function*Yt(t,e,r){if(e)if(!(Symbol.iterator in e)&&e.is("documentSelection")&&e.isCollapsed)t.schema.checkAttributeInSelection(e,r)&&(yield e);else for(const i of function(t,e,r){return!(Symbol.iterator in e)&&(e.is("node")||e.is("$text")||e.is("$textProxy"))?t.schema.checkAttribute(e,r)?[t.createRangeOn(e)]:[]:t.schema.getValidRanges(t.createSelection(e).getRanges(),r)}(t,e,r))yield*i.getItems({shallow:!0})}class Jt extends t.Plugin{static get pluginName(){return"HtmlComment"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,r=new Map;t.data.processor.skipComments=!1,t.model.schema.addAttributeCheck((t,e)=>{if(t.endsWith("$root")&&e.startsWith("$comment"))return!0}),t.conversion.for("upcast").elementToMarker({view:"$comment",model:t=>{const i=`$comment:${(0,e.uid)()}`,o=t.getCustomProperty("$rawContent");return r.set(i,o),i}}),t.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:e})=>{let r;for(const e of this.editor.model.document.getRootNames())if(r=this.editor.model.document.getRoot(e),r.hasAttribute(t.markerName))break;const i=t.markerName,o=r.getAttribute(i),n=e.createUIElement("$comment");return e.setCustomProperty("$rawContent",o,n),n}}),t.model.document.registerPostFixer(e=>{let i=!1;const o=t.model.document.differ.getChangedMarkers().filter(t=>t.name.startsWith("$comment:"));for(const t of o){const{oldRange:o,newRange:n}=t.data;if(!o||!n||o.root!=n.root){if(o){const r=o.root;r.hasAttribute(t.name)&&(e.removeAttribute(t.name,r),i=!0)}if(n){const o=n.root;"$graveyard"==o.rootName?(e.removeMarker(t.name),i=!0):o.hasAttribute(t.name)||(e.setAttribute(t.name,r.get(t.name)||"",o),i=!0)}}}return i}),t.data.on("set",()=>{for(const e of t.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(e.name)},{priority:"high"}),t.model.on("deleteContent",(e,[r])=>{for(const e of r.getRanges()){const r=t.model.schema.getLimitElement(e),i=t.model.createPositionAt(r,0),o=t.model.createPositionAt(r,"end");let n;n=i.isTouching(e.start)&&o.isTouching(e.end)?this.getHtmlCommentsInRange(t.model.createRange(i,o)):this.getHtmlCommentsInRange(e,{skipBoundaries:!0});for(const t of n)this.removeHtmlComment(t)}},{priority:"high"})}createHtmlComment(t,r){const i=(0,e.uid)(),o=this.editor.model,n=o.document.getRoot(t.root.rootName),l=`$comment:${i}`;return o.change(e=>{const i=e.createRange(t);return e.addMarker(l,{usingOperation:!0,affectsData:!0,range:i}),e.setAttribute(l,r,n),l})}removeHtmlComment(t){const e=this.editor,r=e.model.markers.get(t);return!!r&&(e.model.change(t=>{t.removeMarker(r)}),!0)}getHtmlCommentData(t){const e=this.editor.model.markers.get(t);if(!e)return null;let r="";for(const e of this.editor.model.document.getRoots())if(e.hasAttribute(t)){r=e.getAttribute(t);break}return{content:r,position:e.getStart()}}getHtmlCommentsInRange(t,{skipBoundaries:e=!1}={}){const r=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter(e=>function(t,e){const i=t.getRange().start;return(i.isAfter(e.start)||r&&i.isEqual(e.start))&&(i.isBefore(e.end)||r&&i.isEqual(e.end))}(e,t)).map(t=>t.name)}}class Zt extends o.HtmlDataProcessor{toView(t){if(!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(t.trim().slice(0,1e4)))return super.toView(t);let e="",r="";t=(t=t.trim().replace(/<\?xml\s[^?]*\?>/i,t=>(r=t,""))).trim().replace(/^<!DOCTYPE\s[^>]*?>/i,t=>(e=t,""));const i=this._toDom(t),n=this.domConverter.domToView(i,{skipComments:this.skipComments}),l=new o.ViewUpcastWriter(n.document);l.setCustomProperty("$fullPageDocument",i.ownerDocument.documentElement.outerHTML,n);const s=Array.from(i.ownerDocument.querySelectorAll("head style"));return l.setCustomProperty("$fullPageHeadStyles",s,n),e&&l.setCustomProperty("$fullPageDocType",e,n),r&&l.setCustomProperty("$fullPageXmlDeclaration",r,n),n}toData(t){let e=super.toData(t);const r=t.getCustomProperty("$fullPageDocument"),i=t.getCustomProperty("$fullPageDocType"),o=t.getCustomProperty("$fullPageXmlDeclaration");return r&&(e=r.replace(/<\/body\s*>/,e+"$&"),i&&(e=i+"\n"+e),o&&(e=o+"\n"+e)),e}}class te extends t.Plugin{static get pluginName(){return"FullPage"}static get isOfficialPlugin(){return!0}constructor(t){super(t),t.config.define("htmlSupport.fullPage",{allowRenderStylesFromHead:!1,sanitizeCss:t=>((0,e.logWarning)("css-full-page-provide-sanitize-function"),{css:t,hasChanged:!1})}),t.data.processor=new Zt(t.data.viewDocument)}init(){const t=this.editor,e=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration","$fullPageHeadStyles"];t.model.schema.extend("$root",{allowAttributes:e}),t.data.on("toModel",(r,[i])=>{const o=t.model.document.getRoot();t.model.change(t=>{for(const r of e){const e=i.getCustomProperty(r);e&&t.setAttribute(r,e,o)}}),ee(t)&&this._renderStylesFromHead(o)},{priority:"low"}),t.data.on("toView",(t,[r])=>{if(!r.is("rootElement"))return;const i=r,n=t.return;if(!i.hasAttribute("$fullPageDocument"))return;const l=new o.ViewUpcastWriter(n.document);for(const t of e){const e=i.getAttribute(t);e&&l.setCustomProperty(t,e,n)}},{priority:"low"}),t.data.on("set",()=>{const r=t.model.document.getRoot();t.model.change(t=>{for(const i of e)r.hasAttribute(i)&&t.removeAttribute(i,r)})},{priority:"high"}),t.data.on("get",(t,e)=>{e[0]||(e[0]={}),e[0].trim=!1},{priority:"high"})}destroy(){super.destroy(),ee(this.editor)&&this._removeStyleElementsFromDom()}_removeStyleElementsFromDom(){const t=Array.from(e.global.document.querySelectorAll(`[data-full-page-style-id="${this.editor.id}"]`));for(const e of t)e.remove()}_renderStyleElementsInDom(t){const r=this.editor,i=t.getAttribute("$fullPageHeadStyles");if(!i)return;const o=r.config.get("htmlSupport.fullPage.sanitizeCss");for(const t of i){t.setAttribute("data-full-page-style-id",r.id);const i=o(t.innerText);i.hasChanged&&(t.innerText=i.css),e.global.document.head.append(t)}}_renderStylesFromHead(t){this._removeStyleElementsFromDom(),this._renderStyleElementsInDom(t)}}function ee(t){return t.config.get("htmlSupport.fullPage.allowRenderStylesFromHead")}const re="htmlEmptyBlock";class ie extends t.Plugin{static get pluginName(){return"EmptyBlock"}static get isOfficialPlugin(){return!0}afterInit(){const{model:t,conversion:e,plugins:r,config:i}=this.editor,o=t.schema,n=i.get("htmlSupport.preserveEmptyBlocksInEditingView");o.extend("$block",{allowAttributes:[re]}),o.extend("$container",{allowAttributes:[re]}),o.isRegistered("tableCell")&&o.extend("tableCell",{allowAttributes:[re]}),n?e.for("downcast").add(oe()):e.for("dataDowncast").add(oe()),e.for("upcast").add(function(t){return e=>{e.on("element",(e,r,i)=>{const{viewItem:o,modelRange:n}=r;if(!o.is("element")||!o.isEmpty||o.getCustomProperty("$hasBlockFiller"))return;const l=n&&n.start.nodeAfter;if(!l||!t.checkAttribute(l,re))return;if(i.writer.setAttribute(re,!0,l),1!=l.childCount)return;const s=l.getChild(0);s.is("element","paragraph")&&t.checkAttribute(s,re)&&i.writer.setAttribute(re,!0,s)},{priority:"lowest"})}}(o)),r.has("ClipboardPipeline")&&this._registerClipboardPastingHandler()}_registerClipboardPastingHandler(){const t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"contentInsertion",(t,e)=>{e.sourceEditorId!==this.editor.id&&this.editor.model.change(t=>{for(const{item:r}of t.createRangeIn(e.content))r.is("element")&&r.hasAttribute(re)&&t.removeAttribute(re,r)})})}}function oe(){return t=>{t.on(`attribute:${re}`,(t,e,r)=>{const{mapper:i,consumable:o}=r,{item:n}=e;if(!o.consume(n,t.name))return;const l=i.toViewElement(n);l&&e.attributeNewValue&&(l.getFillerOffset=()=>null)})}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=i})();
|
|
5
|
+
*/(()=>{var t={79:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(695),o=r.n(i),n=r(272),l=r.n(n)()(o());l.push([t.id,":root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}",""]);const s=l},212:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(r){t.setAttribute(r,e[r])})}},237:t=>{"use strict";t.exports=CKEditor5.dll},272:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r="",i=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),i&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),i&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r}).join("")},e.i=function(t,r,i,o,n){"string"==typeof t&&(t=[[null,t,void 0]]);var l={};if(i)for(var s=0;s<this.length;s++){var a=this[s][0];null!=a&&(l[a]=!0)}for(var m=0;m<t.length;m++){var c=[].concat(t[m]);i&&l[c[0]]||(void 0!==n&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=n),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),e.push(c))}},e}},507:t=>{"use strict";var e={};t.exports=function(t,r){var i=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}},520:t=>{"use strict";var e=[];function r(t){for(var r=-1,i=0;i<e.length;i++)if(e[i].identifier===t){r=i;break}return r}function i(t,i){for(var n={},l=[],s=0;s<t.length;s++){var a=t[s],m=i.base?a[0]+i.base:a[0],c=n[m]||0,u="".concat(m," ").concat(c);n[m]=c+1;var d=r(u),h={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)e[d].references++,e[d].updater(h);else{var f=o(h,i);i.byIndex=s,e.splice(s,0,{identifier:u,updater:f,references:1})}l.push(u)}return l}function o(t,e){var r=e.domAPI(e);r.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,o){var n=i(t=t||[],o=o||{});return function(t){t=t||[];for(var l=0;l<n.length;l++){var s=r(n[l]);e[s].references--}for(var a=i(t,o),m=0;m<n.length;m++){var c=r(n[m]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}n=a}}},584:(t,e,r)=>{t.exports=r(237)("./src/utils.js")},692:t=>{"use strict";var e,r=(e=[],function(t,r){return e[t]=r,e.filter(Boolean).join("\n")});function i(t,e,i,o){var n;if(i)n="";else{n="",o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var l=void 0!==o.layer;l&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,l&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}")}if(t.styleSheet)t.styleSheet.cssText=r(e,n);else{var s=document.createTextNode(n),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(s,a[e]):t.appendChild(s)}}var o={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=o.singletonCounter++,r=o.singleton||(o.singleton=t.insertStyleElement(t));return{update:function(t){i(r,e,!1,t)},remove:function(t){i(r,e,!0,t)}}}},695:t=>{"use strict";t.exports=function(t){return t[1]}},782:(t,e,r)=>{t.exports=r(237)("./src/core.js")},783:(t,e,r)=>{t.exports=r(237)("./src/engine.js")},888:(t,e,r)=>{t.exports=r(237)("./src/enter.js")},901:(t,e,r)=>{t.exports=r(237)("./src/widget.js")},964:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}}},e={};function r(i){var o=e[i];if(void 0!==o)return o.exports;var n=e[i]={id:i,exports:{}};return t[i](n,n.exports,r),n.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";r.r(i),r.d(i,{CodeBlockElementSupport:()=>Pt,CustomElementSupport:()=>Xt,DataFilter:()=>Et,DataSchema:()=>mt,DualContentModelElementSupport:()=>Ft,EmptyBlock:()=>ie,FullPage:()=>te,GeneralHtmlSupport:()=>Qt,HeadingElementSupport:()=>It,HorizontalLineElementSupport:()=>Kt,HtmlComment:()=>Jt,HtmlPageDataProcessor:()=>Zt,ImageElementSupport:()=>Tt,ListElementSupport:()=>Wt,MediaEmbedElementSupport:()=>Bt,ScriptElementSupport:()=>xt,StyleElementSupport:()=>Vt,TableElementSupport:()=>Ht,_HTML_SUPPORT_SCHEMA_DEFINITIONS:()=>et,_attributeToInlineHtmlSupportConverter:()=>J,_createObjectHtmlSupportView:()=>X,_emptyInlineModelElementToViewHtmlSupportConverter:()=>Y,_getHtmlSupportAttributeName:()=>q,_getHtmlSupportDescendantElement:()=>$t,_mergeHtmlSupportViewElementAttributes:()=>L,_modelToViewBlockAttributeHtmlSupportConverter:()=>tt,_modifyHtmlSupportGhsAttribute:()=>U,_removeHtmlSupportViewAttributes:()=>M,_setHtmlSupportViewAttributes:()=>N,_toHtmlSupportPascalCase:()=>W,_toObjectWidgetHtmlSupportConverter:()=>K,_updateHtmlSupportViewAttributes:()=>V,_viewToAttributeInlineHtmlSupportConverter:()=>Q,_viewToModelBlockAttributeHtmlSupportConverter:()=>Z,_viewToModelObjectContentHtmlSupportConverter:()=>G});var t=r(782),e=r(584),o=r(783),n=r(901);function l(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function s(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const a="[object RegExp]",m="[object String]",c="[object Number]",u="[object Boolean]",d="[object Arguments]",h="[object Symbol]",f="[object Date]",g="[object Map]",b="[object Set]",p="[object Array]",w="[object ArrayBuffer]",A="[object Object]",y="[object DataView]",v="[object Uint8Array]",E="[object Uint8ClampedArray]",S="[object Uint16Array]",k="[object Uint32Array]",O="[object Int8Array]",C="[object Int16Array]",j="[object Int32Array]",P="[object Float32Array]",F="[object Float64Array]";function _(t){return null==t||"object"!=typeof t&&"function"!=typeof t}function I(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function $(t,e,r,i=new Map,o=void 0){const n=o?.(t,e,r,i);if(null!=n)return n;if(_(t))return t;if(i.has(t))return i.get(t);if(Array.isArray(t)){const e=new Array(t.length);i.set(t,e);for(let n=0;n<t.length;n++)e[n]=$(t[n],n,r,i,o);return Object.hasOwn(t,"index")&&(e.index=t.index),Object.hasOwn(t,"input")&&(e.input=t.input),e}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,e}if(t instanceof Map){const e=new Map;i.set(t,e);for(const[n,l]of t)e.set(n,$(l,n,r,i,o));return e}if(t instanceof Set){const e=new Set;i.set(t,e);for(const n of t)e.add($(n,void 0,r,i,o));return e}if("undefined"!=typeof Buffer&&Buffer.isBuffer(t))return t.subarray();if(I(t)){const e=new(Object.getPrototypeOf(t).constructor)(t.length);i.set(t,e);for(let n=0;n<t.length;n++)e[n]=$(t[n],n,r,i,o);return e}if(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const e=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return i.set(t,e),T(e,t,r,i,o),e}if("undefined"!=typeof File&&t instanceof File){const e=new File([t],t.name,{type:t.type});return i.set(t,e),T(e,t,r,i,o),e}if(t instanceof Blob){const e=new Blob([t],{type:t.type});return i.set(t,e),T(e,t,r,i,o),e}if(t instanceof Error){const e=new t.constructor;return i.set(t,e),e.message=t.message,e.name=t.name,e.stack=t.stack,e.cause=t.cause,T(e,t,r,i,o),e}if("object"==typeof t&&function(t){switch(s(t)){case d:case p:case w:case y:case u:case f:case P:case F:case O:case C:case j:case g:case c:case A:case a:case b:case m:case h:case v:case E:case S:case k:return!0;default:return!1}}(t)){const e=Object.create(Object.getPrototypeOf(t));return i.set(t,e),T(e,t,r,i,o),e}return t}function T(t,e,r=t,i,o){const n=[...Object.keys(e),...l(e)];for(let l=0;l<n.length;l++){const s=n[l],a=Object.getOwnPropertyDescriptor(t,s);(null==a||a.writable)&&(t[s]=$(e[s],s,r,i,o))}}function B(t,e){return function(t,e){return $(t,void 0,t,new Map,e)}(t,(r,i,o,n)=>{const l=e?.(r,i,o,n);if(null!=l)return l;if("object"==typeof t)switch(Object.prototype.toString.call(t)){case c:case m:case u:{const e=new t.constructor(t?.valueOf());return T(e,t),e}case d:{const e={};return T(e,t),e.length=t.length,e[Symbol.iterator]=t[Symbol.iterator],e}default:return}})}function x(t){return B(t)}const D=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function H(t){if(null==t)return"";if("string"==typeof t)return t;if(Array.isArray(t))return t.map(H).join(",");const e=String(t);return"0"===e&&Object.is(Number(t),-0)?"-0":e}function R(t){const e=function(t){return Array.from(t.match(D)??[])}(function(t){return"string"!=typeof t&&(t=H(t)),t.replace(/['\u2019]/g,"")}(t).trim());let r="";for(let t=0;t<e.length;t++){const i=e[t];r&&(r+=" "),i===i.toUpperCase()?r+=i:r+=i[0].toUpperCase()+i.slice(1).toLowerCase()}return r}function V(t,e,r,i){e&&M(t,e,i),r&&N(t,r,i)}function N(t,e,r){if(e.attributes)for(const[i,o]of Object.entries(e.attributes))t.setAttribute(i,o,r);e.styles&&t.setStyle(e.styles,r),e.classes&&t.addClass(e.classes,r)}function M(t,e,r){if(e.attributes)for(const[i]of Object.entries(e.attributes))t.removeAttribute(i,r);if(e.styles)for(const i of Object.keys(e.styles))t.removeStyle(i,r);e.classes&&t.removeClass(e.classes,r)}function L(t,e){const r=x(t);let i="attributes";for(i in e)r[i]="classes"==i?Array.from(new Set([...t[i]||[],...e[i]])):{...t[i],...e[i]};return r}function U(t,e,r,i,o){const n=e.getAttribute(r),l={};for(const t of["attributes","styles","classes"]){if(t!=i){n&&n[t]&&(l[t]=n[t]);continue}if("classes"==i){const e=new Set(n&&n.classes||[]);o(e),e.size&&(l[t]=Array.from(e));continue}const e=new Map(Object.entries(n&&n[t]||{}));o(e),e.size&&(l[t]=Object.fromEntries(e))}Object.keys(l).length?e.is("documentSelection")?t.setSelectionAttribute(r,l):t.setAttribute(r,l,e):n&&(e.is("documentSelection")?t.removeSelectionAttribute(r):t.removeAttribute(r,e))}function z(t,e,r){for(const i of e.getItems({shallow:!0})){const e=i.getAttribute(t);e&&e.attributes&&Object.keys(e.attributes).length?Object.keys(e).length>1&&r.setAttribute(t,{attributes:e.attributes},i):r.removeAttribute(t,i)}}function W(t){return R(t).replace(/ /g,"")}function q(t){return`html${W(t)}Attributes`}function G({model:t}){return(e,r)=>r.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function K(t,{view:e,isInline:r}){const i=t.t;return(t,{writer:o})=>{const l=i("HTML object"),s=X(e,t,o),a=t.getAttribute(q(e));o.addClass("html-object-embed__content",s),a&&N(o,a,s);const m=o.createContainerElement(r?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},s);return(0,n.toWidget)(m,o,{label:l})}}function X(t,e,r){return r.createRawElement(t,null,(t,r)=>{r.setContentOf(t,e.getAttribute("htmlContent"))})}function Q({view:t,model:e,allowEmpty:r},i){return e=>{e.on(`element:${t}`,(t,e,n)=>{let l=i.processViewAttributes(e.viewItem,n);if(l||n.consumable.test(e.viewItem,{name:!0})){if(l=l||{},n.consumable.consume(e.viewItem,{name:!0}),e.modelRange||(e=Object.assign(e,n.convertChildren(e.viewItem,e.modelCursor))),r&&e.modelRange.isCollapsed&&Object.keys(l).length){const t=n.writer.createElement("htmlEmptyElement");if(!n.safeInsert(t,e.modelCursor))return;const r=n.getSplitParts(t);return e.modelRange=n.writer.createRange(e.modelRange.start,n.writer.createPositionAfter(r[r.length-1])),n.updateConversionResult(t,e),void o(t,l,n)}for(const t of e.modelRange.getItems())o(t,l,n)}},{priority:"low"})};function o(t,r,i){if(i.schema.checkAttribute(t,e)){const o=L(r,t.getAttribute(e)||{});i.writer.setAttribute(e,o,t)}}}function Y({model:t,view:e},r){return(i,{writer:o,consumable:l})=>{if(!i.hasAttribute(t))return null;const s=o.createContainerElement(e),a=i.getAttribute(t);return l.consume(i,`attribute:${t}`),N(o,a,s),s.getFillerOffset=()=>null,r?(0,n.toWidget)(s,o):s}}function J({priority:t,view:e}){return(r,i)=>{if(!r)return;const{writer:o}=i,n=o.createAttributeElement(e,null,{priority:t});return N(o,r,n),n}}function Z({view:t},e){return r=>{r.on(`element:${t}`,(t,r,i)=>{if(!r.modelRange||r.modelRange.isCollapsed)return;const o=e.processViewAttributes(r.viewItem,i);o&&i.writer.setAttribute(q(r.viewItem.name),o,r.modelRange)},{priority:"low"})}}function tt({view:t,model:e}){return r=>{r.on(`attribute:${q(t)}:${e}`,(t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e;V(r.writer,i,o,r.mapper.toViewElement(e.item))})}}const et={block:[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"horizontalLine",view:"hr"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlHr",view:"hr",isEmpty:!0,modelSchema:{inheritAllFrom:"$blockObject"}}],inline:[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{isFormatting:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}]};function rt(t){return"__proto__"===t}function it(t){return null!==t&&"object"==typeof t&&"[object Arguments]"===s(t)}function ot(t){return"object"==typeof t&&null!==t}function nt(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==Object.prototype.toString.call(t)){const e=t[Symbol.toStringTag];if(null==e)return!1;return!!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable&&t.toString()===`[object ${e}]`}let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function lt(t){return I(t)}function st(t,...e){const r=e.slice(0,-1),i=e[e.length-1];let o=t;for(let t=0;t<r.length;t++){o=at(o,r[t],i,new Map)}return o}function at(t,e,r,i){if(_(t)&&(t=Object(t)),null==e||"object"!=typeof e)return t;if(i.has(e))return function(t){if(_(t))return t;if(Array.isArray(t)||I(t)||t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t),r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const e=new r(t);return e.lastIndex=t.lastIndex,e}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){const e=new r(t.message);return e.stack=t.stack,e.name=t.name,e.cause=t.cause,e}if("undefined"!=typeof File&&t instanceof File)return new r([t],t.name,{type:t.type,lastModified:t.lastModified});if("object"==typeof t){const r=Object.create(e);return Object.assign(r,t)}return t}(i.get(e));if(i.set(e,t),Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]=e[t]??void 0}const o=[...Object.keys(e),...l(e)];for(let n=0;n<o.length;n++){const l=o[n];if(rt(l))continue;let s=e[l],a=t[l];if(it(s)&&(s={...s}),it(a)&&(a={...a}),"undefined"!=typeof Buffer&&Buffer.isBuffer(s)&&(s=x(s)),Array.isArray(s))if("object"==typeof a&&null!=a){const t=[],e=Reflect.ownKeys(a);for(let r=0;r<e.length;r++){const i=e[r];t[i]=a[i]}a=t}else a=[];const m=r(a,s,l,t,e,i);null!=m?t[l]=m:Array.isArray(s)||ot(a)&&ot(s)?t[l]=at(a,s,r,i):null==a&&nt(s)?t[l]=at({},s,r,i):null==a&<(s)?t[l]=x(s):void 0!==a&&void 0===s||(t[l]=s)}return t}class mt extends t.Plugin{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const t of et.block)this.registerBlockElement(t);for(const t of et.inline)this.registerInlineElement(t)}registerBlockElement(t){this._definitions.push({...t,isBlock:!0})}registerInlineElement(t){this._definitions.push({...t,isInline:!0})}extendBlockElement(t){this._extendDefinition({...t,isBlock:!0})}extendInlineElement(t){this._extendDefinition({...t,isInline:!0})}getDefinitionsForView(t,e=!1){const r=new Set;for(const i of this._getMatchingViewDefinitions(t)){if(e)for(const t of this._getReferences(i.model))r.add(t);r.add(i)}return r}getDefinitionsForModel(t){return this._definitions.filter(e=>e.model==t)}_getMatchingViewDefinitions(t){return this._definitions.filter(e=>e.view&&function(t,e){if("string"==typeof t)return t===e;if(t instanceof RegExp)return t.test(e);return!1}(t,e.view))}*_getReferences(t){const r=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],i=this._definitions.filter(e=>e.model==t);for(const{modelSchema:o}of i)if(o)for(const i of r)for(const r of(0,e.toArray)(o[i]||[])){const e=this._definitions.filter(t=>t.model==r);for(const i of e)r!==t&&(yield*this._getReferences(i.model),yield i)}}_extendDefinition(t){const e=Array.from(this._definitions.entries()).filter(([,e])=>e.model==t.model);if(0!=e.length)for(const[r,i]of e)this._definitions[r]=st({},i,t,(t,e)=>Array.isArray(t)?t.concat(e):void 0);else this._definitions.push(t)}}var ct=r(520),ut=r.n(ct),dt=r(692),ht=r.n(dt),ft=r(507),gt=r.n(ft),bt=r(212),pt=r.n(bt),wt=r(964),At=r.n(wt),yt=r(79),vt={attributes:{"data-cke":!0}};vt.setAttributes=pt(),vt.insert=gt().bind(null,"head"),vt.domAPI=ht(),vt.insertStyleElement=At();ut()(yt.A,vt);yt.A&&yt.A.locals&&yt.A.locals;class Et extends t.Plugin{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(t){super(t),this._dataSchema=t.plugins.get("DataSchema"),this._allowedAttributes=new o.Matcher,this._disallowedAttributes=new o.Matcher,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[mt,n.Widget]}loadAllowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=jt(e);this.allowElement(t),r.forEach(t=>this.allowAttributes(t))}}loadDisallowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=jt(e);0==r.length?this.disallowElement(t):r.forEach(t=>this.disallowAttributes(t))}}loadAllowedEmptyElementsConfig(t){for(const e of t)this.allowEmptyElement(e)}allowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!0))this._addAllowedElement(e),this._coupledAttributes=null}disallowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!1))this._disallowedElements.add(e.view)}allowEmptyElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!0))e.isInline&&this._dataSchema.extendInlineElement({...e,allowEmpty:!0})}allowAttributes(t){this._allowedAttributes.add(t)}disallowAttributes(t){this._disallowedAttributes.add(t)}processViewAttributes(t,e){const{consumable:r}=e;return St(t,this._disallowedAttributes,r),function(t,{attributes:e,classes:r,styles:i}){if(!e.length&&!r.length&&!i.length)return null;return{...e.length&&{attributes:kt(t,e)},...i.length&&{styles:Ot(t,i)},...r.length&&{classes:r}}}(t,St(t,this._allowedAttributes,r))}_addAllowedElement(t){if(!this._allowedElements.has(t)){if(this._allowedElements.add(t),"appliesToBlock"in t&&"string"==typeof t.appliesToBlock)for(const e of this._dataSchema.getDefinitionsForModel(t.appliesToBlock))e.isBlock&&this._addAllowedElement(e);this._dataInitialized&&this.editor.data.once("set",()=>{this._fireRegisterEvent(t)},{priority:e.priorities.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",()=>{this._dataInitialized=!0;for(const t of this._allowedElements)this._fireRegisterEvent(t)},{priority:e.priorities.highest+1})}_registerElementHandlers(){this.on("register",(t,r)=>{const i=this.editor.model.schema;if(r.isObject&&!i.isRegistered(r.model))this._registerObjectElement(r);else if(r.isBlock)this._registerBlockElement(r);else{if(!r.isInline)throw new e.CKEditorError("data-filter-invalid-definition",null,r);this._registerInlineElement(r)}t.stop()},{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const t=this.editor.model,e=t.document.selection;t.document.registerPostFixer(e=>{const r=t.document.differ.getChanges();let i=!1;const o=this._getCoupledAttributesMap();for(const t of r){if("attribute"!=t.type||null!==t.attributeNewValue)continue;const r=o.get(t.attributeKey);if(r)for(const{item:o}of t.range.getWalker())for(const t of r)o.hasAttribute(t)&&(e.removeAttribute(t,o),i=!0)}return i}),this.listenTo(e,"change:attribute",(r,{attributeKeys:i})=>{const o=new Set,n=this._getCoupledAttributesMap();for(const t of i){if(e.hasAttribute(t))continue;const r=n.get(t);if(r)for(const t of r)e.hasAttribute(t)&&o.add(t)}0!=o.size&&t.change(t=>{for(const e of o)t.removeSelectionAttribute(e)})})}_registerAssociatedHtmlAttributesPostFixer(){const t=this.editor.model;t.document.registerPostFixer(e=>{const r=t.document.differ.getChanges();let i=!1;for(const o of r)if("insert"===o.type&&"$text"!==o.name)for(const r of o.attributes.keys())r.startsWith("html")&&r.endsWith("Attributes")&&(t.schema.checkAttribute(o.name,r)||(e.removeAttribute(r,o.position.nodeAfter),i=!0));return i})}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const t of this._allowedElements)if(t.coupledAttribute&&t.model){const e=this._coupledAttributes.get(t.coupledAttribute);e?e.push(t.model):this._coupledAttributes.set(t.coupledAttribute,[t.model])}return this._coupledAttributes}_fireRegisterEvent(t){t.view&&this._disallowedElements.has(t.view)||this.fire(t.view?`register:${t.view}`:"register",t)}_registerObjectElement(t){const r=this.editor,i=r.model.schema,o=r.conversion,{view:n,model:l}=t;i.register(l,t.modelSchema),n&&(i.extend(t.model,{allowAttributes:[q(n),"htmlContent"]}),r.data.registerRawContentMatcher({name:n}),o.for("upcast").elementToElement({view:n,model:G(t),converterPriority:e.priorities.low+2}),o.for("upcast").add(Z(t,this)),o.for("editingDowncast").elementToStructure({model:{name:l,attributes:[q(n)]},view:K(r,t)}),o.for("dataDowncast").elementToElement({model:l,view:(t,{writer:e})=>X(n,t,e)}),o.for("dataDowncast").add(tt(t)))}_registerBlockElement(t){const r=this.editor,i=r.model.schema,o=r.conversion,{view:n,model:l}=t;if(!i.isRegistered(t.model)){if(!t.modelSchema)return;if(i.register(t.model,t.modelSchema),!n)return;o.for("upcast").elementToElement({model:l,view:n,converterPriority:e.priorities.low+2}),o.for("downcast").elementToElement({model:l,view:(e,{writer:r})=>t.isEmpty?r.createEmptyElement(n):r.createContainerElement(n)})}n&&(i.extend(t.model,{allowAttributes:q(n)}),o.for("upcast").add(Z(t,this)),o.for("downcast").add(tt(t)))}_registerInlineElement(t){const e=this.editor,r=e.model.schema,i=e.conversion,o=t.model;if(!t.appliesToBlock&&(r.extend("$text",{allowAttributes:o}),t.attributeProperties&&r.setAttributeProperties(o,t.attributeProperties),i.for("upcast").add(Q(t,this)),i.for("downcast").attributeToElement({model:o,view:J(t)}),t.allowEmpty)){if(r.setAttributeProperties(o,{copyFromObject:!1}),!r.isRegistered("htmlEmptyElement")){r.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"});const t=t=>Array.from(t.getAttributeKeys()).some(t=>t.startsWith("html"));e.model.document.registerPostFixer(r=>{const i=e.model.document.differ.getChanges(),o=new Set;for(const e of i)if("remove"!==e.type){if("attribute"===e.type&&null===e.attributeNewValue)for(const{item:r}of e.range)r.is("element","htmlEmptyElement")&&!t(r)&&o.add(r);if("insert"===e.type&&e.position.nodeAfter){const i=e.position.nodeAfter;for(const{item:e}of r.createRangeOn(i))e.is("element","htmlEmptyElement")&&!t(e)&&o.add(e)}}for(const t of o)r.remove(t);return o.size>0})}e.data.htmlProcessor.domConverter.registerInlineObjectMatcher(e=>e.name==t.view&&e.isEmpty&&Array.from(e.getAttributeKeys()).length?{name:!0}:null),i.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:Y(t,!0)}),i.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:Y(t)})}}}function St(t,e,r){const i=e.matchAll(t)||[],o=t.document.stylesProcessor;return i.reduce((e,{match:i})=>{for(const[n,l]of i.attributes||[])if("style"==n){const i=l,n=o.getRelatedStyles(i).filter(t=>t.split("-").length>i.split("-").length).sort((t,e)=>e.split("-").length-t.split("-").length);for(const i of n)r.consume(t,{styles:[i]})&&e.styles.push(i);r.consume(t,{styles:[i]})&&e.styles.push(i)}else if("class"==n){const i=l;r.consume(t,{classes:[i]})&&e.classes.push(i)}else r.consume(t,{attributes:[n]})&&e.attributes.push(n);return e},{attributes:[],classes:[],styles:[]})}function kt(t,r){const i={};for(const o of r){const r=t.getAttribute(o);void 0!==r&&(0,e.isValidAttributeName)(o)&&(i[o]=r)}return i}function Ot(t,e){const r=new o.StylesMap(t.document.stylesProcessor);for(const i of e){const e=t.getStyle(i);void 0!==e&&r.set(i,e)}return Object.fromEntries(r.getStylesEntries())}function Ct(t,e){const{name:r}=t,i=t[e];return nt(i)?Object.entries(i).map(([t,i])=>({name:r,[e]:{[t]:i}})):Array.isArray(i)?i.map(t=>({name:r,[e]:[t]})):[t]}function jt(t){const{name:e,attributes:r,classes:i,styles:o}=t,n=[];return r&&n.push(...Ct({name:e,attributes:r},"attributes")),i&&n.push(...Ct({name:e,classes:i},"classes")),o&&n.push(...Ct({name:e,styles:o},"styles")),n}class Pt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const t=this.editor.plugins.get(Et);t.on("register:pre",(e,r)=>{if("codeBlock"!==r.model)return;const i=this.editor,o=i.model.schema,n=i.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),n.for("upcast").add(function(t){return e=>{e.on("element:code",(e,r,i)=>{const o=r.viewItem,n=o.parent;function l(e,o){const n=t.processViewAttributes(e,i);n&&i.writer.setAttribute(o,n,r.modelRange)}n&&n.is("element","pre")&&(l(n,"htmlPreAttributes"),l(o,"htmlContentAttributes"))},{priority:"low"})}}(t)),n.for("downcast").add(t=>{t.on("attribute:htmlPreAttributes:codeBlock",(t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=r.mapper.toViewElement(e.item).parent;V(r.writer,i,o,n)}),t.on("attribute:htmlContentAttributes:codeBlock",(t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=r.mapper.toViewElement(e.item);V(r.writer,i,o,n)})}),e.stop()})}}class Ft extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(Et).on("register",(t,r)=>{const i=r,o=this.editor,n=o.model.schema,l=o.conversion;if(!i.paragraphLikeModel)return;if(n.isRegistered(i.model)||n.isRegistered(i.paragraphLikeModel))return;const s={model:i.paragraphLikeModel,view:i.view};n.register(i.model,i.modelSchema),n.register(s.model,{inheritAllFrom:"$block"}),l.for("upcast").elementToElement({view:i.view,model:(t,{writer:e})=>this._hasBlockContent(t)?e.createElement(i.model):e.createElement(s.model),converterPriority:e.priorities.low+.5}),l.for("downcast").elementToElement({view:i.view,model:i.model}),this._addAttributeConversion(i),l.for("downcast").elementToElement({view:s.view,model:s.model}),this._addAttributeConversion(s),t.stop()})}_hasBlockContent(t){const e=this.editor.editing.view,r=e.domConverter.blockElements;for(const i of e.createRangeIn(t).getItems())if(i.is("element")&&r.includes(i.name))return!0;return!1}_addAttributeConversion(t){const e=this.editor,r=e.conversion,i=e.plugins.get(Et);e.model.schema.extend(t.model,{allowAttributes:q(t.view)}),r.for("upcast").add(Z(t,i)),r.for("downcast").add(tt(t))}}var _t=r(888);class It extends t.Plugin{static get requires(){return[mt,_t.Enter]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("HeadingEditing"))return;const e=t.config.get("heading.options");this.registerHeadingElements(t,e)}registerHeadingElements(t,e){const r=t.plugins.get(mt),i=[];for(const t of e)"model"in t&&"view"in t&&(r.registerBlockElement({view:t.view,model:t.model}),i.push(t.model));r.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:i}}),r.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:i}})}}function $t(t,e,r){const i=t.createRangeOn(e);for(const{item:t}of i.getWalker())if(t.is("element",r))return t}class Tt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("ImageInlineEditing")&&!t.plugins.has("ImageBlockEditing"))return;const e=t.model.schema,r=t.conversion,i=t.plugins.get(Et);i.on("register:figure",()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",(e,r,i)=>{const o=r.viewItem;if(!r.modelRange||!o.hasClass("image"))return;const n=t.processViewAttributes(o,i);n&&i.writer.setAttribute("htmlFigureAttributes",n,r.modelRange)},{priority:"low"})}}(i))}),i.on("register:img",(o,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:img",(e,r,i)=>{if(!r.modelRange)return;const o=r.viewItem,n=t.processViewAttributes(o,i);n&&i.writer.setAttribute("htmlImgAttributes",n,r.modelRange)},{priority:"low"})}}(i)),r.for("downcast").add(t=>{function e(e){t.on(`attribute:${e}:imageInline`,(t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=r.mapper.toViewElement(e.item);V(r.writer,i,o,n)},{priority:"low"})}function r(e,r){t.on(`attribute:${r}:imageBlock`,(t,r,i)=>{if(!i.consumable.test(r.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=r,l=i.mapper.toViewElement(r.item),s=$t(i.writer,l,e);s&&(V(i.writer,o,n,s),i.consumable.consume(r.item,t.name))},{priority:"low"}),"a"===e&&t.on("attribute:linkHref:imageBlock",(t,e,r)=>{if(!r.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock"))return;const i=r.mapper.toViewElement(e.item),o=$t(r.writer,i,"a");N(r.writer,e.item.getAttribute("htmlLinkAttributes"),o)},{priority:"low"})}e("htmlImgAttributes"),r("img","htmlImgAttributes"),r("figure","htmlFigureAttributes"),r("a","htmlLinkAttributes")}),t.plugins.has("LinkImage")&&r.for("upcast").add(function(t,e){const r=e.plugins.get("ImageUtils");return e=>{e.on("element:a",(e,i,o)=>{const n=i.viewItem;if(!r.findViewImgElement(n))return;const l=i.modelCursor.parent;if(!l.is("element","imageBlock"))return;const s=t.processViewAttributes(n,o);s&&o.writer.setAttribute("htmlLinkAttributes",s,l)},{priority:"low"})}}(i,t)),o.stop())})}}class Bt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("MediaEmbed")||t.config.get("mediaEmbed.previewsInData"))return;const e=t.model.schema,r=t.conversion,i=this.editor.plugins.get(Et),o=this.editor.plugins.get(mt),n=t.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:n}),i.on("register:figure",()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",(e,r,i)=>{const o=r.viewItem;if(!r.modelRange||!o.hasClass("media"))return;const n=t.processViewAttributes(o,i);n&&i.writer.setAttribute("htmlFigureAttributes",n,r.modelRange)},{priority:"low"})}}(i))}),i.on(`register:${n}`,(t,o)=>{"media"===o.model&&(e.extend("media",{allowAttributes:[q(n),"htmlFigureAttributes"]}),r.for("upcast").add(function(t,e){const r=(r,i,o)=>{function n(e,r){const n=t.processViewAttributes(e,o);n&&o.writer.setAttribute(r,n,i.modelRange)}n(i.viewItem,q(e))};return t=>{t.on(`element:${e}`,r,{priority:"low"})}}(i,n)),r.for("dataDowncast").add(function(t){return e=>{function r(t,r){e.on(`attribute:${r}:media`,(e,r,i)=>{if(!i.consumable.consume(r.item,e.name))return;const{attributeOldValue:o,attributeNewValue:n}=r,l=i.mapper.toViewElement(r.item),s=$t(i.writer,l,t);V(i.writer,o,n,s)})}r(t,q(t)),r("figure","htmlFigureAttributes")}}(n)),t.stop())})}}class xt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Et);t.on("register:script",(e,r)=>{const i=this.editor,o=i.model.schema,n=i.conversion;o.register("htmlScript",r.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"script"}),n.for("upcast").elementToElement({view:"script",model:G(r)}),n.for("upcast").add(Z(r,t)),n.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>X("script",t,e)}),n.for("downcast").add(tt(r)),e.stop()})}}const Dt=["width","max-width","min-width","height","min-height","max-height"];class Ht extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("TableEditing"))return;const e=t.model.schema,r=t.conversion,i=t.plugins.get(Et),o=t.plugins.get("TableUtils");i.on("register:figure",()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",(e,r,i)=>{const o=r.viewItem;if(!r.modelRange||!o.hasClass("table"))return;const n=t.processViewAttributes(o,i);n&&i.writer.setAttribute("htmlFigureAttributes",n,r.modelRange)},{priority:"low"})}}(i))}),i.on("register:table",(n,l)=>{"table"===l.model&&(e.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:table",(e,r,i)=>{if(!r.modelRange)return;const o=r.viewItem;n(o,"htmlTableAttributes");for(const t of o.getChildren())t.is("element","thead")&&n(t,"htmlTheadAttributes"),t.is("element","tbody")&&n(t,"htmlTbodyAttributes");function n(e,o){const n=t.processViewAttributes(e,i);n&&i.writer.setAttribute(o,n,r.modelRange)}},{priority:"low"})}}(i)),r.for("downcast").add(t=>{function e(e,r){t.on(`attribute:${r}:table`,(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;const n=o.mapper.toViewElement(i.item),l=$t(o.writer,n,e);if(l)if(o.consumable.consume(i.item,t.name),"htmlTableAttributes"===r&&n!==l){const t=Rt(i.attributeOldValue),e=Rt(i.attributeNewValue);V(o.writer,t.tableAttributes,e.tableAttributes,l),V(o.writer,t.figureAttributes,e.figureAttributes,n)}else V(o.writer,i.attributeOldValue,i.attributeNewValue,l)})}e("table","htmlTableAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes")}),t.model.document.registerPostFixer(function(t,e){return r=>{const i=t.document.differ.getChanges();let o=!1;for(const t of i){if("attribute"!=t.type||"headingRows"!=t.attributeKey)continue;const i=t.range.start.nodeAfter,n=i.getAttribute("htmlTheadAttributes"),l=i.getAttribute("htmlTbodyAttributes");n&&!t.attributeNewValue?(r.removeAttribute("htmlTheadAttributes",i),o=!0):l&&t.attributeNewValue==e.getRows(i)&&(r.removeAttribute("htmlTbodyAttributes",i),o=!0)}return o}}(t.model,o)),n.stop())})}}function Rt(t){const e={},r={...t};if(!t||!("styles"in t))return{figureAttributes:e,tableAttributes:r};r.styles={};for(const[i,o]of Object.entries(t.styles))Dt.includes(i)?e.styles={...e.styles,[i]:o}:r.styles={...r.styles,[i]:o};return{figureAttributes:e,tableAttributes:r}}class Vt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Et);t.on("register:style",(e,r)=>{const i=this.editor,o=i.model.schema,n=i.conversion;o.register("htmlStyle",r.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),i.data.registerRawContentMatcher({name:"style"}),n.for("upcast").elementToElement({view:"style",model:G(r)}),n.for("upcast").add(Z(r,t)),n.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>X("style",t,e)}),n.for("downcast").add(tt(r)),e.stop()})}}function Nt(t){if(!t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e))&&"[object Object]"===Object.prototype.toString.call(t)}function Mt(t,e,r,i,o,n,l){const s=l(t,e,r,i,o,n);if(void 0!==s)return s;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===e;case"number":return t===e||Object.is(t,e);case"object":return Lt(t,e,n,l)}return Lt(t,e,n,l)}function Lt(t,e,r,i){if(Object.is(t,e))return!0;let o=s(t),n=s(e);if(o===d&&(o=A),n===d&&(n=A),o!==n)return!1;switch(o){case m:return t.toString()===e.toString();case c:{const r=t.valueOf(),i=e.valueOf();return(_=r)===(I=i)||Number.isNaN(_)&&Number.isNaN(I)}case u:case f:case h:return Object.is(t.valueOf(),e.valueOf());case a:return t.source===e.source&&t.flags===e.flags;case"[object Function]":return t===e}var _,I;const $=(r=r??new Map).get(t),T=r.get(e);if(null!=$&&null!=T)return $===e;r.set(t,e),r.set(e,t);try{switch(o){case g:if(t.size!==e.size)return!1;for(const[o,n]of t.entries())if(!e.has(o)||!Mt(n,e.get(o),o,t,e,r,i))return!1;return!0;case b:{if(t.size!==e.size)return!1;const o=Array.from(t.values()),n=Array.from(e.values());for(let l=0;l<o.length;l++){const s=o[l],a=n.findIndex(o=>Mt(s,o,void 0,t,e,r,i));if(-1===a)return!1;n.splice(a,1)}return!0}case p:case v:case E:case S:case k:case"[object BigUint64Array]":case O:case C:case j:case"[object BigInt64Array]":case P:case F:if("undefined"!=typeof Buffer&&Buffer.isBuffer(t)!==Buffer.isBuffer(e))return!1;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!Mt(t[o],e[o],o,t,e,r,i))return!1;return!0;case w:return t.byteLength===e.byteLength&&Lt(new Uint8Array(t),new Uint8Array(e),r,i);case y:return t.byteLength===e.byteLength&&t.byteOffset===e.byteOffset&&Lt(new Uint8Array(t),new Uint8Array(e),r,i);case"[object Error]":return t.name===e.name&&t.message===e.message;case A:{if(!(Lt(t.constructor,e.constructor,r,i)||Nt(t)&&Nt(e)))return!1;const o=[...Object.keys(t),...l(t)],n=[...Object.keys(e),...l(e)];if(o.length!==n.length)return!1;for(let n=0;n<o.length;n++){const l=o[n],s=t[l];if(!Object.hasOwn(e,l))return!1;if(!Mt(s,e[l],l,t,e,r,i))return!1}return!0}default:return!1}}finally{r.delete(t),r.delete(e)}}function Ut(){}function zt(t,e){return function(t,e,r){return Mt(t,e,void 0,void 0,void 0,void 0,r)}(t,e,Ut)}class Wt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("ListEditing"))return;const e=t.model.schema,r=t.conversion,i=t.plugins.get(Et),o=t.plugins.get("ListEditing"),n=t.plugins.get("ListUtils"),l=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:N}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:N}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:N}),i.on("register",(t,o)=>{if(!l.includes(o.view))return;if(t.stop(),e.checkAttribute("$block","htmlLiAttributes"))return;const n=l.map(t=>q(t));e.extend("$listItem",{allowAttributes:n}),r.for("upcast").add(t=>{t.on("element:ul",qt("htmlUlAttributes",i),{priority:"low"}),t.on("element:ol",qt("htmlOlAttributes",i),{priority:"low"}),t.on("element:li",qt("htmlLiAttributes",i),{priority:"low"})})}),o.on("postFixer",(t,{listNodes:e,writer:r})=>{for(const{node:i,previousNodeInList:o}of e)if(o){if(o.getAttribute("listType")==i.getAttribute("listType")){const e=Gt(o.getAttribute("listType")),n=o.getAttribute(e);!zt(i.getAttribute(e),n)&&r.model.schema.checkAttribute(i,e)&&(r.setAttribute(e,n,i),t.return=!0)}if(o.getAttribute("listItemId")==i.getAttribute("listItemId")){const e=o.getAttribute("htmlLiAttributes");!zt(i.getAttribute("htmlLiAttributes"),e)&&r.model.schema.checkAttribute(i,"htmlLiAttributes")&&(r.setAttribute("htmlLiAttributes",e,i),t.return=!0)}}}),o.on("postFixer",(t,{listNodes:e,writer:r})=>{for(const{node:i}of e){const e=i.getAttribute("listType");!n.isNumberedListType(e)&&i.getAttribute("htmlOlAttributes")&&(r.removeAttribute("htmlOlAttributes",i),t.return=!0),n.isNumberedListType(e)&&i.getAttribute("htmlUlAttributes")&&(r.removeAttribute("htmlUlAttributes",i),t.return=!0)}})}afterInit(){const t=this.editor;if(!t.commands.get("indentList"))return;const e=t.commands.get("indentList");this.listenTo(e,"afterExecute",(e,r)=>{t.model.change(e=>{for(const i of r){const r=Gt(i.getAttribute("listType"));t.model.schema.checkAttribute(i,r)&&e.setAttribute(r,{},i)}})})}}function qt(t,e){return(r,i,o)=>{const n=i.viewItem;i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor));const l=e.processViewAttributes(n,o);for(const e of i.modelRange.getItems({shallow:!0}))e.hasAttribute("listItemId")&&(e.hasAttribute("htmlUlAttributes")||e.hasAttribute("htmlOlAttributes")||o.writer.model.schema.checkAttribute(e,t)&&o.writer.setAttribute(t,l||{},e))}}function Gt(t){return"numbered"===t||"customNumbered"==t?"htmlOlAttributes":"htmlUlAttributes"}class Kt extends t.Plugin{static get requires(){return[Et]}static get pluginName(){return"HorizontalLineElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(!t.plugins.has("HorizontalLineEditing"))return;const e=t.model.schema,r=t.conversion,i=t.plugins.get(Et);i.on("register:hr",(t,o)=>{"horizontalLine"===o.model&&(e.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),r.for("upcast").add(Z(o,i)),r.for("downcast").add(t=>{t.on("attribute:htmlHrAttributes:horizontalLine",(t,e,r)=>{if(!r.consumable.test(e.item,t.name))return;const{attributeOldValue:i,attributeNewValue:o}=e,n=r.mapper.toViewElement(e.item),l=$t(r.writer,n,"hr");l&&(V(r.writer,i,o,l),r.consumable.consume(e.item,t.name))},{priority:"low"})}),t.stop())})}}class Xt extends t.Plugin{static get requires(){return[Et,mt]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Et),e=this.editor.plugins.get(mt);t.on("register:$customElement",(r,i)=>{r.stop();const n=this.editor,l=n.model.schema,s=n.conversion,a=n.editing.view.domConverter.unsafeElements,m=n.data.htmlProcessor.domConverter.preElements;l.register(i.model,i.modelSchema),l.extend(i.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),n.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),s.for("upcast").elementToElement({view:/.*/,model:(r,l)=>{if("$comment"==r.name)return null;if(!function(t){try{document.createElement(t)}catch{return!1}return!0}(r.name))return null;if(e.getDefinitionsForView(r.name).size)return null;a.includes(r.name)||a.push(r.name),m.includes(r.name)||m.push(r.name);const s=l.writer.createElement(i.model,{htmlElementName:r.name}),c=t.processViewAttributes(r,l);let u;if(c&&l.writer.setAttribute("htmlCustomElementAttributes",c,s),r.is("element","template")&&r.getCustomProperty("$rawContent"))u=r.getCustomProperty("$rawContent");else{const t=new o.ViewUpcastWriter(r.document).createDocumentFragment(r),e=n.data.htmlProcessor.domConverter.viewToDom(t),i=e.firstChild;for(;i.firstChild;)e.appendChild(i.firstChild);i.remove(),u=n.data.htmlProcessor.htmlWriter.getHtml(e)}l.writer.setAttribute("htmlContent",u,s);for(const{item:t}of n.editing.view.createRangeIn(r))l.consumable.consume(t,{name:!0});return s},converterPriority:"low"}),s.for("editingDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),i=e.createRawElement(r);return t.hasAttribute("htmlCustomElementAttributes")&&N(e,t.getAttribute("htmlCustomElementAttributes"),i),i}}),s.for("dataDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),i=t.getAttribute("htmlContent"),o=e.createRawElement(r,null,(t,e)=>{e.setContentOf(t,i)});return t.hasAttribute("htmlCustomElementAttributes")&&N(e,t.getAttribute("htmlCustomElementAttributes"),o),o}})})}}class Qt extends t.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[Et,Pt,Ft,It,Tt,Bt,xt,Ht,Vt,Wt,Kt,Xt]}init(){const t=this.editor,e=t.plugins.get(Et);e.loadAllowedEmptyElementsConfig(t.config.get("htmlSupport.allowEmpty")||[]),e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}afterInit(){const t=this.editor.commands.get("removeFormat");t?.registerCustomAttribute(t=>t.startsWith("html")&&t.endsWith("Attributes"),z)}getGhsAttributeNameForElement(t){const e=this.editor.plugins.get("DataSchema"),r=Array.from(e.getDefinitionsForView(t,!1)),i=r.find(t=>t.isInline&&!r[0].isObject);return i?i.model:q(t)}addModelHtmlClass(t,r,i){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change(t=>{for(const l of Yt(o,i,n))U(t,l,n,"classes",t=>{for(const i of(0,e.toArray)(r))t.add(i)})})}removeModelHtmlClass(t,r,i){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change(t=>{for(const l of Yt(o,i,n))U(t,l,n,"classes",t=>{for(const i of(0,e.toArray)(r))t.delete(i)})})}setModelHtmlAttributes(t,e,r){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change(t=>{for(const n of Yt(i,r,o))U(t,n,o,"attributes",t=>{for(const[r,i]of Object.entries(e))t.set(r,i)})})}removeModelHtmlAttributes(t,r,i){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change(t=>{for(const l of Yt(o,i,n))U(t,l,n,"attributes",t=>{for(const i of(0,e.toArray)(r))t.delete(i)})})}setModelHtmlStyles(t,e,r){const i=this.editor.model,o=this.getGhsAttributeNameForElement(t);i.change(t=>{for(const n of Yt(i,r,o))U(t,n,o,"styles",t=>{for(const[r,i]of Object.entries(e))t.set(r,i)})})}removeModelHtmlStyles(t,r,i){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change(t=>{for(const l of Yt(o,i,n))U(t,l,n,"styles",t=>{for(const i of(0,e.toArray)(r))t.delete(i)})})}}function*Yt(t,e,r){if(e)if(!(Symbol.iterator in e)&&e.is("documentSelection")&&e.isCollapsed)t.schema.checkAttributeInSelection(e,r)&&(yield e);else for(const i of function(t,e,r){return!(Symbol.iterator in e)&&(e.is("node")||e.is("$text")||e.is("$textProxy"))?t.schema.checkAttribute(e,r)?[t.createRangeOn(e)]:[]:t.schema.getValidRanges(t.createSelection(e).getRanges(),r)}(t,e,r))yield*i.getItems({shallow:!0})}class Jt extends t.Plugin{static get pluginName(){return"HtmlComment"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,r=new Map;t.data.processor.skipComments=!1,t.model.schema.addAttributeCheck((t,e)=>{if(t.endsWith("$root")&&e.startsWith("$comment"))return!0}),t.conversion.for("upcast").elementToMarker({view:"$comment",model:t=>{const i=`$comment:${(0,e.uid)()}`,o=t.getCustomProperty("$rawContent");return r.set(i,o),i}}),t.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:e})=>{let r;for(const e of this.editor.model.document.getRootNames())if(r=this.editor.model.document.getRoot(e),r.hasAttribute(t.markerName))break;const i=t.markerName,o=r.getAttribute(i),n=e.createUIElement("$comment");return e.setCustomProperty("$rawContent",o,n),n}}),t.model.document.registerPostFixer(e=>{let i=!1;const o=t.model.document.differ.getChangedMarkers().filter(t=>t.name.startsWith("$comment:"));for(const t of o){const{oldRange:o,newRange:n}=t.data;if(!o||!n||o.root!=n.root){if(o){const r=o.root;r.hasAttribute(t.name)&&(e.removeAttribute(t.name,r),i=!0)}if(n){const o=n.root;"$graveyard"==o.rootName?(e.removeMarker(t.name),i=!0):o.hasAttribute(t.name)||(e.setAttribute(t.name,r.get(t.name)||"",o),i=!0)}}}return i}),t.data.on("set",()=>{for(const e of t.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(e.name)},{priority:"high"}),t.model.on("deleteContent",(e,[r])=>{for(const e of r.getRanges()){const r=t.model.schema.getLimitElement(e),i=t.model.createPositionAt(r,0),o=t.model.createPositionAt(r,"end");let n;n=i.isTouching(e.start)&&o.isTouching(e.end)?this.getHtmlCommentsInRange(t.model.createRange(i,o)):this.getHtmlCommentsInRange(e,{skipBoundaries:!0});for(const t of n)this.removeHtmlComment(t)}},{priority:"high"})}createHtmlComment(t,r){const i=(0,e.uid)(),o=this.editor.model,n=o.document.getRoot(t.root.rootName),l=`$comment:${i}`;return o.change(e=>{const i=e.createRange(t);return e.addMarker(l,{usingOperation:!0,affectsData:!0,range:i}),e.setAttribute(l,r,n),l})}removeHtmlComment(t){const e=this.editor,r=e.model.markers.get(t);return!!r&&(e.model.change(t=>{t.removeMarker(r)}),!0)}getHtmlCommentData(t){const e=this.editor.model.markers.get(t);if(!e)return null;let r="";for(const e of this.editor.model.document.getRoots())if(e.hasAttribute(t)){r=e.getAttribute(t);break}return{content:r,position:e.getStart()}}getHtmlCommentsInRange(t,{skipBoundaries:e=!1}={}){const r=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter(e=>function(t,e){const i=t.getRange().start;return(i.isAfter(e.start)||r&&i.isEqual(e.start))&&(i.isBefore(e.end)||r&&i.isEqual(e.end))}(e,t)).map(t=>t.name)}}class Zt extends o.HtmlDataProcessor{toView(t){if(!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(t.trim().slice(0,1e4)))return super.toView(t);let e="",r="";t=(t=t.trim().replace(/<\?xml\s[^?]*\?>/i,t=>(r=t,""))).trim().replace(/^<!DOCTYPE\s[^>]*?>/i,t=>(e=t,""));const i=this._toDom(t),n=this.domConverter.domToView(i,{skipComments:this.skipComments}),l=new o.ViewUpcastWriter(n.document);l.setCustomProperty("$fullPageDocument",i.ownerDocument.documentElement.outerHTML,n);const s=Array.from(i.ownerDocument.querySelectorAll("head style"));return l.setCustomProperty("$fullPageHeadStyles",s,n),e&&l.setCustomProperty("$fullPageDocType",e,n),r&&l.setCustomProperty("$fullPageXmlDeclaration",r,n),n}toData(t){let e=super.toData(t);const r=t.getCustomProperty("$fullPageDocument"),i=t.getCustomProperty("$fullPageDocType"),o=t.getCustomProperty("$fullPageXmlDeclaration");return r&&(e=r.replace(/<\/body\s*>/,e+"$&"),i&&(e=i+"\n"+e),o&&(e=o+"\n"+e)),e}}class te extends t.Plugin{static get pluginName(){return"FullPage"}static get licenseFeatureCode(){return"FPH"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(t){super(t),t.config.define("htmlSupport.fullPage",{allowRenderStylesFromHead:!1,sanitizeCss:t=>((0,e.logWarning)("css-full-page-provide-sanitize-function"),{css:t,hasChanged:!1})}),t.data.processor=new Zt(t.data.viewDocument)}init(){const t=this.editor,e=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration","$fullPageHeadStyles"];t.model.schema.extend("$root",{allowAttributes:e}),t.data.on("toModel",(r,[i])=>{const o=t.model.document.getRoot();t.model.change(t=>{for(const r of e){const e=i.getCustomProperty(r);e&&t.setAttribute(r,e,o)}}),ee(t)&&this._renderStylesFromHead(o)},{priority:"low"}),t.data.on("toView",(t,[r])=>{if(!r.is("rootElement"))return;const i=r,n=t.return;if(!i.hasAttribute("$fullPageDocument"))return;const l=new o.ViewUpcastWriter(n.document);for(const t of e){const e=i.getAttribute(t);e&&l.setCustomProperty(t,e,n)}},{priority:"low"}),t.data.on("set",()=>{const r=t.model.document.getRoot();t.model.change(t=>{for(const i of e)r.hasAttribute(i)&&t.removeAttribute(i,r)})},{priority:"high"}),t.data.on("get",(t,e)=>{e[0]||(e[0]={}),e[0].trim=!1},{priority:"high"})}destroy(){super.destroy(),ee(this.editor)&&this._removeStyleElementsFromDom()}_removeStyleElementsFromDom(){const t=Array.from(e.global.document.querySelectorAll(`[data-full-page-style-id="${this.editor.id}"]`));for(const e of t)e.remove()}_renderStyleElementsInDom(t){const r=this.editor,i=t.getAttribute("$fullPageHeadStyles");if(!i)return;const o=r.config.get("htmlSupport.fullPage.sanitizeCss");for(const t of i){t.setAttribute("data-full-page-style-id",r.id);const i=o(t.innerText);i.hasChanged&&(t.innerText=i.css),e.global.document.head.append(t)}}_renderStylesFromHead(t){this._removeStyleElementsFromDom(),this._renderStyleElementsInDom(t)}}function ee(t){return t.config.get("htmlSupport.fullPage.allowRenderStylesFromHead")}const re="htmlEmptyBlock";class ie extends t.Plugin{static get pluginName(){return"EmptyBlock"}static get isOfficialPlugin(){return!0}afterInit(){const{model:t,conversion:e,plugins:r,config:i}=this.editor,o=t.schema,n=i.get("htmlSupport.preserveEmptyBlocksInEditingView");o.extend("$block",{allowAttributes:[re]}),o.extend("$container",{allowAttributes:[re]}),o.isRegistered("tableCell")&&o.extend("tableCell",{allowAttributes:[re]}),n?e.for("downcast").add(oe()):e.for("dataDowncast").add(oe()),e.for("upcast").add(function(t){return e=>{e.on("element",(e,r,i)=>{const{viewItem:o,modelRange:n}=r;if(!o.is("element")||!o.isEmpty||o.getCustomProperty("$hasBlockFiller"))return;const l=n&&n.start.nodeAfter;if(!l||!t.checkAttribute(l,re))return;if(i.writer.setAttribute(re,!0,l),1!=l.childCount)return;const s=l.getChild(0);s.is("element","paragraph")&&t.checkAttribute(s,re)&&i.writer.setAttribute(re,!0,s)},{priority:"lowest"})}}(o)),r.has("ClipboardPipeline")&&this._registerClipboardPastingHandler()}_registerClipboardPastingHandler(){const t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"contentInsertion",(t,e)=>{e.sourceEditorId!==this.editor.id&&this.editor.model.change(t=>{for(const{item:r}of t.createRangeIn(e.content))r.is("element")&&r.hasAttribute(re)&&t.removeAttribute(re,r)})})}}function oe(){return t=>{t.on(`attribute:${re}`,(t,e,r)=>{const{mapper:i,consumable:o}=r,{item:n}=e;if(!o.consume(n,t.name))return;const l=i.toViewElement(n);l&&e.attributeNewValue&&(l.getFillerOffset=()=>null)})}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=i})();
|
package/dist/index.js
CHANGED
|
@@ -4193,11 +4193,22 @@ const STYLE_ATTRIBUTES_TO_PROPAGATE = [
|
|
|
4193
4193
|
*/ static get pluginName() {
|
|
4194
4194
|
return 'FullPage';
|
|
4195
4195
|
}
|
|
4196
|
+
/**
|
|
4197
|
+
* @inheritDoc
|
|
4198
|
+
* @internal
|
|
4199
|
+
*/ static get licenseFeatureCode() {
|
|
4200
|
+
return 'FPH';
|
|
4201
|
+
}
|
|
4196
4202
|
/**
|
|
4197
4203
|
* @inheritDoc
|
|
4198
4204
|
*/ static get isOfficialPlugin() {
|
|
4199
4205
|
return true;
|
|
4200
4206
|
}
|
|
4207
|
+
/**
|
|
4208
|
+
* @inheritDoc
|
|
4209
|
+
*/ static get isPremiumPlugin() {
|
|
4210
|
+
return true;
|
|
4211
|
+
}
|
|
4201
4212
|
/**
|
|
4202
4213
|
* @inheritDoc
|
|
4203
4214
|
*/ constructor(editor){
|