@ckeditor/ckeditor5-html-support 44.3.0 → 45.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/LICENSE.md CHANGED
@@ -18,7 +18,7 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
18
18
 
19
19
  The following libraries are included in CKEditor under the [MIT license](https://opensource.org/licenses/MIT):
20
20
 
21
- * Lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
21
+ * es-toolkit - Copyright (c) 2024 Viva Republica, Inc.
22
22
 
23
23
  Trademarks
24
24
  ----------
@@ -1,5 +1,5 @@
1
- !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"HTML object":"HTML object"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
1
+ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"HTML object":"HTML object"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
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={21:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach((function(r){t.setAttribute(r,e[r])}))}},51:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},128:t=>{"use strict";var e={};t.exports=function(t,r){var o=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(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(r)}},237:t=>{"use strict";t.exports=CKEditor5.dll},275:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var o=r(758),n=r.n(o),i=r(935),s=r.n(i)()(n());s.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 l=s},507:(t,e,r)=>{t.exports=r(237)("./src/enter.js")},584:(t,e,r)=>{t.exports=r(237)("./src/utils.js")},591:t=>{"use strict";var e=[];function r(t){for(var r=-1,o=0;o<e.length;o++)if(e[o].identifier===t){r=o;break}return r}function o(t,o){for(var i={},s=[],l=0;l<t.length;l++){var a=t[l],c=o.base?a[0]+o.base:a[0],u=i[c]||0,m="".concat(c," ").concat(u);i[c]=u+1;var d=r(m),f={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var h=n(f,o);o.byIndex=l,e.splice(l,0,{identifier:m,updater:h,references:1})}s.push(m)}return s}function n(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,n){var i=o(t=t||[],n=n||{});return function(t){t=t||[];for(var s=0;s<i.length;s++){var l=r(i[s]);e[l].references--}for(var a=o(t,n),c=0;c<i.length;c++){var u=r(i[c]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}i=a}}},639:t=>{"use strict";var e,r=(e=[],function(t,r){return e[t]=r,e.filter(Boolean).join("\n")});function o(t,e,o,n){var i;if(o)i="";else{i="",n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,s&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}")}if(t.styleSheet)t.styleSheet.cssText=r(e,i);else{var l=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(l,a[e]):t.appendChild(l)}}var n={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=n.singletonCounter++,r=n.singleton||(n.singleton=t.insertStyleElement(t));return{update:function(t){o(r,e,!1,t)},remove:function(t){o(r,e,!0,t)}}}},758: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")},901:(t,e,r)=>{t.exports=r(237)("./src/widget.js")},935:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",o=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),o&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),o&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,o,n,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(o)for(var l=0;l<this.length;l++){var a=this[l][0];null!=a&&(s[a]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);o&&s[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),n&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=n):u[4]="".concat(n)),e.push(u))}},e}}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={id:o,exports:{}};return t[o](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";r.r(o),r.d(o,{DataFilter:()=>Sn,DataSchema:()=>hn,EmptyBlock:()=>Ai,FullPage:()=>vi,GeneralHtmlSupport:()=>bi,HtmlComment:()=>gi,HtmlPageDataProcessor:()=>wi});var t=r(782),e=r(584),n=r(783),i=r(901);const s=function(){this.__data__=[],this.size=0};const l=function(t,e){return t===e||t!=t&&e!=e};const a=function(t,e){for(var r=t.length;r--;)if(l(t[r][0],e))return r;return-1};var c=Array.prototype.splice;const u=function(t){var e=this.__data__,r=a(e,t);return!(r<0)&&(r==e.length-1?e.pop():c.call(e,r,1),--this.size,!0)};const m=function(t){var e=this.__data__,r=a(e,t);return r<0?void 0:e[r][1]};const d=function(t){return a(this.__data__,t)>-1};const f=function(t,e){var r=this.__data__,o=a(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this};function h(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}h.prototype.clear=s,h.prototype.delete=u,h.prototype.get=m,h.prototype.has=d,h.prototype.set=f;const b=h;const p=function(){this.__data__=new b,this.size=0};const g=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};const w=function(t){return this.__data__.get(t)};const v=function(t){return this.__data__.has(t)};const y="object"==typeof global&&global&&global.Object===Object&&global;var A="object"==typeof self&&self&&self.Object===Object&&self;const E=y||A||Function("return this")();const j=E.Symbol;var _=Object.prototype,O=_.hasOwnProperty,k=_.toString,S=j?j.toStringTag:void 0;const C=function(t){var e=O.call(t,S),r=t[S];try{t[S]=void 0;var o=!0}catch(t){}var n=k.call(t);return o&&(e?t[S]=r:delete t[S]),n};var x=Object.prototype.toString;const P=function(t){return x.call(t)};var F=j?j.toStringTag:void 0;const I=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":F&&F in Object(t)?C(t):P(t)};const $=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const T=function(t){if(!$(t))return!1;var e=I(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const B=E["__core-js_shared__"];var D,R=(D=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"";const N=function(t){return!!R&&R in t};var L=Function.prototype.toString;const H=function(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var M=/^\[object .+?Constructor\]$/,V=Function.prototype,z=Object.prototype,U=V.toString,W=z.hasOwnProperty,q=RegExp("^"+U.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const G=function(t){return!(!$(t)||N(t))&&(T(t)?q:M).test(H(t))};const K=function(t,e){return null==t?void 0:t[e]};const Z=function(t,e){var r=K(t,e);return G(r)?r:void 0};const Y=Z(E,"Map");const X=Z(Object,"create");const J=function(){this.__data__=X?X(null):{},this.size=0};const Q=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var tt=Object.prototype.hasOwnProperty;const et=function(t){var e=this.__data__;if(X){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return tt.call(e,t)?e[t]:void 0};var rt=Object.prototype.hasOwnProperty;const ot=function(t){var e=this.__data__;return X?void 0!==e[t]:rt.call(e,t)};const nt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=X&&void 0===e?"__lodash_hash_undefined__":e,this};function it(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}it.prototype.clear=J,it.prototype.delete=Q,it.prototype.get=et,it.prototype.has=ot,it.prototype.set=nt;const st=it;const lt=function(){this.size=0,this.__data__={hash:new st,map:new(Y||b),string:new st}};const at=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const ct=function(t,e){var r=t.__data__;return at(e)?r["string"==typeof e?"string":"hash"]:r.map};const ut=function(t){var e=ct(this,t).delete(t);return this.size-=e?1:0,e};const mt=function(t){return ct(this,t).get(t)};const dt=function(t){return ct(this,t).has(t)};const ft=function(t,e){var r=ct(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this};function ht(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}ht.prototype.clear=lt,ht.prototype.delete=ut,ht.prototype.get=mt,ht.prototype.has=dt,ht.prototype.set=ft;const bt=ht;const pt=function(t,e){var r=this.__data__;if(r instanceof b){var o=r.__data__;if(!Y||o.length<199)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new bt(o)}return r.set(t,e),this.size=r.size,this};function gt(t){var e=this.__data__=new b(t);this.size=e.size}gt.prototype.clear=p,gt.prototype.delete=g,gt.prototype.get=w,gt.prototype.has=v,gt.prototype.set=pt;const wt=gt;const vt=function(t,e){for(var r=-1,o=null==t?0:t.length;++r<o&&!1!==e(t[r],r,t););return t};const yt=function(){try{var t=Z(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const At=function(t,e,r){"__proto__"==e&&yt?yt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var Et=Object.prototype.hasOwnProperty;const jt=function(t,e,r){var o=t[e];Et.call(t,e)&&l(o,r)&&(void 0!==r||e in t)||At(t,e,r)};const _t=function(t,e,r,o){var n=!r;r||(r={});for(var i=-1,s=e.length;++i<s;){var l=e[i],a=o?o(r[l],t[l],l,r,t):void 0;void 0===a&&(a=t[l]),n?At(r,l,a):jt(r,l,a)}return r};const Ot=function(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o};const kt=function(t){return null!=t&&"object"==typeof t};const St=function(t){return kt(t)&&"[object Arguments]"==I(t)};var Ct=Object.prototype,xt=Ct.hasOwnProperty,Pt=Ct.propertyIsEnumerable;const Ft=St(function(){return arguments}())?St:function(t){return kt(t)&&xt.call(t,"callee")&&!Pt.call(t,"callee")};const It=Array.isArray;const $t=function(){return!1};var Tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Bt=Tt&&"object"==typeof module&&module&&!module.nodeType&&module,Dt=Bt&&Bt.exports===Tt?E.Buffer:void 0;const Rt=(Dt?Dt.isBuffer:void 0)||$t;var Nt=/^(?:0|[1-9]\d*)$/;const Lt=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Nt.test(t))&&t>-1&&t%1==0&&t<e};const Ht=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var Mt={};Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=!0,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=!1;const Vt=function(t){return kt(t)&&Ht(t.length)&&!!Mt[I(t)]};const zt=function(t){return function(e){return t(e)}};var Ut="object"==typeof exports&&exports&&!exports.nodeType&&exports,Wt=Ut&&"object"==typeof module&&module&&!module.nodeType&&module,qt=Wt&&Wt.exports===Ut&&y.process;const Gt=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||qt&&qt.binding&&qt.binding("util")}catch(t){}}();var Kt=Gt&&Gt.isTypedArray;const Zt=Kt?zt(Kt):Vt;var Yt=Object.prototype.hasOwnProperty;const Xt=function(t,e){var r=It(t),o=!r&&Ft(t),n=!r&&!o&&Rt(t),i=!r&&!o&&!n&&Zt(t),s=r||o||n||i,l=s?Ot(t.length,String):[],a=l.length;for(var c in t)!e&&!Yt.call(t,c)||s&&("length"==c||n&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Lt(c,a))||l.push(c);return l};var Jt=Object.prototype;const Qt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Jt)};const te=function(t,e){return function(r){return t(e(r))}};const ee=te(Object.keys,Object);var re=Object.prototype.hasOwnProperty;const oe=function(t){if(!Qt(t))return ee(t);var e=[];for(var r in Object(t))re.call(t,r)&&"constructor"!=r&&e.push(r);return e};const ne=function(t){return null!=t&&Ht(t.length)&&!T(t)};const ie=function(t){return ne(t)?Xt(t):oe(t)};const se=function(t,e){return t&&_t(e,ie(e),t)};const le=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e};var ae=Object.prototype.hasOwnProperty;const ce=function(t){if(!$(t))return le(t);var e=Qt(t),r=[];for(var o in t)("constructor"!=o||!e&&ae.call(t,o))&&r.push(o);return r};const ue=function(t){return ne(t)?Xt(t,!0):ce(t)};const me=function(t,e){return t&&_t(e,ue(e),t)};var de="object"==typeof exports&&exports&&!exports.nodeType&&exports,fe=de&&"object"==typeof module&&module&&!module.nodeType&&module,he=fe&&fe.exports===de?E.Buffer:void 0,be=he?he.allocUnsafe:void 0;const pe=function(t,e){if(e)return t.slice();var r=t.length,o=be?be(r):new t.constructor(r);return t.copy(o),o};const ge=function(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e};const we=function(t,e){for(var r=-1,o=null==t?0:t.length,n=0,i=[];++r<o;){var s=t[r];e(s,r,t)&&(i[n++]=s)}return i};const ve=function(){return[]};var ye=Object.prototype.propertyIsEnumerable,Ae=Object.getOwnPropertySymbols;const Ee=Ae?function(t){return null==t?[]:(t=Object(t),we(Ae(t),(function(e){return ye.call(t,e)})))}:ve;const je=function(t,e){return _t(t,Ee(t),e)};const _e=function(t,e){for(var r=-1,o=e.length,n=t.length;++r<o;)t[n+r]=e[r];return t};const Oe=te(Object.getPrototypeOf,Object);const ke=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)_e(e,Ee(t)),t=Oe(t);return e}:ve;const Se=function(t,e){return _t(t,ke(t),e)};const Ce=function(t,e,r){var o=e(t);return It(t)?o:_e(o,r(t))};const xe=function(t){return Ce(t,ie,Ee)};const Pe=function(t){return Ce(t,ue,ke)};const Fe=Z(E,"DataView");const Ie=Z(E,"Promise");const $e=Z(E,"Set");const Te=Z(E,"WeakMap");var Be="[object Map]",De="[object Promise]",Re="[object Set]",Ne="[object WeakMap]",Le="[object DataView]",He=H(Fe),Me=H(Y),Ve=H(Ie),ze=H($e),Ue=H(Te),We=I;(Fe&&We(new Fe(new ArrayBuffer(1)))!=Le||Y&&We(new Y)!=Be||Ie&&We(Ie.resolve())!=De||$e&&We(new $e)!=Re||Te&&We(new Te)!=Ne)&&(We=function(t){var e=I(t),r="[object Object]"==e?t.constructor:void 0,o=r?H(r):"";if(o)switch(o){case He:return Le;case Me:return Be;case Ve:return De;case ze:return Re;case Ue:return Ne}return e});const qe=We;var Ge=Object.prototype.hasOwnProperty;const Ke=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Ge.call(t,"index")&&(r.index=t.index,r.input=t.input),r};const Ze=E.Uint8Array;const Ye=function(t){var e=new t.constructor(t.byteLength);return new Ze(e).set(new Ze(t)),e};const Xe=function(t,e){var r=e?Ye(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)};var Je=/\w*$/;const Qe=function(t){var e=new t.constructor(t.source,Je.exec(t));return e.lastIndex=t.lastIndex,e};var tr=j?j.prototype:void 0,er=tr?tr.valueOf:void 0;const rr=function(t){return er?Object(er.call(t)):{}};const or=function(t,e){var r=e?Ye(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};const nr=function(t,e,r){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return Ye(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return Xe(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return or(t,r);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return Qe(t);case"[object Symbol]":return rr(t)}};var ir=Object.create;const sr=function(){function t(){}return function(e){if(!$(e))return{};if(ir)return ir(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const lr=function(t){return"function"!=typeof t.constructor||Qt(t)?{}:sr(Oe(t))};const ar=function(t){return kt(t)&&"[object Map]"==qe(t)};var cr=Gt&&Gt.isMap;const ur=cr?zt(cr):ar;const mr=function(t){return kt(t)&&"[object Set]"==qe(t)};var dr=Gt&&Gt.isSet;const fr=dr?zt(dr):mr;var hr="[object Arguments]",br="[object Function]",pr="[object Object]",gr={};gr[hr]=gr["[object Array]"]=gr["[object ArrayBuffer]"]=gr["[object DataView]"]=gr["[object Boolean]"]=gr["[object Date]"]=gr["[object Float32Array]"]=gr["[object Float64Array]"]=gr["[object Int8Array]"]=gr["[object Int16Array]"]=gr["[object Int32Array]"]=gr["[object Map]"]=gr["[object Number]"]=gr[pr]=gr["[object RegExp]"]=gr["[object Set]"]=gr["[object String]"]=gr["[object Symbol]"]=gr["[object Uint8Array]"]=gr["[object Uint8ClampedArray]"]=gr["[object Uint16Array]"]=gr["[object Uint32Array]"]=!0,gr["[object Error]"]=gr[br]=gr["[object WeakMap]"]=!1;const wr=function t(e,r,o,n,i,s){var l,a=1&r,c=2&r,u=4&r;if(o&&(l=i?o(e,n,i,s):o(e)),void 0!==l)return l;if(!$(e))return e;var m=It(e);if(m){if(l=Ke(e),!a)return ge(e,l)}else{var d=qe(e),f=d==br||"[object GeneratorFunction]"==d;if(Rt(e))return pe(e,a);if(d==pr||d==hr||f&&!i){if(l=c||f?{}:lr(e),!a)return c?Se(e,me(l,e)):je(e,se(l,e))}else{if(!gr[d])return i?e:{};l=nr(e,d,a)}}s||(s=new wt);var h=s.get(e);if(h)return h;s.set(e,l),fr(e)?e.forEach((function(n){l.add(t(n,r,o,n,e,s))})):ur(e)&&e.forEach((function(n,i){l.set(i,t(n,r,o,i,e,s))}));var b=m?void 0:(u?c?Pe:xe:c?ue:ie)(e);return vt(b||e,(function(n,i){b&&(n=e[i=n]),jt(l,i,t(n,r,o,i,e,s))})),l};const vr=function(t){return wr(t,5)};const yr=function(t,e,r,o){var n=-1,i=null==t?0:t.length;for(o&&i&&(r=t[++n]);++n<i;)r=e(r,t[n],n,t);return r};const Ar=function(t){return function(e){return null==t?void 0:t[e]}}({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});const Er=function(t,e){for(var r=-1,o=null==t?0:t.length,n=Array(o);++r<o;)n[r]=e(t[r],r,t);return n};const jr=function(t){return"symbol"==typeof t||kt(t)&&"[object Symbol]"==I(t)};var _r=j?j.prototype:void 0,Or=_r?_r.toString:void 0;const kr=function t(e){if("string"==typeof e)return e;if(It(e))return Er(e,t)+"";if(jr(e))return Or?Or.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r};const Sr=function(t){return null==t?"":kr(t)};var Cr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xr=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");const Pr=function(t){return(t=Sr(t))&&t.replace(Cr,Ar).replace(xr,"")};var Fr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;const Ir=function(t){return t.match(Fr)||[]};var $r=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;const Tr=function(t){return $r.test(t)};var Br="\\ud800-\\udfff",Dr="\\u2700-\\u27bf",Rr="a-z\\xdf-\\xf6\\xf8-\\xff",Nr="A-Z\\xc0-\\xd6\\xd8-\\xde",Lr="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Hr="["+Lr+"]",Mr="\\d+",Vr="["+Dr+"]",zr="["+Rr+"]",Ur="[^"+Br+Lr+Mr+Dr+Rr+Nr+"]",Wr="(?:\\ud83c[\\udde6-\\uddff]){2}",qr="[\\ud800-\\udbff][\\udc00-\\udfff]",Gr="["+Nr+"]",Kr="(?:"+zr+"|"+Ur+")",Zr="(?:"+Gr+"|"+Ur+")",Yr="(?:['’](?:d|ll|m|re|s|t|ve))?",Xr="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jr="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Qr="[\\ufe0e\\ufe0f]?",to=Qr+Jr+("(?:\\u200d(?:"+["[^"+Br+"]",Wr,qr].join("|")+")"+Qr+Jr+")*"),eo="(?:"+[Vr,Wr,qr].join("|")+")"+to,ro=RegExp([Gr+"?"+zr+"+"+Yr+"(?="+[Hr,Gr,"$"].join("|")+")",Zr+"+"+Xr+"(?="+[Hr,Gr+Kr,"$"].join("|")+")",Gr+"?"+Kr+"+"+Yr,Gr+"+"+Xr,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Mr,eo].join("|"),"g");const oo=function(t){return t.match(ro)||[]};const no=function(t,e,r){return t=Sr(t),void 0===(e=r?void 0:e)?Tr(t)?oo(t):Ir(t):t.match(e)||[]};var io=RegExp("['’]","g");const so=function(t){return function(e){return yr(no(Pr(e).replace(io,"")),t,"")}};const lo=function(t,e,r){var o=-1,n=t.length;e<0&&(e=-e>n?0:n+e),(r=r>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(n);++o<n;)i[o]=t[o+e];return i};const ao=function(t,e,r){var o=t.length;return r=void 0===r?o:r,!e&&r>=o?t:lo(t,e,r)};var co=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const uo=function(t){return co.test(t)};const mo=function(t){return t.split("")};var fo="\\ud800-\\udfff",ho="["+fo+"]",bo="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",po="\\ud83c[\\udffb-\\udfff]",go="[^"+fo+"]",wo="(?:\\ud83c[\\udde6-\\uddff]){2}",vo="[\\ud800-\\udbff][\\udc00-\\udfff]",yo="(?:"+bo+"|"+po+")"+"?",Ao="[\\ufe0e\\ufe0f]?",Eo=Ao+yo+("(?:\\u200d(?:"+[go,wo,vo].join("|")+")"+Ao+yo+")*"),jo="(?:"+[go+bo+"?",bo,wo,vo,ho].join("|")+")",_o=RegExp(po+"(?="+po+")|"+jo+Eo,"g");const Oo=function(t){return t.match(_o)||[]};const ko=function(t){return uo(t)?Oo(t):mo(t)};const So=function(t){return function(e){e=Sr(e);var r=uo(e)?ko(e):void 0,o=r?r[0]:e.charAt(0),n=r?ao(r,1).join(""):e.slice(1);return o[t]()+n}}("toUpperCase");const Co=so((function(t,e,r){return t+(r?" ":"")+So(e)}));function xo(t,e,r,o){e&&function(t,e,r){if(e.attributes)for(const[o]of Object.entries(e.attributes))t.removeAttribute(o,r);if(e.styles)for(const o of Object.keys(e.styles))t.removeStyle(o,r);e.classes&&t.removeClass(e.classes,r)}(t,e,o),r&&Po(t,r,o)}function Po(t,e,r){if(e.attributes)for(const[o,n]of Object.entries(e.attributes))t.setAttribute(o,n,r);e.styles&&t.setStyle(e.styles,r),e.classes&&t.addClass(e.classes,r)}function Fo(t,e,r,o,n){const i=e.getAttribute(r),s={};for(const t of["attributes","styles","classes"]){if(t!=o){i&&i[t]&&(s[t]=i[t]);continue}if("classes"==o){const e=new Set(i&&i.classes||[]);n(e),e.size&&(s[t]=Array.from(e));continue}const e=new Map(Object.entries(i&&i[t]||{}));n(e),e.size&&(s[t]=Object.fromEntries(e))}Object.keys(s).length?e.is("documentSelection")?t.setSelectionAttribute(r,s):t.setAttribute(r,s,e):i&&(e.is("documentSelection")?t.removeSelectionAttribute(r):t.removeAttribute(r,e))}function Io(t){return`html${e=t,Co(e).replace(/ /g,"")}Attributes`;var e}function $o({model:t}){return(e,r)=>r.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function To(t,{view:e,isInline:r}){const o=t.t;return(t,{writer:n})=>{const s=o("HTML object"),l=Bo(e,t,n),a=t.getAttribute(Io(e));n.addClass("html-object-embed__content",l),a&&Po(n,a,l);const c=n.createContainerElement(r?"span":"div",{class:"html-object-embed","data-html-object-embed-label":s},l);return(0,i.toWidget)(c,n,{label:s})}}function Bo(t,e,r){return r.createRawElement(t,null,((t,r)=>{r.setContentOf(t,e.getAttribute("htmlContent"))}))}function Do({view:t,model:e,allowEmpty:r},o){return e=>{e.on(`element:${t}`,((t,e,i)=>{let s=o.processViewAttributes(e.viewItem,i);if(s||i.consumable.test(e.viewItem,{name:!0})){if(s=s||{},i.consumable.consume(e.viewItem,{name:!0}),e.modelRange||(e=Object.assign(e,i.convertChildren(e.viewItem,e.modelCursor))),r&&e.modelRange.isCollapsed&&Object.keys(s).length){const t=i.writer.createElement("htmlEmptyElement");if(!i.safeInsert(t,e.modelCursor))return;const r=i.getSplitParts(t);return e.modelRange=i.writer.createRange(e.modelRange.start,i.writer.createPositionAfter(r[r.length-1])),i.updateConversionResult(t,e),void n(t,s,i)}for(const t of e.modelRange.getItems())n(t,s,i)}}),{priority:"low"})};function n(t,r,o){if(o.schema.checkAttribute(t,e)){const n=function(t,e){const r=vr(t);let o="attributes";for(o in e)r[o]="classes"==o?Array.from(new Set([...t[o]||[],...e[o]])):{...t[o],...e[o]};return r}(r,t.getAttribute(e)||{});o.writer.setAttribute(e,n,t)}}}function Ro({model:t,view:e},r){return(o,{writer:n,consumable:s})=>{if(!o.hasAttribute(t))return null;const l=n.createContainerElement(e),a=o.getAttribute(t);return s.consume(o,`attribute:${t}`),Po(n,a,l),l.getFillerOffset=()=>null,r?(0,i.toWidget)(l,n):l}}function No({priority:t,view:e}){return(r,o)=>{if(!r)return;const{writer:n}=o,i=n.createAttributeElement(e,null,{priority:t});return Po(n,r,i),i}}function Lo({view:t},e){return r=>{r.on(`element:${t}`,((t,r,o)=>{if(!r.modelRange||r.modelRange.isCollapsed)return;const n=e.processViewAttributes(r.viewItem,o);n&&o.writer.setAttribute(Io(r.viewItem.name),n,r.modelRange)}),{priority:"low"})}}function Ho({view:t,model:e}){return r=>{r.on(`attribute:${Io(t)}:${e}`,((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e;xo(r.writer,o,n,r.mapper.toViewElement(e.item))}))}}const Mo=[{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"}}],Vo=[{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"},{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}}];const zo=function(t,e,r){(void 0!==r&&!l(t[e],r)||void 0===r&&!(e in t))&&At(t,e,r)};const Uo=function(t){return function(e,r,o){for(var n=-1,i=Object(e),s=o(e),l=s.length;l--;){var a=s[t?l:++n];if(!1===r(i[a],a,i))break}return e}}();const Wo=function(t){return kt(t)&&ne(t)};var qo=Function.prototype,Go=Object.prototype,Ko=qo.toString,Zo=Go.hasOwnProperty,Yo=Ko.call(Object);const Xo=function(t){if(!kt(t)||"[object Object]"!=I(t))return!1;var e=Oe(t);if(null===e)return!0;var r=Zo.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Ko.call(r)==Yo};const Jo=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};const Qo=function(t){return _t(t,ue(t))};const tn=function(t,e,r,o,n,i,s){var l=Jo(t,r),a=Jo(e,r),c=s.get(a);if(c)zo(t,r,c);else{var u=i?i(l,a,r+"",t,e,s):void 0,m=void 0===u;if(m){var d=It(a),f=!d&&Rt(a),h=!d&&!f&&Zt(a);u=a,d||f||h?It(l)?u=l:Wo(l)?u=ge(l):f?(m=!1,u=pe(a,!0)):h?(m=!1,u=or(a,!0)):u=[]:Xo(a)||Ft(a)?(u=l,Ft(l)?u=Qo(l):$(l)&&!T(l)||(u=lr(a))):m=!1}m&&(s.set(a,u),n(u,a,o,i,s),s.delete(a)),zo(t,r,u)}};const en=function t(e,r,o,n,i){e!==r&&Uo(r,(function(s,l){if(i||(i=new wt),$(s))tn(e,r,l,o,t,n,i);else{var a=n?n(Jo(e,l),s,l+"",e,r,i):void 0;void 0===a&&(a=s),zo(e,l,a)}}),ue)};const rn=function(t){return t};const on=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)};var nn=Math.max;const sn=function(t,e,r){return e=nn(void 0===e?t.length-1:e,0),function(){for(var o=arguments,n=-1,i=nn(o.length-e,0),s=Array(i);++n<i;)s[n]=o[e+n];n=-1;for(var l=Array(e+1);++n<e;)l[n]=o[n];return l[e]=r(s),on(t,this,l)}};const ln=function(t){return function(){return t}};const an=yt?function(t,e){return yt(t,"toString",{configurable:!0,enumerable:!1,value:ln(e),writable:!0})}:rn;var cn=Date.now;const un=function(t){var e=0,r=0;return function(){var o=cn(),n=16-(o-r);if(r=o,n>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(an);const mn=function(t,e){return un(sn(t,e,rn),t+"")};const dn=function(t,e,r){if(!$(r))return!1;var o=typeof e;return!!("number"==o?ne(r)&&Lt(e,r.length):"string"==o&&e in r)&&l(r[e],t)};const fn=function(t){return mn((function(e,r){var o=-1,n=r.length,i=n>1?r[n-1]:void 0,s=n>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(n--,i):void 0,s&&dn(r[0],r[1],s)&&(i=n<3?void 0:i,n=1),e=Object(e);++o<n;){var l=r[o];l&&t(e,l,o,i)}return e}))}((function(t,e,r,o){en(t,e,r,o)}));class hn extends t.Plugin{constructor(){super(...arguments),this._definitions=[]}static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const t of Mo)this.registerBlockElement(t);for(const t of Vo)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 o of this._getMatchingViewDefinitions(t)){if(e)for(const t of this._getReferences(o.model))r.add(t);r.add(o)}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"],o=this._definitions.filter((e=>e.model==t));for(const{modelSchema:n}of o)if(n)for(const o of r)for(const r of(0,e.toArray)(n[o]||[])){const e=this._definitions.filter((t=>t.model==r));for(const o of e)r!==t&&(yield*this._getReferences(o.model),yield o)}}_extendDefinition(t){const e=Array.from(this._definitions.entries()).filter((([,e])=>e.model==t.model));if(0!=e.length)for(const[r,o]of e)this._definitions[r]=fn({},o,t,((t,e)=>Array.isArray(t)?t.concat(e):void 0));else this._definitions.push(t)}}var bn=r(591),pn=r.n(bn),gn=r(639),wn=r.n(gn),vn=r(128),yn=r.n(vn),An=r(21),En=r.n(An),jn=r(51),_n=r.n(jn),On=r(275),kn={attributes:{"data-cke":!0}};kn.setAttributes=En(),kn.insert=yn().bind(null,"head"),kn.domAPI=wn(),kn.insertStyleElement=_n();pn()(On.A,kn);On.A&&On.A.locals&&On.A.locals;class Sn extends t.Plugin{constructor(t){super(t),this._dataSchema=t.plugins.get("DataSchema"),this._allowedAttributes=new n.Matcher,this._disallowedAttributes=new n.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[hn,i.Widget]}loadAllowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=In(e);this.allowElement(t),r.forEach((t=>this.allowAttributes(t)))}}loadDisallowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/,r=In(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 Cn(t,this._disallowedAttributes,r),function(t,{attributes:e,classes:r,styles:o}){if(!e.length&&!r.length&&!o.length)return null;return{...e.length&&{attributes:xn(t,e)},...o.length&&{styles:Pn(t,o)},...r.length&&{classes:r}}}(t,Cn(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 o=this.editor.model.schema;if(r.isObject&&!o.isRegistered(r.model))this._registerObjectElement(r);else if(r.isBlock)this._registerBlockElement(r);else{if(!r.isInline)throw new e.CKEditorError("data-filter-invalid-definition",null,r);this._registerInlineElement(r)}t.stop()}),{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const t=this.editor.model,e=t.document.selection;t.document.registerPostFixer((e=>{const r=t.document.differ.getChanges();let o=!1;const n=this._getCoupledAttributesMap();for(const t of r){if("attribute"!=t.type||null!==t.attributeNewValue)continue;const r=n.get(t.attributeKey);if(r)for(const{item:n}of t.range.getWalker())for(const t of r)n.hasAttribute(t)&&(e.removeAttribute(t,n),o=!0)}return o})),this.listenTo(e,"change:attribute",((r,{attributeKeys:o})=>{const n=new Set,i=this._getCoupledAttributesMap();for(const t of o){if(e.hasAttribute(t))continue;const r=i.get(t);if(r)for(const t of r)e.hasAttribute(t)&&n.add(t)}0!=n.size&&t.change((t=>{for(const e of n)t.removeSelectionAttribute(e)}))}))}_registerAssociatedHtmlAttributesPostFixer(){const t=this.editor.model;t.document.registerPostFixer((e=>{const r=t.document.differ.getChanges();let o=!1;for(const n of r)if("insert"===n.type&&"$text"!==n.name)for(const r of n.attributes.keys())r.startsWith("html")&&r.endsWith("Attributes")&&(t.schema.checkAttribute(n.name,r)||(e.removeAttribute(r,n.position.nodeAfter),o=!0));return o}))}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const t of this._allowedElements)if(t.coupledAttribute&&t.model){const e=this._coupledAttributes.get(t.coupledAttribute);e?e.push(t.model):this._coupledAttributes.set(t.coupledAttribute,[t.model])}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,o=r.model.schema,n=r.conversion,{view:i,model:s}=t;o.register(s,t.modelSchema),i&&(o.extend(t.model,{allowAttributes:[Io(i),"htmlContent"]}),r.data.registerRawContentMatcher({name:i}),n.for("upcast").elementToElement({view:i,model:$o(t),converterPriority:e.priorities.low+2}),n.for("upcast").add(Lo(t,this)),n.for("editingDowncast").elementToStructure({model:{name:s,attributes:[Io(i)]},view:To(r,t)}),n.for("dataDowncast").elementToElement({model:s,view:(t,{writer:e})=>Bo(i,t,e)}),n.for("dataDowncast").add(Ho(t)))}_registerBlockElement(t){const r=this.editor,o=r.model.schema,n=r.conversion,{view:i,model:s}=t;if(!o.isRegistered(t.model)){if(!t.modelSchema)return;if(o.register(t.model,t.modelSchema),!i)return;n.for("upcast").elementToElement({model:s,view:i,converterPriority:e.priorities.low+2}),n.for("downcast").elementToElement({model:s,view:(e,{writer:r})=>t.isEmpty?r.createEmptyElement(i):r.createContainerElement(i)})}i&&(o.extend(t.model,{allowAttributes:Io(i)}),n.for("upcast").add(Lo(t,this)),n.for("downcast").add(Ho(t)))}_registerInlineElement(t){const e=this.editor,r=e.model.schema,o=e.conversion,n=t.model;t.appliesToBlock||(r.extend("$text",{allowAttributes:n}),t.attributeProperties&&r.setAttributeProperties(n,t.attributeProperties),o.for("upcast").add(Do(t,this)),o.for("downcast").attributeToElement({model:n,view:No(t)}),t.allowEmpty&&(r.setAttributeProperties(n,{copyFromObject:!1}),r.isRegistered("htmlEmptyElement")||r.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"}),e.data.htmlProcessor.domConverter.registerInlineObjectMatcher((e=>e.name==t.view&&e.isEmpty&&Array.from(e.getAttributeKeys()).length?{name:!0}:null)),o.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:Ro(t,!0)}),o.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:Ro(t)})))}}function Cn(t,e,r){const o=e.matchAll(t)||[],n=t.document.stylesProcessor;return o.reduce(((e,{match:o})=>{for(const[i,s]of o.attributes||[])if("style"==i){const o=s,i=n.getRelatedStyles(o).filter((t=>t.split("-").length>o.split("-").length)).sort(((t,e)=>e.split("-").length-t.split("-").length));for(const o of i)r.consume(t,{styles:[o]})&&e.styles.push(o);r.consume(t,{styles:[o]})&&e.styles.push(o)}else if("class"==i){const o=s;r.consume(t,{classes:[o]})&&e.classes.push(o)}else r.consume(t,{attributes:[i]})&&e.attributes.push(i);return e}),{attributes:[],classes:[],styles:[]})}function xn(t,r){const o={};for(const n of r){const r=t.getAttribute(n);void 0!==r&&(0,e.isValidAttributeName)(n)&&(o[n]=r)}return o}function Pn(t,e){const r=new n.StylesMap(t.document.stylesProcessor);for(const o of e){const e=t.getStyle(o);void 0!==e&&r.set(o,e)}return Object.fromEntries(r.getStylesEntries())}function Fn(t,e){const{name:r}=t,o=t[e];return Xo(o)?Object.entries(o).map((([t,o])=>({name:r,[e]:{[t]:o}}))):Array.isArray(o)?o.map((t=>({name:r,[e]:[t]}))):[t]}function In(t){const{name:e,attributes:r,classes:o,styles:n}=t,i=[];return r&&i.push(...Fn({name:e,attributes:r},"attributes")),o&&i.push(...Fn({name:e,classes:o},"classes")),n&&i.push(...Fn({name:e,styles:n},"styles")),i}class $n extends t.Plugin{static get requires(){return[Sn]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const t=this.editor.plugins.get(Sn);t.on("register:pre",((e,r)=>{if("codeBlock"!==r.model)return;const o=this.editor,n=o.model.schema,i=o.conversion;n.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),i.for("upcast").add(function(t){return e=>{e.on("element:code",((e,r,o)=>{const n=r.viewItem,i=n.parent;function s(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}i&&i.is("element","pre")&&(s(i,"htmlPreAttributes"),s(n,"htmlContentAttributes"))}),{priority:"low"})}}(t)),i.for("downcast").add((t=>{t.on("attribute:htmlPreAttributes:codeBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item).parent;xo(r.writer,o,n,i)})),t.on("attribute:htmlContentAttributes:codeBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item);xo(r.writer,o,n,i)}))})),e.stop()}))}}class Tn extends t.Plugin{static get requires(){return[Sn]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(Sn).on("register",((t,r)=>{const o=r,n=this.editor,i=n.model.schema,s=n.conversion;if(!o.paragraphLikeModel)return;if(i.isRegistered(o.model)||i.isRegistered(o.paragraphLikeModel))return;const l={model:o.paragraphLikeModel,view:o.view};i.register(o.model,o.modelSchema),i.register(l.model,{inheritAllFrom:"$block"}),s.for("upcast").elementToElement({view:o.view,model:(t,{writer:e})=>this._hasBlockContent(t)?e.createElement(o.model):e.createElement(l.model),converterPriority:e.priorities.low+.5}),s.for("downcast").elementToElement({view:o.view,model:o.model}),this._addAttributeConversion(o),s.for("downcast").elementToElement({view:l.view,model:l.model}),this._addAttributeConversion(l),t.stop()}))}_hasBlockContent(t){const e=this.editor.editing.view,r=e.domConverter.blockElements;for(const o of e.createRangeIn(t).getItems())if(o.is("element")&&r.includes(o.name))return!0;return!1}_addAttributeConversion(t){const e=this.editor,r=e.conversion,o=e.plugins.get(Sn);e.model.schema.extend(t.model,{allowAttributes:Io(t.view)}),r.for("upcast").add(Lo(t,o)),r.for("downcast").add(Ho(t))}}var Bn=r(507);class Dn extends t.Plugin{static get requires(){return[hn,Bn.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(hn),o=[];for(const t of e)"model"in t&&"view"in t&&(r.registerBlockElement({view:t.view,model:t.model}),o.push(t.model));r.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:o}}),r.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:o}})}}function Rn(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}class Nn extends t.Plugin{static get requires(){return[Sn]}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,o=t.plugins.get(Sn);o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("image"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on("register:img",((n,i)=>{"imageBlock"!==i.model&&"imageInline"!==i.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,o)=>{if(!r.modelRange)return;const n=r.viewItem,i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlImgAttributes",i,r.modelRange)}),{priority:"low"})}}(o)),r.for("downcast").add((t=>{function e(e){t.on(`attribute:${e}:imageInline`,((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item);xo(r.writer,o,n,i)}),{priority:"low"})}function r(e,r){t.on(`attribute:${r}:imageBlock`,((t,r,o)=>{if(!o.consumable.test(r.item,t.name))return;const{attributeOldValue:n,attributeNewValue:i}=r,s=o.mapper.toViewElement(r.item),l=Rn(o.writer,s,e);l&&(xo(o.writer,n,i,l),o.consumable.consume(r.item,t.name))}),{priority:"low"}),"a"===e&&t.on("attribute:linkHref:imageBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock"))return;const o=r.mapper.toViewElement(e.item),n=Rn(r.writer,o,"a");Po(r.writer,e.item.getAttribute("htmlLinkAttributes"),n)}),{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,o,n)=>{const i=o.viewItem;if(!r.findViewImgElement(i))return;const s=o.modelCursor.parent;if(!s.is("element","imageBlock"))return;const l=t.processViewAttributes(i,n);l&&n.writer.setAttribute("htmlLinkAttributes",l,s)}),{priority:"low"})}}(o,t)),n.stop())}))}}class Ln extends t.Plugin{static get requires(){return[Sn]}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,o=this.editor.plugins.get(Sn),n=this.editor.plugins.get(hn),i=t.config.get("mediaEmbed.elementName");n.registerBlockElement({model:"media",view:i}),o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("media"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on(`register:${i}`,((t,n)=>{"media"===n.model&&(e.extend("media",{allowAttributes:[Io(i),"htmlFigureAttributes"]}),r.for("upcast").add(function(t,e){const r=(r,o,n)=>{function i(e,r){const i=t.processViewAttributes(e,n);i&&n.writer.setAttribute(r,i,o.modelRange)}i(o.viewItem,Io(e))};return t=>{t.on(`element:${e}`,r,{priority:"low"})}}(o,i)),r.for("dataDowncast").add(function(t){return e=>{function r(t,r){e.on(`attribute:${r}:media`,((e,r,o)=>{if(!o.consumable.consume(r.item,e.name))return;const{attributeOldValue:n,attributeNewValue:i}=r,s=o.mapper.toViewElement(r.item),l=Rn(o.writer,s,t);xo(o.writer,n,i,l)}))}r(t,Io(t)),r("figure","htmlFigureAttributes")}}(i)),t.stop())}))}}class Hn extends t.Plugin{static get requires(){return[Sn]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Sn);t.on("register:script",((e,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;n.register("htmlScript",r.modelSchema),n.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),o.data.registerRawContentMatcher({name:"script"}),i.for("upcast").elementToElement({view:"script",model:$o(r)}),i.for("upcast").add(Lo(r,t)),i.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>Bo("script",t,e)}),i.for("downcast").add(Ho(r)),e.stop()}))}}class Mn extends t.Plugin{static get requires(){return[Sn]}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,o=t.plugins.get(Sn),n=t.plugins.get("TableUtils");o.on("register:figure",(()=>{r.for("upcast").add(function(t){return e=>{e.on("element:figure",((e,r,o)=>{const n=r.viewItem;if(!r.modelRange||!n.hasClass("table"))return;const i=t.processViewAttributes(n,o);i&&o.writer.setAttribute("htmlFigureAttributes",i,r.modelRange)}),{priority:"low"})}}(o))})),o.on("register:table",((i,s)=>{"table"===s.model&&(e.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:table",((e,r,o)=>{if(!r.modelRange)return;const n=r.viewItem;i(n,"htmlTableAttributes");for(const t of n.getChildren())t.is("element","thead")&&i(t,"htmlTheadAttributes"),t.is("element","tbody")&&i(t,"htmlTbodyAttributes");function i(e,n){const i=t.processViewAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}}),{priority:"low"})}}(o)),r.for("downcast").add((t=>{function e(e,r){t.on(`attribute:${r}:table`,((t,r,o)=>{if(!o.consumable.test(r.item,t.name))return;const n=o.mapper.toViewElement(r.item),i=Rn(o.writer,n,e);i&&(o.consumable.consume(r.item,t.name),xo(o.writer,r.attributeOldValue,r.attributeNewValue,i))}))}e("table","htmlTableAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes")})),t.model.document.registerPostFixer(function(t,e){return r=>{const o=t.document.differ.getChanges();let n=!1;for(const t of o){if("attribute"!=t.type||"headingRows"!=t.attributeKey)continue;const o=t.range.start.nodeAfter,i=o.getAttribute("htmlTheadAttributes"),s=o.getAttribute("htmlTbodyAttributes");i&&!t.attributeNewValue?(r.removeAttribute("htmlTheadAttributes",o),n=!0):s&&t.attributeNewValue==e.getRows(o)&&(r.removeAttribute("htmlTbodyAttributes",o),n=!0)}return n}}(t.model,n)),i.stop())}))}}class Vn extends t.Plugin{static get requires(){return[Sn]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Sn);t.on("register:style",((e,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;n.register("htmlStyle",r.modelSchema),n.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),o.data.registerRawContentMatcher({name:"style"}),i.for("upcast").elementToElement({view:"style",model:$o(r)}),i.for("upcast").add(Lo(r,t)),i.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>Bo("style",t,e)}),i.for("downcast").add(Ho(r)),e.stop()}))}}const zn=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const Un=function(t){return this.__data__.has(t)};function Wn(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new bt;++e<r;)this.add(t[e])}Wn.prototype.add=Wn.prototype.push=zn,Wn.prototype.has=Un;const qn=Wn;const Gn=function(t,e){for(var r=-1,o=null==t?0:t.length;++r<o;)if(e(t[r],r,t))return!0;return!1};const Kn=function(t,e){return t.has(e)};const Zn=function(t,e,r,o,n,i){var s=1&r,l=t.length,a=e.length;if(l!=a&&!(s&&a>l))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var m=-1,d=!0,f=2&r?new qn:void 0;for(i.set(t,e),i.set(e,t);++m<l;){var h=t[m],b=e[m];if(o)var p=s?o(b,h,m,e,t,i):o(h,b,m,t,e,i);if(void 0!==p){if(p)continue;d=!1;break}if(f){if(!Gn(e,(function(t,e){if(!Kn(f,e)&&(h===t||n(h,t,r,o,i)))return f.push(e)}))){d=!1;break}}else if(h!==b&&!n(h,b,r,o,i)){d=!1;break}}return i.delete(t),i.delete(e),d};const Yn=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,o){r[++e]=[o,t]})),r};const Xn=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r};var Jn=j?j.prototype:void 0,Qn=Jn?Jn.valueOf:void 0;const ti=function(t,e,r,o,n,i,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new Ze(t),new Ze(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return l(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Yn;case"[object Set]":var c=1&o;if(a||(a=Xn),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;o|=2,s.set(t,e);var m=Zn(a(t),a(e),o,n,i,s);return s.delete(t),m;case"[object Symbol]":if(Qn)return Qn.call(t)==Qn.call(e)}return!1};var ei=Object.prototype.hasOwnProperty;const ri=function(t,e,r,o,n,i){var s=1&r,l=xe(t),a=l.length;if(a!=xe(e).length&&!s)return!1;for(var c=a;c--;){var u=l[c];if(!(s?u in e:ei.call(e,u)))return!1}var m=i.get(t),d=i.get(e);if(m&&d)return m==e&&d==t;var f=!0;i.set(t,e),i.set(e,t);for(var h=s;++c<a;){var b=t[u=l[c]],p=e[u];if(o)var g=s?o(p,b,u,e,t,i):o(b,p,u,t,e,i);if(!(void 0===g?b===p||n(b,p,r,o,i):g)){f=!1;break}h||(h="constructor"==u)}if(f&&!h){var w=t.constructor,v=e.constructor;w==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof v&&v instanceof v||(f=!1)}return i.delete(t),i.delete(e),f};var oi="[object Arguments]",ni="[object Array]",ii="[object Object]",si=Object.prototype.hasOwnProperty;const li=function(t,e,r,o,n,i){var s=It(t),l=It(e),a=s?ni:qe(t),c=l?ni:qe(e),u=(a=a==oi?ii:a)==ii,m=(c=c==oi?ii:c)==ii,d=a==c;if(d&&Rt(t)){if(!Rt(e))return!1;s=!0,u=!1}if(d&&!u)return i||(i=new wt),s||Zt(t)?Zn(t,e,r,o,n,i):ti(t,e,a,r,o,n,i);if(!(1&r)){var f=u&&si.call(t,"__wrapped__"),h=m&&si.call(e,"__wrapped__");if(f||h){var b=f?t.value():t,p=h?e.value():e;return i||(i=new wt),n(b,p,r,o,i)}}return!!d&&(i||(i=new wt),ri(t,e,r,o,n,i))};const ai=function t(e,r,o,n,i){return e===r||(null==e||null==r||!kt(e)&&!kt(r)?e!=e&&r!=r:li(e,r,o,n,t,i))};const ci=function(t,e){return ai(t,e)};class ui extends t.Plugin{static get requires(){return[Sn]}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,o=t.plugins.get(Sn),n=t.plugins.get("ListEditing"),i=t.plugins.get("ListUtils"),s=["ul","ol","li"];n.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:Po}),n.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:Po}),n.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:Po}),o.on("register",((t,n)=>{if(!s.includes(n.view))return;if(t.stop(),e.checkAttribute("$block","htmlLiAttributes"))return;const i=s.map((t=>Io(t)));e.extend("$listItem",{allowAttributes:i}),r.for("upcast").add((t=>{t.on("element:ul",mi("htmlUlAttributes",o),{priority:"low"}),t.on("element:ol",mi("htmlOlAttributes",o),{priority:"low"}),t.on("element:li",mi("htmlLiAttributes",o),{priority:"low"})}))})),n.on("postFixer",((t,{listNodes:e,writer:r})=>{for(const{node:o,previousNodeInList:n}of e)if(n){if(n.getAttribute("listType")==o.getAttribute("listType")){const e=di(n.getAttribute("listType")),i=n.getAttribute(e);!ci(o.getAttribute(e),i)&&r.model.schema.checkAttribute(o,e)&&(r.setAttribute(e,i,o),t.return=!0)}if(n.getAttribute("listItemId")==o.getAttribute("listItemId")){const e=n.getAttribute("htmlLiAttributes");!ci(o.getAttribute("htmlLiAttributes"),e)&&r.model.schema.checkAttribute(o,"htmlLiAttributes")&&(r.setAttribute("htmlLiAttributes",e,o),t.return=!0)}}})),n.on("postFixer",((t,{listNodes:e,writer:r})=>{for(const{node:o}of e){const e=o.getAttribute("listType");!i.isNumberedListType(e)&&o.getAttribute("htmlOlAttributes")&&(r.removeAttribute("htmlOlAttributes",o),t.return=!0),i.isNumberedListType(e)&&o.getAttribute("htmlUlAttributes")&&(r.removeAttribute("htmlUlAttributes",o),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 o of r){const r=di(o.getAttribute("listType"));t.model.schema.checkAttribute(o,r)&&e.setAttribute(r,{},o)}}))}))}}function mi(t,e){return(r,o,n)=>{const i=o.viewItem;o.modelRange||Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor));const s=e.processViewAttributes(i,n);for(const e of o.modelRange.getItems({shallow:!0}))e.hasAttribute("listItemId")&&(e.hasAttribute("htmlUlAttributes")||e.hasAttribute("htmlOlAttributes")||n.writer.model.schema.checkAttribute(e,t)&&n.writer.setAttribute(t,s||{},e))}}function di(t){return"numbered"===t||"customNumbered"==t?"htmlOlAttributes":"htmlUlAttributes"}class fi extends t.Plugin{static get requires(){return[Sn]}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,o=t.plugins.get(Sn);o.on("register:hr",((t,n)=>{"horizontalLine"===n.model&&(e.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),r.for("upcast").add(Lo(n,o)),r.for("downcast").add((t=>{t.on("attribute:htmlHrAttributes:horizontalLine",((t,e,r)=>{if(!r.consumable.test(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item),s=Rn(r.writer,i,"hr");s&&(xo(r.writer,o,n,s),r.consumable.consume(e.item,t.name))}),{priority:"low"})})),t.stop())}))}}class hi extends t.Plugin{static get requires(){return[Sn,hn]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.plugins.get(Sn),e=this.editor.plugins.get(hn);t.on("register:$customElement",((r,o)=>{r.stop();const i=this.editor,s=i.model.schema,l=i.conversion,a=i.editing.view.domConverter.unsafeElements,c=i.data.htmlProcessor.domConverter.preElements;s.register(o.model,o.modelSchema),s.extend(o.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),i.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),l.for("upcast").elementToElement({view:/.*/,model:(r,s)=>{if("$comment"==r.name)return null;if(!function(t){try{document.createElement(t)}catch(t){return!1}return!0}(r.name))return null;if(e.getDefinitionsForView(r.name).size)return null;a.includes(r.name)||a.push(r.name),c.includes(r.name)||c.push(r.name);const l=s.writer.createElement(o.model,{htmlElementName:r.name}),u=t.processViewAttributes(r,s);let m;if(u&&s.writer.setAttribute("htmlCustomElementAttributes",u,l),r.is("element","template")&&r.getCustomProperty("$rawContent"))m=r.getCustomProperty("$rawContent");else{const t=new n.UpcastWriter(r.document).createDocumentFragment(r),e=i.data.htmlProcessor.domConverter.viewToDom(t),o=e.firstChild;for(;o.firstChild;)e.appendChild(o.firstChild);o.remove(),m=i.data.htmlProcessor.htmlWriter.getHtml(e)}s.writer.setAttribute("htmlContent",m,l);for(const{item:t}of i.editing.view.createRangeIn(r))s.consumable.consume(t,{name:!0});return l},converterPriority:"low"}),l.for("editingDowncast").elementToElement({model:{name:o.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),o=e.createRawElement(r);return t.hasAttribute("htmlCustomElementAttributes")&&Po(e,t.getAttribute("htmlCustomElementAttributes"),o),o}}),l.for("dataDowncast").elementToElement({model:{name:o.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(t,{writer:e})=>{const r=t.getAttribute("htmlElementName"),o=t.getAttribute("htmlContent"),n=e.createRawElement(r,null,((t,e)=>{e.setContentOf(t,o)}));return t.hasAttribute("htmlCustomElementAttributes")&&Po(e,t.getAttribute("htmlCustomElementAttributes"),n),n}})}))}}class bi extends t.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[Sn,$n,Tn,Dn,Nn,Ln,Hn,Mn,Vn,ui,fi,hi]}init(){const t=this.editor,e=t.plugins.get(Sn);e.loadAllowedEmptyElementsConfig(t.config.get("htmlSupport.allowEmpty")||[]),e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(t){const e=this.editor.plugins.get("DataSchema"),r=Array.from(e.getDefinitionsForView(t,!1)),o=r.find((t=>t.isInline&&!r[0].isObject));return o?o.model:Io(t)}addModelHtmlClass(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of pi(n,o,i))Fo(t,s,i,"classes",(t=>{for(const o of(0,e.toArray)(r))t.add(o)}))}))}removeModelHtmlClass(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of pi(n,o,i))Fo(t,s,i,"classes",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}setModelHtmlAttributes(t,e,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change((t=>{for(const i of pi(o,r,n))Fo(t,i,n,"attributes",(t=>{for(const[r,o]of Object.entries(e))t.set(r,o)}))}))}removeModelHtmlAttributes(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of pi(n,o,i))Fo(t,s,i,"attributes",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}setModelHtmlStyles(t,e,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change((t=>{for(const i of pi(o,r,n))Fo(t,i,n,"styles",(t=>{for(const[r,o]of Object.entries(e))t.set(r,o)}))}))}removeModelHtmlStyles(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const s of pi(n,o,i))Fo(t,s,i,"styles",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}}function*pi(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 o 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*o.getItems({shallow:!0})}class gi 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 o=`$comment:${(0,e.uid)()}`,n=t.getCustomProperty("$rawContent");return r.set(o,n),o}}),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 o=t.markerName,n=r.getAttribute(o),i=e.createUIElement("$comment");return e.setCustomProperty("$rawContent",n,i),i}}),t.model.document.registerPostFixer((e=>{let o=!1;const n=t.model.document.differ.getChangedMarkers().filter((t=>t.name.startsWith("$comment:")));for(const t of n){const{oldRange:n,newRange:i}=t.data;if(!n||!i||n.root!=i.root){if(n){const r=n.root;r.hasAttribute(t.name)&&(e.removeAttribute(t.name,r),o=!0)}if(i){const n=i.root;"$graveyard"==n.rootName?(e.removeMarker(t.name),o=!0):n.hasAttribute(t.name)||(e.setAttribute(t.name,r.get(t.name)||"",n),o=!0)}}}return o})),t.data.on("set",(()=>{for(const e of t.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(e.name)}),{priority:"high"}),t.model.on("deleteContent",((e,[r])=>{for(const e of r.getRanges()){const r=t.model.schema.getLimitElement(e),o=t.model.createPositionAt(r,0),n=t.model.createPositionAt(r,"end");let i;i=o.isTouching(e.start)&&n.isTouching(e.end)?this.getHtmlCommentsInRange(t.model.createRange(o,n)):this.getHtmlCommentsInRange(e,{skipBoundaries:!0});for(const t of i)this.removeHtmlComment(t)}}),{priority:"high"})}createHtmlComment(t,r){const o=(0,e.uid)(),n=this.editor.model,i=n.document.getRoot(t.root.rootName),s=`$comment:${o}`;return n.change((e=>{const o=e.createRange(t);return e.addMarker(s,{usingOperation:!0,affectsData:!0,range:o}),e.setAttribute(s,r,i),s}))}removeHtmlComment(t){const e=this.editor,r=e.model.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 o=t.getRange().start;return(o.isAfter(e.start)||r&&o.isEqual(e.start))&&(o.isBefore(e.end)||r&&o.isEqual(e.end))}(e,t))).map((t=>t.name))}}class wi extends n.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 o=this._toDom(t),i=this.domConverter.domToView(o,{skipComments:this.skipComments}),s=new n.UpcastWriter(i.document);return s.setCustomProperty("$fullPageDocument",o.ownerDocument.documentElement.outerHTML,i),e&&s.setCustomProperty("$fullPageDocType",e,i),r&&s.setCustomProperty("$fullPageXmlDeclaration",r,i),i}toData(t){let e=super.toData(t);const r=t.getCustomProperty("$fullPageDocument"),o=t.getCustomProperty("$fullPageDocType"),n=t.getCustomProperty("$fullPageXmlDeclaration");return r&&(e=r.replace(/<\/body\s*>/,e+"$&"),o&&(e=o+"\n"+e),n&&(e=n+"\n"+e)),e}}class vi extends t.Plugin{static get pluginName(){return"FullPage"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration"];t.data.processor=new wi(t.data.viewDocument),t.model.schema.extend("$root",{allowAttributes:e}),t.data.on("toModel",((r,[o])=>{const n=t.model.document.getRoot();t.model.change((t=>{for(const r of e){const e=o.getCustomProperty(r);e&&t.setAttribute(r,e,n)}}))}),{priority:"low"}),t.data.on("toView",((t,[r])=>{if(!r.is("rootElement"))return;const o=r,i=t.return;if(!o.hasAttribute("$fullPageDocument"))return;const s=new n.UpcastWriter(i.document);for(const t of e){const e=o.getAttribute(t);e&&s.setCustomProperty(t,e,i)}}),{priority:"low"}),t.data.on("set",(()=>{const r=t.model.document.getRoot();t.model.change((t=>{for(const o of e)r.hasAttribute(o)&&t.removeAttribute(o,r)}))}),{priority:"high"}),t.data.on("get",((t,e)=>{e[0]||(e[0]={}),e[0].trim=!1}),{priority:"high"})}}const yi="htmlEmptyBlock";class Ai extends t.Plugin{static get pluginName(){return"EmptyBlock"}static get isOfficialPlugin(){return!0}afterInit(){const{model:t,conversion:e,plugins:r,config:o}=this.editor,n=t.schema,i=o.get("htmlSupport.preserveEmptyBlocksInEditingView");n.extend("$block",{allowAttributes:[yi]}),n.extend("$container",{allowAttributes:[yi]}),n.isRegistered("tableCell")&&n.extend("tableCell",{allowAttributes:[yi]}),i?e.for("downcast").add(Ei()):e.for("dataDowncast").add(Ei()),e.for("upcast").add(function(t){return e=>{e.on("element",((e,r,o)=>{const{viewItem:n,modelRange:i}=r;if(!n.is("element")||!n.isEmpty||n.getCustomProperty("$hasBlockFiller"))return;const s=i&&i.start.nodeAfter;if(!s||!t.checkAttribute(s,yi))return;if(o.writer.setAttribute(yi,!0,s),1!=s.childCount)return;const l=s.getChild(0);l.is("element","paragraph")&&t.checkAttribute(l,yi)&&o.writer.setAttribute(yi,!0,l)}),{priority:"lowest"})}}(n)),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(yi)&&t.removeAttribute(yi,r)}))}))}}function Ei(){return t=>{t.on(`attribute:${yi}`,((t,e,r)=>{const{mapper:o,consumable:n}=r,{item:i}=e;if(!n.consume(i,t.name))return;const s=o.toViewElement(i);s&&e.attributeNewValue&&(s.getFillerOffset=()=>null)}))}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=o})();
5
+ */(()=>{var e={21:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach((function(i){e.setAttribute(i,t[i])}))}},51:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},128:e=>{"use strict";var t={};e.exports=function(e,i){var r=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(i)}},237:e=>{"use strict";e.exports=CKEditor5.dll},275:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(758),o=i.n(r),n=i(935),l=i.n(n)()(o());l.push([e.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},507:(e,t,i)=>{e.exports=i(237)("./src/enter.js")},584:(e,t,i)=>{e.exports=i(237)("./src/utils.js")},591:e=>{"use strict";var t=[];function i(e){for(var i=-1,r=0;r<t.length;r++)if(t[r].identifier===e){i=r;break}return i}function r(e,r){for(var n={},l=[],s=0;s<e.length;s++){var a=e[s],m=r.base?a[0]+r.base:a[0],c=n[m]||0,u="".concat(m," ").concat(c);n[m]=c+1;var d=i(u),h={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)t[d].references++,t[d].updater(h);else{var f=o(h,r);r.byIndex=s,t.splice(s,0,{identifier:u,updater:f,references:1})}l.push(u)}return l}function o(e,t){var i=t.domAPI(t);i.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,o){var n=r(e=e||[],o=o||{});return function(e){e=e||[];for(var l=0;l<n.length;l++){var s=i(n[l]);t[s].references--}for(var a=r(e,o),m=0;m<n.length;m++){var c=i(n[m]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}n=a}}},639:e=>{"use strict";var t,i=(t=[],function(e,i){return t[e]=i,t.filter(Boolean).join("\n")});function r(e,t,r,o){var n;if(r)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(e.styleSheet)e.styleSheet.cssText=i(t,n);else{var s=document.createTextNode(n),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(s,a[t]):e.appendChild(s)}}var o={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=o.singletonCounter++,i=o.singleton||(o.singleton=e.insertStyleElement(e));return{update:function(e){r(i,t,!1,e)},remove:function(e){r(i,t,!0,e)}}}},758:e=>{"use strict";e.exports=function(e){return e[1]}},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")},783:(e,t,i)=>{e.exports=i(237)("./src/engine.js")},901:(e,t,i)=>{e.exports=i(237)("./src/widget.js")},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",r=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),r&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),r&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,r,o,n){"string"==typeof e&&(e=[[null,e,void 0]]);var l={};if(r)for(var s=0;s<this.length;s++){var a=this[s][0];null!=a&&(l[a]=!0)}for(var m=0;m<e.length;m++){var c=[].concat(e[m]);r&&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),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c))}},t}}},t={};function i(r){var o=t[r];if(void 0!==o)return o.exports;var n=t[r]={id:r,exports:{}};return e[r](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";i.r(r),i.d(r,{DataFilter:()=>pe,DataSchema:()=>oe,EmptyBlock:()=>Je,FullPage:()=>Xe,GeneralHtmlSupport:()=>qe,HtmlComment:()=>Ge,HtmlPageDataProcessor:()=>Ke});var e=i(782),t=i(584),o=i(783),n=i(901);function l(e){return Object.getOwnPropertySymbols(e).filter((t=>Object.prototype.propertyIsEnumerable.call(e,t)))}function s(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}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 I(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function $(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _(e,t,i,r=new Map,o=void 0){const n=o?.(e,t,i,r);if(null!=n)return n;if(I(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const t=new Array(e.length);r.set(e,t);for(let n=0;n<e.length;n++)t[n]=_(e[n],n,i,r,o);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;r.set(e,t);for(const[n,l]of e)t.set(n,_(l,n,i,r,o));return t}if(e instanceof Set){const t=new Set;r.set(e,t);for(const n of e)t.add(_(n,void 0,i,r,o));return t}if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e.subarray();if($(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);r.set(e,t);for(let n=0;n<e.length;n++)t[n]=_(e[n],n,i,r,o);return t}if(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),B(t,e,i,r,o),t}if("undefined"!=typeof File&&e instanceof File){const t=new File([e],e.name,{type:e.type});return r.set(e,t),B(t,e,i,r,o),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return r.set(e,t),B(t,e,i,r,o),t}if(e instanceof Error){const t=new e.constructor;return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,B(t,e,i,r,o),t}if("object"==typeof e&&function(e){switch(s(e)){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}}(e)){const t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),B(t,e,i,r,o),t}return e}function B(e,t,i=e,r,o){const n=[...Object.keys(t),...l(t)];for(let l=0;l<n.length;l++){const s=n[l],a=Object.getOwnPropertyDescriptor(e,s);(null==a||a.writable)&&(e[s]=_(t[s],s,i,r,o))}}function x(e,t){return function(e,t){return _(e,void 0,e,new Map,t)}(e,((i,r,o,n)=>{const l=t?.(i,r,o,n);if(null!=l)return l;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case c:case m:case u:{const t=new e.constructor(e?.valueOf());return B(t,e),t}case d:{const t={};return B(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}))}function T(e){return x(e)}const D=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function R(e){if(null==e)return"";if(Array.isArray(e))return e.map(R).join(",");const t=String(e);return"0"===t&&Object.is(Number(e),-0)?"-0":t}function N(e){const t=function(e){return Array.from(e.match(D)??[])}(function(e){return"string"!=typeof e&&(e=R(e)),e.replace(/['\u2019]/g,"")}(e).trim());let i="";for(let e=0;e<t.length;e++){const r=t[e];i&&(i+=" "),r===r.toUpperCase()?i+=r:i+=r[0].toUpperCase()+r.slice(1).toLowerCase()}return i}function H(e,t,i,r){t&&function(e,t,i){if(t.attributes)for(const[r]of Object.entries(t.attributes))e.removeAttribute(r,i);if(t.styles)for(const r of Object.keys(t.styles))e.removeStyle(r,i);t.classes&&e.removeClass(t.classes,i)}(e,t,r),i&&V(e,i,r)}function V(e,t,i){if(t.attributes)for(const[r,o]of Object.entries(t.attributes))e.setAttribute(r,o,i);t.styles&&e.setStyle(t.styles,i),t.classes&&e.addClass(t.classes,i)}function L(e,t,i,r,o){const n=t.getAttribute(i),l={};for(const e of["attributes","styles","classes"]){if(e!=r){n&&n[e]&&(l[e]=n[e]);continue}if("classes"==r){const t=new Set(n&&n.classes||[]);o(t),t.size&&(l[e]=Array.from(t));continue}const t=new Map(Object.entries(n&&n[e]||{}));o(t),t.size&&(l[e]=Object.fromEntries(t))}Object.keys(l).length?t.is("documentSelection")?e.setSelectionAttribute(i,l):e.setAttribute(i,l,t):n&&(t.is("documentSelection")?e.removeSelectionAttribute(i):e.removeAttribute(i,t))}function M(e){return`html${t=e,N(t).replace(/ /g,"")}Attributes`;var t}function U({model:e}){return(t,i)=>i.writer.createElement(e,{htmlContent:t.getCustomProperty("$rawContent")})}function z(e,{view:t,isInline:i}){const r=e.t;return(e,{writer:o})=>{const l=r("HTML object"),s=q(t,e,o),a=e.getAttribute(M(t));o.addClass("html-object-embed__content",s),a&&V(o,a,s);const m=o.createContainerElement(i?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},s);return(0,n.toWidget)(m,o,{label:l})}}function q(e,t,i){return i.createRawElement(e,null,((e,i)=>{i.setContentOf(e,t.getAttribute("htmlContent"))}))}function W({view:e,model:t,allowEmpty:i},r){return t=>{t.on(`element:${e}`,((e,t,n)=>{let l=r.processViewAttributes(t.viewItem,n);if(l||n.consumable.test(t.viewItem,{name:!0})){if(l=l||{},n.consumable.consume(t.viewItem,{name:!0}),t.modelRange||(t=Object.assign(t,n.convertChildren(t.viewItem,t.modelCursor))),i&&t.modelRange.isCollapsed&&Object.keys(l).length){const e=n.writer.createElement("htmlEmptyElement");if(!n.safeInsert(e,t.modelCursor))return;const i=n.getSplitParts(e);return t.modelRange=n.writer.createRange(t.modelRange.start,n.writer.createPositionAfter(i[i.length-1])),n.updateConversionResult(e,t),void o(e,l,n)}for(const e of t.modelRange.getItems())o(e,l,n)}}),{priority:"low"})};function o(e,i,r){if(r.schema.checkAttribute(e,t)){const o=function(e,t){const i=T(e);let r="attributes";for(r in t)i[r]="classes"==r?Array.from(new Set([...e[r]||[],...t[r]])):{...e[r],...t[r]};return i}(i,e.getAttribute(t)||{});r.writer.setAttribute(t,o,e)}}}function G({model:e,view:t},i){return(r,{writer:o,consumable:l})=>{if(!r.hasAttribute(e))return null;const s=o.createContainerElement(t),a=r.getAttribute(e);return l.consume(r,`attribute:${e}`),V(o,a,s),s.getFillerOffset=()=>null,i?(0,n.toWidget)(s,o):s}}function K({priority:e,view:t}){return(i,r)=>{if(!i)return;const{writer:o}=r,n=o.createAttributeElement(t,null,{priority:e});return V(o,i,n),n}}function X({view:e},t){return i=>{i.on(`element:${e}`,((e,i,r)=>{if(!i.modelRange||i.modelRange.isCollapsed)return;const o=t.processViewAttributes(i.viewItem,r);o&&r.writer.setAttribute(M(i.viewItem.name),o,i.modelRange)}),{priority:"low"})}}function Q({view:e,model:t}){return i=>{i.on(`attribute:${M(e)}:${t}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t;H(i.writer,r,o,i.mapper.toViewElement(t.item))}))}}const Y=[{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"}}],J=[{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"},{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 Z(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===s(e)}function ee(e){return"object"==typeof e&&null!==e}function te(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];if(null==t)return!1;return!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ie(e,...t){const i=t.slice(0,-1),r=t[t.length-1];let o=e;for(let e=0;e<i.length;e++){o=re(o,i[e],r,new Map)}return o}function re(e,t,i,r){if(I(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(r.has(t))return function(e){if(I(e))return e;if(Array.isArray(e)||$(e)||e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e),i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){const t=new i(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}if("undefined"!=typeof File&&e instanceof File)return new i([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const i=Object.create(t);return Object.assign(i,e)}return e}(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}const o=[...Object.keys(t),...l(t)];for(let n=0;n<o.length;n++){const l=o[n];let s=t[l],a=e[l];if(Z(s)&&(s={...s}),Z(a)&&(a={...a}),"undefined"!=typeof Buffer&&Buffer.isBuffer(s)&&(s=T(s)),Array.isArray(s))if("object"==typeof a&&null!=a){const e=[],t=Reflect.ownKeys(a);for(let i=0;i<t.length;i++){const r=t[i];e[r]=a[r]}a=e}else a=[];const m=i(a,s,l,e,t,r);null!=m?e[l]=m:Array.isArray(s)||ee(a)&&ee(s)?e[l]=re(a,s,i,r):null==a&&te(s)?e[l]=re({},s,i,r):null==a&&$(s)?e[l]=T(s):void 0!==a&&void 0===s||(e[l]=s)}return e}class oe extends e.Plugin{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const e of Y)this.registerBlockElement(e);for(const e of J)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push({...e,isBlock:!0})}registerInlineElement(e){this._definitions.push({...e,isInline:!0})}extendBlockElement(e){this._extendDefinition({...e,isBlock:!0})}extendInlineElement(e){this._extendDefinition({...e,isInline:!0})}getDefinitionsForView(e,t=!1){const i=new Set;for(const r of this._getMatchingViewDefinitions(e)){if(t)for(const e of this._getReferences(r.model))i.add(e);i.add(r)}return i}getDefinitionsForModel(e){return this._definitions.filter((t=>t.model==e))}_getMatchingViewDefinitions(e){return this._definitions.filter((t=>t.view&&function(e,t){if("string"==typeof e)return e===t;if(e instanceof RegExp)return e.test(t);return!1}(e,t.view)))}*_getReferences(e){const i=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],r=this._definitions.filter((t=>t.model==e));for(const{modelSchema:o}of r)if(o)for(const r of i)for(const i of(0,t.toArray)(o[r]||[])){const t=this._definitions.filter((e=>e.model==i));for(const r of t)i!==e&&(yield*this._getReferences(r.model),yield r)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter((([,t])=>t.model==e.model));if(0!=t.length)for(const[i,r]of t)this._definitions[i]=ie({},r,e,((e,t)=>Array.isArray(e)?e.concat(t):void 0));else this._definitions.push(e)}}var ne=i(591),le=i.n(ne),se=i(639),ae=i.n(se),me=i(128),ce=i.n(me),ue=i(21),de=i.n(ue),he=i(51),fe=i.n(he),ge=i(275),be={attributes:{"data-cke":!0}};be.setAttributes=de(),be.insert=ce().bind(null,"head"),be.domAPI=ae(),be.insertStyleElement=fe();le()(ge.A,be);ge.A&&ge.A.locals&&ge.A.locals;class pe extends e.Plugin{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(e){super(e),this._dataSchema=e.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[oe,n.Widget]}loadAllowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=Ee(t);this.allowElement(e),i.forEach((e=>this.allowAttributes(e)))}}loadDisallowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=Ee(t);0==i.length?this.disallowElement(e):i.forEach((e=>this.disallowAttributes(e)))}}loadAllowedEmptyElementsConfig(e){for(const t of e)this.allowEmptyElement(t)}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowEmptyElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))t.isInline&&this._dataSchema.extendInlineElement({...t,allowEmpty:!0})}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){const{consumable:i}=t;return we(e,this._disallowedAttributes,i),function(e,{attributes:t,classes:i,styles:r}){if(!t.length&&!i.length&&!r.length)return null;return{...t.length&&{attributes:Ae(e,t)},...r.length&&{styles:ye(e,r)},...i.length&&{classes:i}}}(e,we(e,this._allowedAttributes,i))}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&"string"==typeof e.appliesToBlock)for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",(()=>{this._fireRegisterEvent(e)}),{priority:t.priorities.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)}),{priority:t.priorities.highest+1})}_registerElementHandlers(){this.on("register",((e,i)=>{const r=this.editor.model.schema;if(i.isObject&&!r.isRegistered(i.model))this._registerObjectElement(i);else if(i.isBlock)this._registerBlockElement(i);else{if(!i.isInline)throw new t.CKEditorError("data-filter-invalid-definition",null,i);this._registerInlineElement(i)}e.stop()}),{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const e=this.editor.model,t=e.document.selection;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let r=!1;const o=this._getCoupledAttributesMap();for(const e of i){if("attribute"!=e.type||null!==e.attributeNewValue)continue;const i=o.get(e.attributeKey);if(i)for(const{item:o}of e.range.getWalker())for(const e of i)o.hasAttribute(e)&&(t.removeAttribute(e,o),r=!0)}return r})),this.listenTo(t,"change:attribute",((i,{attributeKeys:r})=>{const o=new Set,n=this._getCoupledAttributesMap();for(const e of r){if(t.hasAttribute(e))continue;const i=n.get(e);if(i)for(const e of i)t.hasAttribute(e)&&o.add(e)}0!=o.size&&e.change((e=>{for(const t of o)e.removeSelectionAttribute(t)}))}))}_registerAssociatedHtmlAttributesPostFixer(){const e=this.editor.model;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let r=!1;for(const o of i)if("insert"===o.type&&"$text"!==o.name)for(const i of o.attributes.keys())i.startsWith("html")&&i.endsWith("Attributes")&&(e.schema.checkAttribute(o.name,i)||(t.removeAttribute(i,o.position.nodeAfter),r=!0));return r}))}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const i=this.editor,r=i.model.schema,o=i.conversion,{view:n,model:l}=e;r.register(l,e.modelSchema),n&&(r.extend(e.model,{allowAttributes:[M(n),"htmlContent"]}),i.data.registerRawContentMatcher({name:n}),o.for("upcast").elementToElement({view:n,model:U(e),converterPriority:t.priorities.low+2}),o.for("upcast").add(X(e,this)),o.for("editingDowncast").elementToStructure({model:{name:l,attributes:[M(n)]},view:z(i,e)}),o.for("dataDowncast").elementToElement({model:l,view:(e,{writer:t})=>q(n,e,t)}),o.for("dataDowncast").add(Q(e)))}_registerBlockElement(e){const i=this.editor,r=i.model.schema,o=i.conversion,{view:n,model:l}=e;if(!r.isRegistered(e.model)){if(!e.modelSchema)return;if(r.register(e.model,e.modelSchema),!n)return;o.for("upcast").elementToElement({model:l,view:n,converterPriority:t.priorities.low+2}),o.for("downcast").elementToElement({model:l,view:(t,{writer:i})=>e.isEmpty?i.createEmptyElement(n):i.createContainerElement(n)})}n&&(r.extend(e.model,{allowAttributes:M(n)}),o.for("upcast").add(X(e,this)),o.for("downcast").add(Q(e)))}_registerInlineElement(e){const t=this.editor,i=t.model.schema,r=t.conversion,o=e.model;e.appliesToBlock||(i.extend("$text",{allowAttributes:o}),e.attributeProperties&&i.setAttributeProperties(o,e.attributeProperties),r.for("upcast").add(W(e,this)),r.for("downcast").attributeToElement({model:o,view:K(e)}),e.allowEmpty&&(i.setAttributeProperties(o,{copyFromObject:!1}),i.isRegistered("htmlEmptyElement")||i.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"}),t.data.htmlProcessor.domConverter.registerInlineObjectMatcher((t=>t.name==e.view&&t.isEmpty&&Array.from(t.getAttributeKeys()).length?{name:!0}:null)),r.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:G(e,!0)}),r.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:G(e)})))}}function we(e,t,i){const r=t.matchAll(e)||[],o=e.document.stylesProcessor;return r.reduce(((t,{match:r})=>{for(const[n,l]of r.attributes||[])if("style"==n){const r=l,n=o.getRelatedStyles(r).filter((e=>e.split("-").length>r.split("-").length)).sort(((e,t)=>t.split("-").length-e.split("-").length));for(const r of n)i.consume(e,{styles:[r]})&&t.styles.push(r);i.consume(e,{styles:[r]})&&t.styles.push(r)}else if("class"==n){const r=l;i.consume(e,{classes:[r]})&&t.classes.push(r)}else i.consume(e,{attributes:[n]})&&t.attributes.push(n);return t}),{attributes:[],classes:[],styles:[]})}function Ae(e,i){const r={};for(const o of i){const i=e.getAttribute(o);void 0!==i&&(0,t.isValidAttributeName)(o)&&(r[o]=i)}return r}function ye(e,t){const i=new o.StylesMap(e.document.stylesProcessor);for(const r of t){const t=e.getStyle(r);void 0!==t&&i.set(r,t)}return Object.fromEntries(i.getStylesEntries())}function ve(e,t){const{name:i}=e,r=e[t];return te(r)?Object.entries(r).map((([e,r])=>({name:i,[t]:{[e]:r}}))):Array.isArray(r)?r.map((e=>({name:i,[t]:[e]}))):[e]}function Ee(e){const{name:t,attributes:i,classes:r,styles:o}=e,n=[];return i&&n.push(...ve({name:t,attributes:i},"attributes")),r&&n.push(...ve({name:t,classes:r},"classes")),o&&n.push(...ve({name:t,styles:o},"styles")),n}class Se extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(pe);e.on("register:pre",((t,i)=>{if("codeBlock"!==i.model)return;const r=this.editor,o=r.model.schema,n=r.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),n.for("upcast").add(function(e){return t=>{t.on("element:code",((t,i,r)=>{const o=i.viewItem,n=o.parent;function l(t,o){const n=e.processViewAttributes(t,r);n&&r.writer.setAttribute(o,n,i.modelRange)}n&&n.is("element","pre")&&(l(n,"htmlPreAttributes"),l(o,"htmlContentAttributes"))}),{priority:"low"})}}(e)),n.for("downcast").add((e=>{e.on("attribute:htmlPreAttributes:codeBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item).parent;H(i.writer,r,o,n)})),e.on("attribute:htmlContentAttributes:codeBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item);H(i.writer,r,o,n)}))})),t.stop()}))}}class ke extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(pe).on("register",((e,i)=>{const r=i,o=this.editor,n=o.model.schema,l=o.conversion;if(!r.paragraphLikeModel)return;if(n.isRegistered(r.model)||n.isRegistered(r.paragraphLikeModel))return;const s={model:r.paragraphLikeModel,view:r.view};n.register(r.model,r.modelSchema),n.register(s.model,{inheritAllFrom:"$block"}),l.for("upcast").elementToElement({view:r.view,model:(e,{writer:t})=>this._hasBlockContent(e)?t.createElement(r.model):t.createElement(s.model),converterPriority:t.priorities.low+.5}),l.for("downcast").elementToElement({view:r.view,model:r.model}),this._addAttributeConversion(r),l.for("downcast").elementToElement({view:s.view,model:s.model}),this._addAttributeConversion(s),e.stop()}))}_hasBlockContent(e){const t=this.editor.editing.view,i=t.domConverter.blockElements;for(const r of t.createRangeIn(e).getItems())if(r.is("element")&&i.includes(r.name))return!0;return!1}_addAttributeConversion(e){const t=this.editor,i=t.conversion,r=t.plugins.get(pe);t.model.schema.extend(e.model,{allowAttributes:M(e.view)}),i.for("upcast").add(X(e,r)),i.for("downcast").add(Q(e))}}var Oe=i(507);class Ce extends e.Plugin{static get requires(){return[oe,Oe.Enter]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const t=e.config.get("heading.options");this.registerHeadingElements(e,t)}registerHeadingElements(e,t){const i=e.plugins.get(oe),r=[];for(const e of t)"model"in e&&"view"in e&&(i.registerBlockElement({view:e.view,model:e.model}),r.push(e.model));i.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:r}}),i.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:r}})}}function je(e,t,i){const r=e.createRangeOn(t);for(const{item:e}of r.getWalker())if(e.is("element",i))return e}class Pe extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(pe);r.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("image"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)}),{priority:"low"})}}(r))})),r.on("register:img",((o,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:img",((t,i,r)=>{if(!i.modelRange)return;const o=i.viewItem,n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlImgAttributes",n,i.modelRange)}),{priority:"low"})}}(r)),i.for("downcast").add((e=>{function t(t){e.on(`attribute:${t}:imageInline`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item);H(i.writer,r,o,n)}),{priority:"low"})}function i(t,i){e.on(`attribute:${i}:imageBlock`,((e,i,r)=>{if(!r.consumable.test(i.item,e.name))return;const{attributeOldValue:o,attributeNewValue:n}=i,l=r.mapper.toViewElement(i.item),s=je(r.writer,l,t);s&&(H(r.writer,o,n,s),r.consumable.consume(i.item,e.name))}),{priority:"low"}),"a"===t&&e.on("attribute:linkHref:imageBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,"attribute:htmlLinkAttributes:imageBlock"))return;const r=i.mapper.toViewElement(t.item),o=je(i.writer,r,"a");V(i.writer,t.item.getAttribute("htmlLinkAttributes"),o)}),{priority:"low"})}t("htmlImgAttributes"),i("img","htmlImgAttributes"),i("figure","htmlFigureAttributes"),i("a","htmlLinkAttributes")})),e.plugins.has("LinkImage")&&i.for("upcast").add(function(e,t){const i=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,r,o)=>{const n=r.viewItem;if(!i.findViewImgElement(n))return;const l=r.modelCursor.parent;if(!l.is("element","imageBlock"))return;const s=e.processViewAttributes(n,o);s&&o.writer.setAttribute("htmlLinkAttributes",s,l)}),{priority:"low"})}}(r,e)),o.stop())}))}}class Fe extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const t=e.model.schema,i=e.conversion,r=this.editor.plugins.get(pe),o=this.editor.plugins.get(oe),n=e.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:n}),r.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("media"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)}),{priority:"low"})}}(r))})),r.on(`register:${n}`,((e,o)=>{"media"===o.model&&(t.extend("media",{allowAttributes:[M(n),"htmlFigureAttributes"]}),i.for("upcast").add(function(e,t){const i=(i,r,o)=>{function n(t,i){const n=e.processViewAttributes(t,o);n&&o.writer.setAttribute(i,n,r.modelRange)}n(r.viewItem,M(t))};return e=>{e.on(`element:${t}`,i,{priority:"low"})}}(r,n)),i.for("dataDowncast").add(function(e){return t=>{function i(e,i){t.on(`attribute:${i}:media`,((t,i,r)=>{if(!r.consumable.consume(i.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=i,l=r.mapper.toViewElement(i.item),s=je(r.writer,l,e);H(r.writer,o,n,s)}))}i(e,M(e)),i("figure","htmlFigureAttributes")}}(n)),e.stop())}))}}class Ie extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(pe);e.on("register:script",((t,i)=>{const r=this.editor,o=r.model.schema,n=r.conversion;o.register("htmlScript",i.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"script"}),n.for("upcast").elementToElement({view:"script",model:U(i)}),n.for("upcast").add(X(i,e)),n.for("downcast").elementToElement({model:"htmlScript",view:(e,{writer:t})=>q("script",e,t)}),n.for("downcast").add(Q(i)),t.stop()}))}}const $e=["width","max-width","min-width","height","min-height","max-height"];class _e extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(pe),o=e.plugins.get("TableUtils");r.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("table"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)}),{priority:"low"})}}(r))})),r.on("register:table",((n,l)=>{"table"===l.model&&(t.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:table",((t,i,r)=>{if(!i.modelRange)return;const o=i.viewItem;n(o,"htmlTableAttributes");for(const e of o.getChildren())e.is("element","thead")&&n(e,"htmlTheadAttributes"),e.is("element","tbody")&&n(e,"htmlTbodyAttributes");function n(t,o){const n=e.processViewAttributes(t,r);n&&r.writer.setAttribute(o,n,i.modelRange)}}),{priority:"low"})}}(r)),i.for("downcast").add((e=>{function t(t,i){e.on(`attribute:${i}:table`,((e,r,o)=>{if(!o.consumable.test(r.item,e.name))return;const n=o.mapper.toViewElement(r.item),l=je(o.writer,n,t);if(l)if(o.consumable.consume(r.item,e.name),"htmlTableAttributes"===i&&n!==l){const e=Be(r.attributeOldValue),t=Be(r.attributeNewValue);H(o.writer,e.tableAttributes,t.tableAttributes,l),H(o.writer,e.figureAttributes,t.figureAttributes,n)}else H(o.writer,r.attributeOldValue,r.attributeNewValue,l)}))}t("table","htmlTableAttributes"),t("figure","htmlFigureAttributes"),t("thead","htmlTheadAttributes"),t("tbody","htmlTbodyAttributes")})),e.model.document.registerPostFixer(function(e,t){return i=>{const r=e.document.differ.getChanges();let o=!1;for(const e of r){if("attribute"!=e.type||"headingRows"!=e.attributeKey)continue;const r=e.range.start.nodeAfter,n=r.getAttribute("htmlTheadAttributes"),l=r.getAttribute("htmlTbodyAttributes");n&&!e.attributeNewValue?(i.removeAttribute("htmlTheadAttributes",r),o=!0):l&&e.attributeNewValue==t.getRows(r)&&(i.removeAttribute("htmlTbodyAttributes",r),o=!0)}return o}}(e.model,o)),n.stop())}))}}function Be(e){const t={},i={...e};if(!e||!("styles"in e))return{figureAttributes:t,tableAttributes:i};i.styles={};for(const[r,o]of Object.entries(e.styles))$e.includes(r)?t.styles={...t.styles,[r]:o}:i.styles={...i.styles,[r]:o};return{figureAttributes:t,tableAttributes:i}}class xe extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(pe);e.on("register:style",((t,i)=>{const r=this.editor,o=r.model.schema,n=r.conversion;o.register("htmlStyle",i.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"style"}),n.for("upcast").elementToElement({view:"style",model:U(i)}),n.for("upcast").add(X(i,e)),n.for("downcast").elementToElement({model:"htmlStyle",view:(e,{writer:t})=>q("style",e,t)}),n.for("downcast").add(Q(i)),t.stop()}))}}function Te(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function De(e,t,i,r,o,n,l){const s=l(e,t,i,r,o,n);if(void 0!==s)return s;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Re(e,t,n,l)}return Re(e,t,n,l)}function Re(e,t,i,r){if(Object.is(e,t))return!0;let o=s(e),n=s(t);if(o===d&&(o=A),n===d&&(n=A),o!==n)return!1;switch(o){case m:return e.toString()===t.toString();case c:{const i=e.valueOf(),r=t.valueOf();return(I=i)===($=r)||Number.isNaN(I)&&Number.isNaN($)}case u:case f:case h:return Object.is(e.valueOf(),t.valueOf());case a:return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}var I,$;const _=(i=i??new Map).get(e),B=i.get(t);if(null!=_&&null!=B)return _===t;i.set(e,t),i.set(t,e);try{switch(o){case g:if(e.size!==t.size)return!1;for(const[o,n]of e.entries())if(!t.has(o)||!De(n,t.get(o),o,e,t,i,r))return!1;return!0;case b:{if(e.size!==t.size)return!1;const o=Array.from(e.values()),n=Array.from(t.values());for(let l=0;l<o.length;l++){const s=o[l],a=n.findIndex((o=>De(s,o,void 0,e,t,i,r)));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(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!De(e[o],t[o],o,e,t,i,r))return!1;return!0;case w:return e.byteLength===t.byteLength&&Re(new Uint8Array(e),new Uint8Array(t),i,r);case y:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Re(new Uint8Array(e),new Uint8Array(t),i,r);case"[object Error]":return e.name===t.name&&e.message===t.message;case A:{if(!(Re(e.constructor,t.constructor,i,r)||Te(e)&&Te(t)))return!1;const o=[...Object.keys(e),...l(e)],n=[...Object.keys(t),...l(t)];if(o.length!==n.length)return!1;for(let n=0;n<o.length;n++){const l=o[n],s=e[l];if(!Object.hasOwn(t,l))return!1;if(!De(s,t[l],l,e,t,i,r))return!1}return!0}default:return!1}}finally{i.delete(e),i.delete(t)}}function Ne(){}function He(e,t){return function(e,t,i){return De(e,t,void 0,void 0,void 0,void 0,i)}(e,t,Ne)}class Ve extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ListEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(pe),o=e.plugins.get("ListEditing"),n=e.plugins.get("ListUtils"),l=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:V}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:V}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:V}),r.on("register",((e,o)=>{if(!l.includes(o.view))return;if(e.stop(),t.checkAttribute("$block","htmlLiAttributes"))return;const n=l.map((e=>M(e)));t.extend("$listItem",{allowAttributes:n}),i.for("upcast").add((e=>{e.on("element:ul",Le("htmlUlAttributes",r),{priority:"low"}),e.on("element:ol",Le("htmlOlAttributes",r),{priority:"low"}),e.on("element:li",Le("htmlLiAttributes",r),{priority:"low"})}))})),o.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:r,previousNodeInList:o}of t)if(o){if(o.getAttribute("listType")==r.getAttribute("listType")){const t=Me(o.getAttribute("listType")),n=o.getAttribute(t);!He(r.getAttribute(t),n)&&i.model.schema.checkAttribute(r,t)&&(i.setAttribute(t,n,r),e.return=!0)}if(o.getAttribute("listItemId")==r.getAttribute("listItemId")){const t=o.getAttribute("htmlLiAttributes");!He(r.getAttribute("htmlLiAttributes"),t)&&i.model.schema.checkAttribute(r,"htmlLiAttributes")&&(i.setAttribute("htmlLiAttributes",t,r),e.return=!0)}}})),o.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:r}of t){const t=r.getAttribute("listType");!n.isNumberedListType(t)&&r.getAttribute("htmlOlAttributes")&&(i.removeAttribute("htmlOlAttributes",r),e.return=!0),n.isNumberedListType(t)&&r.getAttribute("htmlUlAttributes")&&(i.removeAttribute("htmlUlAttributes",r),e.return=!0)}}))}afterInit(){const e=this.editor;if(!e.commands.get("indentList"))return;const t=e.commands.get("indentList");this.listenTo(t,"afterExecute",((t,i)=>{e.model.change((t=>{for(const r of i){const i=Me(r.getAttribute("listType"));e.model.schema.checkAttribute(r,i)&&t.setAttribute(i,{},r)}}))}))}}function Le(e,t){return(i,r,o)=>{const n=r.viewItem;r.modelRange||Object.assign(r,o.convertChildren(r.viewItem,r.modelCursor));const l=t.processViewAttributes(n,o);for(const t of r.modelRange.getItems({shallow:!0}))t.hasAttribute("listItemId")&&(t.hasAttribute("htmlUlAttributes")||t.hasAttribute("htmlOlAttributes")||o.writer.model.schema.checkAttribute(t,e)&&o.writer.setAttribute(e,l||{},t))}}function Me(e){return"numbered"===e||"customNumbered"==e?"htmlOlAttributes":"htmlUlAttributes"}class Ue extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"HorizontalLineElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HorizontalLineEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(pe);r.on("register:hr",((e,o)=>{"horizontalLine"===o.model&&(t.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),i.for("upcast").add(X(o,r)),i.for("downcast").add((e=>{e.on("attribute:htmlHrAttributes:horizontalLine",((e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item),l=je(i.writer,n,"hr");l&&(H(i.writer,r,o,l),i.consumable.consume(t.item,e.name))}),{priority:"low"})})),e.stop())}))}}class ze extends e.Plugin{static get requires(){return[pe,oe]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(pe),t=this.editor.plugins.get(oe);e.on("register:$customElement",((i,r)=>{i.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(r.model,r.modelSchema),l.extend(r.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),n.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),s.for("upcast").elementToElement({view:/.*/,model:(i,l)=>{if("$comment"==i.name)return null;if(!function(e){try{document.createElement(e)}catch(e){return!1}return!0}(i.name))return null;if(t.getDefinitionsForView(i.name).size)return null;a.includes(i.name)||a.push(i.name),m.includes(i.name)||m.push(i.name);const s=l.writer.createElement(r.model,{htmlElementName:i.name}),c=e.processViewAttributes(i,l);let u;if(c&&l.writer.setAttribute("htmlCustomElementAttributes",c,s),i.is("element","template")&&i.getCustomProperty("$rawContent"))u=i.getCustomProperty("$rawContent");else{const e=new o.UpcastWriter(i.document).createDocumentFragment(i),t=n.data.htmlProcessor.domConverter.viewToDom(e),r=t.firstChild;for(;r.firstChild;)t.appendChild(r.firstChild);r.remove(),u=n.data.htmlProcessor.htmlWriter.getHtml(t)}l.writer.setAttribute("htmlContent",u,s);for(const{item:e}of n.editing.view.createRangeIn(i))l.consumable.consume(e,{name:!0});return s},converterPriority:"low"}),s.for("editingDowncast").elementToElement({model:{name:r.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),r=t.createRawElement(i);return e.hasAttribute("htmlCustomElementAttributes")&&V(t,e.getAttribute("htmlCustomElementAttributes"),r),r}}),s.for("dataDowncast").elementToElement({model:{name:r.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),r=e.getAttribute("htmlContent"),o=t.createRawElement(i,null,((e,t)=>{t.setContentOf(e,r)}));return e.hasAttribute("htmlCustomElementAttributes")&&V(t,e.getAttribute("htmlCustomElementAttributes"),o),o}})}))}}class qe extends e.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[pe,Se,ke,Ce,Pe,Fe,Ie,_e,xe,Ve,Ue,ze]}init(){const e=this.editor,t=e.plugins.get(pe);t.loadAllowedEmptyElementsConfig(e.config.get("htmlSupport.allowEmpty")||[]),t.loadAllowedConfig(e.config.get("htmlSupport.allow")||[]),t.loadDisallowedConfig(e.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(e){const t=this.editor.plugins.get("DataSchema"),i=Array.from(t.getDefinitionsForView(e,!1)),r=i.find((e=>e.isInline&&!i[0].isObject));return r?r.model:M(e)}addModelHtmlClass(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change((e=>{for(const l of We(o,r,n))L(e,l,n,"classes",(e=>{for(const r of(0,t.toArray)(i))e.add(r)}))}))}removeModelHtmlClass(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change((e=>{for(const l of We(o,r,n))L(e,l,n,"classes",(e=>{for(const r of(0,t.toArray)(i))e.delete(r)}))}))}setModelHtmlAttributes(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change((e=>{for(const n of We(r,i,o))L(e,n,o,"attributes",(e=>{for(const[i,r]of Object.entries(t))e.set(i,r)}))}))}removeModelHtmlAttributes(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change((e=>{for(const l of We(o,r,n))L(e,l,n,"attributes",(e=>{for(const r of(0,t.toArray)(i))e.delete(r)}))}))}setModelHtmlStyles(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change((e=>{for(const n of We(r,i,o))L(e,n,o,"styles",(e=>{for(const[i,r]of Object.entries(t))e.set(i,r)}))}))}removeModelHtmlStyles(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change((e=>{for(const l of We(o,r,n))L(e,l,n,"styles",(e=>{for(const r of(0,t.toArray)(i))e.delete(r)}))}))}}function*We(e,t,i){if(t)if(!(Symbol.iterator in t)&&t.is("documentSelection")&&t.isCollapsed)e.schema.checkAttributeInSelection(t,i)&&(yield t);else for(const r of function(e,t,i){return!(Symbol.iterator in t)&&(t.is("node")||t.is("$text")||t.is("$textProxy"))?e.schema.checkAttribute(t,i)?[e.createRangeOn(t)]:[]:e.schema.getValidRanges(e.createSelection(t).getRanges(),i)}(e,t,i))yield*r.getItems({shallow:!0})}class Ge extends e.Plugin{static get pluginName(){return"HtmlComment"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=new Map;e.data.processor.skipComments=!1,e.model.schema.addAttributeCheck(((e,t)=>{if(e.endsWith("$root")&&t.startsWith("$comment"))return!0})),e.conversion.for("upcast").elementToMarker({view:"$comment",model:e=>{const r=`$comment:${(0,t.uid)()}`,o=e.getCustomProperty("$rawContent");return i.set(r,o),r}}),e.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(e,{writer:t})=>{let i;for(const t of this.editor.model.document.getRootNames())if(i=this.editor.model.document.getRoot(t),i.hasAttribute(e.markerName))break;const r=e.markerName,o=i.getAttribute(r),n=t.createUIElement("$comment");return t.setCustomProperty("$rawContent",o,n),n}}),e.model.document.registerPostFixer((t=>{let r=!1;const o=e.model.document.differ.getChangedMarkers().filter((e=>e.name.startsWith("$comment:")));for(const e of o){const{oldRange:o,newRange:n}=e.data;if(!o||!n||o.root!=n.root){if(o){const i=o.root;i.hasAttribute(e.name)&&(t.removeAttribute(e.name,i),r=!0)}if(n){const o=n.root;"$graveyard"==o.rootName?(t.removeMarker(e.name),r=!0):o.hasAttribute(e.name)||(t.setAttribute(e.name,i.get(e.name)||"",o),r=!0)}}}return r})),e.data.on("set",(()=>{for(const t of e.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(t.name)}),{priority:"high"}),e.model.on("deleteContent",((t,[i])=>{for(const t of i.getRanges()){const i=e.model.schema.getLimitElement(t),r=e.model.createPositionAt(i,0),o=e.model.createPositionAt(i,"end");let n;n=r.isTouching(t.start)&&o.isTouching(t.end)?this.getHtmlCommentsInRange(e.model.createRange(r,o)):this.getHtmlCommentsInRange(t,{skipBoundaries:!0});for(const e of n)this.removeHtmlComment(e)}}),{priority:"high"})}createHtmlComment(e,i){const r=(0,t.uid)(),o=this.editor.model,n=o.document.getRoot(e.root.rootName),l=`$comment:${r}`;return o.change((t=>{const r=t.createRange(e);return t.addMarker(l,{usingOperation:!0,affectsData:!0,range:r}),t.setAttribute(l,i,n),l}))}removeHtmlComment(e){const t=this.editor,i=t.model.markers.get(e);return!!i&&(t.model.change((e=>{e.removeMarker(i)})),!0)}getHtmlCommentData(e){const t=this.editor.model.markers.get(e);if(!t)return null;let i="";for(const t of this.editor.model.document.getRoots())if(t.hasAttribute(e)){i=t.getAttribute(e);break}return{content:i,position:t.getStart()}}getHtmlCommentsInRange(e,{skipBoundaries:t=!1}={}){const i=!t;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter((t=>function(e,t){const r=e.getRange().start;return(r.isAfter(t.start)||i&&r.isEqual(t.start))&&(r.isBefore(t.end)||i&&r.isEqual(t.end))}(t,e))).map((e=>e.name))}}class Ke extends o.HtmlDataProcessor{toView(e){if(!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4)))return super.toView(e);let t="",i="";e=(e=e.trim().replace(/<\?xml\s[^?]*\?>/i,(e=>(i=e,"")))).trim().replace(/^<!DOCTYPE\s[^>]*?>/i,(e=>(t=e,"")));const r=this._toDom(e),n=this.domConverter.domToView(r,{skipComments:this.skipComments}),l=new o.UpcastWriter(n.document);l.setCustomProperty("$fullPageDocument",r.ownerDocument.documentElement.outerHTML,n);const s=Array.from(r.ownerDocument.querySelectorAll("head style"));return l.setCustomProperty("$fullPageHeadStyles",s,n),t&&l.setCustomProperty("$fullPageDocType",t,n),i&&l.setCustomProperty("$fullPageXmlDeclaration",i,n),n}toData(e){let t=super.toData(e);const i=e.getCustomProperty("$fullPageDocument"),r=e.getCustomProperty("$fullPageDocType"),o=e.getCustomProperty("$fullPageXmlDeclaration");return i&&(t=i.replace(/<\/body\s*>/,t+"$&"),r&&(t=r+"\n"+t),o&&(t=o+"\n"+t)),t}}class Xe extends e.Plugin{static get pluginName(){return"FullPage"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("htmlSupport.fullPage",{allowRenderStylesFromHead:!1,sanitizeCss:e=>((0,t.logWarning)("css-full-page-provide-sanitize-function"),{css:e,hasChanged:!1})}),e.data.processor=new Ke(e.data.viewDocument)}init(){const e=this.editor,t=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration","$fullPageHeadStyles"];e.model.schema.extend("$root",{allowAttributes:t}),e.data.on("toModel",((i,[r])=>{const o=e.model.document.getRoot();e.model.change((e=>{for(const i of t){const t=r.getCustomProperty(i);t&&e.setAttribute(i,t,o)}})),Qe(e)&&this._renderStylesFromHead(o)}),{priority:"low"}),e.data.on("toView",((e,[i])=>{if(!i.is("rootElement"))return;const r=i,n=e.return;if(!r.hasAttribute("$fullPageDocument"))return;const l=new o.UpcastWriter(n.document);for(const e of t){const t=r.getAttribute(e);t&&l.setCustomProperty(e,t,n)}}),{priority:"low"}),e.data.on("set",(()=>{const i=e.model.document.getRoot();e.model.change((e=>{for(const r of t)i.hasAttribute(r)&&e.removeAttribute(r,i)}))}),{priority:"high"}),e.data.on("get",((e,t)=>{t[0]||(t[0]={}),t[0].trim=!1}),{priority:"high"})}destroy(){super.destroy(),Qe(this.editor)&&this._removeStyleElementsFromDom()}_removeStyleElementsFromDom(){const e=Array.from(t.global.document.querySelectorAll(`[data-full-page-style-id="${this.editor.id}"]`));for(const t of e)t.remove()}_renderStyleElementsInDom(e){const i=this.editor,r=e.getAttribute("$fullPageHeadStyles");if(!r)return;const o=i.config.get("htmlSupport.fullPage.sanitizeCss");for(const e of r){e.setAttribute("data-full-page-style-id",i.id);const r=o(e.innerText);r.hasChanged&&(e.innerText=r.css),t.global.document.head.append(e)}}_renderStylesFromHead(e){this._removeStyleElementsFromDom(),this._renderStyleElementsInDom(e)}}function Qe(e){return e.config.get("htmlSupport.fullPage.allowRenderStylesFromHead")}const Ye="htmlEmptyBlock";class Je extends e.Plugin{static get pluginName(){return"EmptyBlock"}static get isOfficialPlugin(){return!0}afterInit(){const{model:e,conversion:t,plugins:i,config:r}=this.editor,o=e.schema,n=r.get("htmlSupport.preserveEmptyBlocksInEditingView");o.extend("$block",{allowAttributes:[Ye]}),o.extend("$container",{allowAttributes:[Ye]}),o.isRegistered("tableCell")&&o.extend("tableCell",{allowAttributes:[Ye]}),n?t.for("downcast").add(Ze()):t.for("dataDowncast").add(Ze()),t.for("upcast").add(function(e){return t=>{t.on("element",((t,i,r)=>{const{viewItem:o,modelRange:n}=i;if(!o.is("element")||!o.isEmpty||o.getCustomProperty("$hasBlockFiller"))return;const l=n&&n.start.nodeAfter;if(!l||!e.checkAttribute(l,Ye))return;if(r.writer.setAttribute(Ye,!0,l),1!=l.childCount)return;const s=l.getChild(0);s.is("element","paragraph")&&e.checkAttribute(s,Ye)&&r.writer.setAttribute(Ye,!0,s)}),{priority:"lowest"})}}(o)),i.has("ClipboardPipeline")&&this._registerClipboardPastingHandler()}_registerClipboardPastingHandler(){const e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"contentInsertion",((e,t)=>{t.sourceEditorId!==this.editor.id&&this.editor.model.change((e=>{for(const{item:i}of e.createRangeIn(t.content))i.is("element")&&i.hasAttribute(Ye)&&e.removeAttribute(Ye,i)}))}))}}function Ze(){return e=>{e.on(`attribute:${Ye}`,((e,t,i)=>{const{mapper:r,consumable:o}=i,{item:n}=t;if(!o.consume(n,e.name))return;const l=r.toViewElement(n);l&&t.attributeNewValue&&(l.getFillerOffset=()=>null)}))}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=r})();
@@ -0,0 +1 @@
1
+ !function(i){const n=i.be=i.be||{};n.dictionary=Object.assign(n.dictionary||{},{"HTML object":"HTML аб'ект"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
package/dist/index.js CHANGED
@@ -3,10 +3,10 @@
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
6
- import { toArray, priorities, CKEditorError, isValidAttributeName, uid } from '@ckeditor/ckeditor5-utils/dist/index.js';
6
+ import { toArray, priorities, CKEditorError, isValidAttributeName, uid, logWarning, global } from '@ckeditor/ckeditor5-utils/dist/index.js';
7
7
  import { Matcher, StylesMap, UpcastWriter, HtmlDataProcessor } from '@ckeditor/ckeditor5-engine/dist/index.js';
8
8
  import { toWidget, Widget } from '@ckeditor/ckeditor5-widget/dist/index.js';
9
- import { startCase, cloneDeep, mergeWith, isPlainObject, isEqual } from 'lodash-es';
9
+ import { startCase, cloneDeep, mergeWith, isPlainObject, isEqual } from 'es-toolkit/compat';
10
10
  import { Enter } from '@ckeditor/ckeditor5-enter/dist/index.js';
11
11
 
12
12
  /**
@@ -2933,6 +2933,14 @@ function modelToViewMediaAttributeConverter(mediaElementName) {
2933
2933
  }
2934
2934
  }
2935
2935
 
2936
+ const STYLE_ATTRIBUTES_TO_PROPAGATE = [
2937
+ 'width',
2938
+ 'max-width',
2939
+ 'min-width',
2940
+ 'height',
2941
+ 'min-height',
2942
+ 'max-height'
2943
+ ];
2936
2944
  /**
2937
2945
  * Provides the General HTML Support integration with {@link module:table/table~Table Table} feature.
2938
2946
  */ class TableElementSupport extends Plugin {
@@ -3087,11 +3095,52 @@ function modelToViewMediaAttributeConverter(mediaElementName) {
3087
3095
  return;
3088
3096
  }
3089
3097
  conversionApi.consumable.consume(data.item, evt.name);
3090
- updateViewAttributes(conversionApi.writer, data.attributeOldValue, data.attributeNewValue, viewElement);
3098
+ // Downcast selected styles to a figure element instead of a table element.
3099
+ if (attributeName === 'htmlTableAttributes' && containerElement !== viewElement) {
3100
+ const oldAttributes = splitAttributesForFigureAndTable(data.attributeOldValue);
3101
+ const newAttributes = splitAttributesForFigureAndTable(data.attributeNewValue);
3102
+ updateViewAttributes(conversionApi.writer, oldAttributes.tableAttributes, newAttributes.tableAttributes, viewElement);
3103
+ updateViewAttributes(conversionApi.writer, oldAttributes.figureAttributes, newAttributes.figureAttributes, containerElement);
3104
+ } else {
3105
+ updateViewAttributes(conversionApi.writer, data.attributeOldValue, data.attributeNewValue, viewElement);
3106
+ }
3091
3107
  });
3092
3108
  }
3093
3109
  };
3094
3110
  }
3111
+ /**
3112
+ * Splits styles based on the `STYLE_ATTRIBUTES_TO_PROPAGATE` pattern that should be moved to the parent element
3113
+ * and those that should remain on element.
3114
+ */ function splitAttributesForFigureAndTable(data) {
3115
+ const figureAttributes = {};
3116
+ const tableAttributes = {
3117
+ ...data
3118
+ };
3119
+ if (!data || !('styles' in data)) {
3120
+ return {
3121
+ figureAttributes,
3122
+ tableAttributes
3123
+ };
3124
+ }
3125
+ tableAttributes.styles = {};
3126
+ for (const [key, value] of Object.entries(data.styles)){
3127
+ if (STYLE_ATTRIBUTES_TO_PROPAGATE.includes(key)) {
3128
+ figureAttributes.styles = {
3129
+ ...figureAttributes.styles,
3130
+ [key]: value
3131
+ };
3132
+ } else {
3133
+ tableAttributes.styles = {
3134
+ ...tableAttributes.styles,
3135
+ [key]: value
3136
+ };
3137
+ }
3138
+ }
3139
+ return {
3140
+ figureAttributes,
3141
+ tableAttributes
3142
+ };
3143
+ }
3095
3144
 
3096
3145
  /**
3097
3146
  * Provides the General HTML Support for `style` elements.
@@ -4011,6 +4060,9 @@ function modelToViewMediaAttributeConverter(mediaElementName) {
4011
4060
  const writer = new UpcastWriter(viewFragment.document);
4012
4061
  // Using the DOM document with body content extracted as a skeleton of the page.
4013
4062
  writer.setCustomProperty('$fullPageDocument', domFragment.ownerDocument.documentElement.outerHTML, viewFragment);
4063
+ // List of `<style>` elements extracted from document's `<head>` element.
4064
+ const headStylesElements = Array.from(domFragment.ownerDocument.querySelectorAll('head style'));
4065
+ writer.setCustomProperty('$fullPageHeadStyles', headStylesElements, viewFragment);
4014
4066
  if (docType) {
4015
4067
  writer.setCustomProperty('$fullPageDocType', docType, viewFragment);
4016
4068
  }
@@ -4052,6 +4104,30 @@ function modelToViewMediaAttributeConverter(mediaElementName) {
4052
4104
  */ static get isOfficialPlugin() {
4053
4105
  return true;
4054
4106
  }
4107
+ /**
4108
+ * @inheritDoc
4109
+ */ constructor(editor){
4110
+ super(editor);
4111
+ editor.config.define('htmlSupport.fullPage', {
4112
+ allowRenderStylesFromHead: false,
4113
+ sanitizeCss: (rawCss)=>{
4114
+ /**
4115
+ * When using the Full page with the `config.htmlSupport.fullPage.allowRenderStylesFromHead` set to `true`,
4116
+ * it is strongly recommended to define a sanitize function that will clean up the CSS
4117
+ * which is present in the `<head>` in editors content in order to avoid XSS vulnerability.
4118
+ *
4119
+ * For a detailed overview, check the {@glink features/html/full-page-html Full page HTML feature} documentation.
4120
+ *
4121
+ * @error css-full-page-provide-sanitize-function
4122
+ */ logWarning('css-full-page-provide-sanitize-function');
4123
+ return {
4124
+ css: rawCss,
4125
+ hasChanged: false
4126
+ };
4127
+ }
4128
+ });
4129
+ editor.data.processor = new HtmlPageDataProcessor(editor.data.viewDocument);
4130
+ }
4055
4131
  /**
4056
4132
  * @inheritDoc
4057
4133
  */ init() {
@@ -4059,9 +4135,9 @@ function modelToViewMediaAttributeConverter(mediaElementName) {
4059
4135
  const properties = [
4060
4136
  '$fullPageDocument',
4061
4137
  '$fullPageDocType',
4062
- '$fullPageXmlDeclaration'
4138
+ '$fullPageXmlDeclaration',
4139
+ '$fullPageHeadStyles'
4063
4140
  ];
4064
- editor.data.processor = new HtmlPageDataProcessor(editor.data.viewDocument);
4065
4141
  editor.model.schema.extend('$root', {
4066
4142
  allowAttributes: properties
4067
4143
  });
@@ -4076,6 +4152,9 @@ function modelToViewMediaAttributeConverter(mediaElementName) {
4076
4152
  }
4077
4153
  }
4078
4154
  });
