1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e6012c53-9abd-4d22-95cc-273780c9cb75",e._sentryDebugIdIdentifier="sentry-dbid-e6012c53-9abd-4d22-95cc-273780c9cb75")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4799],{7717:(e,t,i)=>{i.d(t,{$H:()=>el,$U:()=>iE,$Y:()=>ep,A4:()=>te,A9:()=>v,AM:()=>tl,AO:()=>tc,AZ:()=>H,BD:()=>eQ,BO:()=>eY,BY:()=>iP,Bj:()=>k,By:()=>tT,Cy:()=>ti,Dy:()=>ei,E6:()=>eH,EI:()=>e6,Eg:()=>e8,Ex:()=>eT,FB:()=>e4,FZ:()=>W,F_:()=>tk,G2:()=>z,G5:()=>ey,GC:()=>t$,GG:()=>iI,GR:()=>tV,Gn:()=>t1,H:()=>es,H2:()=>tu,I8:()=>tz,IN:()=>tB,IY:()=>tt,J3:()=>ea,JV:()=>tD,Jc:()=>ii,Je:()=>e0,Jr:()=>ek,KO:()=>ew,Kn:()=>eI,L2:()=>iv,L7:()=>eO,LU:()=>t7,Lb:()=>t8,Ln:()=>J,Lz:()=>ix,MM:()=>er,MO:()=>e9,MZ:()=>iw,Mw:()=>eR,NV:()=>tr,O:()=>tw,OB:()=>eK,Ox:()=>ez,Q9:()=>t4,Qy:()=>ic,Rj:()=>tE,So:()=>ir,Ss:()=>N,UR:()=>ie,Vd:()=>eP,Vr:()=>t_,Vz:()=>ej,WU:()=>t6,Wm:()=>eC,X3:()=>tn,XE:()=>i_,XH:()=>e5,Xt:()=>t5,YQ:()=>K,Ye:()=>T,Yp:()=>X,Z5:()=>q,Zi:()=>V,Zn:()=>tg,Zz:()=>eU,_:()=>ee,_m:()=>ed,au:()=>tU,b2:()=>eF,b8:()=>ip,bQ:()=>iV,cc:()=>tO,cu:()=>tN,d$:()=>e7,d4:()=>tH,e0:()=>Q,eF:()=>eE,eG:()=>en,eH:()=>tS,e_:()=>ii,ep:()=>tK,fM:()=>tm,f_:()=>tP,fl:()=>to,gD:()=>iu,gT:()=>eN,hK:()=>e$,iv:()=>eA,kS:()=>ef,kV:()=>ts,kq:()=>ig,l1:()=>j,l2:()=>tx,lF:()=>eS,lG:()=>eu,lU:()=>eX,lV:()=>it,lu:()=>G,mB:()=>tq,mU:()=>eM,m_:()=>e1,nI:()=>tj,nN:()=>eZ,nc:()=>t9,nu:()=>eh,oB:()=>tF,pQ:()=>eD,pU:()=>io,pg:()=>e3,ph:()=>tv,qf:()=>eJ,rF:()=>iC,rS:()=>eI,s3:()=>_,tp:()=>id,u3:()=>t3,uI:()=>im,uO:()=>e2,v1:()=>eb,vF:()=>eL,wD:()=>id,wi:()=>U,wy:()=>$,xE:()=>eG,xw:()=>ih,y0:()=>Y,y8:()=>em,yJ:()=>iS,yX:()=>ib,yu:()=>td,zO:()=>tI,zj:()=>iO});var s=i(18430),o=i(31324),r=i(37202),n=i(96571),l=i(53606),a=i(30209),h=i(30104),c=i(87791),d=i(89316),u=i(28561),p=i(72494),m=i(33719),f=i(79176),w=i(95172),b=i(63897),g=i(53509);class _ extends s.pM{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(e,t,i)=>{this._renderViewIntoCollectionParent(t,i)}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){for(let t of(this._parentElement=e,this))this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!e.every(e=>"string"==typeof e))throw new s.Yb("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(let i of this)for(let s of e)i.delegate(s).to(t);this.on("add",(i,s)=>{for(let i of e)s.delegate(i).to(t)}),this.on("remove",(i,s)=>{for(let i of e)s.stopDelegating(i,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}class k extends(0,s.Mm)(){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,O(E(e))),this._isRendered=!1,this._revertData=null}render(){let e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=M(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new s.Yb("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function* e(t){if(t.children)for(let i of t.children)S(i)?yield i:A(i)&&(yield*e(i))}(this)}static bind(e,t){return{to:(i,s)=>new T({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:s}),if:(i,s,o)=>new v({observable:e,emitter:t,attribute:i,valueIfTrue:s,callback:o})}}static extend(e,t){if(e._isRendered)throw new s.Yb("template-extend-render",[this,e]);!function e(t,i){if(i.attributes&&(t.attributes||(t.attributes={}),I(t.attributes,i.attributes)),i.eventListeners&&(t.eventListeners||(t.eventListeners={}),I(t.eventListeners,i.eventListeners)),i.text&&t.text.push(...i.text),i.children&&i.children.length){if(t.children.length!=i.children.length)throw new s.Yb("ui-template-extend-children-mismatch",t);let o=0;for(let s of i.children)e(t.children[o++],s)}}(e,O(E(t)))}_renderNode(e){if(e.node?this.tag&&this.text:this.tag?this.text:!this.text)throw new s.Yb("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){var t;let i=e.node;
1return i?e.revertData.text=i.textContent:i=e.node=document.createTextNode(""),y(this.text)?this._bindToObservable({schema:this.text,updater:(t=i,{set(e){t.textContent=e},remove(){t.textContent=""}}),data:e}):i.textContent=this.text.join(""),i}_renderAttributes(e){if(!this.attributes)return;let t=e.node,i=e.revertData;for(let s in this.attributes){let o=t.getAttribute(s),r=this.attributes[s];i&&(i.attributes[s]=o);let n=D(r)?r[0].ns:null;if(y(r)){let l=D(r)?r[0].value:r;i&&R(s)&&l.unshift(o),this._bindToObservable({schema:l,updater:function(e,t,i){return{set(s){e.setAttributeNS(i,t,s)},remove(){e.removeAttributeNS(i,t)}}}(t,s,n),data:e})}else if("style"==s&&"string"!=typeof r[0])this._renderStyleAttribute(r[0],e);else{i&&o&&R(s)&&r.unshift(o);let e=r.map(e=>e&&e.value||e).reduce((e,t)=>e.concat(t),[]).reduce(B,"");F(e)||t.setAttributeNS(n,s,e)}}}_renderStyleAttribute(e,t){let i=t.node;for(let s in e){let o=e[s];y(o)?this._bindToObservable({schema:[o],updater:function(e,t){return{set(i){x(t)?e.style.setProperty(t,i):e.style[t]=i},remove(){x(t)?e.style.removeProperty(t):e.style[t]=null}}}(i,s),data:t}):x(s)?i.style.setProperty(s,o):i.style[s]=o}}_renderElementChildren(e){let t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying,r=0;for(let n of this.children)if(L(n)){if(!o)for(let e of(n.setParent(t),n))i.appendChild(e.element)}else if(S(n))o||(n.isRendered||n.render(),i.appendChild(n.element));else if((0,s.Ll)(n))i.appendChild(n);else if(o){let t=e.revertData,s=M();t.children.push(s),n._renderNode({intoFragment:!1,node:i.childNodes[r++],isApplying:!0,revertData:s})}else i.appendChild(n.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(let t in this.eventListeners){let i=this.eventListeners[t].map(i=>{let[s,o]=t.split("@");return i.activateDomEventListener(s,o,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){let s=i.revertData;C(e,t,i);let o=e.filter(e=>!F(e)).filter(e=>e.observable).map(s=>s.activateAttributeListener(e,t,i));s&&s.bindings.push(o)}_revertTemplateFromNode(e,t){for(let e of t.bindings)for(let t of e)t();if(t.text){e.textContent=t.text;return}for(let i in t.attributes){let s=t.attributes[i];null===s?e.removeAttribute(i):e.setAttribute(i,s)}for(let i=0;i<t.children.length;++i)this._revertTemplateFromNode(e.childNodes[i],t.children[i])}}class V{attribute;observable;emitter;callback;constructor(e){this.attribute=e.attribute,this.observable=e.observable,this.emitter=e.emitter,this.callback=e.callback}getValue(e){let t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){let s=()=>C(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,s),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,s)}}}class T extends V{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){let s=(e,i)=>{(!t||i.target.matches(t))&&("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,e,s),()=>{this.emitter.stopListening(i.node,e,s)}}}class v extends V{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!F(super.getValue(e))&&(this.valueIfTrue||!0)}}function y(e){return!!e&&((e.value&&(e=e.value),Array.isArray(e))?e.some(y):e instanceof V)}function x(e){return/^--[a-zA-Z_-][\w-]*$/.test(e)}function C(e,t,{node:i}){let s,o=e.map(e=>e instanceof V?e.getValue(i):e);F(s=1==e.length&&e[0]instanceof v?o[0]:o.reduce(B,""))?t.remove():t.set(s)}function E(e){return(0,o.s)(e,e=>{if(e&&(e instanceof V||A(e)||S(e)||L(e)))return e})}function O(e){var t;if("string"==typeof e?e={text:[e]}:e.text&&((t=e).text=(0,s.$r)(t.text)),e.on&&(e.eventListeners=function(e){for(let t in e)P(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(let t in e)e[t].value&&(e[t].value=(0,s.$r)(e[t].value)),P(e,t)}(e.attributes);let t=[];if(e.children)if(L(e.children))t.push(e.children);else for(let i of e.children)A(i)||S(i)||(0,s.Ll)(i)?t.push(i):t.push(new k(i));e.children=t}return e}function P(e,t){e[t]=(0,s.$r)(e[t])}function B(e,t){return F(t)?e:F(e)?t:`${e} ${t}`}
1function I(e,t){for(let i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function F(e){return!e&&0!==e}function S(e){return e instanceof N}function A(e){return e instanceof k}function L(e){return e instanceof _}function D(e){return(0,r.G)(e[0])&&e[0].ns}function M(){return{children:[],bindings:[],attributes:{}}}function R(e){return"class"==e||"style"==e}class N extends(0,s.c5)((0,s.VM)()){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new s.pM,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=k.bind(this,this)}createCollection(e){let t=new _(e);return this._viewCollections.add(t),t}registerChild(e){for(let t of((0,s.xZ)(e)||(e=[e]),e))this._unboundChildren.add(t)}deregisterChild(e){for(let t of((0,s.xZ)(e)||(e=[e]),e))this._unboundChildren.remove(t)}setTemplate(e){this.template=new k(e)}extendTemplate(e){k.extend(this.template,e)}render(){if(this.isRendered)throw new s.Yb("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}let W={POLITE:"polite",ASSERTIVE:"assertive"};class G{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(let e of Object.values(W))this.announce("",e)})}announce(e,t=W.POLITE){let i=this.editor;if(!i.ui.view)return;this.view||(this.view=new z(i.locale),i.ui.view.body.add(this.view));let{politeness:s,isUnsafeHTML:o}="string"==typeof t?{politeness:t}:t,r=this.view.regionViews.find(e=>e.politeness===s);r||(r=new H(i,s),this.view.regionViews.add(r)),r.announce({announcement:e,isUnsafeHTML:o})}}class z extends N{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class H extends N{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{null!==this._pruneAnnouncementsInterval&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;let i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}function $({emitter:e,activator:t,callback:i,contextElements:s,listenerOptions:o}){e.listenTo(document,"mousedown",(e,o)=>{if(!t())return;let r="function"==typeof o.composedPath?o.composedPath():[];for(let e of"function"==typeof s?s():s)if(e.contains(o.target)||r.includes(e))return;i()},o)}function U(e){class t extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return t}function K(e){class t extends e{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...e){super(...e),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(s.Sf.document,"mouseup",this._onDragEndBound),this.listenTo(s.Sf.document,"touchend",this._onDragEndBound),this.listenTo(s.Sf.document,"mousemove",this._onDragBound),this.listenTo(s.Sf.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(s.Sf.document,"mouseup",this._onDragEndBound),this.stopListening(s.Sf.document,"touchend",this._onDragEndBound),this.stopListening(s.Sf.document,"mousemove",this._onDragBound),this.stopListening(s.Sf.document,"touchmove",this._onDragBound)}_onDragStart(e,t){if(!this._isHandleElementPressed(t))return;this._attachDragListeners();let i=0,s=0;t instanceof MouseEvent?(i=t.clientX,s=t.clientY):(i=t.touches[0].clientX,s=t.touches[0].clientY),this._lastDraggingCoordinates={x:i,y:s},this.isDragging=!0}_onDrag(e,t){if(!this.isDragging)return void this._detachDragListeners();let i=0,s=0;t instanceof MouseEvent?(i=t.clientX,s=t.clientY):(i=t.touches[0].clientX,s=t.touches[0].clientY),t.preventDefault(),this.fire("drag",{deltaX:Math.round(i-this._lastDraggingCoordinates.x),deltaY:Math.round(s-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:i,y:s}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(e){return!!this.dragHandleElement&&(this.dragHandleElement===e.target||e.target instanceof HTMLElement&&this.dragHandleElement.contains(e.target))}}return t}function q({view:e}){e.listenTo(e.element,"submit",(t,i)=>{i.preventDefault(),e.fire("submit")},{useCapture:!0})}
1function j({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:s,uiLanguageDirection:o}){let r="number"==typeof s?()=>s:s;function n(e){return s=>{let o=i.find(e=>e.element===t.focusedElement),r=e(i.getIndex(o),i);i.get(r).focus(),s.stopPropagation(),s.preventDefault()}}e.set("arrowright",n((e,t)=>{var i,s,r;return"rtl"===o?(i=e,s=t.length,0===i?s-1:i-1):(r=e)===t.length-1?0:r+1})),e.set("arrowleft",n((e,t)=>{var i,s,r;return"rtl"===o?(i=e)===t.length-1?0:i+1:(s=e,r=t.length,0===s?r-1:s-1)})),e.set("arrowup",n((e,t)=>{let i=e-r();return i<0&&(i=e+r()*Math.floor(t.length/r()))>t.length-1&&(i-=r()),i})),e.set("arrowdown",n((e,t)=>{let i=e+r();return i>t.length-1&&(i=e%r()),i}))}class Y extends N{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${(0,s.Ld)()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class X extends N{constructor(e,t){super(e);const i=e.t,o=new Y;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[(0,s.n)(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map(e=>{let t=[(0,s.n)(document,"h3",{},e.label),...Array.from(e.groups.values()).map(e=>this._createGroup(e)).flat()];return e.description&&t.splice(1,0,(0,s.n)(document,"p",{},e.description)),(0,s.n)(document,"section",{},t)})}_createGroup(e){let t=e.keystrokes.sort((e,t)=>e.label.localeCompare(t.label)).map(e=>this._createGroupRow(e)).flat(),i=[(0,s.n)(document,"dl",{},t)];return e.label&&i.unshift((0,s.n)(document,"h4",{},e.label)),i}_createGroupRow(e){var t;let i=this.locale.t,o=(0,s.n)(document,"dt"),r=(0,s.n)(document,"dd"),n="string"==typeof(t=e.keystroke)?[[t]]:"string"==typeof t[0]?[t]:t,l=[];for(let e of n)l.push(e.map(Z).join(""));return o.innerHTML=e.label,r.innerHTML=l.join(", ")+(e.mayRequireFn&&s._K.isMac?` ${i("(may require <kbd>Fn</kbd>)")}`:""),[o,r]}}function Z(e){return(0,s.YA)(e).split("+").map(e=>`<kbd>${e}</kbd>`).join("+")}class J extends N{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",e=>!e),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){let e=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!e)throw new s.Yb("ui-iconview-invalid-svg",this);let t=e.getAttribute("viewBox");for(let{name:i,value:s}of(t&&(this.viewBox=t),Array.from(e.attributes)))J.presentationalAttributeNames.includes(i)&&this.element.setAttribute(i,s);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e
1=>{e.style.fill=this.fillColor})}}class Q extends N{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class ee extends N{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new Q){super(e);const i=this.bindTemplate,o=(0,s.Ld)();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new J,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const r={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",e=>!e),i.if("isVisible","ck-hidden",e=>!e),i.to("isOn",e=>e?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",e=>e||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,e=>!e),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(e,t,i)=>!(!t||et(i))&&String(!!e)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(e,t,i)=>!!t&&!!et(i)&&String(!!e)),s._K.isSafari&&(this._focusDelayed||(this._focusDelayed=(0,s.cb)(()=>this.focus(),0)),r.on.mousedown=i.to(()=>{this._focusDelayed()}),r.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(r)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,i,s)=>{i&&!s?this.children.add(this.iconView,0):!i&&s&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){let e=new N;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>(0,s.YA)(e))}]}),e}_getTooltipString(e,t,i){if(e)if("string"==typeof e)return e;else return(i&&(i=(0,s.YA)(i)),e instanceof Function)?e(t,i):`${t}${i?` (${i})`:""}`;return""}}function et(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class ei extends N{children;iconView;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new J,this.iconView.content=t.icon,this.children.add(this.iconView));const s=new N(e);s.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(s)}}class es extends(0,s.Mm)(){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let i=e.actions[t];for(const s of("string"==typeof i&&(i=[i]),i))e.keystrokeHandler.set(s,(e,i)=>{this[t](),i()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(eo)||null}get last(){return this.focusables.filter(eo).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,i)=>{let s=t.element===this.focusTracker.focusedElement;return s&&(e=i),s}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){let e=this.next;e&&this.focusables.getIndex(e)===this.current||e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){let e=this.previous;e&&this.focusables.getIndex(e)===this.current||e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){let t=()=>null===this.current?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",e=>{let i=t();this.focusNext(),i!==t()&&e.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",e=>{let i=t();this.focusPrevious(),i!==t()&&e.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}
1_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){let t=this.focusables.length;if(!t)return null;let i=this.current;if(null===i)return this[1===e?"first":"last"];let s=this.focusables.get(i),o=(i+t+e)%t;do{let i=this.focusables.get(o);if(eo(i)){s=i;break}o=(o+t+e)%t}while(o!==i);return s}}function eo(e){return er(e)&&(0,s.zN)(e.element)}function er(e){return!!("focus"in e&&"function"==typeof e.focus)}function en(e){return er(e)&&"focusCycler"in e&&e.focusCycler instanceof es}class el extends N{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new s.EP,this._focusTracker=new s.$x,this._focusables=new _,this.focusCycler=new es({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(let t of e){let e,i=new ee(this.locale);for(e in i.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(i),t)"onExecute"!=e&&"onCreate"!=e&&i.set(e,t[e]);this.children.add(i)}this._updateFocusCyclableItems()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}}class ea extends N{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}let eh={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},ec=(0,s.To)("px");class ed extends K(N){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:o}){super(e);const r=this.bindTemplate,n=e.t;this.set("className",""),this.set("ariaLabel",n("Editor dialog")),this.set("isModal",!1),this.set("position",eh.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new s.EP,this.focusTracker=new s.$x,this._focusables=new _,this._focusCycler=new es({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:o}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",r.if("isModal","ck-dialog-overlay__transparent",e=>!e),r.if("_isVisible","ck-hidden",e=>!e)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",r.if("isModal","ck-dialog_modal"),r.to("className")],role:"dialog","aria-label":r.to("ariaLabel"),style:{top:r.to("_top",e=>ec(e)),left:r.to("_left",e=>ec(e)),visibility:r.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())}),this.on("drag",(e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)}),this.listenTo(s.Sf.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(s.Sf.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,t,i)=>{i&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:s,actionButtons:o}){t&&(this.headerView=new ei(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),s&&(s instanceof N&&(s=[s]),this.contentView=new ea(this.locale),this.contentView.children.addMany(s),this.parts.add(this.contentView)),o&&(this.actionsView=new el(this.locale),this.actionsView.setButtons(o),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}
1moveTo(e,t){let i=this._getViewportRect(),s=this._getDialogRect();e+s.width>i.right&&(e=i.right-s.width),e<i.left&&(e=i.left),t<i.top&&(t=i.top),this._moveTo(e,t)}_moveTo(e,t){this._left=e,this._top=t}moveBy(e,t){this.moveTo(this._left+e,this._top+t)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){let e;if(!this.element||!this.element.parentNode)return;let t=this._getViewportRect(),i=this.position;this._getCurrentDomRoot()?e=this._getVisibleDomRootRect(t):i=eh.SCREEN_CENTER;let s=ed.defaultOffset,o=this._getDialogRect();if(null!=this.position){if("function"==typeof this.position){let t=this.position(o,e);return null==t?void this._moveOffScreen():void this._moveTo(t.left,t.top)}switch(i){case eh.EDITOR_TOP_SIDE:if(e){let t="ltr"===this.locale.contentLanguageDirection?e.right-o.width-s:e.left+s;this.moveTo(t,e.top+s)}else this._moveOffScreen();break;case eh.EDITOR_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),Math.round(e.top+e.height/2-o.height/2)):this._moveOffScreen();break;case eh.SCREEN_CENTER:this.moveTo(Math.round((t.width-o.width)/2),Math.round((t.height-o.height)/2));break;case eh.EDITOR_TOP_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),e.top+s):this._moveOffScreen();break;case eh.EDITOR_BOTTOM_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),e.bottom-o.height-s):this._moveOffScreen();break;case eh.EDITOR_ABOVE_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),e.top-o.height-s):this._moveOffScreen();break;case eh.EDITOR_BELOW_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),e.bottom+s):this._moveOffScreen()}}}_getVisibleDomRootRect(e){let t=new s.rw(this._getCurrentDomRoot()).getVisible();return t&&(t=e.getIntersection(t))?t:null}_getDialogRect(){return new s.rw(this.element.firstElementChild)}_getViewportRect(){let e=new s.rw(s.Sf.window);return this.isModal?e:(0,s.tS)(this._getViewportOffset())}_updateFocusCyclableItems(){let e=[];
1if(this.contentView)for(let t of this.contentView.children)er(t)&&e.push(t);this.actionsView&&e.push(this.actionsView),this.closeButtonView&&e.push(this.closeButtonView),e.forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element),en(e)&&this._focusCycler.chain(e.focusCycler)})}_createCloseButton(){let e=new ee(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:m.AUn}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}}class eu extends p.k_{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),eu._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(e,t)=>{this._show(t)}),this.on("show",(e,t)=>{t.onShow&&t.onShow(this)},{priority:"low"}),this.on("hide",()=>{eu._visibleDialogPlugin&&eu._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){let e=this.editor;e.keystrokes.set("Ctrl+F6",(t,i)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())})}_initMultiRootIntegration(){let e=this.editor.model;e.document.on("change:data",()=>{if(this.view)for(let t of e.document.differ.getChangedRoots())t.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:s=!0,content:o,actionButtons:r,className:n,isModal:l,position:a,onHide:h,keystrokeHandlerOptions:c}){let d=this.editor;this.view=new ed(d.locale,{getCurrentDomRoot:()=>d.editing.view.getDomRoot(d.model.document.selection.anchor.root.rootName),getViewportOffset:()=>d.ui.viewportOffset,keystrokeHandlerOptions:c});let u=this.view;u.on("close",()=>{this.hide()}),d.ui.view.body.add(u),d.keystrokes.listenTo(u.element),a||(a=l?eh.SCREEN_CENTER:eh.EDITOR_CENTER),l&&this._lockBodyScroll(),u.set({position:a,_isVisible:!0,className:n,isModal:l}),u.setupParts({icon:t,title:i,hasCloseButton:s,content:o,actionButtons:r}),this.id=e,h&&(this._onHide=h),this.isOpen=!0,eu._visibleDialogPlugin=this}hide(){eu._visibleDialogPlugin&&eu._visibleDialogPlugin.fire(`hide:${eu._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;let e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,eu._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class ep extends ee{_checkIconHolderView=new em;constructor(e,t=new Q){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(e,t)=>e||t)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{let{children:s,_checkIconHolderView:o}=this;i?s.add(o,0):s.remove(o)})}}class em extends N{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",e=>e?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{let{children:s,_checkIconView:o}=this;i&&!s.has(o)?s.add(o):!i&&s.has(o)&&s.remove(o)})}_createCheckIconView(){let e=new J;return e.content=m.iWP,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class ef extends ep{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class ew extends p.k_{contentView=null;static get requires(){return[eu]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{let e=this._createButton(ee);return e.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),e}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{let e=this._createButton(ef);return e.label=t("Accessibility"),e}),e.keystrokes.set("Alt+0",(e,t)=>{this._toggleDialog(),t()}),this._setupRootLabels()}_createButton(e){let t=this.editor,i=t.plugins.get("Dialog"),s=new e(t.locale);return s.set({keystroke:"Alt+0",icon:m.I1A,isToggleable:!0}),s.on("execute",()=>this._toggleDialog()),s.bind("isOn").to(i,"id",e=>"accessibilityHelp"===e),s}_setupRootLabels(){let e=this.editor,t=e.editing.view,i=e.t;function o(e,t){let o=[t.getAttribute("aria-label"),i("Press %0 for help.",[(0,s.YA)("Alt+0")])].filter(e=>e).join(". ");e.setAttribute("aria-label",o,t)}e.ui.on("ready",()=>{t.change(e=>{for(let i of t.document.roots)o(e,i)}),e.on("addRoot",(i,s)=>{let r=e.editing.view.document.getRoot(s.rootName);t.change(e=>o(e,r))},{priority:"low"})})}_toggleDialog(){let e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new X(e.locale,e.accessibility.keystrokeInfos)),"accessibilityHelp"===t.id?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:m.I1A,hasCloseButton:!0,content:this.contentView})}}class eb extends _{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new k({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),eb._bodyWrapper&&eb._bodyWrapper.isConnected||(eb._bodyWrapper=(0,s.n)(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(eb._bodyWrapper)),eb._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),eb._bodyWrapper&&!eb._bodyWrapper.childElementCount&&(eb._bodyWrapper.remove(),delete eb._bodyWrapper)}}let eg=(0,s.To)("px"),e_={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}
1};class ek extends N{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",eg),left:t.to("left",eg)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){let t=eV(e.target);if(t&&!(0,s.zN)(t))return!1;this.show();let i=ek.defaultPositions,o=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:s.Sf.document.body,fitInViewport:!0},e),r=ek._getOptimalPosition(o)||e_,n=parseInt(r.left),l=parseInt(r.top),a=r.name,{withArrow:h=!0}=r.config||{};return this.top=l,this.left=n,this.position=a,this.withArrow=h,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let t=eV(e.target),i=e.limiter?eV(e.limiter):s.Sf.document.body;if(this.listenTo(s.Sf.document,"scroll",(s,o)=>{let r=o.target,n=t&&r.contains(t),l=i&&r.contains(i);(n||l||!t||!i)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(s.Sf.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(t&&(0,s.KH)(t)&&(t=t.parentElement),t)){let e=()=>{(0,s.zN)(t)||this.unpin()};this._resizeObserver=new s.tb(t,e)}return!0}_stopPinning(){this.stopListening(s.Sf.document,"scroll"),this.stopListening(s.Sf.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){let{sideOffset:t=ek.arrowSideOffset,heightOffset:i=ek.arrowHeightOffset,stickyVerticalOffset:o=ek.stickyVerticalOffset,config:r}=e;return{northWestArrowSouthWest:(e,i)=>({top:n(e,i),left:e.left-t,name:"arrow_sw",...r&&{config:r}}),northWestArrowSouthMiddleWest:(e,i)=>({top:n(e,i),left:e.left-.25*i.width-t,name:"arrow_smw",...r&&{config:r}}),northWestArrowSouth:(e,t)=>({top:n(e,t),left:e.left-t.width/2,name:"arrow_s",...r&&{config:r}}),northWestArrowSouthMiddleEast:(e,i)=>({top:n(e,i),left:e.left-.75*i.width+t,name:"arrow_sme",...r&&{config:r}}),northWestArrowSouthEast:(e,i)=>({top:n(e,i),left:e.left-i.width+t,name:"arrow_se",...r&&{config:r}}),northArrowSouthWest:(e,i)=>({top:n(e,i),left:e.left+e.width/2-t,name:"arrow_sw",...r&&{config:r}}),northArrowSouthMiddleWest:(e,i)=>({top:n(e,i),left:e.left+e.width/2-.25*i.width-t,name:"arrow_smw",...r&&{config:r}}),northArrowSouth:(e,t)=>({top:n(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...r&&{config:r}}),northArrowSouthMiddleEast:(e,i)=>({top:n(e,i),left:e.left+e.width/2-.75*i.width+t,name:"arrow_sme",...r&&{config:r}}),northArrowSouthEast:(e,i)=>({top:n(e,i),left:e.left+e.width/2-i.width+t,name:"arrow_se",...r&&{config:r}}),northEastArrowSouthWest:(e,i)=>({top:n(e,i),left:e.right-t,name:"arrow_sw",...r&&{config:r}}),northEastArrowSouthMiddleWest:(e,i)=>({top:n(e,i),left:e.right-.25*i.width-t,name:"arrow_smw",...r&&{config:r}}),northEastArrowSouth:(e,t)=>({top:n(e,t),left:e.right-t.width/2,name:"arrow_s",...r&&{config:r}}),northEastArrowSouthMiddleEast:(e,i)=>({top:n(e,i),left:e.right-.75*i.width+t,name:"arrow_sme",...r&&{config:r}}),northEastArrowSouthEast:(e,i)=>
1({top:n(e,i),left:e.right-i.width+t,name:"arrow_se",...r&&{config:r}}),southWestArrowNorthWest:e=>({top:l(e),left:e.left-t,name:"arrow_nw",...r&&{config:r}}),southWestArrowNorthMiddleWest:(e,i)=>({top:l(e),left:e.left-.25*i.width-t,name:"arrow_nmw",...r&&{config:r}}),southWestArrowNorth:(e,t)=>({top:l(e),left:e.left-t.width/2,name:"arrow_n",...r&&{config:r}}),southWestArrowNorthMiddleEast:(e,i)=>({top:l(e),left:e.left-.75*i.width+t,name:"arrow_nme",...r&&{config:r}}),southWestArrowNorthEast:(e,i)=>({top:l(e),left:e.left-i.width+t,name:"arrow_ne",...r&&{config:r}}),southArrowNorthWest:e=>({top:l(e),left:e.left+e.width/2-t,name:"arrow_nw",...r&&{config:r}}),southArrowNorthMiddleWest:(e,i)=>({top:l(e),left:e.left+e.width/2-.25*i.width-t,name:"arrow_nmw",...r&&{config:r}}),southArrowNorth:(e,t)=>({top:l(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...r&&{config:r}}),southArrowNorthMiddleEast:(e,i)=>({top:l(e),left:e.left+e.width/2-.75*i.width+t,name:"arrow_nme",...r&&{config:r}}),southArrowNorthEast:(e,i)=>({top:l(e),left:e.left+e.width/2-i.width+t,name:"arrow_ne",...r&&{config:r}}),southEastArrowNorthWest:e=>({top:l(e),left:e.right-t,name:"arrow_nw",...r&&{config:r}}),southEastArrowNorthMiddleWest:(e,i)=>({top:l(e),left:e.right-.25*i.width-t,name:"arrow_nmw",...r&&{config:r}}),southEastArrowNorth:(e,t)=>({top:l(e),left:e.right-t.width/2,name:"arrow_n",...r&&{config:r}}),southEastArrowNorthMiddleEast:(e,i)=>({top:l(e),left:e.right-.75*i.width+t,name:"arrow_nme",...r&&{config:r}}),southEastArrowNorthEast:(e,i)=>({top:l(e),left:e.right-i.width+t,name:"arrow_ne",...r&&{config:r}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-i,name:"arrow_e",...r&&{config:r}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+i,name:"arrow_w",...r&&{config:r}}),viewportStickyNorth:(e,t,i)=>{let n=new s.rw(s.Sf.document.body).getIntersection(i.getVisible());if(!n)return null;let l=n.getVisible();return e.getIntersection(l)&&l.top-e.top-o<t.height&&l.bottom-e.bottom<t.height?{top:l.top+o,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...r}}:null}};function n(e,t){return e.top-t.height-i}function l(e){return e.bottom+i}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=s.W;static defaultPositions=ek.generatePositions()}function eV(e){return(0,n.v)(e)?e:(0,s._Z)(e)?e.commonAncestorContainer:"function"==typeof e?eV(e()):null}class eT extends(0,s.c5)(){editor;_balloonView=null;_showBalloonThrottled=(0,l.n)(()=>this._showBalloon(),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){let e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){let e=this.editor;!this._isEnabled()||e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(e,t,i)=>{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(e,t,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:"ltr"===this.editor.locale.contentLanguageDirection?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){let e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){let e=this.editor,t=new ek,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){var e,t,i,s;if(!this._lastFocusedEditableElement)return null;let o=this._getNormalizedConfig(),r="right"===o.side?(e=this._lastFocusedEditableElement,ev(e,t=o,(e,i)=>e.left+e.width-i.width-t.horizontalOffset)):(i=this._lastFocusedEditableElement,ev(i,s=o,e=>e.left+s.horizontalOffset));return{target:this._lastFocusedEditableElement,positions:[r]}}_updateLastFocusedEditableElement(){let e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i){this._lastFocusedEditableElement=null;return}let s=Array.from(e.ui.getEditableElementsNames()).map(t=>e.ui.getEditableElement(t));s.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=s[0]}}function ev(e,t,i){return(o,r)=>{let n,l=new s.rw(e);if(l.width<350||l.height<50)return null;n=("inside"===t.position?l.bottom-r.height:l.bottom-r.height/2)-t.verticalOffset;let a=i(l,r),h=o.clone().moveTo(a,n).getIntersection(r.clone().moveTo(a,n)).getVisible();return!h||h.getArea()<r.getArea()?null:{top:n,left:a,name:`position_${t.position}-side_${t.side}`,config:{withArrow:!1}
1}}}class ey extends eT{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){let e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;let t=e.config.get("licenseKey");if("GPL"==t)return!0;let i=(0,s.yE)(t.split(".")[1]);return!i||!i.whiteLabel}_createBadgeContent(){return new ex(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,s="inside"===i?5:e.verticalOffset;return{position:i,side:t.side||e.side,label:void 0===t.label?"Powered by":t.label,verticalOffset:void 0!==t.verticalOffset?t.verticalOffset:s,horizontalOffset:void 0!==t.horizontalOffset?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}}class ex extends N{constructor(e,t){super(e);const i=new J,s=this.bindTemplate;i.set({content:m.w06,isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:s.to(e=>e.preventDefault())}}]})}}class eC extends ee{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){let e=new N;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class eE extends eP(ee){}class eO extends eP(ep){}function eP(e){class t extends e{_fileInputView;constructor(...e){super(...e),this._fileInputView=new eB(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}return t}class eB extends N{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class eI extends N{buttonView;children;constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){let e=new ee(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:m.G3R}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",e=>String(e))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",e=>!e),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}}function eF(e,t){let i=e.t,s={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map(e=>{let t=s[e.label];return t&&t!=e.label&&(e.label=t),e})}function eS(e){return e.map(eA).filter(e=>!!e)}function eA(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class eL extends ee{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=m.$V3,this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",e=>s._K.isMediaForcedColors?null:e)},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class eD extends N{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||5;const o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new s.$x,this.keystrokes=new s.EP,this.items.on("add",(e,t)=>{t.isOn=t.color===this.selectedColor}
1),i.forEach(e=>{let t=new eL;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})}),this.items.add(t)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(e,t,i)=>{for(let e of this.items)e.isOn=e.color===i})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){for(let e of(super.render(),this.items))this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),j({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}function eM(e,t){var i;if(!e)return"";let s=eW(e);if(!s)return"";if(s.space===t)return e;if(i=s,!Object.keys(w.A).includes(i.space))return"";let o=w.A[s.space][t];return o?function(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb(${e[0]}, ${e[1]}, ${e[2]})`;case"hsl":return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`;case"hwb":return`hwb(${e[0]}, ${e[1]}, ${e[2]})`;case"lab":return`lab(${e[0]}% ${e[1]} ${e[2]})`;case"lch":return`lch(${e[0]}% ${e[1]} ${e[2]})`;default:return""}}(o("hex"===s.space?s.hexValue:s.values),t):""}function eR(e){if(!e)return"";let t=eW(e);return t?"hex"===t.space?t.hexValue:eM(e,"hex"):"#000"}function eN(e,t){void 0===customElements.get(e)&&customElements.define(e,t)}function eW(e){if(e.startsWith("#")){let t=(0,f.A)(e);return{space:"hex",values:t.values,hexValue:e,alpha:t.alpha}}let t=(0,f.A)(e);return t.space?t:null}class eG extends N{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);const i=`ck-labeled-field-view-${(0,s.Ld)()}`,o=`ck-labeled-field-view-status-${(0,s.Ld)()}`;this.fieldView=t(this,i,o),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",e=>!e),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){let t=new Y(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){let t=new N(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",e=>!e)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class ez extends N{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new s.$x,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...e)=>{this.fire("input",...e),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class eH extends ez{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class e$ extends eH{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class eU extends eH{constructor(e,{min:t,max:i,step:s}={}){super(e);const o=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",s),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:o.to("min"),max:o.to("max"),step:o.to("step")}})}}class eK extends ez{_resizeObserver;_isUpdateAutoGrowHeightPending=!1;constructor(e){super(e);const t=(0,s.To)("px");this.set("minRows",2),this.set("maxRows",5),this.set("_height",null),this.set("resize","none"),this._resizeObserver=null,this.on("change:minRows",this._val
1idateMinMaxRows.bind(this)),this.on("change:maxRows",this._validateMinMaxRows.bind(this));const i=this.bindTemplate;this.template.tag="textarea",this.extendTemplate({attributes:{class:["ck-textarea"],style:{height:i.to("_height",e=>e?t(e):null),resize:i.to("resize")},rows:i.to("minRows")}})}render(){super.render();let e=!1;this.on("input",()=>{this._updateAutoGrowHeight(!0),this.fire("update")}),this.on("change:value",()=>{s.Sf.window.requestAnimationFrame(()=>{if(!(0,s.zN)(this.element)){this._isUpdateAutoGrowHeightPending=!0;return}this._updateAutoGrowHeight(),this.fire("update")})}),this._resizeObserver=new s.tb(this.element,t=>{let i=!!t.contentRect.width&&!!t.contentRect.height;!e&&i&&this._isUpdateAutoGrowHeightPending&&s.Sf.window.requestAnimationFrame(()=>{this._updateAutoGrowHeight(),this.fire("update")}),e=i})}destroy(){this._resizeObserver&&this._resizeObserver.destroy()}reset(){super.reset(),this._updateAutoGrowHeight(),this.fire("update")}_updateAutoGrowHeight(e){let t=this.element;if(!t.offsetParent){this._isUpdateAutoGrowHeightPending=!0;return}this._isUpdateAutoGrowHeightPending=!1;let i=eq(t,"1"),o=eq(t,t.value),r=i.ownerDocument.defaultView.getComputedStyle(i),n=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),l=(0,s.Md)(i),a=parseFloat(r.lineHeight),h=l.top+l.bottom,c=new s.rw(i).height,d=Math.round((o.scrollHeight-n)/a),u=this.maxRows*a+n+h,p=1===d?c:this.minRows*a+n+h;this._height=Math.min(Math.max(Math.max(d,this.minRows)*a+n+h,p),u),e&&(t.scrollTop=t.scrollHeight),i.remove(),o.remove()}_validateMinMaxRows(){if(this.minRows>this.maxRows)throw new s.Yb("ui-textarea-view-min-rows-greater-than-max-rows",{textareaView:this,minRows:this.minRows,maxRows:this.maxRows})}}function eq(e,t){let i=e.cloneNode();return i.style.position="absolute",i.style.top="-99999px",i.style.left="-99999px",i.style.height="auto",i.style.overflow="hidden",i.style.width=e.ownerDocument.defaultView.getComputedStyle(e).width,i.tabIndex=-1,i.rows=1,i.value=t,e.parentNode.insertBefore(i,e),i}class ej extends N{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",e=>`ck-dropdown__panel_${e}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(e=>{let t=e.target;t instanceof Element&&"input"===t.tagName.toLocaleLowerCase()||e.preventDefault()})}})}focus(){if(this.children.length){let e=this.children.first;"function"==typeof e.focus?e.focus():(0,s.FF)("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){let e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}class eY extends N{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new s.EP,this.focusTracker=new s.$x,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",e=>!e)],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":o.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(e,t,i)=>{if(i)if("auto"===this.panelPosition){let e=eY._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=e?e.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);let e=(e,t)=>
1{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){let{south:e,north:t,southEast:i,southWest:s,northEast:o,northWest:r,southMiddleEast:n,southMiddleWest:l,northMiddleEast:a,northMiddleWest:h}=eY.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,s,n,l,e,o,r,a,h,t]:[s,i,l,n,e,r,o,h,a,t]}get _defaultPanelPositionName(){return"rtl"===this.locale.uiLanguageDirection?"sw":"se"}static defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)*3/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)*3/4,name:"nmw"})};static _getOptimalPosition=s.W}class eX extends ee{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new J;return e.content=m.G3R,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class eZ extends ee{id;constructor(e,t,i){super(e),this.id=t,this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem",label:i}),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__item__button"]}})}}class eJ extends ep{arrowView;constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new J;return e.content=m.G3R,e.extendTemplate({attributes:{class:"ck-dropdown-menu-list__nested-menu__button__arrow"}}),e}}class eQ extends N{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",e=>!e)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class e0 extends N{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class e1 extends N{labelView;items;children;constructor(e,t=new Y){super(e);const i=this.bindTemplate,s=new e2(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,s]),s.set({role:"group",ariaLabelledBy:t.id}),s.focusTracker.destroy(),s.keystrokes.destroy(),this.items=s.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",e=>!e)]},children:this.children})}focus(){if(this.items){let e=this.items.find(e=>!(e instanceof e0));e&&e.focus()}}}class e2 extends N{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const t=this.bindTemplate;this.focusables=new _,this.items=this.createCollection(),this.focusTracker=new s.$x,this.keystrokes=new s.EP,this._focusCycler=new es({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){for(let e of(super.render(),this.items))e instanceof e1?this._registerFocusableItemsGroup(e):e instanceof eQ&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(let e of t.removed)e instanceof e1?this._deregisterFocusableItemsGroup(e):e instanceof eQ&&this._deregisterFocusableListItem(e);for(let e of Array.from(t.added).reverse())e instanceof e1?this._registerFocusableItemsGroup(e,t.index):this._registerFocusableListItem(e,t.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(let e of i.removed)this._deregisterFocusableListItem(e);for(let t of Array.from(i.added).reverse())this._registerFocusableListItem(t,this.items.getIndex(e)+i.index)}}
1_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((e,i)=>{this._registerFocusableListItem(e,void 0!==t?t+i:void 0)});let i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(let t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class e9 extends e2{constructor(e){super(e);const t=this.bindTemplate;this.role="menu",this.set("isVisible",!0),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list",t.if("isVisible","ck-hidden",e=>!e)]}})}}let e5={eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height+e.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height+e.height,left:e.left-t.width+5,name:"wn"})};class e3 extends eQ{childView;constructor(e,t,i){super(e);const s=this.bindTemplate;this.childView=i,this.children.add(i),this.extendTemplate({attributes:{class:["ck-dropdown-menu-list__nested-menu__item"]},on:{mouseenter:s.to("mouseenter")}}),t&&(this.delegate("mouseenter").to(t),i instanceof eZ&&i.delegate("execute").to(t))}}let e7={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",t=>{let[i]=t.path;for(let s of(t.source.focus(),e.menus)){let e=i instanceof e3&&i.childView===s;s.isOpen=(t.path.includes(s)||e)&&s.isEnabled}})},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",(t,i,s)=>{if(!s)return;let o=t.source;for(let t of e.menus)o.parentMenuView===t.parentMenuView&&o!==t&&(t.isOpen=!1)})}},e4={openOnArrowRightKey(e){let t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnButtonClick(e){e.buttonView.on("execute",()=>{e.isEnabled&&(e.isOpen=!0)})},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())})},closeOnArrowLeftKey(e){let t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,(t,i)=>{e.isOpen&&(e.focus(),e.isOpen=!1,i())})},closeOnEscKey(e){e.keystrokes.set("esc",(t,i)=>{e.isOpen&&(e.focus(),e.isOpen=!1,i())})},closeOnParentClose(e,t){t.on("change:isOpen",(i,s,o)=>{o||i.source!==t||(e.isOpen=!1)})}};class e6 extends ek{constructor(e){super(e);const t=this.bindTemplate;this.set({isVisible:!1,position:"se",class:null,top:0,left:0}),this.extendTemplate({tag:"div",attributes:{class:["ck-reset","ck-dropdown-menu__nested-menu__panel"],tabindex:"-1"},on:{selectstart:t.to(e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()})}})}focus(e=1){let{content:t}=this;t.length&&(1===e?t.first.focus():t.last.focus())}}class e8 extends N{static DELEGATED_EVENTS=["mouseenter","execute","change:isOpen"];id;buttonView;panelView;listView;focusTracker;keystrokes;_bodyCollection;constructor(e,t,i,o,r){super(e),this._bodyCollection=t,this.id=i,this.set({isOpen:!1,isEnabled:!0,panelPosition:"w",class:void 0,parentMenuView:null}),this.keystrokes=new s.EP,this.focusTracker=new s.$x,this.buttonView=new eJ(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.buttonView.label=o,this.panelView=new e6(e),this.panelView.isVisible=!0,this.listView=new e9(e),this.listView.bind("ariaLabel").to(this.buttonView,"label"),this.panelView.content.add(this.listView);const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown-menu-list__nested-menu",n.to("class"),n.if("isEnabled","ck-disabled",e=>!e)],role:"presentation"},children:[this.buttonView]}),this.parentMenuView=r,this.parentMenuView&&this._handleParentMenuView(),this._attachBehaviors()}get _panelPositions(){let{westSouth:e,eastSouth:t,westNorth:i,eastNorth:s}=e5;return"ltr"===this.locale.uiLanguageDirection?[t,s,e,i]:[e,i,t,s]}render(){super.render(),this.panelView.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.focusTracker.add(this.listView),this.keystrokes.listenTo(this.element),this._mountPanelOnOpen()}destroy(){this._removePanelFromBody(),this.panelView.destroy(),super.destroy()}focus(){this.buttonView.focus()}_handleParentMenuView(){this.delegate(...e8.DELEGATED_EVENTS).to(this.parentMenuView),e4.closeOnParentClose(this,this.parentMenuView)}_attachBehaviors(){e4.openOnButtonClick(this),e4.openAndFocusOnEnterKeyPress(this),e4.openOnArrowRightKey(this),e4.closeOnEscKey(this),e4.closeOnArrowLeftKey(this)}_mountPanelOnOpen(){let{panelView:e}=this;this.on("change:isOpen",(t,i,s)=>{if(t.source===this){if(!s&&this._bodyCollection.has(e))return void this._removePanelFromBody();s&&!this._bodyCollection.has(e)&&this._addPanelToBody()}})}_removePanelFromBody(){let{panelView:e,keystrokes:t}=this;this._bodyCollection.has(e)&&(this._bodyCollection.remove(e),t.stopListening(e.element))}_addPanelToBody(){let{panelView:e,buttonView:t,keystrokes:i}=this;this._bodyCollection.has(e)||(this._bodyCollection.add(e),i.listenTo(e.element),e.pin({positions:this._panelPositions,limiter:s.Sf.document.body,element:e.element,target:t.element,fitInViewport:!0}))}}class te extends e9{_definition;_cachedMenus=[];_cachedButtons=[];_bodyCollection;constructor(e,t,i){super(e),this._bodyCollection=t,this._definition=i,this.set("menuPanelClass",void 0)}get menus(){return Array.from(this._cachedMenus.values())}get buttons(){return Array.from(this._cachedButtons.values())}render(){this._createStructure(this._definition,null),super.render(),e7.toggleMenusAndFocusItemsOnHover(this),e7.closeMenuWhenAnotherOnTheSameLevelOpens(this)}
1closeMenus(){this.menus.forEach(e=>{e.isOpen=!1})}_createStructure(e,t){let i=[];for(let s of e){let e;"menu"in s?((e=new e8(this.locale,this._bodyCollection,s.id,s.menu,t)).panelView.bind("class").to(this,"menuPanelClass"),t||e.delegate(...e8.DELEGATED_EVENTS).to(this,e=>`menu:${e}`),this._cachedMenus.push(e),this._createStructure(s.children,e)):(e=new eZ(this.locale,s.id,s.label),t||e.delegate("execute").to(this,"menu:execute"),this._cachedButtons.push(e));let o=new e3(this.locale,t,e);t||o.delegate("mouseenter").to(this,"menu:mouseenter"),i.push(o)}(t?t.listView:this).items.addMany(i)}}class tt extends N{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class ti extends N{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function ts(e){return e.bindTemplate.to(t=>{t.target===e.element&&t.preventDefault()})}function to(e){if(Array.isArray(e))return{items:e,removeItems:[]};let t={items:[],removeItems:[]};return e?{...t,...e}:t}let tr={alignLeft:m.UFF,bold:m.NdK,importExport:m.XWU,paragraph:m.yBe,plus:m.blu,text:m.hfJ,threeVerticalDots:m.ebm,pilcrow:m.kaJ,dragIndicator:m.hT4};class tn extends N{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new s.$x,this.keystrokes=new s.EP,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new tl(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r="rtl"===e.uiLanguageDirection;this._focusCycler=new es({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const n=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&n.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:n,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:ts(this)}}),this._behavior=this.options.shouldGroupWhenFull?new th(this):new ta(this)}render(){for(let e of(super.render(),this.focusTracker.add(this.element),this.items))this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),"dynamic"===e?(this._behavior=new th(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new ta(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){let s=to(e),o=i||s.removeItems;return this._cleanItemsConfiguration(s.items,t,o).map(e=>(0,r.G)(e)?this._createNestedToolbarDropdown(e,t,o):"|"===e?new tt:"-"===e?new ti:t.create(e)).filter(e=>!!e)}_cleanItemsConfiguration(e,t,i){let o=e.filter((e,o,n)=>"|"===e||-1===i.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||((0,s.FF)("toolbarview-line-break-ignored-when-grouping-items",n),!1):!!(0,r.G)(e)||!!t.has(e)||((0,s.FF)("toolbarview-item-unavailable",{item:e}),!1)));return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){let t=e=>"-"!==e&&"|"!==e,i=e.length,s=e.findIndex(t);if(-1===s)return[];let o=i-e.slice().reverse().findIndex(t);return e.slice(s,o).filter((e,i,s)=>!!t(e)||!(i>0&&s[i-1]===e))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:r,items:n,tooltip:l=!0,withText:a=!1}=e;if(!(n=this._cleanItemsConfiguration(n,t,i)).length)return null;let h=td(this.locale);return o||(0,s.FF)("toolbarview-nested-toolbar-dropdown-missing-label",e),h.class="ck-toolbar__nested-toolbar-dropdown",h.buttonView.set({label:o,tooltip:l,withText:!!a}),!1!==r?h.buttonView.icon=tr[r]||r||m.ebm:h.buttonView.withText=!0,tm(h,()=>h.toolbarView._buildItemsFromConfig(n,t,i)),h}}class tl extends N{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class ta{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(e=>e),e.focusables.bindTo(e.items).using(e=>er(e)?e:null)}render(){}destroy(){}}class th{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(e,t)=>{let i=t.index,s=Array.from(t.added);for(let e of t.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=i;e<i+s.length;e++){let t=s[e-i];e>this.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,e)}this._updateGrouping()})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){let e=this.view;if(e.items.length){for(let t=0;t<e.items.length;t++){let i=[...e.items][t];this.ungroupedItems.add(i,t)}this._updateGrouping()}}_updateGrouping(){let e;if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!(0,s.zN)(this.viewElement)){this.shouldUpdateGroupingOnNextResize=!0;return}let t=this.groupedItems.length;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;let e=this.viewElement,t=this.viewLocale.uiLanguageDirection,i=new s.rw(e.last
1Child),o=new s.rw(e);if(!this.cachedPadding){let i=s.Sf.window.getComputedStyle(e);this.cachedPadding=Number.parseInt(i["ltr"===t?"paddingRight":"paddingLeft"])}return"ltr"===t?i.right>o.right-this.cachedPadding:i.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new s.tb(this.viewElement,t=>{(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize)&&(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new tt),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){let e=this.viewLocale,t=e.t,i=td(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",tm(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:m.ebm}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{er(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class tc extends N{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new s.EP,this.focusTracker=new s.$x,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",e=>!e),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){let t=e||new ee;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){let e=new ee,t=e.bindTemplate;return e.icon=m.G3R,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",e=>String(e))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function td(e,t=eX){var i,o,r,n,l,a,h;let c="function"==typeof t?new t(e):t,d=new ej(e),u=new eY(e,c,d);return c.bind("isEnabled").to(u),c instanceof tc?c.arrowView.bind("isOn").to(u,"isOpen"):c.bind("isOn").to(u,"isOpen"),$({emitter:o=i=u,activator:()=>o.isRendered&&o.isOpen,callback:()=>{o.isOpen=!1},contextElements:()=>[o.element,...(function e(t){return[...t.elements,...t.externalViews.flatMap(t=>e(t.focusTracker))]})(o.focusTracker).filter(e=>!o.element.contains(e))]}),(r=i).on("execute",e=>{e.source instanceof eC||(r.isOpen=!1)}),(n=i).focusTracker.on("change:isFocused",(e,t,i)=>{!i&&n.isOpen&&(n.isOpen=!1)}),(l=i).keystrokes.set("arrowdown",(e,t)=>{l.isOpen&&(l.panelView.focus(),t())}),l.keystrokes.set("arrowup",(e,t)=>{l.isOpen&&(l.panelView.focusLast(),t())}),(a=i).on("change:isOpen",(e,t,i)=>{i||a.focusTracker.elements.some(e=>e.contains(s.Sf.document.activeElement))&&a.buttonView.focus()}),(h=i).on("change:isOpen",(e,t,i)=>{i&&h.panelView.focus()},{priority:"low"}),u}function tu(e,t,i,s={}){e.menuView=new te(e.locale,t,i),e.focusTracker.add(e.menuView),e.isOpen?tp(e,s):e.once("change:isOpen",()=>{tp(e,s)},{priority:"highest"})}function tp(e,t){let i=e.menuView,s=e.locale.t;for(let t of(i.delegate("menu:execute").to(e,"execute"),i.listenTo(e,"change:isOpen",(e,t,s)=>{s||i.closeMenus()},{priority:"low"}),e.panelView.children.add(i),i.menus))e.focusTracker.add(t);i.ariaLabel=t.ariaLabel||s("Dropdown menu")}function tm(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?tf(e,t,i):e.once("change:isOpen",()=>tf(e,t,i),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&tg(e,()=>e.toolbarView.items.find(e=>e.isOn))}function tf(e,t,i){let s=e.locale,o=s.t,r=e.toolbarView=new tn(s),n="function"==typeof t?t():t;r.ariaLabel=i.ariaLabel||o("Dropdown toolbar"),i.maxWidth&&(r.maxWidth=i.maxWidth),i.class&&(r.class=i.class),i.isCompact&&(r.isCompact=i.isCompact),i.isVertical&&(r.isVertical=!0),n instanceof _?r.items.bindTo(n).using(e=>e):r.items.addMany(n),e.panelView.children.add(r),e.focusTracker.add(r),r.items.delegate("execute").to(e)}function tw(e,t,i={}){e.isOpen?tb(e,t,i):e.once("change:isOpen",()=>tb(e,t,i),{priority:"highest"}),tg(e,()=>e.listView.items.find(e=>e instanceof eQ&&e.children.first.isOn))}function tb(e,t,i){let s=e.locale,o=e.listView=new e2(s),r="function"==typeof t?t():t;o.ariaLabel=i.ariaLabel,o.role=i.role,function e(t,i,s,o){var r;let n,l,a;r=i,n=0,l=e=>e instanceof eQ&&e.children.first instanceof ep?e.children.first:null,a=e=>{let t=l(e);return t&&t.isToggleable?t:null},r.on("change",(e,t)=>{let i=n>0;for(let e of t.removed)a(e)&&n--;for(let e of t.added){let t=l(e);t&&(t.isToggleable&&n++,t.hasCheckSpace=n>0)}let s=n>0;i!==s&&(e=>{for(let t of r){let i=l(t);i&&(i.hasCheckSpace=e)}})(s)}),i.bindTo(s).using(i=>{if("separator"===i.type)return new e0(o);
1if("group"===i.type){let s=new e1(o);return s.set({label:i.label}),e(t,s.items,i.items,o),s.items.delegate("execute").to(t),s}if("button"===i.type||"switchbutton"===i.type){let e,t="menuitemcheckbox"===i.model.role||"menuitemradio"===i.model.role,s=new eQ(o);return"button"===i.type?(e=new ep(o,i.labelView)).set({isToggleable:t}):e=new eC(o),e.bind(...Object.keys(i.model)).to(i.model),e.delegate("execute").to(s),s.children.add(e),s}return null})}(e,o.items,r,s),e.panelView.children.add(o),o.items.delegate("execute").to(e)}function tg(e,t){e.on("change:isOpen",()=>{if(!e.isOpen)return;let i=t();i&&("function"==typeof i.focus?i.focus():(0,s.FF)("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))},{priority:s.vx.low-10})}let t_=(e,t,i)=>{let s=new e$(e.locale);return s.set({id:t,ariaDescribedById:i}),s.bind("isReadOnly").to(e,"isEnabled",e=>!e),s.bind("hasError").to(e,"errorText",e=>!!e),s.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(s),s},tk=(e,t,i)=>{let s=new eU(e.locale);return s.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),s.bind("isReadOnly").to(e,"isEnabled",e=>!e),s.bind("hasError").to(e,"errorText",e=>!!e),s.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(s),s},tV=(e,t,i)=>{let s=new eK(e.locale);return s.set({id:t,ariaDescribedById:i}),s.bind("isReadOnly").to(e,"isEnabled",e=>!e),s.bind("hasError").to(e,"errorText",e=>!!e),s.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(s),s},tT=(e,t,i)=>{let s=td(e.locale);return s.set({id:t,ariaDescribedById:i}),s.bind("isEnabled").to(e),s};class tv extends N{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=(0,a.s)(e=>{this.set("color",e),this.fire("colorSelected",{color:this.color})},150,{leading:!0}),this.on("set:color",(e,t,i)=>{e.return=eM(i,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=ty(this.color)}),this.on("change:_hexColor",()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),ty(this.color)!=ty(this._hexColor)&&(this.color=this._hexColor)})}render(){if(super.render(),eN("hex-color-picker",b.Z),this.picker=s.Sf.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);let e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",e=>{let t=e.detail.value;this._debounceColorPickerEvent(t)})}focus(){!this._config.hideInput&&(s._K.isGecko||s._K.isiOS||s._K.isSafari||s._K.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){let e=[...this.picker.shadowRoot.children].filter(e=>"slider"===e.getAttribute("role")).map(e=>new tx(e));this.slidersView=this.createCollection(),e.forEach(e=>{this.slidersView.add(e)})}_createInputRow(){let e=this._createColorInput();return new tE(this.locale,e)}_createColorInput(){let e=new eG(this.locale,t_),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",t=>e.isFocused?e.fieldView.value:t.startsWith("#")?t.substring(1):t),e.fieldView.on("input",()=>{let t=e.fieldView.element.value;if(t){let e=tO(t);e&&this._debounceColorPickerEvent(e)}}),e}isValid(){let{t:e}=this.locale;return!!this._config.hideInput||(this.resetValidationStatus(),!!this.hexInputRow.getParsedColor()||(this.hexInputRow.inputVie
1w.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function ty(e){let t=eR(e);return t||(t="#000"),4===t.length&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}class tx extends N{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class tC extends N{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class tE extends N{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new tC,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return tO(this.inputView.fieldView.element.value)}}function tO(e){if(!e)return null;let t=e.trim().replace(/^#/,"");return[3,4,6,8].includes(t.length)&&/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?`#${t}`:null}class tP extends(0,s.VM)(s.pM){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(e,t){return this.find(t=>t.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}class tB extends N{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:s,documentColorsLabel:o,documentColorsCount:r,colorPickerLabel:n,focusTracker:l,focusables:a}){super(e);const h=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=l,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new tP,this.documentColorsCount=r,this._focusables=a,this._removeButtonLabel=s,this._colorPickerLabel=n,this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",h.if("isVisible","ck-hidden",e=>!e)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){let i=e.document,s=this.documentColorsCount;for(let o of(this.documentColors.clear(),i.getRoots()))for(let i of e.createRangeIn(o).getItems())if(i.is("$textProxy")&&i.hasAttribute(t)&&(this._addColorToDocumentColors(i.getAttribute(t)),this.documentColors.length>=s))return}updateSelectedColors(){let e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){let e=k.bind(this.documentColors,this.documentColors),t=new N(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new ee,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:m.wE,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){let e=new ee;return e.set({withText:!0,icon:m.Mxb,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){let e=new eD(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(e,t)=>{this.fire("execute",{value:t.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){let e=k.bind(this.documentColors,this.documentColors),t=new eD(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(e=>{let t=new eL;return t.set({color:e.color,hasBorder:e.options?.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color,source:"documentColorsGrid"})}),t}),this.documentColors.on("change:isEmpty",(e,i,s)=>{s&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){let t=this.colorDefinitions.find(t=>t.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class tI extends N{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:s,colorPickerViewConfig:o}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=s,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=o;const r=this.bindTemplate,{saveButtonView:n,cancelButtonView:l}=this._createActionButtons();this.saveButtonView=n,this.cancelButtonView=l,this.actionBarView=this._createActionBarView({saveButtonView:n,cancelButtonView:l}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",r.if("isVisible","ck-hidden",e=>!e)]},children:this.items})}render(){super.render();
1let e=new tv(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(t,i,s)=>{e.color=s}),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())})}_stopPropagationOnArrowsKeys(){let e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(let e of this.colorPickerView.slidersView)this.focusTracker.add(e.element),this._focusables.add(e);let e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){let i=new N,s=this.createCollection();return s.add(e),s.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:s}),i}_createActionButtons(){let e=this.locale,t=e.t,i=new ee(e),s=new ee(e);return i.set({icon:m.iWP,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),s.set({icon:m.AUn,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),s.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:i,cancelButtonView:s}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)})}}class tF extends N{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new s.$x,this.keystrokes=new s.EP,this._focusables=new _,this._colorPickerViewConfig=a,this._focusCycler=new es({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new tB(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new tI(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",(e,t,i)=>{this.colorGridsFragmentView.set("selectedColor",i),this.colorPickerFragmentView.set("selectedColor",i)}),this.colorGridsFragmentView.on("change:selectedColor",(e,t,i)=>{this.set("selectedColor",i)}),this.colorPickerFragmentView.on("change:selectedColor",(e,t,i)=>{this.set("selectedColor",i)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){this.colorPickerFragmentView.colorPickerView&&!this._isColorPickerFragmentVisible&&(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){2!==this.items.length&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",()=>{this.showColorPickerFragment()}),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class tS{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(let e of this._components.values())yield e.originalName}add(e,t){this._components.set(tA(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new s.Yb("componentfactory-item-missing",this,{name:e});return this._components.get(tA(e)).callback(this.editor.locale)}has(e){return this._components.has(tA(e))}}function tA(e){return String(e).toLowerCase()}let tL="ck-tooltip";class tD extends(0,s.c5)(){tooltipTextView;balloonPanelView;static defaultBalloonPositions=ek.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),tD._editors.add(e),tD._instance)return tD._instance;tD._instance=this,this.tooltipTextView=new N(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new ek(e.locale),this.balloonPanelView.class=tL,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(e){let t=new MutationObserver(()=>{e()});return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=(0,a.s)(this._pinTooltip,600),this._unpinTooltipDebounced=(0,a.s)(this._unpinTooltip,400),this.listenTo(s.Sf.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(s.Sf.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(s.Sf.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(s.Sf.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(s.Sf.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(s.Sf.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){let t=e.ui.view&&e.ui.view.body;tD._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),tD._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),tD._instance=null)}static getPositioningFunctions(e){let t=tD.defaultBalloonPositions;return({s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]})[e]}_onKeyDown(e,t){"Escape"===t.key&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){let i=tM(t);if(!i){"focus"===e.name&&this._unpinTooltip();return}i===this._currentElementWithTooltip?this._unpinTooltipDebounced.cancel():(this._unpinTooltip(),"focus"===e.name&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,tR(i)):this._pinTooltipDebounced(i,tR(i)))}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if("mouseleave"===e.name){if(!(0,n.v)(t))return;let e=this.balloonPanelView.element,s=e&&(e===i||e.contains(i)),o=!s&&t===e;if(s)return void this._unpinTooltipDebounced.cancel();if(!o&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;let r=tM(t),l=tM(i);(o||r&&r!==l)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||r&&r.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){!this._currentElementWithTooltip||t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip()}_pinTooltip(e,{text:t,position:i,cssClass:o}){this._unpinTooltip();let r=(0,s.$1)(tD._editors.values()).ui.view.body;for(let s of(r.has(this.balloonPanelView)||r.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[tL,o].filter(e=>e).join(" "),this.balloonPanelView.pin({target:e,positions:tD.getPositioningFunctions(i)}),this._mutationObserver.attach(e),tD._editors))this.listenTo(s.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){for(let e of(this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin(),tD._editors))this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;let e=tR(this._currentElementWithTooltip);(0,s.zN)(this._currentElementWithTooltip)&&e.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:tD.getPositioningFunctions(e.position)}):this._unpinTooltip()}}function tM(e){return(0,n.v)(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function tR(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}class tN extends eT{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){let e=tG(this.editor.config.get("licenseKey"));return!!(e&&this.licenseTypeMessage[e])}_createBadgeContent(){let e=tG(this.editor.config.get("licenseKey"));return new tW(this.editor.locale,this.licenseTypeMessage[e])}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{};return{position:t.position||e.position,side:"left"===(t.side||e.side)?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class tW extends N{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}}function tG(e){if("GPL"==e)return"GPL";let t=(0,s.yE)(e.split(".")[1]);return t?t.licenseType||"production":null}class tz extends eQ{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}let tH={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",t=>{if(e.isFocusBorderEnabled||e.isOpen){if(e.isOpen)for(let i of e.menus){let e=t.path[0],s=e instanceof tz&&e.children.first===i;i.isOpen=(t.path.includes(i)||s)&&i.isEnabled}
1t.source.focus()}})},focusCycleMenusOnArrows(e){let t="rtl"===e.locale.uiLanguageDirection;function i(t,i){let s=e.children.getIndex(t),o=t.isOpen,r=e.children.length,n=e.children.get((s+r+i)%r);t.isOpen=!1,o&&(n.isOpen=!0),n.buttonView.focus()}e.on("menu:arrowright",e=>{i(e.source,t?-1:1)}),e.on("menu:arrowleft",e=>{i(e.source,t?1:-1)})},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",()=>{e.isOpen||e.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",(t,i,s)=>{s&&e.menus.filter(e=>t.source.parentMenuView===e.parentMenuView&&t.source!==e&&e.isOpen).forEach(e=>{e.isOpen=!1})})},closeOnClickOutside(e){$({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",(i,s,o)=>{o||(t||(e.isFocusBorderEnabled=!1),t=!1)}),e.listenTo(e.element,"keydown",()=>{t=!0},{useCapture:!0}),e.listenTo(e.element,"keyup",()=>{t=!1},{useCapture:!0}),e.listenTo(e.element,"focus",()=>{t&&(e.isFocusBorderEnabled=!0)},{useCapture:!0})}},t$={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",(t,i)=>{e.isEnabled&&e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnArrowRightKey(e){let t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!0})},toggleOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!e.isOpen})},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())})},closeOnArrowLeftKey(e){let t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,(t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())})},closeOnEscKey(e){e.keystrokes.set("esc",(t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())})},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",(t,i,s)=>{s||t.source!==e.parentMenuView||(e.isOpen=!1)})}},tU={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+5,name:"wn"})},tK=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:insertFootnote","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]}
1,{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function tq(e){return"items"in e&&e.items?{items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e}:{items:(0,h.m)(tK),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e}}function tj({normalizedConfig:e,locale:t,componentFactory:i,extraItems:o}){var r,n,l,a;let c,d,u=(0,h.m)(e);return tY(e,u,o),function(e,t){let i=t.removeItems,o=[];for(let r of(t.items=t.items.filter(({menuId:e})=>!i.includes(e)||(o.push(e),!1)),tJ(t.items,e=>{for(let t of(e.groups=e.groups.filter(({groupId:e})=>!i.includes(e)||(o.push(e),!1)),e.groups))t.items=t.items.filter(e=>{let t=tQ(e);return!i.includes(t)||(o.push(t),!1)})}),i))o.includes(r)||(0,s.FF)("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:r})}(e,u),tY(e,u,u.addItems),r=e,n=u,l=i,tJ(n.items,e=>{for(let t of e.groups)t.items=t.items.filter(t=>{let i="string"==typeof t&&!l.has(t);return i&&!n.isUsingDefaultConfig&&(0,s.FF)("menu-bar-item-unavailable",{menuBarConfig:r,parentMenuConfig:(0,h.m)(e),componentName:t}),!i})}),function e(t,i){let s=i.isUsingDefaultConfig,o=!1;(i.items=i.items.filter(e=>!!e.groups.length||(tZ(t,e,s),!1)),i.items.length)?(tJ(i.items,e=>{for(let i of(e.groups=e.groups.filter(e=>!!e.items.length||(o=!0,!1)),e.groups))i.items=i.items.filter(e=>!t0(e)||!!e.groups.length||(tZ(t,e,s),o=!0,!1))}),o&&e(t,i)):tZ(t,t,s)}(e,u),a=u,d={File:(c=t.t)({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:c({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:c({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:c({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:c({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:c({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:c({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:c({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:c({string:"Font",id:"MENU_BAR_MENU_FONT"})},tJ(a.items,e=>{e.label in d&&(e.label=d[e.label])}),u}function tY(e,t,i){let o=[];if(0!=i.length){for(let e of i){var r,n,l;let i=(r=e.position).startsWith("start")?"start":r.startsWith("end")?"end":r.startsWith("after")?"after":"before",s=function(e){let t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}(e.position);if("object"==typeof(n=e)&&"menu"in n)if(s){let r=t.items.findIndex(e=>e.menuId===s);-1!=r?"before"===i?(t.items.splice(r,0,e.menu),o.push(e)):"after"===i&&(t.items.splice(r+1,0,e.menu),o.push(e)):tX(t,e.menu,s,i)&&o.push(e)}else"start"===i?(t.items.unshift(e.menu),o.push(e)):"end"===i&&(t.items.push(e.menu),o.push(e));else{"object"==typeof(l=e)&&"group"in l?tJ(t.items,t=>{if(t.menuId===s)"start"===i?(t.groups.unshift(e.group),o.push(e)):"end"===i&&(t.groups.push(e.group),o.push(e));else{let r=t.groups.findIndex(e=>e.groupId===s);-1!==r&&("before"===i?(t.groups.splice(r,0,e.group),o.push(e)):"after"===i&&(t.groups.splice(r+1,0,e.group),o.push(e)))}}
1):tX(t,e.item,s,i)&&o.push(e)}}for(let t of i)o.includes(t)||(0,s.FF)("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:t})}}function tX(e,t,i,s){let o=!1;return tJ(e.items,e=>{for(let{groupId:r,items:n}of e.groups){if(o)return;if(r===i)"start"===s?(n.unshift(t),o=!0):"end"===s&&(n.push(t),o=!0);else{let e=n.findIndex(e=>tQ(e)===i);-1!==e&&("before"===s?(n.splice(e,0,t),o=!0):"after"===s&&(n.splice(e+1,0,t),o=!0))}}}),o}function tZ(e,t,i){i||(0,s.FF)("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function tJ(e,t){if(Array.isArray(e))for(let i of e)!function e(i){for(let s of(t(i),i.groups))for(let t of s.items)t0(t)&&e(t)}(i)}function tQ(e){return"string"==typeof e?e:e.menuId}function t0(e){return"object"==typeof e&&"menuId"in e}class t1 extends(0,s.VM)(){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();const t=e.editing.view;this.editor=e,this.componentFactory=new tS(e),this.focusTracker=new s.$x,this.tooltipManager=new tD(e),this.poweredBy=new ey(e),this.evaluationBadge=new tN(e),this.ariaLiveAnnouncer=new G(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0}),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){for(let e of(this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy(),this._editableElementsMap.values()))e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);let i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){let t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){let t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);let i=tq(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(e,i)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),i())}),this.editor.keystrokes.set("Alt+F9",(i,s)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),s())})}_readViewportOffsetFromConfig(){let e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;let i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){let e,t=this.editor;t.keystrokes.set("Alt+F10",(t,i)=>{this._saveLastFocusedForeignElement();let s=this._getCurrentFocusedToolbarDefinition();s&&e||(e=this._getFocusableCandidateToolbarDefinitions());for(let t=0;t<e.length;t++){let t=e.shift();if(e.push(t),t!==s&&this._focusFocusableCandidateToolbar(t)){s&&s.options.afterBlur&&s.options.afterBlur();break}}i()}),t.keystrokes.set("Esc",(e,i)=>{let s=this._getCurrentFocusedToolbarDefinition();s&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):t.editing.view.focus(),s.options.afterBlur&&s.options.afterBlur(),i())})}_saveLastFocusedForeignElement(){let e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){let e=[];for(let t of this._focusableToolbarDefinitions){let{toolbarView:i,options:o}=t;((0,s.zN)(i.element)||o.beforeFocus)&&e.push(t)}return e.sort((e,t)=>
1t2(e)-t2(t)),e}_getCurrentFocusedToolbarDefinition(){for(let e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){let{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),!!(0,s.zN)(t.element)&&(t.focus(),!0)}_handleScrollToTheSelection(e,t){let i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){let e=this.view.body;for(let t of e)this.focusTracker.add(t.element);e.on("add",(e,t)=>{this.focusTracker.add(t.element)}),e.on("remove",(e,t)=>{this.focusTracker.remove(t.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(e,t,i)=>{let s=this._getVisualViewportTopOffset(i);i.visualTop!==s&&(e.return={...i,visualTop:s})}),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!s.Sf.window.visualViewport)return;let e=()=>{let e=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==e&&(this.viewportOffset={...this.viewportOffset,visualTop:e})};this._domEmitter=new((0,s.c5)()),this._domEmitter.listenTo(s.Sf.window.visualViewport,"scroll",e),this._domEmitter.listenTo(s.Sf.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){let t=(0,s.UM)().top,i=e.top||0;return t>i?0:i-t}}function t2(e){let{toolbarView:t,options:i}=e,o=10;return(0,s.zN)(t.element)&&o--,i.isContextual&&(o-=2),o}class t9 extends N{body;menuBarView;toolbar;constructor(e){super(e),this.body=new eb(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class t5 extends t9{top;main;_voiceLabelView;constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){let e=this.t,t=new Y;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class t3 extends N{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){let e=this._editingView;function t(t){e.change(i=>{let s=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",s),i.removeClass(t.isFocused?"ck-blurred":"ck-focused",s)})}e.isRenderingInProgress?function i(s){e.once("change:isRenderingInProgress",(e,o,r)=>{r?i(s):t(s)})}(this):t(this)}}class t7 extends t3{_options;constructor(e,t,i,s={}){super(e,t,i),this._options=s,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();let e=this._editingView;e.change(t=>{let i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){let e=this.locale.t,t=this._options.label,i=this._editableElement,s=this.name;if("string"==typeof t)return t;if("object"==typeof t)return t[s];if("function"==typeof t)return t(this);if(i){let e=i.getAttribute("aria-label");if(e)return e}return e("Rich Text Editor. Editing area: %0",s)}}class t4 extends N{children;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",["ck","ck-form__row",...(0,s.$r)(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEac
1h(e=>this.children.add(e)),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",e=>e.join(" ")),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}class t6 extends N{constructor(e){super(e);const t=this.bindTemplate;this.setTemplate({tag:"iframe",attributes:{class:["ck","ck-reset_all"],sandbox:"allow-same-origin allow-scripts"},on:{load:t.to("loaded")}})}render(){return new Promise(e=>(this.on("loaded",e),super.render()))}}class t8 extends N{labelView;inputView;statusView;constructor(e,t){super(e);const i=`ck-input-${(0,s.Ld)()}`,o=`ck-status-${(0,s.Ld)()}`;this.set("label",void 0),this.set("value",void 0),this.set("isReadOnly",!1),this.set("errorText",null),this.set("infoText",null),this.labelView=this._createLabelView(i),this.inputView=this._createInputView(t,i,o),this.statusView=this._createStatusView(o),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input",r.if("isReadOnly","ck-disabled")]},children:[this.labelView,this.inputView,this.statusView]})}_createLabelView(e){let t=new Y(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createInputView(e,t,i){let s=new e(this.locale,i);return s.id=t,s.ariaDescribedById=i,s.bind("value").to(this),s.bind("isReadOnly").to(this),s.bind("hasError").to(this,"errorText",e=>!!e),s.on("input",()=>{this.errorText=null}),s}_createStatusView(e){let t=new N(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input__status",i.if("errorText","ck-labeled-input__status_error"),i.if("_statusText","ck-hidden",e=>!e)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}select(){this.inputView.select()}focus(){this.inputView.focus()}}function ie(e,t){let i=0,s=0;for(let o of t){let t=o.items,r=e&&!!o.label.match(e);for(let i of(o.labelView.highlightText(r?e:null),t)){let t=i.children.first,s=t.labelView;if(e){let o=!!t.label.match(e);s.highlightText(o?e:null),i.isVisible=r||o}else i.isVisible=!0,s.highlightText(null)}let n=t.filter(e=>e.isVisible).length;i+=o.items.length,s+=r?o.items.length:n,o.isVisible=r||!!n}return{resultsCount:s,totalItemsCount:i}}class it extends p.HY{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){let t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class ii extends(0,s.VM)(){constructor(e,t){super(),t&&(0,c.J)(this,t),e&&this.set(e)}}let is=(0,s.To)("px");class io extends p.k_{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{let e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new s.Yb("contextualballoon-add-view-exist",[this,e]);let t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(t);return}let i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new s.Yb("contextualballoon-remove-view-not-exist",[this,e]);let t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;let t=this._idToStack.get(e);if(!t)throw new s.Yb("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new ek(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){let e=new ir(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(e,i)=>i<2?"":t("%0 of %1",[Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1,i])
1),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){let e=new il(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>=2?Math.min(e-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:s=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),s&&(this._singleViewMode=!0)}}class ir extends N{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new s.$x,this.buttonPrevView=this._createButtonView(t("Previous"),m.saM),this.buttonNextView=this._createButtonView(t("Next"),m.YAm),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){let i=new ee(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class il extends N{content;_balloonPanelView;constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:i.to("top",is),left:i.to("left",is),width:i.to("width",is),height:i.to("height",is)}},children:this.content}),this.on("change:numberOfPanels",(e,t,i,s)=>{i>s?this._addPanels(i-s):this._removePanels(s-i),this.updatePosition()})}_addPanels(e){for(;e--;){let e=new N;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){let e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){let{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new s.rw(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}}let ia=(0,s.To)("px");class ih extends N{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new k({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?ia(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new k({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",e=>e?ia(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_stickyTopOffset",e=>e?ia(e):e),bottom:t.to("_stickyBottomOffset",e=>e?ia(e):e),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]}
1)}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(s.Sf.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),s.Sf.window.visualViewport&&(this.listenTo(s.Sf.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(s.Sf.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();let e=new s.rw(this.limiterElement),t=e.getVisible();if(t){let e=new s.rw(s.Sf.window);e.top+=this.viewportTopOffset,e.height-=this.viewportTopOffset,t=t.getIntersection(e)}let{left:i,top:o}=(0,s.UM)();if(e.moveBy(i,o),t&&t.moveBy(i,o),t&&e.top<t.top)if(this._contentPanelRect.height+this.limiterBottomOffset>t.height){let i=Math.max(e.bottom-t.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+i+1<e.height?this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<e.height?this._stickToTopOfAncestors(t.top):this._unstick();else this._unstick()}_stickToTopOfAncestors(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=e,this._stickyBottomOffset=null,this._marginLeft=ia(-s.Sf.window.scrollX+(0,s.UM)().left)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=ia(-s.Sf.window.scrollX+(0,s.UM)().left)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new s.rw(this.contentPanelElement)}}class ic extends eG{iconView;resetButtonView;_viewConfig;constructor(e,t){const i=e.t,s=Object.assign({},{showResetButton:!0,showIcon:!0,creator:t_},t);super(e,s.creator),this.label=t.label,this._viewConfig=s,this._viewConfig.showIcon&&(this.iconView=new J,this.iconView.content=m.Fh3,this.fieldWrapperChildren.add(this.iconView,0),this.extendTemplate({attributes:{class:"ck-search__query_with-icon"}})),this._viewConfig.showResetButton&&(this.resetButtonView=new ee(e),this.resetButtonView.set({label:i("Clear"),icon:m.AUn,class:"ck-search__reset",isVisible:!1,tooltip:!0}),this.resetButtonView.on("execute",()=>{this.reset(),this.focus(),this.fire("reset")}),this.resetButtonView.bind("isVisible").to(this.fieldView,"isEmpty",e=>!e),this.fieldWrapperChildren.add(this.resetButtonView),this.extendTemplate({attributes:{class:"ck-search__query_with-reset"}}))}reset(){this.fieldView.reset(),this._viewConfig.showResetButton&&(this.resetButtonView.isVisible=!1)}}class id extends N{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,primaryText:"",secondaryText:""}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__info",e.if("isVisible","ck-hidden",e=>!e)],tabindex:-1},children:[{tag:"span",children:[{text:[e.to("primaryText")]}]},{tag:"span",children:[{text:[e.to("secondaryText")]}]}]})}focus(){this.element.focus()}}class iu extends N{focusTracker;children;_focusCycler;constructor(e){super(e),this.children=this.createCollection(),this.focusTracker=new s.$x,this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__results"],tabindex:-1},children:this.children}),this._focusCycler=new es({focusables:this.children,focusTracker:this.focusTracker})}render(){for(let e of(super.render(),this.children))this.focusTracker.add(e.element)}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class ip extends N{focusTracker;keystrokes;resultsView;filteredView;infoView;queryView;focusCycler;_config;constructor(e,t){super(e),this._config=t,this.filteredView=t.filteredView,this.queryView=this._createSearchTextQueryView(),this.focusTracker=new s.$x,this.keystrokes=new s.EP,this.resultsView=new iu(e),this.children=this.createCollection(),this.focusableChildren=this.createCollection([this.queryView,this.resultsView]),this.set("isEnabled",!0),this.set("resultsCount",0),this.set("totalItemsCount",0),t.infoView&&t.infoView.instance?this.infoView=t.infoView.instance:(this.infoView=new id,this._enableDefaultInfoViewBehavior(),this.on("render",()=>{this.search("")})),this.resultsView.children.addMany([this.infoView,this.filteredView]),this.focusCycler=new es({focusables:this.focusableChildren,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.on("search",(e,{resultsCount:t,totalItemsCount:i})=>{this.resultsCount=t,this.totalItemsCount=i}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search",t.class||null],tabindex:"-1"},children:this.children})}render(){super.render(),this.children.addMany([this.queryView,this.resultsView]);let e=e=>e.stopPropagation();for(let e of this.focusableChildren)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}focus(){this.queryView.focus()}reset(){this.queryView.reset(),this.search(""),this.filteredView.element.scrollTo(0,0)}search(e){let t=e?RegExp((0,d.N)(e),"ig"):null,i=this.filteredView.filter(t);this.fire("search",{query:e,...i})}_createSearchTextQueryView(){let e=new ic(this.locale,this._config.queryView);return this.listenTo(e.fieldView,"input",()=>{this.search(e.fieldView.element.value)}),e.on("reset",()=>this.reset()),e.bind("isEnabled").to(this),e}_enableDefaultInfoViewBehavior(){let e=this.locale.t,t=this.infoView;function i(e,{query:t,resultsCount:s,totalItemsCount:o}){return"function"==typeof e?e(t,s,o):e}this.on("search",(s,o)=>
1{if(o.resultsCount)t.set({isVisible:!1});else{let s,r,n=this._config.infoView&&this._config.infoView.text;o.totalItemsCount?n?.notFound?(s=n.notFound.primary,r=n.notFound.secondary):(s=e("No results found"),r=""):n?.noSearchableItems?(s=n.noSearchableItems.primary,r=n.noSearchableItems.secondary):(s=e("No searchable items"),r=""),t.set({primaryText:i(s,o),secondaryText:i(r,o),isVisible:!0})}})}}class im extends ip{_config;constructor(e,t){super(e,t),this._config=t;const i=(0,s.To)("px");this.extendTemplate({attributes:{class:["ck-autocomplete"]}});const o=this.resultsView.bindTemplate;this.resultsView.set("isVisible",!1),this.resultsView.set("_position","s"),this.resultsView.set("_width",0),this.resultsView.extendTemplate({attributes:{class:[o.if("isVisible","ck-hidden",e=>!e),o.to("_position",e=>`ck-search__results_${e}`)],style:{width:o.to("_width",i)}}}),this.focusTracker.on("change:isFocused",(e,i,s)=>{this._updateResultsVisibility(),s?this.resultsView.element.scrollTop=0:t.resetOnBlur&&this.queryView.reset()}),this.on("search",()=>{this._updateResultsVisibility(),this._updateResultsViewWidthAndPosition()}),this.keystrokes.set("esc",(e,t)=>{this.resultsView.isVisible&&(this.queryView.focus(),this.resultsView.isVisible=!1,t())}),this.listenTo(s.Sf.document,"scroll",()=>{this._updateResultsViewWidthAndPosition()}),this.on("change:isEnabled",()=>{this._updateResultsVisibility()}),this.filteredView.on("execute",(e,{value:t})=>{this.focus(),this.reset(),this.queryView.fieldView.value=this.queryView.fieldView.element.value=t,this.resultsView.isVisible=!1}),this.resultsView.on("change:isVisible",()=>{this._updateResultsViewWidthAndPosition()})}_updateResultsViewWidthAndPosition(){if(!this.resultsView.isVisible)return;this.resultsView._width=new s.rw(this.queryView.fieldView.element).width;let e=im._getOptimalPosition({element:this.resultsView.element,target:this.queryView.element,fitInViewport:!0,positions:im.defaultResultsPositions});this.resultsView._position=e?e.name:"s"}_updateResultsVisibility(){let e=void 0===this._config.queryMinChars?0:this._config.queryMinChars,t=this.queryView.fieldView.element.value.length;this.resultsView.isVisible=this.focusTracker.isFocused&&this.isEnabled&&t>=e}static defaultResultsPositions=[e=>({top:e.bottom,left:e.left,name:"s"}),(e,t)=>({top:e.top-t.height,left:e.left,name:"n"})];static _getOptimalPosition=s.W}class iw extends N{constructor(){super(),this.set("text",void 0),this.setTemplate({tag:"span",attributes:{class:["ck","ck-highlighted-text"]}}),this.on("render",()=>{this.on("change:text",()=>{this._updateInnerHTML(this.text)}),this._updateInnerHTML(this.text)})}highlightText(e){this._updateInnerHTML(function(e,t){if(!t)return(0,u.i)(e);let i=[],s=0,o=t.exec(e);for(;null!==o;){let r=o.index;r!==s&&i.push({text:e.substring(s,r),isMatch:!1}),i.push({text:o[0],isMatch:!0}),s=t.lastIndex,o=t.exec(e)}return s!==e.length&&i.push({text:e.substring(s),isMatch:!1}),i.map(e=>(e.text=(0,u.i)(e.text),e)).map(e=>e.isMatch?`<mark>${e.text}</mark>`:e.text).join("")}(this.text||"",e))}_updateInnerHTML(e){this.element.innerHTML=e||""}}class ib extends iw{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-button__label"],style:e.to("style"),id:e.to("id")}})}}class ig extends iw{id;constructor(){super(),this.set("for",void 0);const e=this.bindTemplate;this.id=`ck-editor__label_${(0,s.Ld)()}`,this.extendTemplate({attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")}})}}class i_ extends N{constructor(){super(),this.set("isVisible",!1);const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-spinner-container",e.if("isVisible","ck-hidden",e=>!e)]},children:[{tag:"span",attributes:{class:["ck","ck-spinner"]}}]})}}let ik=(0,s.To)("px");class iV extends p.k_{toolbarView;focusTracker;_balloonConfig;_resizeObserver=null;_balloon;_fireSelectionChangeDebounced;static get pluginName(){return"BalloonToolbar"}static get isOfficialPlugin(){return!0}static get requires(){return[io]}constructor(e){super(e),this._balloonConfig=to(e.config.get("balloonToolbar")),this.toolbarView=this._createToolbarView(),this.focusTracker=new s.$x,this._trackFocusableEditableElements(),this.focusTracker.add(this.toolbarView),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this.show(!0),afterBlur:()=>this.hide(),isContextual:!0}),this._balloon=e.plugins.get(io),this._fireSelectionChangeDebounced=(0,a.s)(()=>this.fire("_selectionChangeDebounced"),200),this.decorate("show")}init(){let e=this.editor,t=e.model.document.selection;this.listenTo(this.focusTracker,"change:isFocused",(e,t,i)=>{!i&&this._isToolbarVisible?this.hide():i&&this.show()}),this.listenTo(t,"change:range",(e,i)=>{(i.directChange||t.isCollapsed)&&this.hide(),this._fireSelectionChangeDebounced()}),this.listenTo(this,"_selectionChangeDebounced",()=>{this.editor.editing.view.document.isFocused&&this.show()}),this._balloonConfig.shouldNotGroupWhenFull||this.listenTo(e,"ready",()=>{let t=e.ui.view.editable.element;this._resizeObserver=new s.tb(t,e=>{this.toolbarView.maxWidth=ik(.9*e.contentRect.width)})}),this.listenTo(this.toolbarView,"groupedItemsUpdate",()=>{this._updatePosition()}),e.ui.once("ready",()=>{this.toolbarView.fillFromConfig(this._balloonConfig,this.editor.ui.componentFactory)})}get _isToolbarVisible(){return this._balloon.visibleView===this.toolbarView}_createToolbarView(){let e=this.editor.locale.t,t=!this._balloonConfig.shouldNotGroupWhenFull,i=new tn(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return i.ariaLabel=e("Editor contextual toolbar"),i.render(),i}show(e=!1){var t,i;let s=this.editor,o=s.model.document.selection,r=s.model.schema;this._balloon.hasView(this.toolbarView)||o.isCollapsed&&!e||(t=o,i=r,1!==t.rangeCount&&[...t.getRanges()].every(e=>{let t=e.getContainedElement();return t&&i.isSelectable(t)}))||Array.from(this.toolbarView.items).every(e=>void 0!==e.isEnabled&&!e.isEnabled)||(this.listenTo(this.editor.ui,"update",()=>{this._updatePosition()}),this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"}))}hide(){this._balloon.hasView(this.toolbarView)&&(this.stopListening(this.editor.ui,"update"),this._balloon.remove(this.toolbarView))}_trackFocusableEditableElements(){let{editor:e,focusTracker:t}=this,{editing:i}=e;i.view.addObserver(class extends g.nun{observe(e){t.add(e)}stopObserving(e){t.remove(e)}})}_getBalloonPositionData(){let e=this.editor.editing.view,t=e.document,i=t.selection,o=t.selection.isBackward;return{target:()=>
1{let t=o?i.getFirstRange():i.getLastRange(),r=s.rw.getDomRangeRects(e.domConverter.viewRangeToDom(t));return o?r[0]:(r.length>1&&0===r[r.length-1].width&&r.pop(),r[r.length-1])},positions:this._getBalloonPositions(o)}}_updatePosition(){this._isToolbarVisible&&this._balloon.updatePosition(this._getBalloonPositionData())}destroy(){super.destroy(),this.stopListening(),this._fireSelectionChangeDebounced.cancel(),this.toolbarView.destroy(),this.focusTracker.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getBalloonPositions(e){let t=s._K.isSafari&&s._K.isiOS?ek.generatePositions({heightOffset:Math.max(ek.arrowHeightOffset,Math.round(20/s.Sf.window.visualViewport.scale))}):ek.defaultPositions;return e?[t.northWestArrowSouth,t.northWestArrowSouthWest,t.northWestArrowSouthEast,t.northWestArrowSouthMiddleEast,t.northWestArrowSouthMiddleWest,t.southWestArrowNorth,t.southWestArrowNorthWest,t.southWestArrowNorthEast,t.southWestArrowNorthMiddleWest,t.southWestArrowNorthMiddleEast]:[t.southEastArrowNorth,t.southEastArrowNorthEast,t.southEastArrowNorthWest,t.southEastArrowNorthMiddleEast,t.southEastArrowNorthMiddleWest,t.northEastArrowSouth,t.northEastArrowSouthEast,t.northEastArrowSouthWest,t.northEastArrowSouthMiddleEast,t.northEastArrowSouthMiddleWest]}}let iT=(0,s.To)("px");class iv extends ee{constructor(e){super(e);const t=this.bindTemplate;this.isVisible=!1,this.isToggleable=!0,this.set("top",0),this.set("left",0),this.extendTemplate({attributes:{class:"ck-block-toolbar-button",style:{to
1p:t.to("top",e=>iT(e)),left:t.to("left",e=>iT(e))}}})}}let iy=(0,s.To)("px");class ix extends p.k_{toolbarView;panelView;buttonView;_resizeObserver=null;_blockToolbarConfig;static get pluginName(){return"BlockToolbar"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this._blockToolbarConfig=to(this.editor.config.get("blockToolbar")),this.toolbarView=this._createToolbarView(),this.panelView=this._createPanelView(),this.buttonView=this._createButtonView(),$({emitter:this.panelView,contextElements:[this.panelView.element,this.buttonView.element],activator:()=>this.panelView.isVisible,callback:()=>this._hidePanel()})}init(){let e=this.editor,t=e.t,i=t("Click to edit block"),s=t("Drag to move"),o=t("Edit block"),r=e.plugins.has("DragDropBlockToolbar"),n=r?`${i} 2${s}`:o;this.buttonView.label=n,r&&(this.buttonView.element.dataset.ckeTooltipClass="ck-tooltip_multi-line"),this.listenTo(e.model.document.selection,"change:range",(e,t)=>{t.directChange&&this._hidePanel()}),this.listenTo(e.ui,"update",()=>this._updateButton()),this.listenTo(e,"change:isReadOnly",()=>this._updateButton(),{priority:"low"}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>this._updateButton()),this.listenTo(this.buttonView,"change:isVisible",(e,t,i)=>{i?this.buttonView.listenTo(window,"resize",()=>this._updateButton()):(this.buttonView.stopListening(window,"resize"),this._hidePanel())}),this._repositionButtonOnScroll(),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this._showPanel(),afterBlur:()=>this._hidePanel()}),e.ui.once("ready",()=>{for(let e of(this.toolbarView.fillFromConfig(this._blockToolbarConfig,this.editor.ui.componentFactory),this.toolbarView.items))e.on("execute",()=>this._hidePanel(!0),{priority:"high"})})}destroy(){super.destroy(),this.panelView.destroy(),this.buttonView.destroy(),this.toolbarView.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_createToolbarView(){let e=this.editor.locale.t,t=!this._blockToolbarConfig.shouldNotGroupWhenFull,i=new tn(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return i.ariaLabel=e("Editor block content toolbar"),i}_createPanelView(){let e=this.editor,t=new ek(e.locale);return t.content.add(this.toolbarView),t.class="ck-toolbar-container",e.ui.view.body.add(t),this.toolbarView.keystrokes.set("Esc",(e,t)=>{this._hidePanel(!0),t()}),t}_createButtonView(){let e=this.editor,t=e.t,i=new iv(e.locale),s=this._blockToolbarConfig.icon,o=tr[s]||s||tr.dragIndicator;return i.set({label:t("Edit block"),icon:o,withText:!1}),i.bind("isOn").to(this.panelView,"isVisible"),i.bind("tooltip").to(this.panelView,"isVisible",e=>!e),this.listenTo(i,"execute",()=>{this.panelView.isVisible?this._hidePanel(!0):this._showPanel()}),this.listenTo(i,"change:isEnabled",(e,t,i)=>{!i&&this.panelView.isVisible&&this._hidePanel(!1)}),e.ui.view.body.add(i),i}_updateButton(){let e=this.editor,t=e.model,i=e.editing.view;if(!e.ui.focusTracker.isFocused||!e.model.canEditAt(e.model.document.selection))return void this._hideButton();let s=Array.from(t.document.selection.getSelectedBlocks())[0];if(!s||Array.from(this.toolbarView.items).every(e=>!e.isEnabled))return void this._hideButton();let o=i.domConverter.mapViewToDom(e.editing.mapper.toViewElement(s));this.buttonView.isVisible=!0,this._setupToolbarResize(),this._attachButtonToElement(o),this.panelView.isVisible&&this._showPanel()}_hideButton(){this.buttonView.isVisible=!1}_showPanel(){if(!this.buttonView.isVisible)return;let e=this.panelView.isVisible;this.panelView.show();let t=this._getSelectedEditableElement();this.toolbarView.maxWidth=this._getToolbarMaxWidth(t),this.panelView.pin({target:this.buttonView.element,limiter:t}),e||this.toolbarView.items.get(0).focus()}_getSelectedEditableElement(){let e=this.editor.model.document.selection.getFirstRange().root.rootName;return this.editor.ui.getEditableElement(e)}_hidePanel(e){this.panelView.isVisible=!1,e&&this.editor.editing.view.focus()}_repositionButtonOnScroll(){let{buttonView:e}=this,t=!1,i=(e,i)=>{if(t)return;let o=this._getSelectedEditableElement();(i.target===s.Sf.document||(0,s.DS)(o).includes(i.target))&&(t=!0,s.Sf.window.requestAnimationFrame(()=>{this._updateButton(),t=!1}))};e.on("change:isVisible",(t,o,r)=>{r?e.listenTo(s.Sf.document,"scroll",i,{useCapture:!0,usePassive:!0}):e.stopListening(s.Sf.document,"scroll",i)})}_attachButtonToElement(e){let t,i=this.buttonView.element,o=this._getSelectedEditableElement(),r=window.getComputedStyle(e),n=new s.rw(o),l=parseInt(r.paddingTop,10),a=parseInt(r.lineHeight,10)||1.2*
2parseInt(r.fontSize,10),h=new s.rw(i),c=new s.rw(e);t="ltr"===this.editor.locale.uiLanguageDirection?n.left-h.width:n.right;let d=c.top+l+(a-h.height)/2;h.moveTo(t,d);let u=h.toAbsoluteRect();this.buttonView.top=u.top,this.buttonView.left=u.left,this._clipButtonToViewport(this.buttonView,o)}_clipButtonToViewport(e,t){let i=new s.rw(e.element),o=new s.rw(t).getVisible(),r=(...t)=>{e.element.style.clipPath=t.length?`polygon(${t.join(",")})`:""},n=t=>{e.isEnabled=!t,e.element.style.pointerEvents=t?"none":""};if(o&&o.bottom<i.bottom){let e=Math.min(i.height,i.bottom-o.bottom);n(e>=i.height),r("0 0","100% 0",`100% calc(100% - ${iy(e)})`,`0 calc(100% - ${iy(e)}`)}else if(o&&o.top>i.top){let e=Math.min(i.height,o.top-i.top);n(e>=i.height),r(`0 ${iy(e)}`,`100% ${iy(e)}`,"100% 100%","0 100%")}else n(!1),r()}_setupToolbarResize(){let e=this._getSelectedEditableElement();!this._blockToolbarConfig.shouldNotGroupWhenFull&&(this._resizeObserver&&this._resizeObserver.element!==e&&(this._resizeObserver.destroy(),this._resizeObserver=null),this._resizeObserver||(this._resizeObserver=new s.tb(e,()=>{this.toolbarView.maxWidth=this._getToolbarMaxWidth(e)})))}_getToolbarMaxWidth(e){let t=new s.rw(e),i=new s.rw(this.buttonView.element),o="rtl"===this.editor.locale.uiLanguageDirection?i.left-t.right+i.width:t.left-i.left;return iy(t.width+o)}}class iC extends ep{arrowView;constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new J;return e.content=m.G3R,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class iE extends N{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",e=>`ck-menu-bar__menu__panel_position_${e}`),t.if("isVisible","ck-hidden",e=>!e)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()})}})}focus(e=1){this.children.length&&(1===e?this.children.first.focus():this.children.last.focus())}}class iO extends N{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new iC(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new iE(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new s.EP,this.focusTracker=new s.$x,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("parentMenuView","ck-menu-bar__menu_top-level",e=>!e)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),t$.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(t$.openOnButtonClick(this),t$.openOnArrowRightKey(this),t$.closeOnArrowLeftKey(this),t$.openAndFocusOnEnterKeyPress(this),t$.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),t$.openAndFocusPanelOnArrowDownKey(this),t$.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(e,t)=>{this.fire("arrowright"),t()}),this.keystrokes.set("arrowleft",(e,t)=>{this.fire("arrowleft"),t()})}_repositionPanelOnOpen(){this.on("change:isOpen",(e,t,i)=>{if(!i)return;let s=iO._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=s?s.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){let{southEast:e,southWest:t,northEast:i,northWest:s,westSouth:o,eastSouth:r,westNorth:n,eastNorth:l}=tU;if("ltr"===this.locale.uiLanguageDirection)if(this.parentMenuView)return[r,l,o,n];else return[e,t,i,s];return this.parentMenuView?[o,n,r,l]:[t,e,s,i]}get _defaultMenuPositionName(){if("ltr"===this.locale.uiLanguageDirection)if(this.parentMenuView)return"es";else return"se";return this.parentMenuView?"ws":"sw"}static _getOptimalPosition=s.W}class iP extends e2{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){let e=Array.from(this.items).some(e=>{let t=iB(e);return t&&t.isToggleable});
2this.items.forEach(t=>{let i=iB(t);i&&(i.hasCheckSpace=e)})}}function iB(e){return e instanceof eQ?e.children.map(e=>{var t;return"object"==typeof(t=e)&&"buttonView"in t&&t.buttonView instanceof ee?e.buttonView:e}).find(e=>e instanceof ep):null}class iI extends eO{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}let iF=["mouseenter","arrowleft","arrowright","change:isOpen"];class iS extends N{children;menus=[];constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){let s=tj({normalizedConfig:e,locale:this.locale,componentFactory:t,extraItems:i}).items.map(e=>this._createMenu({componentFactory:t,menuDefinition:e}));this.children.addMany(s)}render(){super.render(),tH.toggleMenusAndFocusItemsOnHover(this),tH.closeMenusWhenTheBarCloses(this),tH.closeMenuWhenAnotherOnTheSameLevelOpens(this),tH.focusCycleMenusOnArrows(this),tH.closeOnClickOutside(this),tH.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(let e of this.children)e.isOpen=!1}disable(){for(let e of this.children)e.isEnabled=!1}enable(){for(let e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...iF).to(t),e.parentMenuView=t):e.delegate(...iF).to(this,e=>"menu:"+e),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){let s=this.locale,o=new iO(s);return this.registerMenu(o,i),o.buttonView.set({label:t.label}),o.once("change:isOpen",()=>{let i=new iP(s);i.ariaLabel=t.label,o.panelView.children.add(i),i.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:o,componentFactory:e}))}),o}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){let s=this.locale,o=[];for(let n of e.groups){for(let e of n.items){let n=new tz(s,t);if((0,r.G)(e))n.children.add(this._createMenu({componentFactory:i,menuDefinition:e,parentMenuView:t}));else{let s=this._createMenuItemContentFromFactory({componentName:e,componentFactory:i,parentMenuView:t});if(!s)continue;n.children.add(s)}o.push(n)}n!==e.groups[e.groups.length-1]&&o.push(new e0(s))}return o}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){let o=i.create(e);return o instanceof iO||o instanceof ef||o instanceof iI?(this._registerMenuTree(o,t),o.on("execute",()=>{this.close()}),o):((0,s.FF)("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof iO))return void e.delegate("mouseenter").to(t);this.registerMenu(e,t);let i=e.panelView.children.filter(e=>e instanceof iP)[0];if(!i)return void e.delegate("mouseenter").to(t);for(let t of i.items.filter(e=>e instanceof eQ))this._registerMenuTree(t.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,i,s)=>{clearTimeout(e),s?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(e=>e.isOpen)},0)})}}}}]); 3//# sourceMappingURL=bc5c5176.a8f42ee095ffe28d.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.