4155
+ if (isAllowedRenderStylesFromHead(editor)) {
4156
+ this._renderStylesFromHead(root);
4157
+ }
4079
4158
  }, {
4080
4159
  priority: 'low'
4081
4160
  });
@@ -4122,6 +4201,57 @@ function modelToViewMediaAttributeConverter(mediaElementName) {
4122
4201
  priority: 'high'
4123
4202
  });
4124
4203
  }
4204
+ /**
4205
+ * @inheritDoc
4206
+ */ destroy() {
4207
+ super.destroy();
4208
+ if (isAllowedRenderStylesFromHead(this.editor)) {
4209
+ this._removeStyleElementsFromDom();
4210
+ }
4211
+ }
4212
+ /**
4213
+ * Checks if in the document exists any `<style>` elements injected by the plugin and removes them,
4214
+ * so these could be re-rendered later.
4215
+ * There is used `data-full-page-style-id` attribute to recognize styles injected by the feature.
4216
+ */ _removeStyleElementsFromDom() {
4217
+ const existingStyleElements = Array.from(global.document.querySelectorAll(`[data-full-page-style-id="${this.editor.id}"]`));
4218
+ for (const style of existingStyleElements){
4219
+ style.remove();
4220
+ }
4221
+ }
4222
+ /**
4223
+ * Extracts `<style>` elements from the full page data and renders them in the main document `<head>`.
4224
+ * CSS content is sanitized before rendering.
4225
+ */ _renderStyleElementsInDom(root) {
4226
+ const editor = this.editor;
4227
+ // Get `<style>` elements list from the `<head>` from the full page data.
4228
+ const styleElements = root.getAttribute('$fullPageHeadStyles');
4229
+ if (!styleElements) {
4230
+ return;
4231
+ }
4232
+ const sanitizeCss = editor.config.get('htmlSupport.fullPage.sanitizeCss');
4233
+ // Add `data-full-page-style-id` attribute to the `<style>` element and render it in `<head>` in the main document.
4234
+ for (const style of styleElements){
4235
+ style.setAttribute('data-full-page-style-id', editor.id);
4236
+ // Sanitize the CSS content before rendering it in the editor.
4237
+ const sanitizedCss = sanitizeCss(style.innerText);
4238
+ if (sanitizedCss.hasChanged) {
4239
+ style.innerText = sanitizedCss.css;
4240
+ }
4241
+ global.document.head.append(style);
4242
+ }
4243
+ }
4244
+ /**
4245
+ * Removes existing `<style>` elements injected by the plugin and renders new ones from the full page data.
4246
+ */ _renderStylesFromHead(root) {
4247
+ this._removeStyleElementsFromDom();
4248
+ this._renderStyleElementsInDom(root);
4249
+ }
4250
+ }
4251
+ /**
4252
+ * Normalize the Full page configuration option `allowRenderStylesFromHead`.
4253
+ */ function isAllowedRenderStylesFromHead(editor) {
4254
+ return editor.config.get('htmlSupport.fullPage.allowRenderStylesFromHead');
4125
4255
  }
4126
4256
 
4127
4257
  const EMPTY_BLOCK_MODEL_ATTRIBUTE = 'htmlEmptyBlock';