diff --git a/build/app.js b/build/app.js new file mode 100644 index 00000000000..67817305042 --- /dev/null +++ b/build/app.js @@ -0,0 +1,11 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md. + */ +var _NumberPOSITIVE_INFINITY=Number.POSITIVE_INFINITY,_Mathfloor=Math.floor,_Mathmax=Math.max,_Mathmin=Math.min;(function(o){function r(d){if(s[d])return s[d].exports;var u=s[d]={i:d,l:!1,exports:{}};return o[d].call(u.exports,u,u.exports,r),u.l=!0,u.exports}var s={};return r.m=o,r.c=s,r.i=function(d){return d},r.d=function(d,u,f){r.o(d,u)||Object.defineProperty(d,u,{configurable:!1,enumerable:!0,get:f})},r.n=function(d){var u=d&&d.__esModule?function(){return d['default']}:function(){return d};return r.d(u,'a',u),u},r.o=function(d,u){return Object.prototype.hasOwnProperty.call(d,u)},r.p='',r(r.s=527)})([function(o,r){'use strict';class d extends Error{constructor(u,f){f&&(u+=' '+JSON.stringify(f)),super(u),this.name='CKEditorError',this.data=f}static isCKEditorError(u){return u instanceof d}}r.a=d},function(o,r,s){'use strict';var d=s(33),u=s(19),f=s(62),h=s(0),w=s(25);class C{constructor(T,P){if(!T.is('element')&&!T.is('documentFragment'))throw new h.a('model-position-root-invalid: Position root invalid.');if(!(P instanceof Array)||0===P.length)throw new h.a('model-position-path-incorrect: Position path must be an Array with at least one item.',{path:P});P=T.getPath().concat(P),T=T.root,this.root=T,this.path=P}get offset(){return s.i(u.a)(this.path)}set offset(T){this.path[this.path.length-1]=T}get parent(){let T=this.root;for(let P=0;PS?0:S,P}isAfter(T){return'after'==this.compareWith(T)}isBefore(T){return'before'==this.compareWith(T)}isEqual(T){return'same'==this.compareWith(T)}isTouching(T){let P=null,S=null,E=this.compareWith(T);switch(E){case'same':return!0;case'before':P=C.createFromPosition(this),S=C.createFromPosition(T);break;case'after':P=C.createFromPosition(T),S=C.createFromPosition(this);break;default:return!1;}for(let O=P.parent;P.path.length+S.path.length;){if(P.isEqual(S))return!0;if(P.path.length>S.path.length){if(P.offset!==O.maxOffset)return!1;P.path=P.path.slice(0,-1),O=O.parent,P.offset++}else{if(0!==S.offset)return!1;S.path=S.path.slice(0,-1)}}}_getTransformedByDeletion(T,P){let S=C.createFromPosition(this);if(this.root!=T.root)return S;if('same'==s.i(f.a)(T.getParentPath(),this.getParentPath())){if(T.offsetthis.offset)return null;S.offset-=P}}else if('prefix'==s.i(f.a)(T.getParentPath(),this.getParentPath())){const E=T.path.length-1;if(T.offset<=this.path[E]){if(T.offset+P>this.path[E])return null;S.path[E]-=P}}return S}_getTransformedByInsertion(T,P,S){let E=C.createFromPosition(this);if(this.root!=T.root)return E;if('same'==s.i(f.a)(T.getParentPath(),this.getParentPath()))(T.offsetC+1;){let S=P.maxOffset-T.offset;0!=S&&w.push(new h(T,T.getShiftedBy(S))),T.path=T.path.slice(0,-1),T.offset++,P=P.parent}for(;T.path.length<=this.end.path.length;){let S=this.end.path[T.path.length-1],E=S-T.offset;0!=E&&w.push(new h(T,T.getShiftedBy(E))),T.offset=S,T.path.push(0)}return w}getWalker(w={}){return w.boundaries=this,new u.a(w)}*getItems(w={}){w.boundaries=this,w.ignoreElementEnd=!0;const C=new u.a(w);for(let T of C)yield T.item}*getPositions(w={}){w.boundaries=this;const C=new u.a(w);yield C.position;for(let T of C)yield T.nextPosition}getTransformedByDelta(w){let C=[h.createFromRange(this)];const T=new Set(['insert','move','remove','reinsert']);for(let P of w.operations)if(T.has(P.type))for(let S=0;SS.start.isAfter(E.start));const T=w.indexOf(C),P=new this(C.start,C.end);for(let S=T-1;0<=S&&w[S].end.isEqual(P.start);S++)P.start=d.a.createFromPosition(w[S].start);for(let S=T+1;S{Object.getOwnPropertyNames(h).concat(Object.getOwnPropertySymbols(h)).forEach((w)=>{if(!(w in u.prototype)){const C=Object.getOwnPropertyDescriptor(h,w);C.enumerable=!1,Object.defineProperty(u.prototype,w,C)}})})}},function(o,r,s){'use strict';function d(T){return'string'==typeof T?[new h.a(T)]:(s.i(w.a)(T)||(T=[T]),Array.from(T).map((P)=>'string'==typeof P?new h.a(P):P))}var u=s(56),f=s(71),h=s(25),w=s(43);class C extends u.a{constructor(T,P,S){super(P),this.name=T,this._children=new f.a,S&&this.insertChildren(0,S)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(T,P=null){return P?'element'==T&&P==this.name:'element'==T||T==this.name}getChild(T){return this._children.getNode(T)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(T){return this._children.getNodeIndex(T)}getChildStartOffset(T){return this._children.getNodeStartOffset(T)}clone(T=!1){const P=T?Array.from(this._children).map((S)=>S.clone()):Array.from(this._children);return new C(this.name,this.getAttributes(),P)}offsetToIndex(T){return this._children.offsetToIndex(T)}appendChildren(T){this.insertChildren(this.childCount,T)}insertChildren(T,P){P=d(P);for(let S of P)S.parent=this;this._children.insertNodes(T,P)}removeChildren(T,P=1){const S=this._children.removeNodes(T,P);for(let E of S)E.parent=null;return S}getNodeByPath(T){let P=this;for(const S of T)P=P.getChild(S);return P}toJSON(){let T=super.toJSON();if(T.name=this.name,0{return re instanceof te?re.getValue(oe):re})}function f(ie,oe,{node:re}){let se=u(ie,re);se=1==ie.length&&ie[0]instanceof ne?se[0]:se.reduce(R,''),I(se)?oe.remove():oe.set(se)}function h(ie){return{set(oe){ie.textContent=oe},remove(){ie.textContent=''}}}function w(ie,oe,re){return{set(se){ie.setAttributeNS(re,oe,se)},remove(){ie.removeAttributeNS(re,oe)}}}function C(ie,oe){return{set(re){ie.style[oe]=re},remove(){ie.style[oe]=null}}}function T(ie){const oe=s.i(J.a)(ie,(re)=>{if(re&&(re instanceof te||D(re)||L(re)||q(re)))return re});return oe}function P(ie){if('string'==typeof ie?ie=O(ie):ie.text&&V(ie),ie.on&&(ie.eventListeners=E(ie.on),delete ie.on),!ie.text){ie.attributes&&S(ie.attributes);const oe=new U.a;if(ie.children)if(q(ie.children))oe.add(ie.children);else for(let re of ie.children)D(re)||L(re)?oe.add(re):oe.add(new ee(re));ie.children=oe}return ie}function S(ie){for(let oe in ie)ie[oe].value&&(ie[oe].value=[].concat(ie[oe].value)),F(ie,oe)}function E(ie){for(let oe in ie)F(ie,oe);return ie}function O(ie){return{text:[ie]}}function V(ie){Array.isArray(ie.text)||(ie.text=[ie.text])}function F(ie,oe){Array.isArray(ie[oe])||(ie[oe]=[ie[oe]])}function R(ie,oe){return I(oe)?ie:I(ie)?oe:`${ie} ${oe}`}function N(ie,oe){for(let re in oe)ie[re]?ie[re].push(...oe[re]):ie[re]=oe[re]}function M(ie,oe){if(oe.attributes&&(!ie.attributes&&(ie.attributes={}),N(ie.attributes,oe.attributes)),oe.eventListeners&&(!ie.eventListeners&&(ie.eventListeners={}),N(ie.eventListeners,oe.eventListeners)),oe.text&&ie.text.push(...oe.text),oe.children&&oe.children.length){if(ie.children.length!=oe.children.length)throw new $.a('ui-template-extend-children-mismatch: The number of children in extended definition does not match.');let re=0;for(let se of oe.children)M(ie.children.get(re++),se)}}function I(ie){return!ie&&0!==ie}function L(ie){return ie instanceof Z.a}function D(ie){return ie instanceof ee}function q(ie){return ie instanceof G.a}function z(){return{children:[],bindings:[],attributes:{}}}function K(ie){return'class'==ie||'style'==ie}var $=s(0),H=s(4),W=s(7),U=s(78),Z=s(9),G=s(118),J=s(482),Q=s(15),Y=s(48);class ee{constructor(ie){Object.assign(this,P(T(ie))),this._isRendered=!1,this._revertData=null}render(){const ie=this._renderNode({intoFragment:!0});return this._isRendered=!0,ie}apply(ie){return this._revertData=z(),this._renderNode({node:ie,isApplying:!0,revertData:this._revertData}),ie}revert(ie){if(!this._revertData)throw new $.a('ui-template-revert-not-applied: Attempting reverting a template which has not been applied yet.');this._revertTemplateFromNode(ie,this._revertData)}static bind(ie,oe){return{to(re,se){return new ae({eventNameOrFunction:re,attribute:re,observable:ie,emitter:oe,callback:se})},if(re,se,le){return new ne({observable:ie,emitter:oe,attribute:re,valueIfTrue:se,callback:le})}}}static extend(ie,oe){ie._isRendered&&Y.a.warn('template-extend-render: Attempting to extend a template which has already been rendered.'),M(ie,P(T(oe)))}_renderNode(ie){let oe;if(oe=ie.node?this.tag&&this.text:this.tag?this.text:!this.text,oe)throw new $.a('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering new Node.');return this.text?this._renderText(ie):this._renderElement(ie)}_renderElement(ie){let oe=ie.node;return oe||(oe=ie.node=document.createElementNS(this.ns||'http://www.w3.org/1999/xhtml',this.tag)),this._renderAttributes(ie),this._renderElementChildren(ie),this._setUpListeners(ie),oe}_renderText(ie){let oe=ie.node;return oe?ie.revertData.text=oe.textContent:oe=ie.node=document.createTextNode(''),d(this.text)?this._bindToObservable({schema:this.text,updater:h(oe),data:ie}):oe.textContent=this.text.join(''),oe}_renderAttributes(ie){let oe,re,se,le;if(this.attributes){const de=ie.node,ce=ie.revertData;for(oe in this.attributes)if(se=de.getAttribute(oe),re=this.attributes[oe],ce&&(ce.attributes[oe]=se),le=s.i(Q.a)(re[0])&&re[0].ns?re[0].ns:null,d(re)){const ue=le?re[0].value:re;ce&&K(oe)&&ue.unshift(se),this._bindToObservable({schema:ue,updater:w(de,oe,le),data:ie})}else'style'==oe&&'string'!=typeof re[0]?this._renderStyleAttribute(re[0],ie):(ce&&se&&K(oe)&&re.unshift(se),re=re.map((ue)=>ue?ue.value||ue:ue).reduce((ue,me)=>ue.concat(me),[]).reduce(R,''),I(re)||de.setAttributeNS(le,oe,re))}}_renderStyleAttribute(ie,oe){const re=oe.node;for(let se in ie){const le=ie[se];d(le)?this._bindToObservable({schema:[le],updater:C(re,se),data:oe}):re.style[se]=le}}_renderElementChildren(ie){const oe=ie.node,re=ie.intoFragment?document.createDocumentFragment():oe,se=ie.isApplying;let le=0;for(let de of this.children)if(q(de)){if(!se){de.setParent(oe);for(let ce of de)re.appendChild(ce.element)}}else if(L(de))se||re.appendChild(de.element);else if(se){const ce=ie.revertData,ue=z();ce.children.push(ue),de._renderNode({node:re.childNodes[le++],isApplying:!0,revertData:ue})}else re.appendChild(de.render());ie.intoFragment&&oe.appendChild(re)}_setUpListeners(ie){if(this.eventListeners)for(let oe in this.eventListeners){const re=this.eventListeners[oe].map((se)=>{const[le,de]=oe.split('@');return se.activateDomEventListener(le,de,ie)});ie.revertData&&ie.revertData.bindings.push(re)}}_bindToObservable({schema:ie,updater:oe,data:re}){const se=re.revertData;f(ie,oe,re);const le=ie.filter((de)=>!I(de)).filter((de)=>de.observable).map((de)=>de.activateAttributeListener(ie,oe,re));se&&se.bindings.push(le)}_revertTemplateFromNode(ie,oe){for(let re of oe.bindings)for(let se of re)se();if(oe.text)return void(ie.textContent=oe.text);for(let re in oe.attributes){const se=oe.attributes[re];null===se?ie.removeAttribute(re):ie.setAttribute(re,se)}for(let re=0;ref(ie,oe,re);return this.emitter.listenTo(this.observable,'change:'+this.attribute,se),()=>{this.emitter.stopListening(this.observable,'change:'+this.attribute,se)}}}class ae extends te{activateDomEventListener(ie,oe,re){const se=(le,de)=>{(!oe||de.target.matches(oe))&&('function'==typeof this.eventNameOrFunction?this.eventNameOrFunction(de):this.observable.fire(this.eventNameOrFunction,de))};return this.emitter.listenTo(re.node,ie,se),()=>{this.emitter.stopListening(re.node,ie,se)}}}class ne extends te{getValue(ie){const oe=super.getValue(ie);return!I(oe)&&(this.valueIfTrue||!0)}}},function(o,r,s){'use strict';function u(M,I){M[R]||(M[R]=I||s.i(O.a)())}function f(M){return M[R]}function h(M){return M._events||Object.defineProperty(M,'_events',{value:{}}),M._events}function w(){return{callbacks:[],childEvents:[]}}function C(M,I){const L=h(M);if(L[I])return;let D=I,q=null;const z=[];for(;''!==D&&!L[D];)L[D]=w(),z.push(L[D]),q&&L[D].childEvents.push(q),q=D,D=D.substr(0,D.lastIndexOf(':'));if(''!==D){for(let K of z)K.callbacks=L[D].callbacks.slice();L[D].childEvents.push(q)}}function T(M,I){const L=h(M)[I];if(!L)return[];let D=[L.callbacks];for(let q=0,z;q{this._delegations||(this._delegations=new Map);for(let D of M){let q=this._delegations.get(D);q?q.set(I,L):this._delegations.set(D,new Map([[I,L]]))}}}},stopDelegating(M,I){if(this._delegations)if(!M)this._delegations.clear();else if(!I)this._delegations.delete(M);else{const L=this._delegations.get(M);L&&L.delete(I)}}};r.a=N},function(o,r,s){'use strict';var u=s(191),f=s(16),w=_Mathmax;r.a=function(C,T){if('function'!=typeof C)throw new TypeError('Expected a function');return T=w(void 0===T?C.length-1:s.i(f.a)(T),0),function(){for(var P=arguments,S=-1,E=w(P.length-T,0),O=Array(E);++S{V.locale=E})}get element(){return this._element?this._element:this.template?(this._addTemplateChildren(),this._element=this.template.render()):null}set element(E){this._element=E}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=f.a.bind(this,this)}createCollection(){const E=new u.a;return this._viewCollections.add(E),E}addChildren(E){s.i(P.a)(E)||(E=[E]);for(let O of E)this._unboundChildren.add(O)}init(){if(this.ready)throw new d.a('ui-view-init-reinit: This View has already been initialized.');return Promise.resolve().then(()=>{return Promise.all(this._viewCollections.map((E)=>E.init()))}).then(()=>{this.ready=!0})}destroy(){this.stopListening();const E=this._viewCollections.map((O)=>O.destroy());return this._unboundChildren.clear(),this._viewCollections.clear(),this.element=this.template=this.locale=this.t=this._viewCollections=this._unboundChildren=null,Promise.all(E)}_addTemplateChildren(){const E=(O)=>{if(O.children)for(let V of O.children)V instanceof S?this.addChildren(V):E(V)};E(this.template)}}r.a=S,s.i(T.a)(S,h.a),s.i(T.a)(S,w.a)},function(o,r,s){'use strict';var u=s(422),f=s(423),h=s(225),w=s(12),C=s(493);r.a=function(T){return'function'==typeof T?T:null==T?h.a:'object'==typeof T?s.i(w.a)(T)?s.i(f.a)(T[0],T[1]):s.i(u.a)(T):s.i(C.a)(T)}},function(o,r,s){'use strict';function d(w,C){C.isEnabled=!1}var u=s(31),f=s(4);class h{constructor(w){this.editor=w,this.set('isEnabled',!0),this._checkEnabled&&this.on('refreshState',(C,T)=>{T.isEnabled=this._checkEnabled()})}destroy(){this.stopListening()}refreshState(){const w={isEnabled:!0};this.fire('refreshState',w),this.isEnabled=w.isEnabled}_execute(w){this.isEnabled&&this._doExecute(w)}_disable(){this.on('refreshState',d),this.refreshState()}_enable(){this.off('refreshState',d),this.refreshState()}_doExecute(){}}r.a=h,s.i(f.a)(h,u.a)},function(o,r){'use strict';var d=Array.isArray;r.a=d},function(o,r,s){'use strict';function u(L){if(!L.isFlat)throw new M.a('model-writer-remove-range-not-flat: Trying to remove a range that starts and ends in different element.');const D=L.start.parent;P(L.start),P(L.end);const q=D.removeChildren(L.start.index,L.end.index-L.start.index);return T(D,L.start.index),q}function C(L){const D=[];L instanceof Array||(L=[L]);for(let q=0;q$+H.offsetSize,0),z=L.parent;P(L);const K=L.index;return z.insertChildren(K,D),T(z,K+D.length),T(z,K),new F.a(L,L.getShiftedBy(q))},remove:u,move:function(L,D){if(!L.isFlat)throw new M.a('model-writer-move-range-not-flat: Trying to move a range that starts and ends in different element.');const q=this.remove(L);return D=D._getTransformedByDeletion(L.start,L.end.offset-L.start.offset),this.insert(D,q)},setAttribute:function(L,D,q){P(L.start),P(L.end);for(let z of L.getItems()){let K=z.is('textProxy')?z.textNode:z;null===q?K.removeAttribute(D):K.setAttribute(D,q),T(K.parent,K.index)}T(L.end.parent,L.end.index)},removeAttribute:function(L,D){this.setAttribute(L,D,null)},normalizeNodes:C}},function(o,r,s){'use strict';var u=s(95),f=s(46);r.a=function(h){return s.i(f.a)(h)&&s.i(u.a)(h)}},function(o,r){'use strict';r.a=function(u){var f=typeof u;return!!u&&('object'==f||'function'==f)}},function(o,r,s){'use strict';var u=s(495);r.a=function(f){var h=s.i(u.a)(f),w=h%1;return h===h?w?h-w:h:0}},function(o,r,s){'use strict';var u=s(0);r.b=function(h,w){if(f.prototype[h])throw new u.a('model-batch-register-taken: This batch method name is already taken.',{name:h});f.prototype[h]=w};class f{constructor(h,w='default'){this.document=h,this.deltas=[],this.type=w}get baseVersion(){return 0O.add(R))}function f(O){return'string'==typeof O?[new w.a(O)]:(s.i(T.a)(O)||(O=[O]),Array.from(O).map((V)=>'string'==typeof V?new w.a(V):V))}var h=s(75),w=s(29),C=s(270),T=s(43),P=s(97),S=s(166);class E extends h.a{constructor(O,V,F){if(super(),this.name=O,this._attrs=s.i(P.a)(V)?s.i(C.a)(V):new Map(V),this._children=[],F&&this.insertChildren(0,F),this._classes=new Set,this._attrs.has('class')){const R=this._attrs.get('class');u(this._classes,R),this._attrs.delete('class')}this._styles=new Map,this._attrs.has('style')&&(d(this._styles,this._attrs.get('style')),this._attrs.delete('style')),this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(O,V=null){return V?'element'==O&&V==this.name:'element'==O||O==this.name}clone(O){const V=[];if(O)for(let R of this.getChildren())V.push(R.clone(O));const F=new this.constructor(this.name,this._attrs,V);return F._classes=new Set(this._classes),F._styles=new Map(this._styles),F._customProperties=new Map(this._customProperties),F.getFillerOffset=this.getFillerOffset,F}appendChildren(O){return this.insertChildren(this.childCount,O)}getChild(O){return this._children[O]}getChildIndex(O){return this._children.indexOf(O)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){0this._classes.add(V))}removeClass(...O){this._fireChange('attributes',this),O.forEach((V)=>this._classes.delete(V))}hasClass(...O){for(let V of O)if(!this._classes.has(V))return!1;return!0}getClassNames(){return this._classes.keys()}setStyle(O,V){if(this._fireChange('attributes',this),s.i(P.a)(O)){const F=Object.keys(O);for(let R of F)this._styles.set(R,O[R])}else this._styles.set(O,V)}getStyle(O){return this._styles.get(O)}getStyleNames(){return this._styles.keys()}hasStyle(...O){for(let V of O)if(!this._styles.has(V))return!1;return!0}removeStyle(...O){this._fireChange('attributes',this),O.forEach((V)=>this._styles.delete(V))}findAncestor(...O){const V=new S.a(...O);for(let F=this.parent;F;){if(V.match(F))return F;F=F.parent}return null}setCustomProperty(O,V){this._customProperties.set(O,V)}getCustomProperty(O){return this._customProperties.get(O)}removeCustomProperty(O){return this._customProperties.delete(O)}*getCustomProperties(){yield*this._customProperties.entries()}}r.a=E},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(374),h=s(23);class w extends d.a{constructor(C){super(C),this.set('label'),this.set('keystroke'),this.set('tooltip'),this.set('type','button'),this.set('isOn',!1),this.set('isEnabled',!0),this.set('withText',!1),this.set('icon'),this.set('tabindex',-1),this.bind('_tooltipString').to(this,'tooltip',this,'label',this,'keystroke',this._getTooltipString.bind(this));const T=this.bindTemplate;this.template=new u.a({tag:'button',attributes:{class:['ck-button',T.if('_tooltipString','ck-tooltip_s'),T.to('isEnabled',(P)=>P?'ck-enabled':'ck-disabled'),T.to('isOn',(P)=>P?'ck-on':'ck-off'),T.if('withText','ck-button_with-text')],type:T.to('type',(P)=>P?P:'button'),'data-ck-tooltip':[T.to('_tooltipString')],tabindex:T.to('tabindex')},children:[{tag:'span',attributes:{class:['ck-button__label']},children:[{text:T.to('label')}]}],on:{mousedown:T.to((P)=>{P.preventDefault()}),click:T.to((P)=>{this.isEnabled?this.fire('execute'):P.preventDefault()})}})}init(){let C=Promise.resolve();if(this.icon&&!this.iconView){const T=this.iconView=new f.a;T.bind('content').to(this,'icon'),this.element.insertBefore(T.element,this.element.firstChild),C=C.then(()=>this.addChildren(T))}return C.then(()=>super.init())}focus(){this.element.focus()}_getTooltipString(C,T,P){if(C){if('string'==typeof C)return C;if(P&&(P=s.i(h.b)(P)),C instanceof Function)return C(T,P);if(!0===C)return`${T}${P?` (${P})`:''}`}return!1}}r.a=w},function(o,r,s){'use strict';function d(S){let E;if('string'!=typeof S)E=S.keyCode+(S.altKey?P.alt:0)+(S.ctrlKey?P.ctrl:0)+(S.shiftKey?P.shift:0);else if(E=P[S.toLowerCase()],!E)throw new C.a('keyboard-unknown-key: Unknown key name.',{key:S});return E}function w(S){return S.split(/\s*\+\s*/)}var C=s(0),T=s(399);r.c=d,r.a=function(S){return'string'==typeof S&&(S=w(S)),S.map((E)=>'string'==typeof E?d(E):E).reduce((E,O)=>O+E,0)},r.b=function(S){const E=w(S);return T.a.mac&&'ctrl'==E[0].toLowerCase()?'\u2318'+(E[1]||''):S};const P=function(){const S={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let E=65;90>=E;E++){const O=String.fromCharCode(E);S[O.toLowerCase()]=E}for(let E=48;57>=E;E++)S[E-48]=E;for(let E=112;123>=E;E++)S['f'+(E-111)]=E;return S}();r.d=P},function(o,r,s){'use strict';function d(h,w,C,T,P){var S=-1,E=h.length;for(C||(C=f.a),P||(P=[]);++SP?0:P,T}getLastMatchingPosition(C,T={}){T.startPosition=this;const P=new d.a(T);return P.skip(C),P.position}getAncestors(){return this.parent.is('documentFragment')?[this.parent]:this.parent.getAncestors({includeNode:!0})}isEqual(C){return this.parent==C.parent&&this.offset==C.offset}isBefore(C){return'before'==this.compareWith(C)}isAfter(C){return'after'==this.compareWith(C)}compareWith(C){if(this.isEqual(C))return'same';if(this.parent===C.parent)return 0>this.offset-C.offset?'before':'after';const T=this.getAncestors(),P=C.getAncestors(),S=s.i(u.a)(T,P);let E;switch(S){case 0:return'different';case'prefix':E=T.length-1;break;case'extension':E=P.length-1;break;default:E=S-1;}const O=T[E],V=T[E+1],F=P[E+1];if(O===this.parent){const N=this.offset-F.index;return 0>=N?'before':'after'}if(O===C.parent){const N=V.index-C.offset;return 0>N?'before':'after'}const R=V.index-F.index;return 0>R?'before':'after'}static createAt(C,T){if(C instanceof w)return this.createFromPosition(C);let P=C;if('end'==T)T=P.is('text')?P.data.length:P.childCount;else{if('before'==T)return this.createBefore(P);if('after'==T)return this.createAfter(P);T||(T=0)}return new w(P,T)}static createAfter(C){if(C.is('textProxy'))return new w(C.textNode,C.offsetInText+C.data.length);if(!C.parent)throw new f.a('view-position-after-root: You can not make position after root.',{root:C});return new w(C.parent,C.index+1)}static createBefore(C){if(C.is('textProxy'))return new w(C.textNode,C.offsetInText);if(!C.parent)throw new f.a('view-position-before-root: You can not make position before root.',{root:C});return new w(C.parent,C.index)}static createFromPosition(C){return new this(C.parent,C.offset)}}r.a=w},function(o,r){'use strict';r.a=function(u,f){for(var h=-1,w=u.length,C=Array(w);++hP.maxOffset)throw new h.a('move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.');else if(P===S&&E=E&&this.targetPosition.path[F]{if(z.attrs.length&&z.attrs.length!==q)throw new E.a('observable-bind-to-attrs-length: The number of attributes must match.');z.attrs.length||(z.attrs=this._bindAttrs)}),this._to=L.to,L.callback&&(this._bindings.get(D[0]).callback=L.callback),P(this._observable,this._to),C(this),this._bindAttrs.forEach((z)=>{T(this._observable,z)})}function f(I){return I.every((L)=>'string'==typeof L)}function h(...I){if(!I.length)throw new E.a('observable-bind-to-parse-error: Invalid argument syntax in `to()`.');const L={to:[]};let D;return'function'==typeof I[I.length-1]&&(L.callback=I.pop()),I.forEach((q)=>{if('string'==typeof q)D.attrs.push(q);else if('object'==typeof q)D={observable:q,attrs:[]},L.to.push(D);else throw new E.a('observable-bind-to-parse-error: Invalid argument syntax in `to()`.')}),L}function w(I,L,D,q){const z=I[R],K=z.get(D),$=K||{};$[q]||($[q]=new Set),$[q].add(L),K||z.set(D,$)}function C(I){let L;I._bindings.forEach((D,q)=>{I._to.forEach((z)=>{L=z.attrs[D.callback?0:I._bindAttrs.indexOf(q)],D.to.push([z.observable,L]),w(I._observable,D,z.observable,L)})})}function T(I,L){const D=I[N],q=D.get(L);let z;q.callback?z=q.callback.apply(I,q.to.map((K)=>K[0][K[1]])):(z=q.to[0],z=z[0][z[1]]),I.hasOwnProperty(L)?I[L]=z:I.set(L,z)}function P(I,L){L.forEach((D)=>{const q=I[R];let z;q.get(D.observable)||I.listenTo(D.observable,'change',(K,$)=>{z=q.get(D.observable)[$],z&&z.forEach((H)=>{T(I,H.attr)})})})}var S=s(7),E=s(0),O=s(45),V=s(15);const F=Symbol('attributes'),R=Symbol('boundObservables'),N=Symbol('boundAttributes'),M={set(I,L){if(s.i(V.a)(I))return void Object.keys(I).forEach((q)=>{this.set(q,I[q])},this);d(this);const D=this[F];if(I in this&&!D.has(I))throw new E.a('observable-set-cannot-override: Cannot override an existing property.');Object.defineProperty(this,I,{enumerable:!0,configurable:!0,get(){return D.get(I)},set(q){const z=D.get(I);z===q&&D.has(I)||(D.set(I,q),this.fire('change:'+I,I,q,z))}}),this[I]=L},bind(...I){if(!I.length||!f(I))throw new E.a('observable-bind-wrong-attrs: All attributes must be strings.');if(new Set(I).size!==I.length)throw new E.a('observable-bind-duplicate-attrs: Attributes must be unique.');d(this);const L=this[N];I.forEach((q)=>{if(L.has(q))throw new E.a('observable-bind-rebind: Cannot bind the same attribute more that once.')});const D=new Map;return I.forEach((q)=>{const z={attr:q,to:[]};L.set(q,z),D.set(q,z)}),{to:u,_observable:this,_bindAttrs:I,_to:[],_bindings:D}},unbind(...I){if(!(F in this))return;const L=this[N],D=this[R];if(I.length){if(!f(I))throw new E.a('observable-unbind-wrong-attrs: Attributes must be strings.');I.forEach((q)=>{const z=L.get(q);let K,$,H,W;z.to.forEach((U)=>{K=U[0],$=U[1],H=D.get(K),W=H[$],W.delete(z),W.size||delete H[$],Object.keys(H).length||(D.delete(K),this.stopListening(K,'change'))}),L.delete(q)})}else D.forEach((q,z)=>{this.stopListening(z,'change')}),D.clear(),L.clear()}};r.a=M,s.i(O.a)(M,S.a)},function(o,r,s){'use strict';var d=s(94);class u{constructor(f){this.baseVersion=f}toJSON(){const f=s.i(d.a)(this,!0);return f.__className=this.constructor.className,delete f.delta,f}static get className(){return'engine.model.operation.Operation'}static fromJSON(f){return new this(f.baseVersion)}}r.a=u},function(o,r,s){'use strict';function d(P,S,E,O,V){return{done:!1,value:{type:P,item:S,previousPosition:E,nextPosition:O,length:V}}}var u=s(25),f=s(58),h=s(5),w=s(1),C=s(0);class T{constructor(P={}){if(!P.boundaries&&!P.startPosition)throw new C.a('model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');const S=P.direction||'forward';if('forward'!=S&&'backward'!=S)throw new C.a('model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:S});this.direction=S,this.boundaries=P.boundaries||null,this.position=P.startPosition?w.a.createFromPosition(P.startPosition):w.a.createFromPosition(this.boundaries['backward'==this.direction?'end':'start']),this.singleCharacters=!!P.singleCharacters,this.shallow=!!P.shallow,this.ignoreElementEnd=!!P.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(P){let S,E,O,V;do O=this.position,V=this._visitedParent,({done:S,value:E}=this.next());while(!S&&P(E));S||(this.position=O,this._visitedParent=V)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){const P=this.position,S=w.a.createFromPosition(this.position),E=this._visitedParent;if(null===E.parent&&S.offset===E.maxOffset)return{done:!0};if(E===this._boundaryEndParent&&S.offset==this.boundaries.end.offset)return{done:!0};const O=S.textNode?S.textNode:S.nodeAfter;if(O instanceof h.a)return this.shallow?S.offset++:(S.path.push(0),this._visitedParent=O),this.position=S,d('elementStart',O,P,S,1);if(O instanceof u.a){let V,F;if(this.singleCharacters)V=1;else{let N=O.endOffset;this._boundaryEndParent==E&&this.boundaries.end.offsetN&&(N=this.boundaries.start.offset),V=S.offset-N}F=S.offset-O.startOffset;const R=new f.a(O,F-V,V);return S.offset-=V,this.position=S,d('text',R,P,S,V)}return S.path.pop(),this.position=S,this._visitedParent=E.parent,d('elementStart',E,P,S,1)}}r.a=T},function(o,r,s){'use strict';function d(w){return w.item.is('attributeElement')||w.item.is('uiElement')}var u=s(26),f=s(51);class h{constructor(w,C=null){this.start=u.a.createFromPosition(w),this.end=C?u.a.createFromPosition(C):u.a.createFromPosition(w)}*[Symbol.iterator](){yield*new f.a({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let w=this.start.getLastMatchingPosition(d,{direction:'backward'}),C=this.end.getLastMatchingPosition(d);return w.parent.is('text')&&w.isAtStart&&(w=u.a.createBefore(w.parent)),C.parent.is('text')&&C.isAtEnd&&(C=u.a.createAfter(C.parent)),new h(w,C)}getTrimmed(){let w=this.start.getLastMatchingPosition(d),C=this.end.getLastMatchingPosition(d,{direction:'backward'}),T=w.nodeAfter,P=C.nodeBefore;return T&&T.is('text')&&(w=new u.a(T,0)),P&&P.is('text')&&(C=new u.a(P,P.data.length)),new h(w,C)}isEqual(w){return this==w||this.start.isEqual(w.start)&&this.end.isEqual(w.end)}containsPosition(w){return w.isAfter(this.start)&&w.isBefore(this.end)}containsRange(w){return this.containsPosition(w.start)&&this.containsPosition(w.end)}getDifference(w){const C=[];return this.isIntersecting(w)?(this.containsPosition(w.start)&&C.push(new h(this.start,w.start)),this.containsPosition(w.end)&&C.push(new h(w.end,this.end))):C.push(h.createFromRange(this)),C}getIntersection(w){if(this.isIntersecting(w)){let C=this.start,T=this.end;return this.containsPosition(w.start)&&(C=w.start),this.containsPosition(w.end)&&(T=w.end),new h(C,T)}return null}getWalker(w={}){return w.boundaries=this,new f.a(w)}*getItems(w={}){w.boundaries=this,w.ignoreElementEnd=!0;const C=new f.a(w);for(let T of C)yield T.item}*getPositions(w={}){w.boundaries=this;const C=new f.a(w);yield C.position;for(let T of C)yield T.nextPosition}isIntersecting(w){return this.start.isBefore(w.end)&&this.end.isAfter(w.start)}static createFromParentsAndOffsets(w,C,T,P){return new this(new u.a(w,C),new u.a(T,P))}static createFromRange(w){return new this(w.start,w.end)}static createFromPositionAndShift(w,C){const T=w,P=w.getShiftedBy(C);return 0f&&(f=-f>C?0:C+f),h=h>C?C:h,0>h&&(h+=C),C=f>h?0:h-f>>>0,f>>>=0;for(var T=Array(C);++w{let I=V.matcher.matchAll(R.input);if(I)for(let L of I){const D=E instanceof Function?E(R.input):new h.a(E),q=Array.from(D.getAttributeKeys());if(!M.schema.check({name:D.name,attributes:q,inside:R.context}))continue;if(!N.consume(R.input,V.consume||L.match))continue;R.context.push(D);const z=M.convertChildren(R.input,N,R),K=w.a.createAt(D,'end');C.a.insert(K,z),R.context.pop(),R.output=D;break}}},'normal')}toAttribute(E,O){this._setCallback(function(F){return(R,N,M,I)=>{let L=F.matcher.matchAll(N.input);if(L)for(let D of L){if(!M.consume(N.input,F.consume||D.match))continue;N.output||(N.output=I.convertChildren(N.input,M,N));let q=E instanceof Function?E(N.input):{key:E,value:O};d(N.output,q,N,I);break}}},'low')}toMarker(E){this._setCallback(function(V){return(F,R,N)=>{const M=V.matcher.matchAll(R.input);if(!M)return;let I;if(I=E instanceof Function?E(R.input):new h.a('$marker',{'data-name':R.input.getAttribute('data-name')}),'$marker'!=I.name||'string'!=typeof I.getAttribute('data-name'))throw new T.a('build-view-converter-invalid-marker: Invalid model element to mark marker range.');for(const L of M)if(N.consume(R.input,V.consume||L.match)){R.output=I;break}}},'normal')}_setCallback(E,O){for(let V of this._from){const F=V.matcher.getElementName(),R=F?'element:'+F:'element',N=E(V),M=null===V.priority?O:V.priority;for(let I of this._dispatchers)I.on(R,N,{priority:M})}}}},function(o,r,s){'use strict';var d=s(32),u=s(1),f=s(71),h=s(40),w=s(13),C=s(25),T=s(5);class P extends d.a{constructor(S,E,O){super(O),this.position=u.a.createFromPosition(S),this.nodes=new f.a(s.i(w.b)(E))}get type(){return'insert'}clone(){const S=new f.a([...this.nodes].map((E)=>E.clone(!0)));return new P(this.position,S,this.baseVersion)}getReversed(){return new h.a(this.position,this.nodes.maxOffset,this.baseVersion+1)}_execute(){const S=this.nodes;this.nodes=new f.a([...S].map((O)=>O.clone(!0)));const E=w.a.insert(this.position,S);return{range:E}}static get className(){return'engine.model.operation.InsertOperation'}static fromJSON(S,E){let O=[];for(let V of S.nodes)V.name?O.push(T.a.fromJSON(V)):O.push(C.a.fromJSON(V));return new P(u.a.fromJSON(S.position,E),O,S.baseVersion)}}r.a=P},function(o,r,s){'use strict';var d=s(28),u=s(1),f=s(5),h=s(111);class w extends d.a{constructor(C,T,P){const S=C.root.document.graveyard,E=new u.a(S,[S.maxOffset,0]);super(C,T,E,P),this._needsHolderElement=!0}get type(){return'remove'}get _holderElementOffset(){return this.targetPosition.path[0]}set _holderElementOffset(C){this.targetPosition.path[0]=C}getReversed(){return new h.a(this.targetPosition,this.howMany,this.sourcePosition,this.baseVersion+1)}clone(){let C=new w(this.sourcePosition,this.howMany,this.baseVersion);return C.targetPosition=u.a.createFromPosition(this.targetPosition),C}_execute(){if(this._needsHolderElement){const C=this.targetPosition.root,T=new f.a('$graveyardHolder');C.insertChildren(this._holderElementOffset,T),this.sourcePosition.root==C&&this.sourcePosition.path[0]>=this._holderElementOffset&&this.sourcePosition.path[0]++}return super._execute()}static get className(){return'engine.model.operation.RemoveOperation'}static fromJSON(C,T){let P=u.a.fromJSON(C.sourcePosition,T);const S=new w(P,C.howMany,C.baseVersion);return S.targetPosition=u.a.fromJSON(C.targetPosition,T),S._needsHolderElement=C._needsHolderElement,S}}r.a=w},function(o,r,s){'use strict';function d(){return 0===this.childCount?0:null}var u=s(21);class f extends u.a{constructor(h,w,C){super(h,w,C),this.getFillerOffset=d}is(h,w=null){return w?'containerElement'==h&&w==this.name||super.is(h,w):'containerElement'==h||super.is(h)}}r.a=f},function(o,r,s){'use strict';var h=s(151),w=s(5);r.c=function(T,P){return T.setCustomProperty(C,!0),s.i(h.a)(T,{label:function(){const E=T.getChild(0),O=E.getAttribute('alt');return O?`${O} ${P}`:P}})},r.a=function(T){return!!T.getCustomProperty(C)&&s.i(h.b)(T)},r.b=function(T){return T instanceof w.a&&'image'==T.name};const C=Symbol('isImage')},function(o,r){'use strict';r.a=function(u){return!!(u&&u[Symbol.iterator])}},function(o,r,s){'use strict';var u=s(81),f=s(123),h=s(124),w=s(134),C=s(440),T=s(93);r.a=function(S,E,O){var V=-1,F=f.a,R=S.length,N=!0,M=[],I=M;if(O)N=!1,F=h.a;else if(R>=200){var L=E?null:s.i(C.a)(S);if(L)return s.i(T.a)(L);N=!1,F=w.a,I=new u.a}else I=E?[]:M;outer:for(;++V'string'==typeof P?new h.a(P):P))}var u=s(71),f=s(5),h=s(25),w=s(43);class C{constructor(T){this.markers=new Map,this._children=new u.a,T&&this.insertChildren(0,T)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(T){return'documentFragment'==T}getChild(T){return this._children.getNode(T)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(T){return this._children.getNodeIndex(T)}getChildStartOffset(T){return this._children.getNodeStartOffset(T)}getPath(){return[]}offsetToIndex(T){return this._children.offsetToIndex(T)}appendChildren(T){this.insertChildren(this.childCount,T)}insertChildren(T,P){P=d(P);for(let S of P)S.parent=this;this._children.insertNodes(T,P)}removeChildren(T,P=1){const S=this._children.removeNodes(T,P);for(let E of S)E.parent=null;return S}toJSON(){let T=[];for(let P of this._children)T.push(P.toJSON());return T}static fromJSON(T){let P=[];for(let S of T)S.name?P.push(f.a.fromJSON(S)):P.push(h.a.fromJSON(S));return new C(P)}}r.a=C},function(o,r,s){'use strict';var d=s(79),u=s(4);class f{constructor(h){this.document=h,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}r.a=f,s.i(u.a)(f,d.a)},function(o,r,s){'use strict';var d=s(21),u=s(29),f=s(326),h=s(26),w=s(0);class C{constructor(T={}){if(!T.boundaries&&!T.startPosition)throw new w.a('view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.');if(T.direction&&'forward'!=T.direction&&'backward'!=T.direction)throw new w.a('view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',{direction:T.direction});this.boundaries=T.boundaries||null,this.position=T.startPosition?h.a.createFromPosition(T.startPosition):h.a.createFromPosition(T.boundaries['backward'==T.direction?'end':'start']),this.direction=T.direction||'forward',this.singleCharacters=!!T.singleCharacters,this.shallow=!!T.shallow,this.ignoreElementEnd=!!T.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(T){let P,S,E;do E=this.position,({done:P,value:S}=this.next());while(!P&&T(S));P||(this.position=E)}next(){return'forward'==this.direction?this._next():this._previous()}_next(){let T=h.a.createFromPosition(this.position);const P=this.position,S=T.parent;if(null===S.parent&&T.offset===S.childCount)return{done:!0};if(S===this._boundaryEndParent&&T.offset==this.boundaries.end.offset)return{done:!0};let E;if(S instanceof u.a){if(T.isAtEnd)return this.position=h.a.createAfter(S),this._next();E=S.data[T.offset]}else E=S.getChild(T.offset);if(E instanceof d.a)return this.shallow?T.offset++:T=new h.a(E,0),this.position=T,this._formatReturnValue('elementStart',E,P,T,1);if(E instanceof u.a){if(this.singleCharacters)return T=new h.a(E,0),this.position=T,this._next();let O=E.data.length,V=E;return E==this._boundaryEndParent?(O=this.boundaries.end.offset,V=new f.a(E,0,O),T=h.a.createAfter(V)):T.offset++,this.position=T,this._formatReturnValue('text',V,P,T,O)}if('string'==typeof E){let O;if(this.singleCharacters)O=1;else{const F=S===this._boundaryEndParent?this.boundaries.end.offset:S.data.length;O=F-T.offset}const V=new f.a(S,T.offset,O);return T.offset+=O,this.position=T,this._formatReturnValue('text',V,P,T,O)}return T=h.a.createAfter(S),this.position=T,this.ignoreElementEnd?this._next():this._formatReturnValue('elementEnd',S,P,T)}_previous(){let T=h.a.createFromPosition(this.position);const P=this.position,S=T.parent;if(null===S.parent&&0===T.offset)return{done:!0};if(S==this._boundaryStartParent&&T.offset==this.boundaries.start.offset)return{done:!0};let E;if(S instanceof u.a){if(T.isAtStart)return this.position=h.a.createBefore(S),this._previous();E=S.data[T.offset-1]}else E=S.getChild(T.offset-1);if(E instanceof d.a)return this.shallow?(T.offset--,this.position=T,this._formatReturnValue('elementStart',E,P,T,1)):(T=new h.a(E,E.childCount),this.position=T,this.ignoreElementEnd?this._previous():this._formatReturnValue('elementEnd',E,P,T));if(E instanceof u.a){if(this.singleCharacters)return T=new h.a(E,E.data.length),this.position=T,this._previous();let O=E.data.length,V=E;if(E==this._boundaryStartParent){const F=this.boundaries.start.offset;V=new f.a(E,F,E.data.length-F),O=V.data.length,T=h.a.createBefore(V)}else T.offset--;return this.position=T,this._formatReturnValue('text',V,P,T,O)}if('string'==typeof E){let O;if(!this.singleCharacters){const F=S===this._boundaryStartParent?this.boundaries.start.offset:0;O=T.offset-F}else O=1;T.offset-=O;const V=new f.a(S,T.offset,O);return this.position=T,this._formatReturnValue('text',V,P,T,O)}return T=h.a.createBefore(S),this.position=T,this._formatReturnValue('elementStart',S,P,T,1)}_formatReturnValue(T,P,S,E,O){return P instanceof f.a&&(P.offsetInText+P.data.length==P.textNode.data.length&&('forward'!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?S=h.a.createAfter(P.textNode):(E=h.a.createAfter(P.textNode),this.position=E)),0===P.offsetInText&&('backward'!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?S=h.a.createBefore(P.textNode):(E=h.a.createBefore(P.textNode),this.position=E))),{done:!1,value:{type:T,item:P,previousPosition:S,nextPosition:E,length:O}}}}r.a=C},function(o,r,s){'use strict';var u=s(231);r.a=function(f,h){var w=f[h];return s.i(u.a)(w)?w:void 0}},function(o,r,s){'use strict';var u=s(12),f=s(47),h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/;r.a=function(C,T){if(s.i(u.a)(C))return!1;var P=typeof C;return'number'==P||'symbol'==P||'boolean'==P||null==C||s.i(f.a)(C)||w.test(C)||!h.test(C)||null!=T&&C in Object(T)}},function(o,r,s){'use strict';var u=s(47);r.a=function(h){if('string'==typeof h||s.i(u.a)(h))return h;var w=h+'';return'0'==w&&1/h==-(1/0)?'-0':w}},function(o,r){'use strict';r.a=function(u,f){return u===f||u!==u&&f!==f}},function(o,r,s){'use strict';var d=s(150),u=s(0);class f{constructor(h){this.parent=null,this._attrs=s.i(d.a)(h)}get index(){let h;if(!this.parent)return null;if(null===(h=this.parent.getChildIndex(this)))throw new u.a('model-node-not-found-in-parent: The node\'s parent does not contain this node.');return h}get startOffset(){let h;if(!this.parent)return null;if(null===(h=this.parent.getChildStartOffset(this)))throw new u.a('model-node-not-found-in-parent: The node\'s parent does not contain this node.');return h}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const h=this.index;return null!==h&&this.parent.getChild(h+1)||null}get previousSibling(){const h=this.index;return null!==h&&this.parent.getChild(h-1)||null}get root(){let h=this;for(;h.parent;)h=h.parent;return h}get document(){return this.root==this?null:this.root.document||null}clone(){return new f(this._attrs)}getPath(){const h=[];for(let w=this;w.parent;)h.unshift(w.startOffset),w=w.parent;return h}getAncestors(h={includeNode:!1,parentFirst:!1}){const w=[];for(let C=h.includeNode?this:this.parent;C;)w[h.parentFirst?'push':'unshift'](C),C=C.parent;return w}remove(){this.parent.removeChildren(this.index)}hasAttribute(h){return this._attrs.has(h)}getAttribute(h){return this._attrs.get(h)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}setAttribute(h,w){this._attrs.set(h,w)}setAttributesTo(h){this._attrs=s.i(d.a)(h)}removeAttribute(h){return this._attrs.delete(h)}clearAttributes(){this._attrs.clear()}toJSON(){let h={};return this._attrs.size&&(h.attributes=[...this._attrs]),h}}r.a=f},function(o,r,s){'use strict';function d(V,F){return!F.has(V)&&(F.add(V),V.document.schema.itemExtends(V.name,'$block')&&V.parent)}function u(V,F){const R=V.parent.getAncestors({parentFirst:!0,includeNode:!0}),N=R.find((M)=>d(M,F));return R.forEach((M)=>F.add(M)),N}var f=s(1),h=s(5),w=s(3),C=s(7),T=s(0),P=s(4),S=s(150),E=s(500);class O{constructor(){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map}get anchor(){if(0{if(!(N instanceof w.a))throw new T.a('model-selection-added-not-range: Trying to add an object that is not an instance of Range.');return this._ranges.every((M)=>{return!M.isEqual(N)})});if(V.length!==this._ranges.length||R){this._removeAllRanges();for(let N of V)this._pushRange(N);this._lastRangeBackward=!!F,this.fire('change:range',{directChange:!0})}}setTo(V){this.setRanges(V.getRanges(),V.isBackward)}collapse(V,F){const R=f.a.createAt(V,F),N=new w.a(R,R);this.setRanges([N])}collapseToStart(){const V=this.getFirstPosition();null!==V&&this.setRanges([new w.a(V,V)])}collapseToEnd(){const V=this.getLastPosition();null!==V&&this.setRanges([new w.a(V,V)])}setFocus(V,F){if(null===this.anchor)throw new T.a('model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const R=f.a.createAt(V,F);if('same'!=R.compareWith(this.focus)){const N=this.anchor;this._ranges.length&&this._popRange(),'before'==R.compareWith(N)?this.addRange(new w.a(R,N),!0):this.addRange(new w.a(N,R))}}getAttribute(V){return this._attrs.get(V)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(V){return this._attrs.has(V)}clearAttributes(){if(0h||h>f.offsetSize)throw new d.a('model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>w||h+w>f.offsetSize)throw new d.a('model-textproxy-wrong-length: Given length value is incorrect.');this.data=f.data.substring(h,h+w),this.offsetInText=h}get startOffset(){return null===this.textNode.startOffset?null:this.textNode.startOffset+this.offsetInText}get offsetSize(){return this.data.length}get endOffset(){return null===this.startOffset?null:this.startOffset+this.offsetSize}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(f){return'textProxy'==f}getPath(){const f=this.textNode.getPath();return 0{const R=F.createElement('br');return R.dataset.ckeFiller=!0,R};r.a=(F)=>F.createTextNode('\xA0');const E=7;r.d=E;let O='';for(let F=0;F{this.listenTo(h,C,(T,P)=>{this.isEnabled&&this.onDomEvent(P)},{useCapture:this.useCapture})})}fire(h,w,C){this.isEnabled&&this.document.fire(h,new u.a(this.document,w,C))}}r.a=f},function(o,r,s){'use strict';var d=s(0),u=s(34),f=s(26),h=s(4),w=s(7),C=s(21);class T{constructor(){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel=''}setFake(P=!0,S={}){this._isFake=P,this._fakeSelectionLabel=P?S.label||'':'',this.fire('change')}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const P=this._ranges[this._ranges.length-1],S=this._lastRangeBackward?P.end:P.start;return f.a.createFromPosition(S)}get focus(){if(!this._ranges.length)return null;const P=this._ranges[this._ranges.length-1],S=this._lastRangeBackward?P.start:P.end;return f.a.createFromPosition(S)}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}addRange(P,S){if(!(P instanceof u.a))throw new d.a('view-selection-invalid-range: Invalid Range.');this._pushRange(P),this._lastRangeBackward=!!S,this.fire('change')}*getRanges(){for(let P of this._ranges)yield u.a.createFromRange(P)}getFirstRange(){let P=null;for(let S of this._ranges)(!P||S.start.isBefore(P.start))&&(P=S);return P?u.a.createFromRange(P):null}getLastRange(){let P=null;for(let S of this._ranges)(!P||S.end.isAfter(P.end))&&(P=S);return P?u.a.createFromRange(P):null}getFirstPosition(){const P=this.getFirstRange();return P?f.a.createFromPosition(P.start):null}getLastPosition(){const P=this.getLastRange();return P?f.a.createFromPosition(P.end):null}isEqual(P){if(this.isFake!=P.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=P.fakeSelectionLabel)return!1;if(this.rangeCount!=P.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(P.anchor)||!this.focus.isEqual(P.focus))return!1;for(let S of this._ranges){let E=!1;for(let O of P._ranges)if(S.isEqual(O)){E=!0;break}if(!E)return!1}return!0}removeAllRanges(){this._ranges.length&&(this._ranges=[],this.fire('change'))}setRanges(P,S){this._ranges=[];for(let E of P){if(!(E instanceof u.a))throw new d.a('view-selection-invalid-range: Invalid Range.');this._pushRange(E)}this._lastRangeBackward=!!S,this.fire('change')}setTo(P){this._isFake=P._isFake,this._fakeSelectionLabel=P._fakeSelectionLabel,this.setRanges(P.getRanges(),P.isBackward)}collapse(P,S){const E=f.a.createAt(P,S),O=new u.a(E,E);this.setRanges([O])}collapseToStart(){const P=this.getFirstPosition();null!==P&&this.setRanges([new u.a(P,P)])}collapseToEnd(){const P=this.getLastPosition();null!==P&&this.setRanges([new u.a(P,P)])}setFocus(P,S){if(null===this.anchor)throw new d.a('view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.');const E=f.a.createAt(P,S);if('same'!=E.compareWith(this.focus)){const O=this.anchor;this._ranges.pop(),'before'==E.compareWith(O)?this.addRange(new u.a(E,O),!0):this.addRange(new u.a(O,E))}}getSelectedElement(){if(1!==this.rangeCount)return null;const P=this.getFirstRange(),S=P.start.nodeAfter,E=P.end.nodeBefore;return S instanceof C.a&&S==E?S:null}static createFromSelection(P){const S=new T;return S.setTo(P),S}_pushRange(P){for(let S of this._ranges)if(P.isIntersecting(S))throw new d.a('view-selection-range-intersects: Trying to add a range that intersects with another range from selection.',{addedRange:P,intersectingRange:S});this._ranges.push(u.a.createFromRange(P))}}r.a=T,s.i(h.a)(T,w.a)},function(o,r){'use strict';r.a=function(u,f){const h=_Mathmin(u.length,f.length);for(let w=0;wthis._focus(C),{useCapture:!0}),this.listenTo(C,'blur',()=>this._blur(),{useCapture:!0}),this._elements.add(C)}remove(C){C===this.focusedElement&&this._blur(C),this._elements.has(C)&&(this.stopListening(C),this._elements.delete(C))}_focus(C){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=C,this.isFocused=!0}_blur(){this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}r.a=w,s.i(h.a)(w,d.a),s.i(h.a)(w,u.a)},function(o,r,s){'use strict';var d=s(79),u=s(23);r.a=class{constructor(){this._listener=Object.create(d.a),this._keystrokes=new Map}listenTo(h){this._listener.listenTo(h,'keydown',(w,C)=>{this.press(C)})}set(h,w){const C=s.i(u.a)(h),T=this._keystrokes.get(C);T?T.push(w):this._keystrokes.set(C,[w])}press(h){const w=s.i(u.c)(h),C=this._keystrokes.get(w);if(!C)return!1;for(let T of C)T(h,()=>{h.preventDefault(),h.stopPropagation()});return!0}destroy(){this._keystrokes=new Map,this._listener.stopListening()}}},function(o,r,s){'use strict';var u=s(55),f=Object.prototype,h=f.hasOwnProperty;r.a=function(w,C,T){var P=w[C];h.call(w,C)&&s.i(u.a)(P,T)&&(T!==void 0||C in w)||(w[C]=T)}},function(o,r,s){'use strict';var u=s(81),f=s(123),h=s(124),w=s(27),C=s(132),T=s(134);r.a=function(S,E,O,V){var F=-1,R=f.a,N=!0,M=S.length,I=[],L=E.length;if(!M)return I;O&&(E=s.i(w.a)(E,s.i(C.a)(O))),V?(R=h.a,N=!1):E.length>=200&&(R=T.a,N=!1,E=new u.a(E));outer:for(;++Ff;f++)u+=_Mathfloor(65536*(1+Math.random())).toString(16).substring(1);return u}},function(o,r,s){'use strict';var d=s(56),u=s(0);class f{constructor(h){this._nodes=[],h&&this.insertNodes(0,h)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((h,w)=>h+w.offsetSize,0)}getNode(h){return this._nodes[h]||null}getNodeIndex(h){const w=this._nodes.indexOf(h);return-1==w?null:w}getNodeStartOffset(h){const w=this.getNodeIndex(h);return null===w?null:this._nodes.slice(0,w).reduce((C,T)=>C+T.offsetSize,0)}indexToOffset(h){if(h==this._nodes.length)return this.maxOffset;const w=this._nodes[h];if(!w)throw new u.a('model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.');return this.getNodeStartOffset(w)}offsetToIndex(h){let w=0;for(let C of this._nodes){if(h>=w&&hh.toJSON())}}r.a=f},function(o,r,s){'use strict';var d=s(32),u=s(3),f=s(0),h=s(13),w=s(487);class C extends d.a{constructor(T,P,S,E,O){super(O),this.range=u.a.createFromRange(T),this.key=P,this.oldValue=S===void 0?null:S,this.newValue=E===void 0?null:E}get type(){return null===this.oldValue?'addAttribute':null===this.newValue?'removeAttribute':'changeAttribute'}clone(){return new C(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new C(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_execute(){for(let T of this.range.getItems()){if(null!==this.oldValue&&!s.i(w.a)(T.getAttribute(this.key),this.oldValue))throw new f.a('attribute-operation-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',{item:T,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&T.hasAttribute(this.key))throw new f.a('attribute-operation-attribute-exists: The attribute with given key already exists.',{node:T,key:this.key});if(s.i(w.a)(this.oldValue,this.newValue))return}return h.a.setAttribute(this.range,this.key,this.newValue),{range:this.range,key:this.key,oldValue:this.oldValue,newValue:this.newValue}}static get className(){return'engine.model.operation.AttributeOperation'}static fromJSON(T,P){return new C(u.a.fromJSON(T.range,P),T.key,T.oldValue,T.newValue,T.baseVersion)}}r.a=C},function(o,r,s){'use strict';var d=s(32);class u extends d.a{clone(){return new u(this.baseVersion)}getReversed(){return new u(this.baseVersion+1)}_execute(){}static get className(){return'engine.model.operation.NoOperation'}}r.a=u},function(o,r,s){'use strict';var d=s(41),u=s(0),f=s(4),h=s(31);const w=Symbol('document');class C extends d.a{constructor(T,P,S){super(T,P,S),this.set('isReadOnly',!1),this.set('isFocused',!1)}get document(){return this.getCustomProperty(w)}set document(T){if(this.getCustomProperty(w))throw new u.a('view-editableelement-document-already-set: View document is already set.');this.setCustomProperty(w,T),this.bind('isFocused').to(T,'isFocused',(P)=>P&&T.selection.editableElement==this),this.listenTo(T,'render',()=>{this.isFocused=T.isFocused&&T.selection.editableElement==this},{priority:'high'})}}r.a=C,s.i(f.a)(C,h.a)},function(o,r,s){'use strict';var d=s(0),u=s(7),f=s(4);class h{constructor(){this.parent=null}get index(){let w;if(!this.parent)return null;if(-1==(w=this.parent.getChildIndex(this)))throw new d.a('view-node-not-found-in-parent: The node\'s parent does not contain this node.');return w}get nextSibling(){const w=this.index;return null!==w&&this.parent.getChild(w+1)||null}get previousSibling(){const w=this.index;return null!==w&&this.parent.getChild(w-1)||null}get root(){let w=this;for(;w.parent;)w=w.parent;return w}get document(){return this.parent instanceof h?this.parent.document:null}getAncestors(w={includeNode:!1,parentFirst:!1}){const C=[];for(let T=w.includeNode?this:this.parent;T;)C[w.parentFirst?'push':'unshift'](T),T=T.parent;return C}remove(){this.parent.removeChildren(this.index)}_fireChange(w,C){this.fire('change:'+w,C),this.parent&&this.parent._fireChange(w,C)}}r.a=h,s.i(f.a)(h,u.a)},function(o,r,s){'use strict';function f(le){const de=le.offset,ce=le.parent;if(ce.is('text'))return le;if(ce.is('attributeElement')&&0===ce.childCount){const ge=ce.parent,pe=ce.index;return ce.remove(),f(new G.a(ge,pe))}const ue=ce.getChild(de-1),me=ce.getChild(de);if(!ue||!me)return le;if(ue.is('text')&&me.is('text'))return z(ue,me);if(ue.is('attributeElement')&&me.is('attributeElement')&&ue.isSimilar(me)){const ge=ue.childCount;return ue.appendChildren(me.getChildren()),me.remove(),f(new G.a(ue,ge))}return le}function C(le,de){de=s.i(oe.a)(de)?[...de]:[de],W(de);const ce=R(le);if(!ce)throw new ne.a('view-writer-invalid-position-container');const ue=M(le,!0),me=ce.insertChildren(ue.offset,de),ge=ue.getShiftedBy(me),pe=f(ue);if(0===me)return new te.a(pe,pe);pe.isEqual(ue)||ge.offset--;const fe=f(ge);return new te.a(pe,fe)}function T(le){if(Z(le),le.isCollapsed)return new ie.a;const{start:de,end:ce}=N(le,!0),ue=de.parent,me=ce.offset-de.offset,ge=ue.removeChildren(de.offset,me),pe=f(de);return le.start=pe,le.end=G.a.createFromPosition(pe),new ie.a(ge)}function S(le,de){let ce;if(de.isAfter(le.end)){de=M(de,!0);const ue=de.parent,me=ue.childCount;le=N(le,!0),ce=T(le),de.offset+=ue.childCount-me}else ce=T(le);return C(de,ce)}function E(le,de){if(!(de instanceof Q.a))throw new ne.a('view-writer-wrap-invalid-attribute');if(Z(le),le.isCollapsed)return le;if(le.end.isEqual(le.start.getShiftedBy(1))){const be=le.start.nodeAfter;if(be instanceof Q.a&&K(de,be))return le}if(H(le)&&K(de,le.start.parent)){const be=le.start.parent.parent,_e=le.start.parent.index;return te.a.createFromParentsAndOffsets(be,_e,be,_e+1)}const{start:ce,end:ue}=N(le,!0),me=ce.parent,ge=I(me,ce.offset,ue.offset,de),pe=L(me,ge.start.offset,ge.end.offset,de),fe=f(pe.start);fe.isEqual(pe.start)||pe.end.offset--;const he=f(pe.end);return new te.a(fe,he)}function R(le){let de=le.parent;for(;!U(de);){if(!de)return;de=de.parent}return de}function N(le,de=!1){const ce=le.start,ue=le.end;if(Z(le),le.isCollapsed){const fe=M(le.start,de);return new te.a(fe,fe)}const me=M(ue,de),ge=me.parent.childCount,pe=M(ce,de);return me.offset+=me.parent.childCount-ge,new te.a(pe,me)}function M(le,de=!1){const ce=le.offset,ue=le.parent;if(le.parent.is('emptyElement'))throw new ne.a('view-writer-cannot-break-empty-element');if(le.parent.is('uiElement'))throw new ne.a('view-writer-cannot-break-ui-element');if(!de&&ue.is('text')&&U(ue.parent))return G.a.createFromPosition(le);if(U(ue))return G.a.createFromPosition(le);if(ue.is('text'))return M(q(le),de);const me=ue.childCount;if(ce==me){const ge=new G.a(ue.parent,ue.index+1);return M(ge,de)}if(0===ce){const ge=new G.a(ue.parent,ue.index);return M(ge,de)}const ge=ue.index+1,pe=ue.clone();ue.parent.insertChildren(ge,pe);const fe=ue.childCount-ce,he=ue.removeChildren(ce,fe);pe.appendChildren(he);const be=new G.a(ue.parent,ge);return M(be,de)}function I(le,de,ce,ue){let me=de;const ge=[];for(;mede instanceof ce))throw new ne.a('view-writer-insert-invalid-node');de.is('text')||W(de.getChildren())}}function U(le){return le&&(le.is('containerElement')||le.is('documentFragment'))}function Z(le){const de=R(le.start),ce=R(le.end);if(!de||!ce||de!==ce)throw new ne.a('view-writer-invalid-range-container')}var G=s(26),J=s(41),Q=s(114),Y=s(165),X=s(169),ee=s(29),te=s(34),ae=s(51),ne=s(0),ie=s(115),oe=s(43);r.a={breakAttributes:function(le){return le instanceof G.a?M(le):N(le)},breakContainer:function(le){const de=le.parent;if(!de.is('containerElement'))throw new ne.a('view-writer-break-non-container-element: Trying to break an element which is not a container element.');if(!de.parent)throw new ne.a('view-writer-break-root: Trying to break root element.');if(le.isAtStart)return G.a.createBefore(de);if(!le.isAtEnd){const ce=de.clone(!1);C(G.a.createAfter(de),ce);const ue=new te.a(le,G.a.createAt(de,'end')),me=new G.a(ce,0);S(ue,me)}return G.a.createAfter(de)},mergeAttributes:f,mergeContainers:function(le){const de=le.nodeBefore,ce=le.nodeAfter;if(!de||!ce||!de.is('containerElement')||!ce.is('containerElement'))throw new ne.a('view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.');const ue=de.getChild(de.childCount-1),me=ue instanceof ee.a?G.a.createAt(ue,'end'):G.a.createAt(de,'end');return S(te.a.createIn(ce),G.a.createAt(de,'end')),T(te.a.createOn(ce)),me},insert:C,remove:T,clear:function(le,de){Z(le);const ce=le.getWalker({direction:'backward',ignoreElementEnd:!0});for(const ue of ce){const me=ue.item;let ge;if(me.is('element')&&de.isSimilar(me))ge=te.a.createOn(me);else if(!ue.nextPosition.isAfter(le.start)&&(me.is('text')||me.is('textProxy'))){const pe=me.getAncestors().find((fe)=>{return fe.is('element')&&de.isSimilar(fe)});pe&&(ge=te.a.createIn(pe))}ge&&(ge.end.isAfter(le.end)&&(ge.end=le.end),ge.start.isBefore(le.start)&&(ge.start=le.start),T(ge))}},move:S,wrap:E,wrapPosition:function(le,de){if(!(de instanceof Q.a))throw new ne.a('view-writer-wrap-invalid-attribute');if(de.isSimilar(le.parent))return D(G.a.createFromPosition(le));le.parent.is('text')&&(le=q(le));const ce=new Q.a;ce.priority=_NumberPOSITIVE_INFINITY,ce.isSimilar=()=>!1,le.parent.insertChildren(le.offset,ce);const ue=new te.a(le,le.getShiftedBy(1));E(ue,de);const me=new G.a(ce.parent,ce.index);ce.remove();const ge=me.nodeBefore,pe=me.nodeAfter;return ge instanceof ee.a&&pe instanceof ee.a?z(ge,pe):D(me)},unwrap:function(le,de){if(!(de instanceof Q.a))throw new ne.a('view-writer-unwrap-invalid-attribute');if(Z(le),le.isCollapsed)return le;if(le.end.isEqual(le.start.getShiftedBy(1))){const he=le.start.nodeAfter;if(!de.isSimilar(he)&&he instanceof Q.a&&$(de,he))return le}const{start:ce,end:ue}=N(le,!0),me=ce.parent,ge=I(me,ce.offset,ue.offset,de),pe=f(ge.start);pe.isEqual(ge.start)||ge.end.offset--;const fe=f(ge.end);return new te.a(pe,fe)},rename:function(le,de){const ce=new J.a(de,le.getAttributes());return C(G.a.createAfter(le),ce),S(te.a.createIn(le),G.a.createAt(ce)),T(te.a.createOn(le)),ce},breakViewRangePerContainer:function(le){const de=[],ce=new ae.a({boundaries:le});let ue=le.start;for(let me of ce)me.item.is('containerElement')&&(ue.isEqual(me.previousPosition)||de.push(new te.a(ue,me.previousPosition)),ue=me.nextPosition);return de.push(new te.a(ue,le.end)),de}};const se=[ee.a,Q.a,J.a,Y.a,X.a]},function(o,r,s){'use strict';function d(L,D,q,z,K){if(z.test(q.input)&&L.schema.check({name:'paragraph',inside:q.context})){const $=new T.a('paragraph');I.add($),q.context.push($);const H=K.convertItem(q.input,z,q);H&&(q.output=$,$.appendChildren(H)),q.context.pop()}}function u(L,D,q,z,K){if(M.paragraphLikeElements.has(q.input.name)&&z.test(q.input,{name:!0})&&!h(q.input)&&L.schema.check({name:'paragraph',inside:q.context})){z.consume(q.input,{name:!0});const $=new T.a('paragraph');q.context.push($);const H=K.convertChildren(q.input,z,q);$.appendChildren(V.a.normalizeNodes(H)),q.context.pop(),q.output=$}}function f(L,D){if(!D.output)return;let q;for(q=s.i(N.a)(D.output)?D.output[0]:D.output.getChild(0);q&&q.nextSibling;){const z=q.nextSibling;I.has(q)&&I.has(z)?(V.a.insert(P.a.createAt(q,'end'),Array.from(z.getChildren())),V.a.remove(S.a.createOn(z))):q=q.nextSibling}}function h(L){const D=O.a.createIn(L);for(const q of D)if(q.item instanceof E.a&&M.paragraphLikeElements.has(q.item.name))return!0;return!1}var w=s(355),C=s(2),T=s(5),P=s(1),S=s(3),E=s(21),O=s(34),V=s(13),F=s(37),R=s(38),N=s(12);class M extends C.a{static get pluginName(){return'paragraph/paragraph'}init(){const L=this.editor,D=L.document,q=L.data,z=L.editing;D.schema.registerItem('paragraph','$block'),s.i(F.a)().for(q.modelToView,z.modelToView).fromElement('paragraph').toElement('p'),s.i(R.a)().for(q.viewToModel).fromElement('p').toElement('paragraph'),q.viewToModel.on('text',(K,$,H,W)=>{d(D,K,$,H,W)},{priority:'lowest'}),q.viewToModel.on('element',f,{priority:'lowest'}),q.viewToModel.on('documentFragment',f,{priority:'lowest'}),q.viewToModel.on('element',(K,$,H,W)=>{u(D,K,$,H,W)},{priority:'low'}),L.commands.set('paragraph',new w.a(L))}}r.a=M,M.paragraphLikeElements=new Set(['blockquote','dd','div','dt','h1','h2','h3','h4','h5','h6','li','p','td']);const I=new WeakSet},function(o,r,s){'use strict';var d=s(7),u=s(0),f=s(70),h=s(4);class w{constructor(C){this._items=[],this._itemMap=new Map,this._idProperty=C&&C.idProperty||'id',this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap}get length(){return this._items.length}add(C,T){let P;const S=this._idProperty;if(S in C){if(P=C[S],'string'!=typeof P)throw new u.a('collection-add-invalid-id');if(this.get(P))throw new u.a('collection-add-item-already-exists')}else C[S]=P=s.i(f.a)();if(void 0===T)T=this._items.length;else if(T>this._items.length||0>T)throw new u.a('collection-add-item-invalid-index');return this._items.splice(T,0,C),this._itemMap.set(P,C),this.fire('add',C,T),this}get(C){let T;if('string'==typeof C)T=this._itemMap.get(C);else if('number'==typeof C)T=this._items[C];else throw new u.a('collection-get-invalid-arg: Index or id must be given.');return T||null}getIndex(C){let T;return T='string'==typeof C?this._itemMap.get(C):C,this._items.indexOf(T)}remove(C){let E=!1,T,P,S;const O=this._idProperty;if('string'==typeof C?(P=C,S=this._itemMap.get(P),E=!S,S&&(T=this._items.indexOf(S))):'number'==typeof C?(T=C,S=this._items[T],E=!S,S&&(P=S[O])):(S=C,P=S[O],T=this._items.indexOf(S),E=-1==T||!this._itemMap.get(P)),E)throw new u.a('collection-remove-404: Item not found.');this._items.splice(T,1),this._itemMap.delete(P);const V=this._bindToInternalToExternalMap.get(S);return this._bindToInternalToExternalMap.delete(S),this._bindToExternalToInternalMap.delete(V),this.fire('remove',S),S}map(C,T){return this._items.map(C,T)}find(C,T){return this._items.find(C,T)}filter(C,T){return this._items.filter(C,T)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(C){if(this._bindToCollection)throw new u.a('collection-bind-to-rebind: The collection cannot be bound more than once.');return this._bindToCollection=C,{as:(T)=>{this._setUpBindToBinding((P)=>new T(P))},using:(T)=>{'function'==typeof T?this._setUpBindToBinding((P)=>T(P)):this._setUpBindToBinding((P)=>P[T])}}}_setUpBindToBinding(C){const T=this._bindToCollection,P=(S,E,O)=>{const V=T._bindToCollection==this,F=T._bindToInternalToExternalMap.get(E);if(V&&F)this._bindToExternalToInternalMap.set(E,F),this._bindToInternalToExternalMap.set(F,E);else{const R=C(E);this._bindToExternalToInternalMap.set(E,R),this._bindToInternalToExternalMap.set(R,E),this.add(R,O)}};for(let S of T)P(null,S);this.listenTo(T,'add',P),this.listenTo(T,'remove',(S,E)=>{const O=this._bindToExternalToInternalMap.get(E);O&&this.remove(O)})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}r.a=w,s.i(h.a)(w,d.a)},function(o,r,s){'use strict';function d(S){return S['data-ck-expando']||(S['data-ck-expando']=s.i(h.a)())}function u(S){return S&&s.i(C.a)(S.addEventListener)}var f=s(7),h=s(70),w=s(45),C=s(231);const T=s.i(w.a)({},f.a,{listenTo(...S){const E=S[0];u(E)&&(S[0]=this._getProxyEmitter(E)||new P(E)),f.a.listenTo.apply(this,S)},stopListening(...S){const E=S[0];if(u(E)){let O=this._getProxyEmitter(E);if(!O)return;S[0]=O}f.a.stopListening.apply(this,S)},_getProxyEmitter(S){return s.i(f.b)(this,d(S))}});r.a=T;class P{constructor(S){s.i(f.c)(this,d(S)),this._domNode=S}}s.i(w.a)(P.prototype,f.a,{on(S,E,O={}){if(f.a.on.apply(this,arguments),!(this._domListeners&&this._domListeners[S])){const V=this._createDomListener(S);this._domNode.addEventListener(S,V,!!O.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[S]=V}},off(S){f.a.off.apply(this,arguments);let E;!this._domListeners[S]||(E=this._events[S])&&E.callbacks.length||this._domListeners[S].removeListener()},_createDomListener(S){const E=(O)=>{this.fire(S,O)};return E.removeListener=()=>{this._domNode.removeEventListener(S,E),delete this._domListeners[S]},E}})},function(o,r,s){'use strict';function d(T){var P=-1,S=T?T.length:0;for(this.clear();++P>>1){for(;E>>1,F=T[V];null!==F&&!s.i(h.a)(F)&&(S?F<=P:F{const H=D instanceof R.a?D.clone(!0):D(z,K,$);if(H&&K.consume(z.item,'insert')){const W=$.mapper.toViewPosition(z.range.start);$.mapper.bindElements(z.item,H),L.a.insert(W,H)}}},r.j=function(){return(D,q,z,K)=>{if(z.consume(q.item,'insert')){const $=K.mapper.toViewPosition(q.range.start),H=new N.a(q.item.data);L.a.insert($,H)}}},r.f=function(D){return(q,z,K,$)=>{let H,W;if((D instanceof R.a?(H=D.clone(!0),W=D.clone(!0)):(z.isOpening=!0,H=D(z,K,$),z.isOpening=!1,W=D(z,K,$)),H&&W)&&K.consume(z.range,'addMarker')){const U=$.mapper;L.a.insert(U.toViewPosition(z.range.start),H),z.range.isCollapsed||L.a.insert(U.toViewPosition(z.range.end),W)}}},r.h=function(D){return D=D||((q,z)=>({value:q,key:z})),(q,z,K,$)=>{if(K.consume(z.item,F(q.name))){const{key:H,value:W}=D(z.attributeNewValue,z.attributeKey,z,K,$);$.mapper.toViewElement(z.item).setAttribute(H,W)}}},r.i=function(D){return D=D||((q,z)=>({key:z})),(q,z,K,$)=>{if(K.consume(z.item,F(q.name))){const{key:H}=D(z.attributeOldValue,z.attributeKey,z,K,$);$.mapper.toViewElement(z.item).removeAttribute(H)}}},r.b=function(D){return(q,z,K,$)=>{const H=D instanceof R.a?D.clone(!0):D(z.attributeNewValue,z,K,$);if(!H)return;if(!K.consume(z.item,F(q.name)))return;let W=$.mapper.toViewRange(z.range);if(null!==z.attributeOldValue&&!(D instanceof R.a)){const U=D(z.attributeOldValue,z,K,$);W=L.a.unwrap(W,U)}L.a.wrap(W,H)}},r.c=function(D){return(q,z,K,$)=>{const H=D instanceof R.a?D.clone(!0):D(z.attributeOldValue,z,K,$);if(H&&K.consume(z.item,F(q.name))){const W=$.mapper.toViewRange(z.range);L.a.unwrap(W,H)}}},r.d=function(D){return(q,z,K,$)=>{const H=D instanceof R.a?D.clone(!0):D(z,K,$);if(H&&K.consume(z.range,'addMarker')){const W=$.mapper.toViewRange(z.range),U=L.a.breakViewRangePerContainer(W);for(let Z of U)L.a.wrap(Z,H)}}},r.e=function(D){return(q,z,K,$)=>{const H=D instanceof R.a?D.clone(!0):D(z,K,$);if(H&&K.consume(z.range,'removeMarker')){const W=$.mapper.toViewRange(z.range),U=L.a.breakViewRangePerContainer(W);for(let Z of U)L.a.unwrap(Z,H)}}},r.k=function(){return(D,q,z,K)=>{if(!z.consume(q.item,'remove'))return;const $=K.mapper.toViewPosition(q.sourcePosition);let H;if(q.item.is('element'))H=M.a.createOn($.nodeAfter);else{const W=O($,q.item.offsetSize);H=new M.a($,W)}L.a.remove(H.getTrimmed()),'$graveyard'==q.item.root.rootName&&K.mapper.unbindModelElement(q.item)}},r.g=function(D){return(q,z,K,$)=>{let H,W;if((D instanceof R.a?(H=D.clone(!0),W=D.clone(!0)):(z.isOpening=!0,H=D(z,K,$),z.isOpening=!1,W=D(z,K,$)),H&&W)&&K.consume(z.range,'removeMarker')){const U=$.mapper.toViewRange(z.range);L.a.clear(U.getEnlarged(),W),H.isSimilar(W)||L.a.clear(U.getEnlarged(),H)}}}},function(o,r,s){'use strict';var d=s(20),u=s(104),f=s(18),h=s(39),w=s(17),C=s(13),T=s(49),P=s(3),S=s(1);class E extends d.a{get type(){return'insert'}get position(){return this._insertOperation?this._insertOperation.position:null}get nodes(){return this._insertOperation?this._insertOperation.nodes:null}get _insertOperation(){return this.operations[0]||null}get _reverseDeltaClass(){return u.a}static get className(){return'engine.model.delta.InsertDelta'}static get _priority(){return 20}}r.a=E,s.i(w.b)('insert',function(O,V){const F=s.i(C.b)(V);if(0===F.length)return this;const R=new E,N=new h.a(O,F,this.document.version);if(this.addDelta(R),R.addOperation(N),this.document.applyOperation(N),V instanceof T.a)for(const[M,I]of V.markers){const L=S.a.createAt(I.root),D=new P.a(I.start._getCombined(L,O),I.end._getCombined(L,O));this.setMarker(M,D)}return this}),f.a.register(E)},function(o,r,s){'use strict';var d=s(20),u=s(18),f=s(105),h=s(17),w=s(1),C=s(5),T=s(40),P=s(28),S=s(0);class E extends d.a{get type(){return'merge'}get position(){return this._removeOperation?this._removeOperation.sourcePosition:null}getReversed(){let O=super.getReversed();return 0M._priority)||!(N._priority{return M+I.operations.length},0)}function S(N,M){const I=N[N.length-1];let L=I.operations.length+I.baseVersion,D=new E.a;for(let q=0;q{T.has(S)&&u.call(this,S,V,E.range,E.sourcePosition)},{priority:'high'})}function u(T,P,S,E){const O=S.end.offset-S.start.offset;let V=S.start;'move'==T&&(V=V._getTransformedByInsertion(E,O));const F=this._getTransformedByDocumentChange(T,P,V,O,E);'move'==T&&3==F.length&&(F[2]=S);const R=f.a.createFromRanges(F);if(!R.isEqual(this)){const N=f.a.createFromRange(this);this.start=R.start,this.end=R.end,this.fire('change',N)}}var f=s(3),h=s(7),w=s(4);class C extends f.a{constructor(T,P){super(T,P),d.call(this)}detach(){this.stopListening()}}r.a=C,s.i(w.a)(C,h.a)},function(o,r,s){'use strict';var d=s(32),u=s(3);class f extends d.a{constructor(h,w,C,T,P){super(P),this.name=h,this.oldRange=w?u.a.createFromRange(w):null,this.newRange=C?u.a.createFromRange(C):null,this._markers=T}get type(){return'marker'}clone(){return new f(this.name,this.oldRange,this.newRange,this._markers,this.baseVersion)}getReversed(){return new f(this.name,this.newRange,this.oldRange,this._markers,this.baseVersion+1)}_execute(){const h=this.newRange?'set':'remove';return this._markers[h](this.name,this.newRange),{name:this.name,type:h}}toJSON(){const h=super.toJSON();return delete h._markers,h}static get className(){return'engine.model.operation.MarkerOperation'}static fromJSON(h,w){return new f(h.name,h.oldRange?u.a.fromJSON(h.oldRange,w):null,h.newRange?u.a.fromJSON(h.newRange,w):null,w.markers,h.baseVersion)}}r.a=f},function(o,r,s){'use strict';var d=s(28),u=s(40);class f extends d.a{get position(){return this.targetPosition}set position(h){this.targetPosition=h}get type(){return'reinsert'}getReversed(){const h=new u.a(this.targetPosition,this.howMany,this.baseVersion+1);return h.targetPosition=this.sourcePosition,h._needsHolderElement=!1,h}static get className(){return'engine.model.operation.ReinsertOperation'}}r.a=f},function(o,r,s){'use strict';var d=s(32),u=s(5),f=s(0),h=s(1);class w extends d.a{constructor(C,T,P,S){super(S),this.position=C,this.oldName=T,this.newName=P}get type(){return'rename'}clone(){return new w(h.a.createFromPosition(this.position),this.oldName,this.newName,this.baseVersion)}getReversed(){return new w(h.a.createFromPosition(this.position),this.newName,this.oldName,this.baseVersion+1)}_execute(){const C=this.position.nodeAfter;if(!(C instanceof u.a))throw new f.a('rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.');else if(C.name!==this.oldName)throw new f.a('rename-operation-wrong-name: Element to change has different name than operation\'s old name.');return this.oldName==this.newName?void 0:(C.name=this.newName,{element:C,oldName:this.oldName})}static get className(){return'engine.model.operation.RenameOperation'}static fromJSON(C,T){return new w(h.a.fromJSON(C.position,T),C.oldName,C.newName,C.baseVersion)}}r.a=w},function(o,r,s){'use strict';var d=s(32),u=s(0);class f extends d.a{constructor(h,w,C,T,P){super(P),this.root=h,this.key=w,this.oldValue=C,this.newValue=T}get type(){return null===this.oldValue?'addRootAttribute':null===this.newValue?'removeRootAttribute':'changeRootAttribute'}clone(){return new f(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new f(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_execute(){if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new u.a('rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new u.a('rootattribute-operation-attribute-exists: The attribute with given key already exists.',{root:this.root,key:this.key});return null===this.newValue?this.root.removeAttribute(this.key):this.root.setAttribute(this.key,this.newValue),{root:this.root,key:this.key,oldValue:this.oldValue,newValue:this.newValue}}static get className(){return'engine.model.operation.RootAttributeOperation'}static fromJSON(h,w){if(!w.hasRoot(h.root))throw new u.a('rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.',{rootName:h});return new f(w.getRoot(h.root),h.key,h.oldValue,h.newValue,h.baseVersion)}}r.a=f},function(o,r,s){'use strict';function d(){if(this.childCount)return null;let w=this.parent;for(;w&&w.is('attributeElement');){if(1'string'==typeof P?new u.a(P):P))}var u=s(29),f=s(4),h=s(43),w=s(7);class C{constructor(T){this._children=[],T&&this.insertChildren(0,T)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(T){return'documentFragment'==T}appendChildren(T){return this.insertChildren(this.childCount,T)}getChild(T){return this._children[T]}getChildIndex(T){return this._children.indexOf(T)}getChildren(){return this._children[Symbol.iterator]()}insertChildren(T,P){this._fireChange('children',this);let S=0;P=d(P);for(let E of P)E.parent=this,this._children.splice(T,0,E),T++,S++;return S}removeChildren(T,P=1){this._fireChange('children',this);for(let S=T;S{this[h](),P()})}}get first(){return this.focusables.find(d)||null}get last(){return this.focusables.filter(d).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let f=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((h,w)=>{const C=h.element===this.focusTracker.focusedElement;return C&&(f=w),C}),f)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(f){f&&f.focus()}_getFocusableItem(f){const h=this.current,w=this.focusables.length;if(!w||null===h)return null;let C=(h+w+f)%w;do{let T=this.focusables.get(C);if(d(T))return T;C=(C+w+f)%w}while(C!==h);return null}}r.a=u},function(o,r,s){'use strict';function d(T){return T.every((P)=>'string'==typeof P)}var u=s(0),f=s(31),h=s(78),w=s(4);class C extends h.a{constructor(T){super({idProperty:'viewUid'}),this.on('add',(P,S,E)=>{S.element&&this._parentElement&&this._parentElement.insertBefore(S.element,this._parentElement.children[E])}),this.on('remove',(P,S)=>{S.element&&this._parentElement&&S.element.remove()}),this.locale=T,this.set('ready',!1),this._parentElement=null}init(){if(this.ready)throw new u.a('ui-viewcollection-init-reinit: This ViewCollection has already been initialized.');return Promise.all(this.map((T)=>T.init())).then(()=>{this.ready=!0})}destroy(){let T=[];for(let P of this)T.push(P.destroy());return Promise.all(T)}add(T,P){super.add(T,P);let S=Promise.resolve();return this.ready&&!T.ready&&(S=S.then(()=>{return T.init()})),S}setParent(T){this._parentElement=T}delegate(...T){if(!T.length||!d(T))throw new u.a('ui-viewcollection-delegate-wrong-events: All event names must be strings.');return{to:(P)=>{for(let S of this)for(let E of T)S.delegate(E).to(P);this.on('add',(S,E)=>{for(let O of T)E.delegate(O).to(P)}),this.on('remove',(S,E)=>{for(let O of T)E.stopDelegating(O,P)})}}}}r.a=C,s.i(w.a)(h.a,f.a)},function(o,r,s){'use strict';function d(w,C){let T=u([w],C);T.sort((P,S)=>P.start.isBefore(S.start)?-1:1);for(let P=1;PF.start.root!=P.graveyard);V&&S.push(V)}S.length&&P.selection.setRanges(S,C)}}r.a=h},function(o,r,s){'use strict';function d(T){var P=-1,S=T?T.length:0;for(this.clear();++P=S||0>Y||G&&X>=K}function N(){var Q=s.i(f.a)();return R(Q)?M(Q):void(H=setTimeout(N,F(Q)))}function M(Q){return(clearTimeout(H),H=void 0,J&&q)?O(Q):(q=z=void 0,$)}function D(){var Q=s.i(f.a)(),Y=R(Q);if(q=arguments,z=this,W=Q,Y){if(void 0===H)return V(W);if(G)return clearTimeout(H),H=setTimeout(N,S),O(W)}return void 0===H&&(H=setTimeout(N,S)),$}var W=0,U=0,Z=!1,G=!1,J=!0,q,z,K,$,H;if('function'!=typeof P)throw new TypeError('Expected a function');return S=s.i(h.a)(S)||0,s.i(u.a)(E)&&(Z=!!E.leading,G='maxWait'in E,K=G?_Mathmax(s.i(h.a)(E.maxWait)||0,S):K,J='trailing'in E?!!E.trailing:J),D.cancel=function(){void 0!==H&&clearTimeout(H),W=U=0,q=z=H=void 0},D.flush=function(){return void 0===H?$:M(s.i(f.a)())},D}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),s.i(u.a)(h,0>w?0:w,T)):[]}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),w=T-w,s.i(u.a)(h,0,0>w?0:w)):[]}},function(o,r){'use strict';r.a=function(u){return u&&u.length?u[0]:void 0}},function(o,r,s){'use strict';var u=s(14),h=Object.prototype,w=h.hasOwnProperty,C=h.toString,T=h.propertyIsEnumerable;r.a=function(P){return s.i(u.a)(P)&&w.call(P,'callee')&&(!T.call(P,'callee')||C.call(P)=='[object Arguments]')}},function(o,r,s){'use strict';var u=s(15),w=Object.prototype,C=w.toString;r.a=function(T){var P=s.i(u.a)(T)?C.call(T):'';return P=='[object Function]'||P=='[object GeneratorFunction]'}},function(o,r,s){'use strict';var u=s(12),f=s(46),w=Object.prototype,C=w.toString;r.a=function(T){return'string'==typeof T||!s.i(u.a)(T)&&s.i(f.a)(T)&&C.call(T)=='[object String]'}},function(o,r,s){'use strict';var u=s(130);r.a=function(f,h){return f&&f.length&&h&&h.length?s.i(u.a)(f,h):f}},function(o,r,s){'use strict';var u=s(191),f=s(27),h=s(98);r.a=function(w,C){if(!(w&&w.length))return[];var T=s.i(h.a)(w);return null==C?T:s.i(f.a)(T,function(P){return s.i(u.a)(C,void 0,P)})}},function(o,r,s){'use strict';var u=s(97),f=s(270);r.a=function(h){return s.i(u.a)(h)?s.i(f.a)(h):new Map(h)}},function(o,r){'use strict';function f(O,V){O.setCustomProperty(P,V)}function C(){return null}r.b=function(O){return!!O.getCustomProperty(T)},r.a=function(O,V){return V=V||{},O.setAttribute('contenteditable',!1),O.getFillerOffset=C,O.addClass(S),O.setCustomProperty(T,!0),V.label&&f(O,V.label),O},r.e=function(O){const V=O.getCustomProperty(P);return V?'function'==typeof V?V():V:''},r.c=function(O){return O.setAttribute('contenteditable','true'),O.addClass('ck-editable'),O.on('change:isFocused',(V,F,R)=>{R?O.addClass('ck-editable_focused'):O.removeClass('ck-editable_focused')}),O};const T=Symbol('isWidget'),P=Symbol('label'),S='ck-widget';r.d='ck-widget_selected'},function(o,r,s){'use strict';var d=s(2),u=s(37),f=s(38),h=s(155);const w='bold';class C extends d.a{init(){const T=this.editor,P=T.data,S=T.editing;T.document.schema.allow({name:'$inline',attributes:[w]}),s.i(u.a)().for(P.modelToView,S.modelToView).fromAttribute(w).toElement('strong'),s.i(f.a)().for(P.viewToModel).fromElement('strong').fromElement('b').fromAttribute('style',{'font-weight':'bold'}).toAttribute(w,!0),T.commands.set(w,new h.a(T,w))}}r.a=C},function(o,r,s){'use strict';var d=s(2),u=s(37),f=s(38),h=s(155);const w='italic';class C extends d.a{init(){const T=this.editor,P=T.data,S=T.editing;T.document.schema.allow({name:'$inline',attributes:[w]}),s.i(u.a)().for(P.modelToView,S.modelToView).fromAttribute(w).toElement('em'),s.i(f.a)().for(P.viewToModel).fromElement('em').fromElement('i').fromAttribute('style',{'font-style':'italic'}).toAttribute(w,!0),T.commands.set(w,new h.a(T,w))}}r.a=C},function(o,r,s){'use strict';var u=s(33);r.a=function(f,h,w){if(h.isCollapsed)return w.check({name:'$text',inside:h.getFirstPosition(),attributes:f});const C=h.getRanges();for(let T of C){const P=new u.a({boundaries:T,mergeCharacters:!0});for(let S=P.position,E=P.next();!E.done;){const O=E.value.item.name||'$text';if(w.check({name:O,inside:S,attributes:f}))return!0;S=P.position,E=P.next()}}return!1}},function(o,r,s){'use strict';var d=s(11),u=s(99),f=s(154);class h extends d.a{constructor(w,C){super(w),this.attributeKey=C,this.set('value',!1),this.listenTo(this.editor.document.selection,'change:attribute',()=>{this.value=this.editor.document.selection.hasAttribute(this.attributeKey)})}_checkEnabled(){const w=this.editor.document;return s.i(f.a)(this.attributeKey,w.selection,w.schema)}_doExecute(w={}){const C=this.editor.document,T=C.selection,P=w.forceValue===void 0?!this.value:w.forceValue;C.enqueueChanges(()=>{if(T.isCollapsed)P?T.setAttribute(this.attributeKey,!0):T.removeAttribute(this.attributeKey);else{const S=s.i(u.a)(this.attributeKey,T.getRanges(),C.schema),E=w.batch||C.batch();for(let O of S)P?E.setAttribute(O,this.attributeKey,P):E.removeAttribute(O,this.attributeKey)}})}}r.a=h},function(o,r,s){'use strict';var d=s(1),u=s(3),f=s(26),h=s(34),w=s(29),C=s(7),T=s(4);class P{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this.on('modelToViewPosition',(S,E)=>{if(!E.viewPosition){let O=this._modelToViewMapping.get(E.modelPosition.parent);E.viewPosition=this._findPositionIn(O,E.modelPosition.offset)}},{priority:'low'}),this.on('viewToModelPosition',(S,E)=>{if(E.modelPosition)return;let O=E.viewPosition.parent,V=this._viewToModelMapping.get(O);for(;!V;)O=O.parent,V=this._viewToModelMapping.get(O);let F=this._toModelOffset(E.viewPosition.parent,E.viewPosition.offset,O);E.modelPosition=d.a.createFromParentAndOffset(V,F)},{priority:'low'})}bindElements(S,E){this._modelToViewMapping.set(S,E),this._viewToModelMapping.set(E,S)}unbindViewElement(S){const E=this.toModelElement(S);this._unbindElements(E,S)}unbindModelElement(S){const E=this.toViewElement(S);this._unbindElements(S,E)}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap}toModelElement(S){return this._viewToModelMapping.get(S)}toViewElement(S){return this._modelToViewMapping.get(S)}toModelRange(S){return new u.a(this.toModelPosition(S.start),this.toModelPosition(S.end))}toViewRange(S){return new h.a(this.toViewPosition(S.start),this.toViewPosition(S.end))}toModelPosition(S){const E={viewPosition:S,mapper:this};return this.fire('viewToModelPosition',E),E.modelPosition}toViewPosition(S){const E={modelPosition:S,mapper:this};return this.fire('modelToViewPosition',E),E.viewPosition}registerViewToModelLength(S,E){this._viewToModelLengthCallbacks.set(S,E)}_toModelOffset(S,E,O){if(O!=S){const F=this._toModelOffset(S.parent,S.index,O),R=this._toModelOffset(S,E,S);return F+R}if(S.is('text'))return E;let V=0;for(let F=0;F{const N=V.selection;if(!N.isCollapsed&&F.consume(N,'selection')){R.viewSelection.removeAllRanges();for(let M of N.getRanges()){const I=R.mapper.toViewRange(M);R.viewSelection.addRange(I,N.isBackward)}}}},r.f=function(){return(O,V,F,R)=>{const N=V.selection;if(N.isCollapsed&&F.consume(N,'selection')){const M=N.getFirstPosition(),I=R.mapper.toViewPosition(M),L=E.a.breakAttributes(I);R.viewSelection.removeAllRanges(),R.viewSelection.addRange(new S.a(L,L))}}},r.a=function(O){return(V,F,R,N)=>{const M=O instanceof P.a?O.clone(!0):O(F.value,F,F.selection,R,N);if(M){const I='selectionAttribute:'+F.key;w(F.selection,N.viewSelection,M,R,I)}}},r.b=function(O){return(V,F,R,N)=>{const M=O instanceof P.a?O.clone(!0):O(F,R,N);if(M){const I='selectionMarker:'+F.name;w(F.selection,N.viewSelection,M,R,I)}}},r.c=function(){return(O,V,F,R)=>{for(let N of R.viewSelection.getRanges())N.isCollapsed&&N.end.parent.document&&E.a.mergeAttributes(N.start);R.viewSelection.removeAllRanges()}},r.d=function(){return(O,V,F,R)=>R.viewSelection.setFake(!1)}},function(o,r,s){'use strict';var d=s(300),u=s(3),f=s(1),h=s(49),w=s(7),C=s(4),T=s(45);class P{constructor(S,E={}){this._modelDocument=S,this.conversionApi=s.i(T.a)({dispatcher:this},E)}convertChange(S,E){'remove'!==S&&E.range&&'$graveyard'==E.range.root.rootName||'remove'==S&&'$graveyard'==E.sourcePosition.root.rootName||'rename'==S&&'$graveyard'==E.element.root.rootName||('insert'==S||'reinsert'==S?this.convertInsertion(E.range):'move'==S?this.convertMove(E.sourcePosition,E.range):'remove'==S?this.convertRemove(E.sourcePosition,E.range):'addAttribute'==S||'removeAttribute'==S||'changeAttribute'==S?this.convertAttribute(S,E.range,E.key,E.oldValue,E.newValue):'rename'==S&&this.convertRename(E.element,E.oldName))}convertInsertion(S){const E=this._createInsertConsumable(S);for(let O of S){const V=O.item,F=u.a.createFromPositionAndShift(O.previousPosition,O.length),R={item:V,range:F};this._testAndFire('insert',R,E);for(let N of V.getAttributeKeys())R.attributeKey=N,R.attributeOldValue=null,R.attributeNewValue=V.getAttribute(N),this._testAndFire(`addAttribute:${N}`,R,E)}for(let O of this._modelDocument.markers){const V=O.getRange();V.containsPosition(S.start)&&this.convertMarker('addMarker',O.name,V.getIntersection(S)),(S.containsRange(V)||S.isEqual(V))&&this.convertMarker('addMarker',O.name,V)}}convertMove(S,E){if(E.start.isBefore(S)){this.convertInsertion(E);const O=S._getTransformedByInsertion(E.start,E.end.offset-E.start.offset);this.convertRemove(O,E)}else this.convertRemove(S,E),this.convertInsertion(E)}convertRemove(S,E){const O=this._createConsumableForRange(E,'remove');for(let V of E.getItems({shallow:!0})){this._testAndFire(`remove`,{sourcePosition:S,item:V},O)}}convertAttribute(S,E,O,V,F){const R=this._createConsumableForRange(E,S+':'+O);for(let N of E){const M=N.item,I=u.a.createFromPositionAndShift(N.previousPosition,N.length);this._testAndFire(`${S}:${O}`,{item:M,range:I,attributeKey:O,attributeOldValue:V,attributeNewValue:F},R)}}convertRename(S,E){const O=S.clone(!0);O.name=E,this.conversionApi.mapper.bindElements(O,this.conversionApi.mapper.toViewElement(S));const V=new h.a;V.appendChildren(O),this.convertRemove(f.a.createBefore(S),u.a.createOn(O)),this.convertInsertion(u.a.createOn(S))}convertSelection(S){const E=Array.from(this._modelDocument.markers.getMarkersAtPosition(S.getFirstPosition())),O=this._createSelectionConsumable(S,E);this.fire('selection',{selection:S},O,this.conversionApi);for(let V of E){const F={selection:S,name:V.name};O.test(S,'selectionMarker:'+V.name)&&this.fire('selectionMarker:'+V.name,F,O,this.conversionApi)}for(let V of S.getAttributeKeys()){const F={selection:S,key:V,value:S.getAttribute(V)};O.test(S,'selectionAttribute:'+F.key)&&this.fire('selectionAttribute:'+F.key,F,O,this.conversionApi)}}convertMarker(S,E,O){if(O.root.document&&'$graveyard'!=O.root.rootName){const V=this._createMarkerConsumable(S,O);this.fire(S+':'+E,{name:E,range:O},V,this.conversionApi)}}_createInsertConsumable(S){const E=new d.a;for(let O of S){const V=O.item;E.add(V,'insert');for(let F of V.getAttributeKeys())E.add(V,'addAttribute:'+F)}return E}_createConsumableForRange(S,E){const O=new d.a;for(let V of S.getItems())O.add(V,E);return O}_createSelectionConsumable(S,E){const O=new d.a;O.add(S,'selection');for(let V of E)O.add(S,'selectionMarker:'+V.name);for(let V of S.getAttributeKeys())O.add(S,'selectionAttribute:'+V);return O}_createMarkerConsumable(S,E){const O=new d.a;return O.add(E,S),O}_testAndFire(S,E,O){if(O.test(E.item,S)){const V=E.item.name||'$text';this.fire(S+':'+V,E,O,this.conversionApi)}}}r.a=P,s.i(C.a)(P,w.a)},function(o,r,s){'use strict';var d=s(305),u=s(164),f=s(59);r.a=class{constructor(){this._domParser=new DOMParser,this._domConverter=new u.a({blockFiller:f.a}),this._htmlWriter=new d.a}toData(w){const C=this._domConverter.viewToDom(w,document);return this._htmlWriter.getHtml(C)}toView(w){const C=this._toDom(w);return this._domConverter.domToView(C)}_toDom(w){const C=this._domParser.parseFromString(w,'text/html'),T=C.createDocumentFragment(),P=C.body.childNodes;for(;0{S.has(O)&&u.call(this,O,V.range,V.sourcePosition)},{priority:'high'})}function u(S,E,O){let V=E.end.offset-E.start.offset,F;switch(S){case'insert':let R='sticksToNext'==this.stickiness;F=this._getTransformedByInsertion(E.start,V,R);break;case'move':case'remove':case'reinsert':let N=h.a.createFromPositionAndShift(O,V),M=N.containsPosition(this)||N.start.isEqual(this)&&'sticksToNext'==this.stickiness||N.end.isEqual(this)&&'sticksToPrevious'==this.stickiness;if(M)F=this._getCombined(O,E.start);else{let I='sticksToNext'==this.stickiness;F=this._getTransformedByMove(O,E.start,V,I)}}if(!this.isEqual(F)){const R=f.a.createFromPosition(this);this.path=F.path,this.root=F.root,this.fire('change',R)}}var f=s(1),h=s(3),w=s(7),C=s(4),T=s(0);class P extends f.a{constructor(S,E,O){if(super(S,E),!this.root.is('rootElement'))throw new T.a('model-liveposition-root-not-rootelement: LivePosition root has to be an instance of RootElement.');this.stickiness=O||'sticksToNext',d.call(this)}detach(){this.stopListening()}}r.a=P,s.i(C.a)(P,w.a)},function(o,r,s){'use strict';function d(R,N,M){let I=s.i(O.a)(R);return M&&(I=I.slice(I.indexOf(M)+1)),I.some((L)=>L.tagName&&N.includes(L.tagName.toLowerCase()))}var u=s(29),f=s(21),h=s(26),w=s(34),C=s(61),T=s(115),P=s(51),S=s(59),E=s(391),O=s(186),V=s(388);r.a=class{constructor(R={}){this.blockFiller=R.blockFiller||S.b,this.preElements=['pre'],this.blockElements=['p','div','h1','h2','h3','h4','h5','h6'],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(R,N){this._fakeSelectionMapping.set(R,C.a.createFromSelection(N))}fakeSelectionToView(R){return this._fakeSelectionMapping.get(R)}bindElements(R,N){this._domToViewMapping.set(R,N),this._viewToDomMapping.set(N,R)}unbindDomElement(R){const N=this._domToViewMapping.get(R);if(N){this._domToViewMapping.delete(R),this._viewToDomMapping.delete(N);for(let M of R.childNodes)this.unbindDomElement(M)}}bindDocumentFragments(R,N){this._domToViewMapping.set(R,N),this._viewToDomMapping.set(N,R)}viewToDom(R,N,M={}){if(R.is('text')){const I=this._processDataFromViewText(R);return N.createTextNode(I)}if(this.getCorrespondingDom(R))return this.getCorrespondingDom(R);let I;if(R.is('documentFragment'))I=N.createDocumentFragment(),M.bind&&this.bindDocumentFragments(I,R);else{I=N.createElement(R.name),M.bind&&this.bindElements(I,R);for(let L of R.getAttributeKeys())I.setAttribute(L,R.getAttribute(L))}if(M.withChildren||void 0===M.withChildren)for(let L of this.viewChildrenToDom(R,N,M))I.appendChild(L);return I}*viewChildrenToDom(R,N,M={}){let I=R.getFillerOffset&&R.getFillerOffset(),L=0;for(let D of R.getChildren())I===L&&(yield this.blockFiller(N)),yield this.viewToDom(D,N,M),L++;I===L&&(yield this.blockFiller(N))}viewRangeToDom(R){const N=this.viewPositionToDom(R.start),M=this.viewPositionToDom(R.end),I=new Range;return I.setStart(N.parent,N.offset),I.setEnd(M.parent,M.offset),I}viewPositionToDom(R){const N=R.parent;if(N.is('text')){const M=this.getCorrespondingDomText(N);if(!M)return null;let I=R.offset;return s.i(S.c)(M)&&(I+=S.d),{parent:M,offset:I}}let M,I,L;if(0===R.offset){if(M=this.getCorrespondingDom(R.parent),!M)return null;L=M.childNodes[0]}else{if(I=this.getCorrespondingDom(R.nodeBefore),!I)return null;M=I.parentNode,L=I.nextSibling}if(this.isText(L)&&s.i(S.c)(L))return{parent:L,offset:S.d};const D=I?s.i(E.a)(I)+1:0;return{parent:M,offset:D}}domToView(R,N={}){if(s.i(S.e)(R,this.blockFiller))return null;if(this.isText(R)){if(s.i(S.f)(R))return null;const M=this._processDataFromDomText(R);return''===M?null:new u.a(M)}if(this.getCorrespondingView(R))return this.getCorrespondingView(R);let M;if(this.isDocumentFragment(R))M=new T.a,N.bind&&this.bindDocumentFragments(R,M);else{const I=N.keepOriginalCase?R.tagName:R.tagName.toLowerCase();M=new f.a(I),N.bind&&this.bindElements(R,M);const L=R.attributes;for(let D=L.length-1;0<=D;D--)M.setAttribute(L[D].name,L[D].value)}if(N.withChildren||void 0===N.withChildren)for(let I of this.domChildrenToView(R,N))M.appendChildren(I);return M}*domChildrenToView(R,N={}){for(let M=0;MI?0:I),new h.a(M,I)):null}if(0===N){const M=this.getCorrespondingView(R);if(M)return new h.a(M,0)}else{const M=this.getCorrespondingView(R.childNodes[N-1]);if(M&&M.parent)return new h.a(M.parent,M.index+1)}return null}getCorrespondingView(R){if(this.isElement(R))return this.getCorrespondingViewElement(R);return this.isDocumentFragment(R)?this.getCorrespondingViewDocumentFragment(R):this.isText(R)?this.getCorrespondingViewText(R):null}getCorrespondingViewElement(R){return this._domToViewMapping.get(R)}getCorrespondingViewDocumentFragment(R){return this._domToViewMapping.get(R)}getCorrespondingViewText(R){if(s.i(S.f)(R))return null;const N=R.previousSibling;if(N){if(!this.isElement(N))return null;const M=this.getCorrespondingViewElement(N);if(M){const I=M.nextSibling;return I instanceof u.a?M.nextSibling:null}}else{const M=this.getCorrespondingViewElement(R.parentNode);if(M){const I=M.getChild(0);return I instanceof u.a?I:null}}return null}getCorrespondingDom(R){if(R instanceof f.a)return this.getCorrespondingDomElement(R);return R instanceof T.a?this.getCorrespondingDomDocumentFragment(R):R instanceof u.a?this.getCorrespondingDomText(R):null}getCorrespondingDomElement(R){return this._viewToDomMapping.get(R)}getCorrespondingDomDocumentFragment(R){return this._viewToDomMapping.get(R)}getCorrespondingDomText(R){const N=R.previousSibling;return N&&this.getCorrespondingDom(N)?this.getCorrespondingDom(N).nextSibling:!N&&R.parent&&this.getCorrespondingDom(R.parent)?this.getCorrespondingDom(R.parent).childNodes[0]:null}focus(R){const N=this.getCorrespondingDomElement(R);N&&N.ownerDocument.activeElement!==N&&N.focus()}isText(R){return R&&R.nodeType==Node.TEXT_NODE}isElement(R){return R&&R.nodeType==Node.ELEMENT_NODE}isDocumentFragment(R){return R&&R.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isDomSelectionBackward(R){if(R.isCollapsed)return!1;const N=new Range;N.setStart(R.anchorNode,R.anchorOffset),N.setEnd(R.focusNode,R.focusOffset);const M=N.collapsed;return N.detach(),M}_processDataFromViewText(R){let N=R.data;if(R.getAncestors().some((q)=>this.preElements.includes(q.name)))return N;const M=this._getTouchingViewTextNode(R,!1),I=this._getTouchingViewTextNode(R,!0);let L=N.match(/ *$/)[0],D=N.substr(0,N.length-L.length);if(M&&' '!=M.data.charAt(M.data.length-1)||(D=D.replace(/^ /,'\xA0')),D=D.replace(/ /g,' \xA0'),0{const F=P.document.selection.getFirstPosition().parent,R=V.batch,N=E.some((M)=>F.is(M.modelElement));N&&!F.is(C)&&0===F.childCount&&R.rename(F,C)})}}r.a=T},function(o,r,s){'use strict';function d(){return new C.a('figure',{class:'image'},new T.a('img'))}var u=s(2),f=s(37),h=s(333),w=s(42),C=s(41),T=s(165);class P extends u.a{init(){const S=this.editor,E=S.document,O=E.schema,V=S.data,F=S.editing,R=S.t;O.registerItem('image'),O.requireAttributes('image',['src']),O.allow({name:'image',attributes:['alt','src'],inside:'$root'}),O.objects.add('image'),s.i(f.a)().for(V.modelToView).fromElement('image').toElement(()=>d()),s.i(f.a)().for(F.modelToView).fromElement('image').toElement(()=>s.i(w.c)(d(),R('image widget'))),s.i(h.a)([F.modelToView,V.modelToView],'src'),s.i(h.a)([F.modelToView,V.modelToView],'alt'),V.viewToModel.on('element:figure',s.i(h.b)())}}r.a=P},function(o,r,s){'use strict';var d=s(494),u=s(63),f=s(182),h=s(42);const w=f.a.arrowVerticalOffset,C={south(P,S){return{top:P.bottom+w,left:P.left+P.width/2-S.width/2,name:'s'}},north(P,S){return{top:P.top-S.height-w,left:P.left+P.width/2-S.width/2,name:'n'}}};class T extends f.a{constructor(P){super(P.locale),this.editor=P;const S=P.editing.view;this.listenTo(P.ui.focusTracker,'change:isFocused',(E,O,V,F)=>{F&&!V&&this.detach()}),P.listenTo(S,'render',()=>{const E=S.selection.getSelectedElement();E&&s.i(h.a)(E)||this.detach()},{priority:'low'}),this._throttledAttach=s.i(d.a)(()=>{this._attach()},100)}init(){return this.editor.ui.focusTracker.add(this.element),super.init()}attach(){this._attach(),this.editor.ui.view.listenTo(u.a.window,'scroll',this._throttledAttach),this.editor.ui.view.listenTo(u.a.window,'resize',this._throttledAttach)}detach(){this.hide(),this.editor.ui.view.stopListening(u.a.window,'scroll',this._throttledAttach),this.editor.ui.view.stopListening(u.a.window,'resize',this._throttledAttach)}_attach(){const P=this.editor.editing.view;this.attachTo({target:P.domConverter.viewRangeToDom(P.selection.getFirstRange()),positions:[C.north,C.south]})}}r.a=T},function(o,r,s){'use strict';var d=s(6),u=s(2),f=s(183),h=s(42),w=s(172);class C extends u.a{static get pluginName(){return'image/imagetoolbar'}constructor(T){super(T),T.config.set('image.defaultToolbar',[]),this.isEnabled=!0}afterInit(){const T=this.editor,P=T.config.get('image.toolbar')||T.config.get('image.defaultToolbar');if(P.length){const S=this._panel=new w.a(T),E=[],O=new f.a;return d.a.extend(S.template,{attributes:{class:['ck-toolbar__container']}}),E.push(S.content.add(O)),E.push(O.fillFromConfig(P,T.ui.componentFactory)),E.push(T.ui.view.body.add(S)),this.listenTo(this.editor.editing.view,'render',()=>{this.isEnabled&&this.show()},{priority:'low'}),this.listenTo(T.ui.focusTracker,'change:isFocused',(V,F,R,N)=>{!N&&R&&this.isEnabled&&this.show()}),Promise.all(E)}}show(){const T=this.editor.editing.view.selection.getSelectedElement();T&&s.i(h.a)(T)&&this._panel.attach()}hide(){this._panel.detach()}}r.a=C},function(o,r,s){'use strict';function u(w,C,T){let P=w.textNode||(T?w.nodeBefore:w.nodeAfter),S=null;for(;P&&P.getAttribute('linkHref')==C;)S=P,P=T?P.previousSibling:P.nextSibling;return S?h.a.createAt(S,T?'before':'after'):w}var f=s(3),h=s(1);r.a=function(w,C){return new f.a(u(w,C,!0),u(w,C,!1))}},function(o,r,s){'use strict';var d=s(114);class u extends d.a{}r.a=u},function(o,r,s){'use strict';function d(P){let S=1;for(let E of P.getChildren())if('ul'==E.name||'ol'==E.name)for(let O of E.getChildren())S+=d(O);return S}var u=s(353),f=s(351),h=s(2),w=s(77),C=s(350);class T extends h.a{static get requires(){return[w.a]}init(){const P=this.editor,S=P.document.schema;S.registerItem('listItem','$block'),S.allow({name:'listItem',inside:'$root',attributes:['type','indent']}),S.requireAttributes('listItem',['type','indent']);const E=P.data,O=P.editing;this.editor.document.on('change',s.i(C.a)(this.editor.document),{priority:'high'}),this.editor.document.on('change',(V,F,R)=>{if('move'==F)for(let N of R.range.getItems())N.is('listItem')&&O.mapper.unbindModelElement(N)},{priority:'high'}),O.mapper.registerViewToModelLength('li',d),E.mapper.registerViewToModelLength('li',d),O.mapper.on('modelToViewPosition',C.b),O.mapper.on('viewToModelPosition',C.c),E.mapper.on('modelToViewPosition',C.b),O.modelToView.on('insert',C.d,{priority:'high'}),O.modelToView.on('insert:listItem',C.e),E.modelToView.on('insert',C.d,{priority:'high'}),E.modelToView.on('insert:listItem',C.e),O.modelToView.on('changeAttribute:type:listItem',C.f),E.modelToView.on('changeAttribute:type:listItem',C.f),O.modelToView.on('remove:listItem',C.g),O.modelToView.on('remove',C.h,{priority:'low'}),E.modelToView.on('remove:listItem',C.g),E.modelToView.on('remove',C.h,{priority:'low'}),O.modelToView.on('changeAttribute:indent:listItem',C.i),E.modelToView.on('changeAttribute:indent:listItem',C.i),E.viewToModel.on('element:ul',C.j,{priority:'high'}),E.viewToModel.on('element:ol',C.j,{priority:'high'}),E.viewToModel.on('element:li',C.k,{priority:'high'}),E.viewToModel.on('element:li',C.l),P.commands.set('numberedList',new u.a(P,'numbered')),P.commands.set('bulletedList',new u.a(P,'bulleted')),P.commands.set('indentList',new f.a(P,'forward')),P.commands.set('outdentList',new f.a(P,'backward'))}}r.a=T},function(o,r,s){'use strict';var d=s(184);class u{constructor(f,h=20){this.document=f,this.size=0,this.limit=h,this.isLocked=!1,this._changeCallback=(w,C,T,P)=>{this._onBatch(P)},this._selectionChangeCallback=()=>{this._reset()},f.on('change',this._changeCallback),f.selection.on('change:range',this._selectionChangeCallback),f.selection.on('change:attribute',this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.document.batch()),this._batch}input(f){this.size+=f,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.document.off('change',this._changeCallback),this.document.selection.off('change:range',this._selectionChangeCallback),this.document.selection.off('change:attribute',this._selectionChangeCallback)}_onBatch(f){'transparent'!=f.type&&f!==this._batch&&1>=s.i(d.a)(f.getOperations())&&this._reset(!0)}_reset(f){(!this.isLocked||f)&&(this._batch=null,this.size=0)}}r.a=u},function(o,r){'use strict';r.a=function({emitter:u,activator:f,callback:h,contextElement:w}){u.listenTo(document,'mouseup',(C,{target:T})=>{f()&&!w.contains(T)&&h()})}},function(o,r){'use strict';r.a=function({view:u}){u.listenTo(u.element,'submit',(f,h)=>{h.preventDefault(),u.fire('submit')},{useCapture:!0})}},function(o,r,s){'use strict';var d=s(9),u=s(6);class f extends d.a{constructor(h){super(h),this.set('value'),this.set('id');const w=this.bindTemplate;this.template=new u.a({tag:'input',attributes:{type:'text',class:['ck-input','ck-input-text'],id:w.to('id')}}),this.on('change:value',(C,T,P)=>this.element.value=P||'')}select(){this.element.select()}focus(){this.element.focus()}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(70),h=s(375);class w extends d.a{constructor(C,T){super(C);const P=`ck-input-${s.i(f.a)()}`;this.set('label'),this.set('value'),this.labelView=this._createLabelView(P),this.inputView=this._createInputView(T,P),this.template=new u.a({tag:'div',children:[this.labelView,this.inputView]})}_createLabelView(C){const T=new h.a(this.locale);return T.for=C,T.bind('text').to(this,'label'),T}_createInputView(C,T){const P=new C(this.locale);return P.id=T,P.bind('value').to(this),P}select(){this.inputView.select()}focus(){this.inputView.focus()}}r.a=w},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(394),h=s(187);const w=s.i(h.a)('px');class C extends d.a{constructor(T){super(T);const P=this.bindTemplate;this.set('top',0),this.set('left',0),this.set('position','se'),this.set('isVisible',!1),this.content=this.createCollection(),this.template=new u.a({tag:'div',attributes:{class:['ck-balloon-panel',P.to('position',(S)=>`ck-balloon-panel_arrow_${S}`),P.if('isVisible','ck-balloon-panel_visible')],style:{top:P.to('top',w),left:P.to('left',w),maxWidth:P.to('maxWidth',w)},tabindex:-1},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(T){this.show();const P=C.defaultPositions,S=Object.assign({},{element:this.element,positions:[P.se,P.sw,P.ne,P.nw],limiter:document.body,fitInViewport:!0},T),{top:E,left:O,name:V}=s.i(f.a)(S);Object.assign(this,{top:E,left:O,position:V})}}r.a=C,C.arrowHorizontalOffset=30,C.arrowVerticalOffset=15,C.defaultPositions={se:(T)=>({top:T.bottom+C.arrowVerticalOffset,left:T.left+T.width/2-C.arrowHorizontalOffset,name:'se'}),sw:(T,P)=>({top:T.bottom+C.arrowVerticalOffset,left:T.left+T.width/2-P.width+C.arrowHorizontalOffset,name:'sw'}),ne:(T,P)=>({top:T.top-P.height-C.arrowVerticalOffset,left:T.left+T.width/2-C.arrowHorizontalOffset,name:'ne'}),nw:(T,P)=>({top:T.top-P.height-C.arrowVerticalOffset,left:T.left+T.width/2-P.width+C.arrowHorizontalOffset,name:'nw'})}},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(65),h=s(117),w=s(66),C=s(381);class T extends d.a{constructor(P){super(P),this.items=this.createCollection(),this.focusTracker=new f.a,this.keystrokes=new w.a,this._focusCycler=new h.a({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:['arrowleft','arrowup'],focusNext:['arrowright','arrowdown']}}),this.template=new u.a({tag:'div',attributes:{class:['ck-toolbar']},children:this.items}),this.items.on('add',(S,E)=>{this.focusTracker.add(E.element)}),this.items.on('remove',(S,E)=>{this.focusTracker.remove(E.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}fillFromConfig(P,S){return P?Promise.all(P.map((E)=>{const O='|'==E?new C.a:S.create(E);return this.items.add(O)})):Promise.resolve()}}r.a=T},function(o,r){'use strict';r.a=function(u){let f=0;for(let h of u)f++;return f}},function(o,r){'use strict';r.a=function(u,f,h){function w(N){const M=(V[N-1]===void 0?-1:V[N-1])+1,I=V[N+1]===void 0?-1:V[N+1],L=M>I?-1:1;O[N+L]&&(O[N]=O[N+L].slice(0)),O[N]||(O[N]=[]),O[N].push(M>I?C:T);let D=_Mathmax(M,I),q=D-N;for(;qE;R--)V[R]=w(R);V[E]=w(E),F++}while(V[E]!==S);return O[E].slice(1)}},function(o,r){'use strict';r.a=function(u){const f=[];for(;u&&u.nodeType!=Node.DOCUMENT_NODE;)f.unshift(u),u=u.parentNode;return f}},function(o,r){'use strict';r.a=function(u){return(f)=>f+u}},function(o,r,s){'use strict';var d=s(52),u=s(30),f=s.i(d.a)(u.a,'Map');r.a=f},function(o,r,s){'use strict';var d=s(52),u=s(30),f=s.i(d.a)(u.a,'Set');r.a=f},function(o,r,s){'use strict';var d=s(30),u=d.a.Uint8Array;r.a=u},function(o,r){'use strict';r.a=function(u,f,h){var w=h.length;return 0===w?u.call(f):1===w?u.call(f,h[0]):2===w?u.call(f,h[0],h[1]):3===w?u.call(f,h[0],h[1],h[2]):u.apply(f,h)}},function(o,r){'use strict';r.a=function(u,f,h,w){var C=-1,T=u.length;for(w&&T&&(h=u[++C]);++CF))return!1;var N=O.get(C);if(N)return N==T;var M=-1,I=!0,L=E&1?new u.a:void 0;for(O.set(C,T);++MP)return[];for(var O=0,V=0,F=Array(w(E/P));OT&&(T=_Mathmax(P+T,0)),s.i(u.a)(w,C,T)):-1}},function(o,r,s){'use strict';var u=s(143);r.a=function(f){return s.i(u.a)(f,1)}},function(o,r,s){'use strict';var d=s(27),u=s(127),f=s(135),h=s(8),w=s.i(h.a)(function(C){var T=s.i(d.a)(C,f.a);return T.length&&T[0]===C[0]?s.i(u.a)(T):[]});r.a=w},function(o,r,s){'use strict';var d=s(27),u=s(127),f=s(10),h=s(135),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P),E=s.i(d.a)(P,h.a);return S===s.i(w.a)(E)?S=void 0:E.pop(),E.length&&E[0]===P[0]?s.i(u.a)(E,s.i(f.a)(S)):[]});r.a=T},function(o,r,s){'use strict';var d=s(27),u=s(127),f=s(135),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T),S=s.i(d.a)(T,f.a);return P===s.i(h.a)(S)?P=void 0:S.pop(),S.length&&S[0]===T[0]?s.i(u.a)(S,void 0,P):[]});r.a=C},function(o,r,s){'use strict';var u=s(146),f=s(89),h=s(15),w=s(207),C=/[\\^$.*+?()[\]{}|]/g,T=/^\[object .+?Constructor\]$/,P=Object.prototype,S=Function.prototype.toString,E=P.hasOwnProperty,O=RegExp('^'+S.call(E).replace(C,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');r.a=function(V){if(!s.i(h.a)(V))return!1;var F=s.i(u.a)(V)||s.i(f.a)(V)?O:T;return F.test(s.i(w.a)(V))}},function(o,r){'use strict';var u=Array.prototype,f=u.join;r.a=function(h,w){return h?f.call(h,w):''}},function(o,r,s){'use strict';var u=s(204),f=s(16);r.a=function(C,T,P){var S=C?C.length:0;if(!S)return-1;var E=S;if(void 0!==P&&(E=s.i(f.a)(P),E=(0>E?_Mathmax(S+E,0):_Mathmin(E,S-1))+1),T!==T)return s.i(u.a)(C,E,!0);for(;E--;)if(C[E]===T)return E;return-1}},function(o,r,s){'use strict';var u=s(424),f=s(16);r.a=function(h,w){return h&&h.length?s.i(u.a)(h,s.i(f.a)(w)):void 0}},function(o,r,s){'use strict';var d=s(148),u=s(8),f=s.i(u.a)(d.a);r.a=f},function(o,r,s){'use strict';var u=s(10),f=s(130);r.a=function(h,w,C){return h&&h.length&&w&&w.length?s.i(f.a)(h,w,s.i(u.a)(C)):h}},function(o,r,s){'use strict';var u=s(130);r.a=function(f,h,w){return f&&f.length&&h&&h.length?s.i(u.a)(f,h,void 0,w):f}},function(o,r,s){'use strict';var d=s(27),u=s(411),f=s(24),h=s(196),w=s(437),C=s(36),T=s(8),P=s.i(T.a)(function(S,E){E=s.i(f.a)(E,1);var O=S?S.length:0,V=s.i(u.a)(S,E);return s.i(h.a)(S,s.i(d.a)(E,function(F){return s.i(C.a)(F,O)?+F:F}).sort(w.a)),V});r.a=P},function(o,r,s){'use strict';var u=s(10),f=s(196);r.a=function(h,w){var C=[];if(!(h&&h.length))return C;var T=-1,P=[],S=h.length;for(w=s.i(u.a)(w,3);++Tw?0:w)):[]}},function(o,r,s){'use strict';var u=s(35),f=s(16);r.a=function(h,w,C){var T=h?h.length:0;return T?(w=C||void 0===w?1:s.i(f.a)(w),w=T-w,s.i(u.a)(h,0>w?0:w,T)):[]}},function(o,r,s){'use strict';var u=s(10),f=s(86);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w,3),!1,!0):[]}},function(o,r,s){'use strict';var u=s(10),f=s(86);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w,3)):[]}},function(o,r,s){'use strict';var u=s(146),f=s(15),h=s(47),w=0/0,C=/^\s+|\s+$/g,T=/^[-+]0x[0-9a-f]+$/i,P=/^0b[01]+$/i,S=/^0o[0-7]+$/i,E=parseInt;r.a=function(O){if('number'==typeof O)return O;if(s.i(h.a)(O))return w;if(s.i(f.a)(O)){var V=s.i(u.a)(O.valueOf)?O.valueOf():O;O=s.i(f.a)(V)?V+'':V}if('string'!=typeof O)return 0===O?O:+O;O=O.replace(C,'');var F=P.test(O);return F||S.test(O)?E(O.slice(2),F?2:8):T.test(O)?w:+O}},function(o,r,s){'use strict';var d=s(24),u=s(44),f=s(14),h=s(8),w=s.i(h.a)(function(C){return s.i(u.a)(s.i(d.a)(C,1,f.a,!0))});r.a=w},function(o,r,s){'use strict';var d=s(24),u=s(10),f=s(44),h=s(14),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P);return s.i(h.a)(S)&&(S=void 0),s.i(f.a)(s.i(d.a)(P,1,h.a,!0),s.i(u.a)(S))});r.a=T},function(o,r,s){'use strict';var d=s(24),u=s(44),f=s(14),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T);return s.i(f.a)(P)&&(P=void 0),s.i(u.a)(s.i(d.a)(T,1,f.a,!0),void 0,P)});r.a=C},function(o,r,s){'use strict';var u=s(44);r.a=function(f){return f&&f.length?s.i(u.a)(f):[]}},function(o,r,s){'use strict';var u=s(10),f=s(44);r.a=function(h,w){return h&&h.length?s.i(f.a)(h,s.i(u.a)(w)):[]}},function(o,r,s){'use strict';var u=s(44);r.a=function(f,h){return f&&f.length?s.i(u.a)(f,void 0,h):[]}},function(o,r,s){'use strict';var d=s(68),u=s(14),f=s(8),h=s.i(f.a)(function(w,C){return s.i(u.a)(w)?s.i(d.a)(w,C):[]});r.a=h},function(o,r,s){'use strict';var d=s(82),u=s(133),f=s(14),h=s(8),w=s.i(h.a)(function(C){return s.i(u.a)(s.i(d.a)(C,f.a))});r.a=w},function(o,r,s){'use strict';var d=s(82),u=s(10),f=s(133),h=s(14),w=s(19),C=s(8),T=s.i(C.a)(function(P){var S=s.i(w.a)(P);return s.i(h.a)(S)&&(S=void 0),s.i(f.a)(s.i(d.a)(P,h.a),s.i(u.a)(S))});r.a=T},function(o,r,s){'use strict';var d=s(82),u=s(133),f=s(14),h=s(19),w=s(8),C=s.i(w.a)(function(T){var P=s.i(h.a)(T);return s.i(f.a)(P)&&(P=void 0),s.i(u.a)(s.i(d.a)(T,f.a),void 0,P)});r.a=C},function(o,r,s){'use strict';var d=s(8),u=s(98),f=s.i(d.a)(u.a);r.a=f},function(o,r,s){'use strict';var u=s(67),f=s(199);r.a=function(h,w){return s.i(f.a)(h||[],w||[],u.a)}},function(o,r,s){'use strict';var u=s(426),f=s(199);r.a=function(h,w){return s.i(f.a)(h||[],w||[],u.a)}},function(o,r,s){'use strict';var d=s(8),u=s(149),f=s.i(d.a)(function(h){var w=h.length,C=1That's a shame... +

We're not proud of this but this early developer preview does not work in your web browser.

+

Please consider using Google Chrome instead.

+

We're terribly sorry.

+ `,C.classList.add('message'),w.style.display='none',w.parentNode.insertBefore(C,w)}Object.defineProperty(r,'__esModule',{value:!0});var u=s(291),f=s(274),h=s(356);try{u.a.create(document.querySelector('#editor'),{plugins:[f.a,h.a],toolbar:['headings','bold','italic','link','unlink','bulletedList','numberedList','blockQuote','undo','redo']}).then((w)=>{window.editor=w}).catch((w)=>{console.error(w.stack)})}catch(w){d()}},function(o,r,s){'use strict';var d=s(275),u=s(276),f=s(2),h=s(170),w=s(176),C=s(152),T=s(153);class P extends f.a{static get requires(){return[h.a,w.a,C.a,T.a]}static get pluginName(){return'autoformat/autoformat'}init(){this._addListAutoformats(),this._addHeadingAutoformats(),this._addInlineAutoformats()}_addListAutoformats(){new d.a(this.editor,/^[\*\-]\s$/,'bulletedList'),new d.a(this.editor,/^\d+[\.|)]?\s$/,'numberedList')}_addHeadingAutoformats(){new d.a(this.editor,/^(#{1,3})\s$/,(S)=>{const{batch:E,match:O}=S,V=O[1].length;this.editor.execute(`heading${V}`,{batch:E})})}_addInlineAutoformats(){new u.a(this.editor,/(\*\*)([^\*]+)(\*\*)$/g,'bold'),new u.a(this.editor,/(__)([^_]+)(__)$/g,'bold'),new u.a(this.editor,/(?:^|[^\*])(\*)([^\*_]+)(\*)$/g,'italic'),new u.a(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,'italic')}}r.a=P},function(o,r,s){'use strict';var d=s(3),u=s(58);r.a=class{constructor(h,w,C){let T;if('function'==typeof C)T=C;else{T=(S)=>{const{batch:E}=S;h.execute(C,{batch:E})}}h.document.on('change',(P,S,E)=>{if('insert'!=S)return;const O=E.range.getItems().next().value;if(!(O instanceof u.a))return;const V=O.textNode,F=V.data;if('paragraph'!==V.parent.name||!F)return;const R=w.exec(F);R&&h.document.enqueueChanges(()=>{const N=h.document.batch(),M=d.a.createFromParentsAndOffsets(V.parent,0,V.parent,R[0].length);N.remove(M),T({batch:N,match:R})})})}}},function(o,r,s){'use strict';function d(w){return Array.from(w.getChildren()).reduce((C,T)=>C+T.data,'')}var u=s(109),f=s(99);r.a=class{constructor(w,C,T){this.editor=w;let P,S,E,O;C instanceof RegExp?P=C:E=C,'string'==typeof T?S=T:O=T,E=E||((V)=>{let F,R=[],N=[];for(;null!==(F=P.exec(V))&&!(F&&4>F.length);){let{index:M,1:I,2:L,3:D}=F;M+=F[0].length-(I+L+D).length;const z=[M,M+I.length],K=[M+I.length+L.length,M+I.length+L.length+D.length];R.push(z),R.push(K),N.push([M+I.length,M+I.length+L.length])}return{remove:R,format:N}}),O=O||((V,F)=>{for(let R of F)V.setAttribute(R,S,!0)}),w.document.on('change',(V,F)=>{if('insert'!==F)return;const R=this.editor.document.selection;if(!R.isCollapsed||!R.focus||!R.focus.parent)return;const N=R.focus.parent,M=d(N).slice(0,R.focus.offset),I=E(M),L=[];I.format.forEach((z)=>{void 0===z[0]||void 0===z[1]||L.push(u.a.createFromParentsAndOffsets(N,z[0],N,z[1]))});const D=[];if(I.remove.slice().reverse().forEach((z)=>{void 0===z[0]||void 0===z[1]||D.push(u.a.createFromParentsAndOffsets(N,z[0],N,z[1]))}),!(L.length&&D.length))return;const q=w.document.batch();w.document.enqueueChanges(()=>{const z=s.i(f.a)(S,L,w.document.schema);O(q,z);for(let K of D)q.remove(K)})})}}},function(o,r,s){'use strict';var d=s(2),u=s(152),f=s(22),h=s(514),w=s.n(h);class C extends d.a{static get requires(){return[u.a]}static get pluginName(){return'basic-styles/bold'}init(){const T=this.editor,P=T.t,S=T.commands.get('bold'),E='CTRL+B';T.ui.componentFactory.add('bold',(O)=>{const V=new f.a(O);return V.set({label:P('Bold'),icon:w.a,keystroke:E,tooltip:!0}),V.bind('isOn','isEnabled').to(S,'value','isEnabled'),this.listenTo(V,'execute',()=>T.execute('bold')),V}),T.keystrokes.set(E,'bold')}}r.a=C},function(o,r,s){'use strict';var d=s(2),u=s(153),f=s(22),h=s(515),w=s.n(h);class C extends d.a{static get requires(){return[u.a]}static get pluginName(){return'basic-styles/italic'}init(){const T=this.editor,P=T.t,S=T.commands.get('italic'),E='CTRL+I';T.ui.componentFactory.add('italic',(O)=>{const V=new f.a(O);return V.set({label:P('Italic'),icon:w.a,keystroke:E,tooltip:!0}),V.bind('isOn','isEnabled').to(S,'value','isEnabled'),this.listenTo(V,'execute',()=>T.execute('italic')),V}),T.keystrokes.set(E,'italic')}}r.a=C},function(o,r,s){'use strict';var d=s(2),u=s(281),f=s(22),h=s(519),w=s.n(h),C=s(505),T=s.n(C);class P extends d.a{static get requires(){return[u.a]}static get pluginName(){return'block-quote/blockquote'}init(){const S=this.editor,E=S.t,O=S.commands.get('blockQuote');S.ui.componentFactory.add('blockQuote',(V)=>{const F=new f.a(V);return F.set({label:E('Block quote'),icon:w.a,tooltip:!0}),F.bind('isOn','isEnabled').to(O,'value','isEnabled'),this.listenTo(F,'execute',()=>S.execute('blockQuote')),F})}afterInit(){const S=this.editor,E=S.commands.get('blockQuote');this.listenTo(this.editor.editing.view,'enter',(O,V)=>{const F=this.editor.document,R=F.selection.getLastPosition().parent;F.selection.isCollapsed&&R.isEmpty&&E.value&&(this.editor.execute('blockQuote'),V.preventDefault(),O.stop())})}}r.a=P},function(o,r,s){'use strict';function d(S){return'blockQuote'==S.parent.name?S.parent:null}function u(S){let E,O=0;const V=[];for(;O{this.refreshValue(),this.refreshState()})}refreshValue(){const S=s.i(T.a)(this.editor.document.selection.getSelectedBlocks());this.value=!!(S&&d(S))}_doExecute(S={}){const E=this.editor.document,O=S.batch||E.batch(),V=Array.from(E.selection.getSelectedBlocks());E.enqueueChanges(()=>{this.value?this._removeQuote(O,V.filter(d)):this._applyQuote(O,V)})}_checkEnabled(){if(this.value)return!0;const S=this.editor.document.selection,E=this.editor.document.schema,O=s.i(T.a)(S.getSelectedBlocks());if(!O)return!1;const V=E.check({name:'blockQuote',inside:h.a.createBefore(O)}),F=E.check({name:O.name,attributes:Array.from(O.getAttributeKeys()),inside:'blockQuote'});return V&&F}_removeQuote(S,E){u(E).reverse().forEach((O)=>{if(O.start.isAtStart&&O.end.isAtEnd)return void S.unwrap(O.start.parent);if(O.start.isAtStart){const F=h.a.createBefore(O.start.parent);return void S.move(O,F)}O.end.isAtEnd||S.split(O.end);const V=h.a.createAfter(O.end.parent);S.move(O,V)})}_applyQuote(S,E){const O=[];u(E).reverse().forEach((V)=>{let F=d(V.start);F||(F=new w.a('blockQuote'),S.wrap(V,F)),O.push(F)}),O.reverse().reduce((V,F)=>{return V.nextSibling==F?(S.merge(h.a.createAfter(V)),V):F})}}r.a=P},function(o,r,s){'use strict';var d=s(2),u=s(280),f=s(38),h=s(37);class w extends d.a{init(){const C=this.editor,T=C.document.schema;C.commands.set('blockQuote',new u.a(C)),T.registerItem('blockQuote'),T.allow({name:'blockQuote',inside:'$root'}),T.allow({name:'$block',inside:'blockQuote'}),s.i(f.a)().for(C.data.viewToModel).fromElement('blockquote').toElement('blockQuote'),s.i(h.a)().for(C.data.modelToView,C.editing.modelToView).fromElement('blockQuote').toElement('blockquote')}afterInit(){const C=this.editor.document.schema;C.hasItem('listItem')&&C.allow({name:'listItem',inside:'blockQuote',attributes:['type','indent']})}}r.a=w},function(o,r,s){'use strict';var d=s(2),u=s(283),f=s(286),h=s(285),w=s(159);class C extends d.a{static get pluginName(){return'clipboard/clipboard'}init(){const T=this.editor,P=T.document,S=T.editing.view;this._htmlDataProcessor=new w.a,S.addObserver(u.a),this.listenTo(S,'paste',(O,V)=>{const F=V.dataTransfer;let R='';F.getData('text/html')?R=s.i(h.a)(F.getData('text/html')):F.getData('text/plain')&&(R=s.i(f.a)(F.getData('text/plain'))),R=this._htmlDataProcessor.toView(R),V.preventDefault(),S.fire('clipboardInput',{dataTransfer:F,content:R})},{priority:'low'}),this.listenTo(S,'clipboardInput',(O,V)=>{if(!V.content.isEmpty){const F=this.editor.data,R=F.toModel(V.content,'$clipboardHolder');P.enqueueChanges(()=>{F.insertContent(R,P.selection)})}},{priority:'low'});const E=(O,V)=>{const F=V.dataTransfer,R=T.data.toView(T.data.getSelectedContent(P.selection));V.preventDefault(),S.fire('clipboardOutput',{dataTransfer:F,content:R,method:O.name})};this.listenTo(S,'copy',E,{priority:'low'}),this.listenTo(S,'cut',E,{priority:'low'}),this.listenTo(S,'clipboardOutput',(O,V)=>{V.content.isEmpty||V.dataTransfer.setData('text/html',this._htmlDataProcessor.toData(V.content)),'cut'==V.method&&P.enqueueChanges(()=>{T.data.deleteContent(P.selection,P.batch(),{merge:!0})})},{priority:'low'})}}r.a=C},function(o,r,s){'use strict';var d=s(60),u=s(284);class f extends d.a{constructor(h){super(h),this.domEventType=['paste','copy','cut']}onDomEvent(h){this.fire(h.type,h,{dataTransfer:new u.a(h.clipboardData)})}}r.a=f},function(o,r){'use strict';r.a=class{constructor(u){this._native=u}getData(u){return this._native.getData(u)}setData(u,f){this._native.setData(u,f)}}},function(o,r){'use strict';r.a=function(u){return u.replace(/(\s+)<\/span>/g,(f,h)=>{return 1==h.length?' ':h})}},function(o,r){'use strict';r.a=function(u){return u=u.replace(//g,'>').replace(/\n\n/g,'

').replace(/\n/g,' ').replace(/^\s/,' ').replace(/\s$/,' ').replace(/\s\s/g,'  '),-1

')&&(u=`

${u}

`),u}},function(o,r,s){'use strict';var d=s(66);class u extends d.a{constructor(f){super(),this.editor=f}set(f,h){if('string'==typeof h){const w=h;h=()=>{this.editor.execute(w)}}super.set(f,h)}listenTo(f){this._listener.listenTo(f,'keydown',(h,w)=>{const C=this.press(w);C&&w.preventDefault()})}}r.a=u},function(o,r,s){'use strict';var d=s(7),u=s(386),f=s(290),h=s(499),w=s(294),C=s(309),T=s(0),P=s(4);class S{constructor(E){const O=this.constructor.build&&this.constructor.build.plugins;this.config=new u.a(E,this.constructor.build&&this.constructor.build.config),this.config.define('plugins',O),this.plugins=new f.a(this,O),this.commands=new Map,this.locale=new h.a(this.config.get('lang')),this.t=this.locale.t,this.document=new C.a,this.data=new w.a(this.document)}initPlugins(){function O(R,N){return R.reduce((M,I)=>{return M.then(I[N].bind(I))},Promise.resolve())}const V=this,F=this.config;return function(){const R=F.get('plugins')||[],N=F.get('removePlugins')||[];return V.plugins.load(R,N)}().then((R)=>{return O(R,'init').then(()=>O(R,'afterInit'))}).then(()=>this.fire('pluginsReady'))}destroy(){return this.fire('destroy'),this.stopListening(),Promise.resolve().then(()=>{this.document.destroy(),this.data.destroy()})}execute(E,O){let V=this.commands.get(E);if(!V)throw new T.a('editor-command-not-found: Specified command has not been added to the editor.');V._execute(O)}static create(E){return new Promise((O)=>{const V=new this(E);O(V.initPlugins().then(()=>{V.fire('dataReady'),V.fire('ready')}).then(()=>V))})}}r.a=S,s.i(P.a)(S,d.a)},function(o,r,s){'use strict';var d=s(288),u=s(287),f=s(296),h=s(389),w=s(397);class C extends d.a{constructor(T,P){super(P),this.element=T,this.editing=new f.a(this.document),this.keystrokes=new u.a(this),this.keystrokes.listenTo(this.editing.view)}destroy(){return Promise.resolve().then(()=>this.keystrokes.destroy()).then(()=>this.editing.destroy()).then(super.destroy())}setData(T){this.data.set(T)}getData(){return this.data.get()}updateEditorElement(){s.i(w.a)(this.element,this.getData())}loadDataFromEditorElement(){this.setData(s.i(h.a)(this.element))}static create(T,P){return new Promise((S)=>{const E=new this(T,P);S(E.initPlugins().then(()=>{E.fire('dataReady'),E.fire('ready')}).then(()=>E))})}}r.a=C},function(o,r,s){'use strict';var d=s(2),u=s(0),f=s(48);class h{constructor(w,C=[]){this._editor=w,this._availablePlugins=new Map,this._plugins=new Map;for(const T of C)this._availablePlugins.set(T,T),T.pluginName&&this._availablePlugins.set(T.pluginName,T)}*[Symbol.iterator](){for(const w of this._plugins)'function'==typeof w[0]&&(yield w)}get(w){return this._plugins.get(w)}load(w,C=[]){function T(q){return L.includes(q)||F.get(q)||N.has(q)?void 0:P(q).catch((z)=>{throw f.a.error('plugincollection-load: It was not possible to load the plugin.',{plugin:q}),z})}function P(q){return new Promise((z)=>{N.add(q),E(q),q.requires&&q.requires.forEach(($)=>{const H=S($);if(C.includes(H))throw new u.a('plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.',{plugin:H,requiredBy:q});T(H)});const K=new q(R);F._add(q,K),M.push(K),z()})}function S(q){return'function'==typeof q?q:F._availablePlugins.get(q)}function E(q){if(!(q.prototype instanceof d.a))throw new u.a('plugincollection-instance: The loaded plugin module is not an instance of Plugin.',{plugin:q})}function V(q){return q.map((z)=>S(z)).filter((z)=>!!z)}const F=this,R=this._editor,N=new Set,M=[],I=V(w),L=V(C),D=function(q){const z=[];for(const K of q)S(K)||z.push(K);return z.length?z:null}(w);if(D){const q='plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.';return f.a.error(q,{plugins:D}),Promise.reject(new u.a(q,{plugins:D}))}return Promise.all(I.map(T)).then(()=>M)}_add(w,C){this._plugins.set(w,C),w.pluginName&&this._plugins.set(w.pluginName,C)}}r.a=h},function(o,r,s){'use strict';var d=s(289),u=s(159),f=s(292),h=s(293),w=s(398),C=s(506),T=s.n(C);class P extends d.a{constructor(S,E){super(S,E),this.document.createRoot(),this.data.processor=new u.a,this.ui=new f.a(this,new h.a(this.locale)),this._elementReplacer=new w.a}destroy(){return this.updateEditorElement(),this._elementReplacer.restore(),this.ui.destroy().then(()=>super.destroy())}static create(S,E){return new Promise((O)=>{const V=new this(S,E);O(V.initPlugins().then(()=>V._elementReplacer.replace(S,V.ui.view.element)).then(()=>V.ui.init()).then(()=>V.fire('uiReady')).then(()=>V.editing.view.attachDomRoot(V.ui.view.editableElement)).then(()=>V.loadDataFromEditorElement()).then(()=>{V.fire('dataReady'),V.fire('ready')}).then(()=>V))})}}r.a=P},function(o,r,s){'use strict';var d=s(365),u=s(65),f=s(379);r.a=class{constructor(w,C){this.editor=w,this.view=C,this.componentFactory=new d.a(w),this.focusTracker=new u.a,C.set('width',w.config.get('ui.width')),C.set('height',w.config.get('ui.height')),C.toolbar.bind('isActive').to(this.focusTracker,'isFocused'),C.toolbar.limiterElement=C.element;const T=w.editing.createRoot('div');C.editable.bind('isReadOnly').to(T),C.editable.bind('isFocused').to(w.editing.view),C.editable.name=T.rootName,this.focusTracker.add(C.editableElement)}init(){const w=this.editor;return this.view.init().then(()=>{return this.view.toolbar.fillFromConfig(w.config.get('toolbar'),this.componentFactory)}).then(()=>{s.i(f.a)({origin:w.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:w.keystrokes,toolbar:this.view.toolbar})})}destroy(){return this.view.destroy()}}},function(o,r,s){'use strict';var d=s(372),u=s(371),f=s(380);class h extends d.a{constructor(w){super(w),this.toolbar=new f.a(w),this.editable=new u.a(w),this.top.add(this.toolbar),this.main.add(this.editable)}get editableElement(){return this.editable.element}}r.a=h},function(o,r,s){'use strict';var d=s(4),u=s(7),f=s(156),h=s(158),w=s(100),C=s(304),T=s(302),P=s(115),S=s(3),E=s(1),O=s(298),V=s(295),F=s(299),R=s(297);class N{constructor(M,I){this.model=M,this.processor=I,this.mapper=new f.a,this.modelToView=new h.a(this.model,{mapper:this.mapper}),this.modelToView.on('insert:$text',s.i(w.j)(),{priority:'lowest'}),this.viewToModel=new C.a({schema:M.schema}),this.viewToModel.on('text',s.i(T.a)(),{priority:'lowest'}),this.viewToModel.on('element',s.i(T.b)(),{priority:'lowest'}),this.viewToModel.on('documentFragment',s.i(T.b)(),{priority:'lowest'}),this.on('insertContent',(L,D)=>s.i(O.a)(this,D.content,D.selection,D.batch)),this.on('deleteContent',(L,D)=>s.i(V.a)(D.selection,D.batch,D.options)),this.on('modifySelection',(L,D)=>s.i(F.a)(this,D.selection,D.options)),this.on('getSelectedContent',(L,D)=>{D.content=s.i(R.a)(D.selection)})}get(M='main'){return this.stringify(this.model.getRoot(M))}stringify(M){const I=this.toView(M);return this.processor.toData(I)}toView(M){const I=S.a.createIn(M),L=new P.a;return this.mapper.bindElements(M,L),this.modelToView.convertInsertion(I),this.mapper.clearBindings(),L}set(M,I='main'){const L=this.model.getRoot(I);this.model.enqueueChanges(()=>{this.model.selection.removeAllRanges(),this.model.selection.clearAttributes(),this.model.batch('transparent').remove(S.a.createIn(L)).insert(E.a.createAt(L,0),this.parse(M))})}parse(M,I='$root'){const L=this.processor.toView(M);return this.toModel(L,I)}toModel(M,I='$root'){return this.viewToModel.convert(M,{context:[I]})}destroy(){}insertContent(M,I,L){this.fire('insertContent',{content:M,selection:I,batch:L})}deleteContent(M,I,L){this.fire('deleteContent',{batch:I,selection:M,options:L})}modifySelection(M,I){this.fire('modifySelection',{selection:M,options:I})}getSelectedContent(M){const I={selection:M};return this.fire('getSelectedContent',I),I.content}}r.a=N,s.i(d.a)(N,u.a)},function(o,r,s){'use strict';function u(S,E,O){const V=E.parent,F=O.parent;if(V!=F&&V.parent&&F.parent&&h(E,O)){for(E=C.a.createAfter(V),O=C.a.createBefore(F),F.isEmpty?S.remove(F):(!O.isEqual(E)&&S.move(F,E),S.merge(E));O.parent.isEmpty;){const R=O.parent;O=C.a.createBefore(R),S.remove(R)}u(S,E,O)}}function f(S,E){const O=S.schema.check({name:'$text',inside:E}),V=S.schema.check({name:'paragraph',inside:E});return!O&&V}function h(S,E){const O=S.root.document.schema,V=new T.a(S,E);for(const F of V.getWalker())if(O.objects.has(F.item.name)||O.limits.has(F.item.name))return!1;return!0}var w=s(163),C=s(1),T=s(3),P=s(5);r.a=function(S,E,O={}){if(!S.isCollapsed){const V=S.getFirstRange(),F=V.start,R=w.a.createFromPosition(V.end);if(V.start.isTouching(V.end)||E.remove(V),O.merge&&u(E,F,R),S.collapse(F),f(E.document,F)){const N=new P.a('paragraph');E.insert(F,N),S.collapse(N)}R.detach()}}},function(o,r,s){'use strict';var d=s(317),u=s(156),f=s(158),h=s(100),w=s(301),C=s(157),T=s(7);r.a=class{constructor(S){this.model=S,this.view=new d.a,this.mapper=new u.a,this.modelToView=new f.a(this.model,{mapper:this.mapper,viewSelection:this.view.selection}),this._listener=Object.create(T.a),this._listener.listenTo(this.model,'change',(E,O,V)=>{this.modelToView.convertChange(O,V)},{priority:'low'}),this._listener.listenTo(this.model,'changesDone',()=>{const E=this.model.selection;this.modelToView.convertSelection(E),this.view.render()},{priority:'low'}),this._listener.listenTo(this.model.markers,'add',(E,O)=>{this.modelToView.convertMarker('addMarker',O.name,O.getRange())}),this._listener.listenTo(this.model.markers,'remove',(E,O)=>{this.modelToView.convertMarker('removeMarker',O.name,O.getRange())}),this._listener.listenTo(this.view,'selectionChange',s.i(w.a)(this.model,this.mapper)),this.modelToView.on('insert:$text',s.i(h.j)(),{priority:'lowest'}),this.modelToView.on('remove',s.i(h.k)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.c)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.d)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.e)(),{priority:'low'}),this.modelToView.on('selection',s.i(C.f)(),{priority:'low'})}createRoot(S,E='main'){const O=this.view.createRoot(S,E),V=this.model.getRoot(E);return this.mapper.bindElements(V,O),O}destroy(){this.view.destroy(),this._listener.stopListening()}}},function(o,r,s){'use strict';function u(P){const S=[];Array.from(P.getItems({direction:'backward'})).map((E)=>h.a.createOn(E)).filter((E)=>{const O=(E.start.isAfter(P.start)||E.start.isEqual(P.start))&&(E.end.isBefore(P.end)||E.end.isEqual(P.end));return O}).forEach((E)=>{S.push(E.start.parent),s.i(T.c)(E)}),S.forEach((E)=>{for(let O=E;O.parent&&O.isEmpty;){const V=h.a.createOn(O);O=O.parent,s.i(T.c)(V)}})}var f=s(49),h=s(3),w=s(1),C=s(25),T=s(13);r.a=function(P){const S=new f.a,E=P.getFirstRange();if(!E||E.isCollapsed)return S;const O=E.start.root,V=E.start.getCommonPath(E.end),F=O.getNodeByPath(V);let R=E.start.parent==E.end.parent?E:h.a.createFromParentsAndOffsets(F,E.start.path[V.length],F,E.end.path[V.length]+1);const N=R.end.offset-R.start.offset;for(const M of R.getItems({shallow:!0}))M.is('textProxy')?S.appendChildren(new C.a(M.data,M.getAttributes())):S.appendChildren(M.clone(!0));if(R!=E){const M=E._getTransformedByMove(R.start,w.a.createAt(S,0),N)[0],I=new h.a(w.a.createAt(S),M.start),L=new h.a(M.end,w.a.createAt(S,'end'));u(L),u(I)}return S}},function(o,r,s){'use strict';var u=s(1),f=s(163),h=s(5),w=s(3),C=s(48);r.a=function(P,S,E,O){O||(O=P.model.batch()),E.isCollapsed||P.deleteContent(E,O,{merge:!0});const V=new T(P,O,E.anchor);let F;F=S.is('documentFragment')?S.getChildren():[S],V.handleNodes(F,{isFirst:!0,isLast:!0});const R=V.getSelectionRange();R?E.setRanges([R]):C.a.warn('insertcontent-no-range: Cannot determine a proper selection range after insertion.')};class T{constructor(P,S,E){this.dataController=P,this.batch=S,this.position=E,this.canMergeWith=new Set([this.position.parent]),this.schema=P.model.schema}handleNodes(P,S){P=Array.from(P);for(let E=0;E!0);if(S.schema.check({name:'$text',inside:E.nextPosition}))return E.nextPosition}}function f(S,E){const O=S.position.textNode;if(O){const V=O.data;for(let F=S.position.offset-O.startOffset;s.i(P.a)(V,F)||'character'==E&&s.i(P.b)(V,F);)S.next(),F=S.position.offset-O.startOffset}return S.position}function h(S,E){const O=S.root,V=w.a.createAt(O,E?'end':0);return E?new T.a(S,V):new T.a(V,S)}var w=s(1),C=s(33),T=s(3),P=s(271);r.a=function(S,E,O={}){const V=S.model.schema,F='backward'!=O.direction,R=O.unit?O.unit:'character',N=E.focus,M=new C.a({boundaries:h(N,F),singleCharacters:!0,direction:F?'forward':'backward'}),I={walker:M,schema:V,isForward:F,unit:R};for(let L;L=M.next();){if(L.done)return;const D=u(I,L.value);if(D)return void E.setFocus(D)}}},function(o,r,s){'use strict';var d=s(58);r.a=class{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f)),this._consumable.has(f)||this._consumable.set(f,new Map),this._consumable.get(f).set(h,!0)}consume(f,h){return f instanceof d.a&&(f=this._getSymbolForTextProxy(f)),!!this.test(f,h)&&(this._consumable.get(f).set(h,!1),!0)}test(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f));const w=this._consumable.get(f);if(w===void 0)return null;const C=w.get(h);return void 0===C?null:C}revert(f,h){f instanceof d.a&&(f=this._getSymbolForTextProxy(f));const w=this.test(f,h);return!1===w?(this._consumable.get(f).set(h,!0),!0):!0!==w&&null}_getSymbolForTextProxy(f){let h=null;const w=this._textProxyRegistry.get(f.startOffset);if(w){const C=w.get(f.endOffset);C&&(h=C.get(f.parent))}return h||(h=this._addSymbolForTextProxy(f.startOffset,f.endOffset,f.parent)),h}_addSymbolForTextProxy(f,h,w){const C=Symbol();let T,P;return T=this._textProxyRegistry.get(f),T||(T=new Map,this._textProxyRegistry.set(f,T)),P=T.get(h),P||(P=new Map,T.set(h,P)),P.set(w,C),C}}},function(o,r,s){'use strict';var u=s(57);r.a=function(f,h){return(w,C)=>{const T=C.newSelection,P=new u.a,S=[];for(let E of T.getRanges())S.push(h.toModelRange(E));P.setRanges(S,T.isBackward),P.isEqual(f.selection)||f.enqueueChanges(()=>{f.selection.setTo(P)})}}},function(o,r,s){'use strict';var f=s(49),h=s(25),w=s(13);r.b=function(){return(C,T,P,S)=>{if(!T.output&&P.consume(T.input,{name:!0})){const E=S.convertChildren(T.input,P,T);T.output=new f.a(s.i(w.b)(E))}}},r.a=function(){return(C,T,P,S)=>{const E={name:'$text',inside:T.context};S.schema.check(E)&&P.consume(T.input)&&(T.output=new h.a(T.input.data))}}},function(o,r,s){'use strict';var d=s(12),u=s(0);class f{constructor(){this._consumables=new Map}add(w,C){let T;return w.is('text')||w.is('documentFragment')?void this._consumables.set(w,!0):void(this._consumables.has(w)?T=this._consumables.get(w):(T=new h,this._consumables.set(w,T)),T.add(C))}test(w,C){const T=this._consumables.get(w);return void 0===T?null:w.is('text')||w.is('documentFragment')?T:T.test(C)}consume(w,C){return!!this.test(w,C)&&(w.is('text')||w.is('documentFragment')?this._consumables.set(w,!1):this._consumables.get(w).consume(C),!0)}revert(w,C){const T=this._consumables.get(w);T!==void 0&&(w.is('text')||w.is('documentFragment')?this._consumables.set(w,!0):T.revert(C))}static consumablesFromElement(w){const C={name:!0,attribute:[],class:[],style:[]},T=w.getAttributeKeys();for(let E of T)'style'!=E&&'class'!=E&&C.attribute.push(E);const P=w.getClassNames();for(let E of P)C.class.push(E);const S=w.getStyleNames();for(let E of S)C.style.push(E);return C}static createFrom(w,C){if(C||(C=new f),w.is('text'))return C.add(w),C;w.is('element')&&C.add(w,f.consumablesFromElement(w)),w.is('documentFragment')&&C.add(w);for(let T of w.getChildren())C=f.createFrom(T,C);return C}}r.a=f;class h{constructor(){this._canConsumeName=null,this._consumables={attribute:new Map,style:new Map,class:new Map}}add(w){for(let C in w.name&&(this._canConsumeName=!0),this._consumables)C in w&&this._add(C,w[C])}test(w){if(w.name&&!this._canConsumeName)return this._canConsumeName;for(let C in this._consumables)if(C in w){const T=this._test(C,w[C]);if(!0!==T)return T}return!0}consume(w){for(let C in w.name&&(this._canConsumeName=!1),this._consumables)C in w&&this._consume(C,w[C])}revert(w){for(let C in w.name&&(this._canConsumeName=!0),this._consumables)C in w&&this._revert(C,w[C])}_add(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T){if('attribute'===w&&('class'===S||'style'===S))throw new u.a('viewconsumable-invalid-attribute: Classes and styles should be handled separately.');P.set(S,!0)}}_test(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)if('attribute'===w&&('class'===S||'style'===S)){const E=this._test(S,[...this._consumables[S].keys()]);if(!0!==E)return E}else{const E=P.get(S);if(E===void 0)return null;if(!E)return!1}return!0}_consume(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)'attribute'===w&&('class'===S||'style'===S)?this._consume(S,[...this._consumables[S].keys()]):P.set(S,!1)}_revert(w,C){const T=s.i(d.a)(C)?C:[C],P=this._consumables[w];for(let S of T)if('attribute'===w&&('class'===S||'style'===S))this._revert(S,[...this._consumables[S].keys()]);else{const E=P.get(S);!1===E&&P.set(S,!0)}}}},function(o,r,s){'use strict';function d(F){const R=new Set,N=new Map,M=new P.a({startPosition:T.a.createAt(F,0),ignoreElementEnd:!0});for(const I of M)'$marker'==I.item.name&&R.add(I.item);for(const I of R){const L=I.getAttribute('data-name'),D=T.a.createBefore(I);N.has(L)?N.get(L).end=T.a.createFromPosition(D):N.set(L,new C.a(T.a.createFromPosition(D))),s.i(O.c)(C.a.createOn(I))}return N}var u=s(303),f=s(7),h=s(4),w=s(45),C=s(3),T=s(1),P=s(33),S=s(56),E=s(49),O=s(13);class V{constructor(F={}){this.conversionApi=s.i(w.a)({},F),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this)}convert(F,R={}){this.fire('viewCleanup',F);const N=u.a.createFrom(F),M=this._convertItem(F,N,R);if(!(M instanceof S.a||M instanceof E.a))return M;let I=M;return I.is('documentFragment')||(I=new E.a([I])),I.markers=d(I),I}_convertItem(F,R,N={}){const M=s.i(w.a)({},N,{input:F,output:null});return F.is('element')?this.fire('element:'+F.name,M,R,this.conversionApi):F.is('text')?this.fire('text',M,R,this.conversionApi):this.fire('documentFragment',M,R,this.conversionApi),M.output}_convertChildren(F,R,N={}){const M=Array.from(F.getChildren()),I=M.map((L)=>this._convertItem(L,R,N));return I.reduce((L,D)=>D?L.concat(D):L,[])}}r.a=V,s.i(h.a)(V,f.a)},function(o,r){'use strict';r.a=class{getHtml(u){const f=document.implementation.createHTMLDocument(''),h=f.createElement('div');return h.appendChild(u),h.innerHTML}}},function(o,r,s){'use strict';var d=s(160),u=s(101),f=s(102),h=s(103),w=s(104),C=s(161),T=s(105),P=s(107),S=s(162),E=s(108)},function(o,r,s){'use strict';function d(H,W){const U=H.clone(),Z=U.operations[0];return Z.oldRange=Z.oldRange.getTransformedByDelta(W)[0],Z.newRange=Z.newRange.getTransformedByDelta(W)[0],[U]}function u(H,W){function U(){const X=new w.a(H.position.getShiftedBy(Q),H.position.getShiftedBy(Y)),ee=new P.a(X,W.key,J,W.value,0);Z.addOperation(ee)}const Z=new V.a,G=H.nodes;let J=G.getNode(0).getAttribute(W.key),Q=0,Y=G.getNode(0).offsetSize;for(let X=1;X{const Z=s.i(h.c)(H,W,U);return H.range.containsPosition(W.position)&&Z.push(u(W,H)),Z}),s.i(h.b)(V.a,I.a,(H,W,U)=>{const Z=new C.a(W.position.root,W.position.path.slice(0,-1)),G=s.i(h.c)(H,W,U);for(let J of H.operations)if(J.range.containsPosition(Z)||J.range.start.isEqual(Z)){const Q=new V.a,Y=Z.getShiftedBy(1),X=C.a.createFromPosition(Y);X.path.push(0);const ee=W._cloneOperation.nodes.getNode(0).getAttribute(J.key);Q.addOperation(new P.a(new w.a(Y,X),J.key,ee===void 0?null:ee,J.newValue,0)),G.push(Q);break}return G}),s.i(h.b)(F.a,N.a,(H,W,U)=>{return H.position.isEqual(W.position)?[W.getReversed(),H.clone()]:s.i(h.c)(H,W,U)}),s.i(h.b)(R.a,I.a,d),s.i(h.b)(R.a,N.a,d),s.i(h.b)(R.a,D.a,d),s.i(h.b)(R.a,q.a,d),s.i(h.b)(R.a,M.a,d),s.i(h.b)(R.a,z.a,d),s.i(h.b)(M.a,N.a,(H,W,U)=>{const Z=H.sourcePosition.root==W.position.root&&'same'===s.i($.a)(H.sourcePosition.getParentPath(),W.position.getParentPath()),G=H.sourcePosition.offset<=W.position.offset&&H.sourcePosition.offset+H.howMany>W.position.offset;return Z&&G?[W.getReversed(),H.clone()]:s.i(h.c)(H,W,U)}),s.i(h.b)(N.a,F.a,(H,W,U)=>{return H.position.isEqual(W.position)?[f()]:s.i(h.c)(H,W,U)}),s.i(h.b)(N.a,M.a,(H,W,U)=>{const Z=H.position.root==W.sourcePosition.root&&'same'===s.i($.a)(H.position.getParentPath(),W.sourcePosition.getParentPath()),G=W.sourcePosition.offset<=H.position.offset&&W.sourcePosition.offset+W.howMany>H.position.offset;return Z&&G?[f()]:s.i(h.c)(H,W,U)}),s.i(h.b)(I.a,I.a,(H,W,U)=>{const Z=H.position.getParentPath(),G=W.position.getParentPath();if('same'==s.i($.a)(Z,G)){if(H.position.offset==W.position.offset)return[f()];if(H.position.offsetW._cloneOperation.sourcePosition.offset&&J._cloneOperation.sourcePosition.offset--,[J]}const J=H.clone();return J._cloneOperation.position.offset++,J._moveOperation.sourcePosition.path[J._moveOperation.sourcePosition.path.length-2]++,J._moveOperation.targetPosition.path[J._moveOperation.targetPosition.path.length-2]++,J._moveOperation.sourcePosition.offset=H.position.offset-W.position.offset,H._cloneOperation instanceof E.a&&W._cloneOperation instanceof E.a&&H._cloneOperation.sourcePosition.offset>W._cloneOperation.sourcePosition.offset&&J._cloneOperation.sourcePosition.offset--,[J]}return s.i(h.c)(H,W,U)}),s.i(h.b)(I.a,q.a,(H,W,U)=>{return'same'===s.i($.a)(W.position.path,H.position.getParentPath())?[f()]:s.i(h.c)(H,W,U)}),s.i(h.b)(I.a,D.a,(H,W,U)=>{const Z='same'===s.i($.a)(H.position.getParentPath(),W.range.start.getParentPath()),G=W.range.start.offset=H.position.offset;if(Z&&G)return[f()];if('same'===s.i($.a)(H.position.getParentPath(),W.range.end.getShiftedBy(-1).path)){const J=H.clone(),Q=C.a.createFromPosition(W.range.start);Q.path.push(W.howMany-1);const Y=Q.getShiftedBy(1);J._cloneOperation.position=Y;const X=C.a.createFromPosition(Q);X.path.push(H.position.offset),J._moveOperation.sourcePosition=X;const ee=C.a.createFromPosition(Y);return ee.path.push(0),J._moveOperation.targetPosition=ee,[J]}return s.i(h.c)(H,W,U)}),s.i(h.b)(I.a,V.a,(H,W)=>{H=H.clone();const U=new C.a(H.position.root,H.position.path.slice(0,-1));if(H._cloneOperation instanceof S.a)for(let Z of W.operations)if(Z.range.containsPosition(U)||Z.range.start.isEqual(U)){null===Z.newValue?H._cloneOperation.nodes.getNode(0).removeAttribute(Z.key):H._cloneOperation.nodes.getNode(0).setAttribute(Z.key,Z.newValue);break}return[H]}),s.i(h.b)(q.a,I.a,(H,W,U)=>{if('same'===s.i($.a)(H.position.path,W.position.getParentPath())){const Z=[W.getReversed(),H.clone()];return Z[1].operations[1].targetPosition.path[0]++,Z}return s.i(h.c)(H,W,U)}),s.i(h.b)(L.a,V.a,(H,W)=>{const U=[H.clone()];return W.range.containsPosition(H.position)&&U.push(u(H,W)),U}),s.i(h.b)(D.a,I.a,(H,W,U)=>{const Z='same'===s.i($.a)(H.range.start.getParentPath(),W.position.getParentPath()),G=H.range.start.offset=W.position.offset;if(Z&&G)return[W.getReversed(),H.clone()];if('same'===s.i($.a)(W.position.getParentPath(),H.range.end.getShiftedBy(-1).path)){const J=H.clone();return J._insertOperation.position.offset++,J._moveOperation.howMany++,J._moveOperation.targetPosition.path[J._moveOperation.targetPosition.path.length-2]++,[J]}return s.i(h.c)(H,W,U)}),s.i(h.b)(z.a,I.a,(H,W,U)=>{const Z=new C.a(W.position.root,W.position.path.slice(0,-1)),G=s.i(h.c)(H,W,U);if(H.operations[0].position.isEqual(Z)){const J=H.clone();J.operations[0].position=H.operations[0].position.getShiftedBy(1),G.push(J)}return G}),s.i(h.b)(I.a,z.a,(H,W)=>{H=H.clone();const U=new C.a(H.position.root,H.position.path.slice(0,-1));return H._cloneOperation instanceof S.a&&W.operations[0].position.isEqual(U)&&(H._cloneOperation.nodes.getNode(0).name=W.operations[0].newName),[H]}),s.i(h.b)(K.a,I.a,(H,W,U)=>{const Z=s.i(h.c)(H,W,U),G=W._cloneOperation.position;for(let J of Z)for(let Q of J.operations){const Y=Q.sourcePosition.getShiftedBy(Q.howMany);Y.isEqual(G)&&(Q.howMany+=1)}return Z}),s.i(h.b)(I.a,K.a,(H,W,U)=>{W=W.clone();const Z=H._cloneOperation.position;for(let G of W.operations){const J=G.sourcePosition.getShiftedBy(G.howMany);J.isEqual(Z)&&(G.howMany+=1)}return s.i(h.c)(H,W,U)})},function(o,r,s){'use strict';function d(P,S,E,O){const V=P.document,F=new T,R=new w.a(S,E,O,V.markers,V.version);P.addDelta(F),F.addOperation(R),V.applyOperation(R)}var u=s(20),f=s(18),h=s(17),w=s(110),C=s(0);class T extends u.a{get type(){return'marker'}get _reverseDeltaClass(){return T}static get className(){return'engine.model.delta.MarkerDelta'}}r.a=T,s.i(h.b)('setMarker',function(P,S){const E='string'==typeof P?P:P.name,O=this.document.markers.get(E);if(!S&&!O)throw new C.a('batch-setMarker-no-range: Range parameter is required when adding a new marker.');const V=O?O.getRange():null;return S?d(this,E,V,S):d(this,E,null,V),this}),s.i(h.b)('removeMarker',function(P){const S='string'==typeof P?P:P.name;if(!this.document.markers.has(S))throw new C.a('batch-removeMarker-no-marker: Trying to remove marker that does not exist.');const E=this.document.markers.get(S).getRange();return d(this,S,E,null),this}),f.a.register(T)},function(o,r,s){'use strict';function d(z){const K=z.textNode;if(K){const $=K.data,H=z.offset-K.startOffset;return!s.i(L.a)($,H)&&!s.i(L.b)($,H)}return!0}function*u(z,K){for(let $=!1;!$;){if($=!0,z){const H=z.next();H.done||($=!1,yield{walker:z,value:H.value})}if(K){const H=K.next();H.done||($=!1,yield{walker:K,value:H.value})}}}var f=s(306),h=s(307),w=s(3),C=s(1),T=s(315),P=s(17),S=s(310),E=s(311),O=s(316),V=s(33),F=s(312),R=s(94),N=s(7),M=s(0),I=s(4),L=s(271);const D='$graveyard';class q{constructor(){this.version=0,this.schema=new O.a,this.history=new S.a(this),this.markers=new F.a,this.selection=new E.a(this),this._pendingChanges=[],this.roots=new Map,this.selection.on('change:range',()=>{for(let z of this.selection.getRanges())if(!this._validateSelectionRange(z))throw new M.a('document-selection-wrong-position: Range from document selection starts or ends at incorrect position.',{range:z})}),this.createRoot('$root',D)}get graveyard(){return this.getRoot(D)}applyOperation(z){if(z.baseVersion!==this.version)throw new M.a('model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.',{operation:z});let K=z._execute();this.version++,this.history.addDelta(z.delta),K&&this.fire('change',z.type,K,z.delta.batch,z.delta.type)}batch(z){return new P.a(this,z)}createRoot(z='$root',K='main'){if(this.roots.has(K))throw new M.a('model-document-createRoot-name-exists: Root with specified name already exists.',{name:K});const $=new T.a(this,z,K);return this.roots.set(K,$),$}destroy(){this.selection.destroy(),this.stopListening()}enqueueChanges(z){if(this._pendingChanges.push(z),1==this._pendingChanges.length){for(;this._pendingChanges.length;)this._pendingChanges[0](),this._pendingChanges.shift();this.fire('changesDone')}}getRoot(z='main'){if(!this.roots.has(z))throw new M.a('model-document-getRoot-root-not-exist: Root with specified name does not exist.',{name:z});return this.roots.get(z)}hasRoot(z){return this.roots.has(z)}getRootNames(){return Array.from(this.roots.keys()).filter((z)=>z!=D)}getNearestSelectionRange(z,K='both'){if(this.schema.check({name:'$text',inside:z}))return new w.a(z);let $,H;('both'==K||'backward'==K)&&($=new V.a({startPosition:z,direction:'backward'})),('both'==K||'forward'==K)&&(H=new V.a({startPosition:z}));for(let W of u($,H)){const U=W.walker==$?'elementEnd':'elementStart',Z=W.value;if(Z.type==U&&this.schema.objects.has(Z.item.name))return w.a.createOn(Z.item);if(this.schema.check({name:'$text',inside:Z.nextPosition}))return new w.a(Z.nextPosition)}return null}toJSON(){const z=s.i(R.a)(this);return z.selection='[engine.model.LiveSelection]',z}_getDefaultRoot(){for(let z of this.roots.values())if(z!==this.graveyard)return z;return this.graveyard}_getDefaultRange(){const z=this._getDefaultRoot(),K=new C.a(z,[0]),$=this.getNearestSelectionRange(K);return $||new w.a(K)}_validateSelectionRange(z){return d(z.start)&&d(z.end)}}r.a=q,s.i(I.a)(q,N.a)},function(o,r,s){'use strict';var d=s(0);r.a=class{constructor(){this._deltas=[],this._historyPoints=new Map}addDelta(f){if(0=h)break;yield C}}}getDelta(f){let h=this._historyPoints.get(f);if(h===void 0)return null;const w=[];for(h;hf&&this._historyPoints.set(T,this._historyPoints.get(T)+C)}}_getIndex(f){let h=this._historyPoints.get(f);if(h===void 0){const w=this._deltas[this._deltas.length-1],C=w.baseVersion+w.operations.length;if(0>f||f>=C)return-1;throw new d.a('model-history-wrong-version: Given base version points to the middle of a delta.')}return h}}},function(o,r,s){'use strict';function d(R){return R instanceof C.a||R instanceof w.a?R.getAttributes():null}var u=s(1),f=s(3),h=s(109),w=s(25),C=s(58),T=s(150),P=s(0),S=s(48),E=s(57);const O='selection:',V=new Set(['addAttribute','removeAttribute','changeAttribute','addRootAttribute','removeRootAttribute','changeRootAttribute']);class F extends E.a{constructor(R){super(),this._document=R,this._attributePriority=new Map,this.listenTo(this._document,'change',(N,M)=>{V.has(M)&&this._updateAttributes(!1)})}get isCollapsed(){const R=this._ranges.length;return!(0!==R)||super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().start}get rangeCount(){return this._ranges.length?this._ranges.length:1}destroy(){for(let R=0;R{N.root==this._document.graveyard&&this._fixGraveyardSelection(N,I),this.fire('change:range',{directChange:!1})}),N}_updateAttributes(R){const N=s.i(T.a)(this._getSurroundingAttributes()),M=s.i(T.a)(this.getAttributes());if(R)this._attributePriority=new Map,this._attrs=new Map;else for(let[L,D]of this._attributePriority)'low'==D&&(this._attrs.delete(L),this._attributePriority.delete(L));this._setAttributesTo(N,!1);const I=[];for(let[L,D]of this.getAttributes())M.has(L)&&M.get(L)===D||I.push(L);for(let[L]of M)this.hasAttribute(L)||I.push(L);0{return new T.a(q,I.key,I.oldValue,I.newValue,I.baseVersion)})},AttributeOperation(I,L,D){if(I.key===L.key){let q=I.range.getDifference(L.range).map((K)=>{return new T.a(K,I.key,I.oldValue,I.newValue,I.baseVersion)});const z=I.range.getIntersection(L.range);return z&&(D?q.push(new T.a(z,L.key,L.newValue,I.newValue,I.baseVersion)):0===q.length&&q.push(new F.a(0))),q}return[I.clone()]},RootAttributeOperation:u,RenameOperation:u,MarkerOperation:u,MoveOperation(I,L){const D=R.a.createFromPositionAndShift(L.sourcePosition,L.howMany);let q=[];L instanceof V.a&&L._needsHolderElement&&I.range.root==L.targetPosition.root&&I.range.start.path[0]>=L._holderElementOffset&&(I=I.clone(),I.range.start.path[0]++,I.range.end.path[0]++);const z=w(I.range.getDifference(D)),K=I.range.getIntersection(D);return null!==z&&(z.start=z.start._getTransformedByDeletion(L.sourcePosition,L.howMany),z.end=z.end._getTransformedByDeletion(L.sourcePosition,L.howMany),q=z._getTransformedByInsertion(L.getMovedRangeStart(),L.howMany,!0,!1).reverse()),null!==K&&(K.start=K.start._getCombined(L.sourcePosition,L.getMovedRangeStart()),K.end=K.end._getCombined(L.sourcePosition,L.getMovedRangeStart()),q.push(K)),q.map(($)=>{return new T.a($,I.key,I.oldValue,I.newValue,I.baseVersion)})}},RootAttributeOperation:{InsertOperation:u,AttributeOperation:u,RootAttributeOperation(I,L,D){return I.root!==L.root||I.key!==L.key||(I.newValue===L.newValue||D)&&I.newValue!==L.newValue?[I.clone()]:[new F.a(I.baseVersion)]},RenameOperation:u,MarkerOperation:u,MoveOperation:u},RenameOperation:{InsertOperation(I,L){const D=I.clone();return D.position=D.position._getTransformedByInsertion(L.position,L.nodes.maxOffset,!0),[D]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation(I,L,D){const q=I.clone();if(I.position.isEqual(L.position))if(D)q.oldName=L.newName;else return[new F.a(I.baseVersion)];return[q]},MarkerOperation:u,MoveOperation(I,L){const D=I.clone(),q=D.position.isEqual(L.sourcePosition);return D.position=D.position._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!0,q),[D]}},MarkerOperation:{InsertOperation(I,L){const D=I.clone();return D.oldRange&&(D.oldRange=D.oldRange._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,!1)[0]),D.newRange&&(D.newRange=D.newRange._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,!1)[0]),[D]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation:u,MarkerOperation(I,L,D){const q=I.clone();if(I.name==L.name)if(D)q.oldRange=L.newRange;else return[new F.a(I.baseVersion)];return[q]},MoveOperation(I,L){const D=I.clone();if(D.oldRange){const q=D.oldRange._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany);D.oldRange=R.a.createFromRanges(q)}if(D.newRange){const q=D.newRange._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany);D.newRange=R.a.createFromRanges(q)}return[D]}},MoveOperation:{InsertOperation(I,L,D){let q=R.a.createFromPositionAndShift(I.sourcePosition,I.howMany);q=q._getTransformedByInsertion(L.position,L.nodes.maxOffset,!1,I.isSticky)[0];let z=new I.constructor(q.start,q.end.offset-q.start.offset,I instanceof V.a?I.baseVersion:I.targetPosition._getTransformedByInsertion(L.position,L.nodes.maxOffset,!D),I instanceof V.a?void 0:I.baseVersion);return z.isSticky=I.isSticky,I instanceof V.a&&(z._needsHolderElement=I._needsHolderElement,z._holderElementOffset=I._holderElementOffset),[z]},AttributeOperation:u,RootAttributeOperation:u,RenameOperation:u,MarkerOperation:u,MoveOperation(I,L,D){if(h(I,L)&&h(L,I))return[L.getReversed()];if(I instanceof V.a&&L instanceof V.a){const J=I.targetPosition.path[0],Q=L.targetPosition.path[0];(J>Q||J==Q&&D)&&(I=I.clone(),I.targetPosition.path[0]++)}I instanceof V.a&&!(L instanceof V.a)?D=!0:!(I instanceof V.a)&&L instanceof V.a&&(D=!1);const q=R.a.createFromPositionAndShift(I.sourcePosition,I.howMany),z=R.a.createFromPositionAndShift(L.sourcePosition,L.howMany);let K=[],$=w(q.getDifference(z));$&&($.start=$.start._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!I.isSticky,!1),$.end=$.end._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,I.isSticky,!1),K.push($));const H=q.getIntersection(z);let W=s.i(N.a)(I.sourcePosition.getParentPath(),L.sourcePosition.getParentPath()),U=q.containsPosition(L.targetPosition)||q.start.isEqual(L.targetPosition)&&I.isSticky||q.end.isEqual(L.targetPosition)&&I.isSticky,Z=z.containsRange(q)&&(z.containsPosition(I.targetPosition)||z.start.isEqual(I.targetPosition)||z.end.isEqual(I.targetPosition));if(null!==H&&('extension'===W||'same'===W&&D||Z)&&!U&&(H.start=H.start._getCombined(L.sourcePosition,L.getMovedRangeStart()),H.end=H.end._getCombined(L.sourcePosition,L.getMovedRangeStart()),$&&q.start.isBefore(z.start)?K.push(H):K.unshift(H)),0===K.length)return I instanceof V.a?(I=I.clone(),I.howMany=0,I.sourcePosition=L.targetPosition,[I]):[new F.a(I.baseVersion)];let G=I.targetPosition._getTransformedByMove(L.sourcePosition,L.targetPosition,L.howMany,!D,L.isSticky||Z);return K.reverse().map((J,Q)=>{let Y=new I.constructor(J.start,J.end.offset-J.start.offset,I instanceof V.a?I.baseVersion:G,I instanceof V.a?void 0:I.baseVersion);return Y.isSticky=I.isSticky,I instanceof V.a&&(Y._needsHolderElement=I._needsHolderElement&&0===Q,Y._holderElementOffset=I._holderElementOffset),Y})}}}},function(o,r,s){'use strict';var d=s(5);class u extends d.a{constructor(f,h,w='main'){super(h),this._doc=f,this.rootName=w}get document(){return this._doc}is(f,h){return h?'rootElement'==f&&h==this.name||super.is(f,h):'rootElement'==f||super.is(f)}toJSON(){return this.rootName}}r.a=u},function(o,r,s){'use strict';function d(E,O,V){for(let F=V.length-1,R=O.length-1;0<=F&&0<=R;){const N=O[R];if(!E.hasItem(N))return!1;const M=E._extensionChains.get(N);if(M.includes(V[F]))F--,R--;else return!1}return!0}var u=s(1),f=s(5),h=s(94),w=s(12),C=s(147),T=s(0);class P{constructor(){this.objects=new Set,this.limits=new Set,this._items=new Map,this._extensionChains=new Map,this.registerItem('$root'),this.registerItem('$block'),this.registerItem('$inline'),this.registerItem('$text','$inline'),this.allow({name:'$block',inside:'$root'}),this.allow({name:'$inline',inside:'$block'}),this.registerItem('$clipboardHolder','$root'),this.allow({name:'$inline',inside:'$clipboardHolder'})}allow(E){this._getItem(E.name).allow(P._normalizeQueryPath(E.inside),E.attributes)}disallow(E){this._getItem(E.name).disallow(P._normalizeQueryPath(E.inside),E.attributes)}requireAttributes(E,O){this._getItem(E).requireAttributes(O)}check(E){if(!this.hasItem(E.name))return!1;s.i(w.a)(E.attributes)?0===E.attributes.length&&E.attributes.push(void 0):E.attributes=[E.attributes];const O=P._normalizeQueryPath(E.inside),V=this._extensionChains.get(E.name).map((F)=>{return this._getItem(F)});if(!this._getItem(E.name)._checkRequiredAttributes(E.attributes))return!1;for(let F of E.attributes)for(let R of V)if(R._hasMatchingPath('disallow',O,F))return!1;for(let F of E.attributes){let R=!1;for(let N of V)if(N._hasMatchingPath('allow',O,F)){R=!0;break}if(!R)return!1}return!0}hasItem(E){return this._items.has(E)}registerItem(E,O){if(this.hasItem(E))throw new T.a('model-schema-item-exists: Item with specified name already exists in schema.');if(!!O&&!this.hasItem(O))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');this._items.set(E,new S(this));const V=this.hasItem(O)?this._extensionChains.get(O).concat(E):[E];this._extensionChains.set(E,V)}itemExtends(E,O){if(!this.hasItem(E)||!this.hasItem(O))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');const V=this._extensionChains.get(E);return V.some((F)=>F==O)}_getItem(E){if(!this.hasItem(E))throw new T.a('model-schema-no-item: Item with specified name does not exist in schema.');return this._items.get(E)}static _normalizeQueryPath(E){let O=[];if(s.i(w.a)(E))for(let V of E)V instanceof f.a?O.push(V.name):s.i(C.a)(V)&&O.push(V);else if(E instanceof u.a){for(let V=E.parent;null!==V;)O.push(V.name),V=V.parent;O.reverse()}else s.i(C.a)(E)&&(O=E.split(' '));return O}}r.a=P;class S{constructor(E){this._schema=E,this._allowed=[],this._disallowed=[],this._requiredAttributes=[]}allow(E,O){this._addPath('_allowed',E,O)}disallow(E,O){this._addPath('_disallowed',E,O)}requireAttributes(E){this._requiredAttributes.push(E)}_addPath(E,O,V){O=O.slice(),s.i(w.a)(V)||(V=[V]);for(let F of V)this[E].push({path:O,attribute:F})}_getPaths(E,O){const V='allow'===E?this._allowed:this._disallowed,F=[];for(let R of V)R.attribute===O&&F.push(R.path);return F}_checkRequiredAttributes(E){let O=!0;for(let V of this._requiredAttributes){O=!0;for(let F of V)if(-1==E.indexOf(F)){O=!1;break}if(O)break}return O}_hasMatchingPath(E,O,V){const F=this._getPaths(E,V);for(const R of F)if(d(this._schema,O,R))return!0;return!1}toJSON(){const E=s.i(h.a)(this);return E._schema='[model.Schema]',E}}},function(o,r,s){'use strict';var d=s(61),u=s(325),f=s(164),h=s(168),w=s(59),C=s(48),T=s(167),P=s(323),S=s(320),E=s(321),O=s(319),V=s(4),F=s(31);class R{constructor(){this.domRoots=new Map,this.selection=new d.a,this.domConverter=new f.a,this.roots=new Map,this.set('isFocused',!1),this.renderer=new u.a(this.domConverter,this.selection),this.renderer.bind('isFocused').to(this,'isFocused'),this._observers=new Map,this.addObserver(T.a),this.addObserver(P.a),this.addObserver(S.a),this.addObserver(E.a),this.addObserver(O.a),s.i(w.h)(this),this.on('render',()=>{this.disableObservers(),this.renderer.render(),this.enableObservers()})}addObserver(N){let M=this._observers.get(N);if(M)return M;M=new N(this),this._observers.set(N,M);for(let[I,L]of this.domRoots)M.observe(L,I);return M.enable(),M}getObserver(N){return this._observers.get(N)}createRoot(N,M='main'){const I='string'==typeof N?N:N.tagName,L=new h.a(I.toLowerCase(),M);return L.document=this,this.roots.set(M,L),L.on('change:children',(D,q)=>this.renderer.markToSync('children',q)),L.on('change:attributes',(D,q)=>this.renderer.markToSync('attributes',q)),L.on('change:text',(D,q)=>this.renderer.markToSync('text',q)),this.domConverter.isElement(N)&&this.attachDomRoot(N,M),L}attachDomRoot(N,M='main'){const I=this.getRoot(M);this.domRoots.set(M,N),this.domConverter.bindElements(N,I),this.renderer.markToSync('children',I),this.renderer.domDocuments.add(N.ownerDocument);for(let L of this._observers.values())L.observe(N,M)}getRoot(N='main'){return this.roots.get(N)}getDomRoot(N='main'){return this.domRoots.get(N)}render(){this.fire('render')}focus(){if(!this.isFocused){const N=this.selection.editableElement;N?(this.domConverter.focus(N),this.render()):C.a.warn('view-focus-no-selection: There is no selection in any editable to focus.')}}disableObservers(){for(let N of this._observers.values())N.disable()}enableObservers(){for(let N of this._observers.values())N.enable()}destroy(){for(let N of this._observers.values())N.destroy()}}r.a=R,s.i(V.a)(R,F.a)},function(o,r,s){'use strict';var d=s(60);class u extends d.a{constructor(f){super(f),this.domEventType='click'}onDomEvent(f){this.fire(f.type,f)}}r.a=u},function(o,r,s){'use strict';function d(T){return T==h.d.arrowright||T==h.d.arrowleft||T==h.d.arrowup||T==h.d.arrowdown}var u=s(50),f=s(61),h=s(23),w=s(141);class C extends u.a{constructor(T){super(T),this._fireSelectionChangeDoneDebounced=s.i(w.a)((P)=>this.document.fire('selectionChangeDone',P),200)}observe(){const T=this.document;T.on('keydown',(P,S)=>{const E=T.selection;E.isFake&&d(S.keyCode)&&this.isEnabled&&(S.preventDefault(),this._handleSelectionMove(S.keyCode))},{priority:'lowest'})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(T){const P=this.document.selection,S=f.a.createFromSelection(P);S.setFake(!1),(T==h.d.arrowleft||T==h.d.arrowup)&&S.collapseToStart(),(T==h.d.arrowright||T==h.d.arrowdown)&&S.collapseToEnd();const E={oldSelection:P,newSelection:S,domSelection:null};this.document.fire('selectionChange',E),this._fireSelectionChangeDoneDebounced(E)}}r.a=C},function(o,r,s){'use strict';var d=s(60);class u extends d.a{constructor(f){super(f),this.domEventType=['focus','blur'],this.useCapture=!0,f.on('focus',()=>{f.isFocused=!0,this._renderTimeoutId=setTimeout(()=>f.render(),0)}),f.on('blur',(h,w)=>{const C=f.selection.editableElement;(null===C||C===w.target)&&(f.isFocused=!1,f.render())})}onDomEvent(f){this.fire(f.type,f)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}r.a=u},function(o,r,s){'use strict';var d=s(60),u=s(23);class f extends d.a{constructor(h){super(h),this.domEventType='keydown'}onDomEvent(h){this.fire('keydown',h,{keyCode:h.keyCode,altKey:h.altKey,ctrlKey:h.ctrlKey||h.metaKey,shiftKey:h.shiftKey,get keystroke(){return s.i(u.c)(this)}})}}r.a=f},function(o,r,s){'use strict';var d=s(60);class u extends d.a{constructor(f){super(f),this.domEventType='mousedown'}onDomEvent(f){this.fire(f.type,f)}}r.a=u},function(o,r,s){'use strict';var d=s(50),u=s(167),f=s(48),h=s(141);class w extends d.a{constructor(C){super(C),this.mutationObserver=C.getObserver(u.a),this.document=C,this.selection=C.selection,this.domConverter=C.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=s.i(h.a)((T)=>this.document.fire('selectionChangeDone',T),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(C){const T=C.ownerDocument;this._documents.has(T)||(this.listenTo(T,'selectionchange',()=>{this._handleSelectionChange(T)}),this._documents.add(T))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(C){if(this.isEnabled&&this.document.isFocused){this.mutationObserver.flush();const T=C.defaultView.getSelection(),P=this.domConverter.domSelectionToView(T);if(!this.selection.isEqual(P)){if(60<++this._loopbackCounter)return void f.a.warn('selectionchange-infinite-loop: Selection change observer detected an infinite rendering loop.');const S={oldSelection:this.selection,newSelection:P,domSelection:T};this.document.fire('selectionChange',S),this._fireSelectionChangeDoneDebounced(S)}}}_clearInfiniteLoop(){this._loopbackCounter=0}}r.a=w},function(o,r,s){'use strict';function u(V){const F=V.document;V.removeClass('ck-placeholder'),V.removeAttribute('data-placeholder'),O.has(F)&&O.get(F).delete(V)}function f(V){const F=O.get(V);for(let[R,N]of F)h(R,N)}function h(V,F){const R=V.document;if(R){const N=R.selection,M=N.anchor;return F&&!F()?void V.removeClass('ck-placeholder'):R.isFocused||V.childCount?void(!V.childCount&&M&&M.parent!==V?V.addClass('ck-placeholder'):V.removeClass('ck-placeholder')):void V.addClass('ck-placeholder')}}var w=s(45),C=s(7),T=s(0),P=s(507),S=s.n(P);r.a=function(V,F,R){const N=V.document;if(!N)throw new T.a('view-placeholder-element-is-detached: Provided element is not placed in document.');u(V),O.has(N)||(O.set(N,new Map),E.listenTo(N,'render',()=>f(N),{priority:'high'})),V.setAttribute('data-placeholder',F),O.get(N).set(V,R),h(V,R)};const E={};s.i(w.a)(E,C.a);const O=new WeakMap},function(o,r,s){'use strict';function d(N,M){return!N.isCollapsed&&u(N).isEqual(u(M))}function u(N){const M=w.a.createFromSelection(N),I=M.getRanges();let L=[];for(let D of I)L.push(D.getTrimmed());return M.setRanges(L,M.isBackward),M}var f=s(29),h=s(26),w=s(61),C=s(59),T=s(4),P=s(185),S=s(392),E=s(396),O=s(48),V=s(31),F=s(0);class R{constructor(N,M){this.domDocuments=new Set,this.domConverter=N,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=M,this._inlineFiller=null,this.isFocused=!1,this._fakeSelectionContainer=null}markToSync(N,M){if('text'===N)this.domConverter.getCorrespondingDom(M.parent)&&this.markedTexts.add(M);else{if(!this.domConverter.getCorrespondingDom(M))return;if('attributes'===N)this.markedAttributes.add(M);else if('children'===N)this.markedChildren.add(M);else throw new F.a('view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.')}}render(){let N;this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?N=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(N=this.selection.getFirstPosition(),this.markedChildren.add(N.parent));for(let M of this.markedTexts)!this.markedChildren.has(M.parent)&&this.domConverter.getCorrespondingDom(M.parent)&&this._updateText(M,{inlineFillerPosition:N});for(let M of this.markedAttributes)this._updateAttrs(M);for(let M of this.markedChildren)this._updateChildren(M,{inlineFillerPosition:N});this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear(),this._inlineFiller=this._getInlineFillerNode(N)}_getInlineFillerNode(N){if(!N)return void(this._inlineFiller=null);const M=this.domConverter.viewPositionToDom(N);if(!M||!s.i(C.c)(M.parent))throw new F.a('view-renderer-cannot-find-filler: Cannot find filler node by its position.');return M.parent}_getInlineFillerPosition(){const N=this.selection.getFirstPosition();return N.parent.is('text')?h.a.createBefore(this.selection.getFirstPosition().parent):N}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const N=this.selection.getFirstPosition(),M=this.domConverter.viewPositionToDom(N);return M&&this.domConverter.isText(M.parent)&&s.i(C.c)(M.parent)}_removeInlineFiller(){const N=this._inlineFiller;if(!s.i(C.c)(N))throw new F.a('view-renderer-filler-was-lost: The inline filler node was lost.');s.i(C.f)(N)?N.parentNode.removeChild(N):N.data=N.data.substr(C.d),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const N=this.selection.getFirstPosition(),M=N.parent,I=N.offset;if(!this.domConverter.getCorrespondingDomElement(M.root))return!1;if(!M.is('element'))return!1;if(I===M.getFillerOffset())return!1;const L=N.nodeBefore,D=N.nodeAfter;return L instanceof f.a||D instanceof f.a?!1:!0}_updateText(N,M){const I=this.domConverter.getCorrespondingDom(N),L=this.domConverter.viewToDom(N,I.ownerDocument),D=I.data;let q=L.data;const z=M.inlineFillerPosition;z&&z.parent==N.parent&&z.offset==N.index&&(q=C.i+q),D!=q&&(I.data=q)}_updateAttrs(N){const M=this.domConverter.getCorrespondingDom(N),I=Array.from(M.attributes).map((D)=>D.name),L=N.getAttributeKeys();for(let D of L)M.setAttribute(D,N.getAttribute(D));for(let D of I)N.hasAttribute(D)||M.removeAttribute(D)}_updateChildren(N,M){function I(U,Z){if(U===Z)return!0;return L.isText(U)&&L.isText(Z)?U.data===Z.data:s.i(C.e)(U,L.blockFiller)&&s.i(C.e)(Z,L.blockFiller)}const L=this.domConverter,D=L.getCorrespondingDom(N);if(D){const q=D.ownerDocument,z=M.inlineFillerPosition,K=D.childNodes,$=Array.from(L.viewChildrenToDom(N,q,{bind:!0}));if(z&&z.parent==N){const U=$[z.offset];this.domConverter.isText(U)?U.data=C.i+U.data:$.splice(z.offset,0,q.createTextNode(C.i))}const H=s.i(P.a)(K,$,I);let W=0;for(let U of H)'insert'===U?(s.i(S.a)(D,W,$[W]),W++):'delete'===U?(this.domConverter.unbindDomElement(K[W]),s.i(E.a)(K[W])):W++}}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const N=this.domConverter.getCorrespondingDomElement(this.selection.editableElement);this.isFocused&&N&&(this.selection.isFake?this._updateFakeSelection(N):(this._removeFakeSelection(),this._updateDomSelection(N)))}_updateFakeSelection(N){const M=N.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=M.createElement('div'),this._fakeSelectionContainer.style.position='fixed',this._fakeSelectionContainer.style.top=0,this._fakeSelectionContainer.style.left='-9999px',this._fakeSelectionContainer.appendChild(M.createTextNode('\xA0'))),this._fakeSelectionContainer.parentElement||N.appendChild(this._fakeSelectionContainer);const I=this.selection.fakeSelectionLabel||'\xA0';this._fakeSelectionContainer.firstChild.data=I;const L=M.getSelection();L.removeAllRanges();const D=new Range;D.selectNodeContents(this._fakeSelectionContainer),L.addRange(D),this.domConverter.bindFakeSelection(this._fakeSelectionContainer,this.selection)}_updateDomSelection(N){const M=N.ownerDocument.defaultView.getSelection(),I=M&&this.domConverter.domSelectionToView(M);if(!(I&&this.selection.isEqual(I))){if(I&&d(I,this.selection)){const q={oldSelection:I,currentSelection:this.selection};return void O.a.warn('renderer-skipped-selection-rendering: The selection was not rendered due to its similarity to the current one.',q)}const L=this.domConverter.viewPositionToDom(this.selection.anchor),D=this.domConverter.viewPositionToDom(this.selection.focus);M.collapse(L.parent,L.offset),M.extend(D.parent,D.offset)}}_removeDomSelection(){for(let N of this.domDocuments){const M=N.getSelection();if(M.rangeCount){const I=N.activeElement,L=this.domConverter.getCorrespondingViewElement(I);I&&L&&N.getSelection().removeAllRanges()}}}_removeFakeSelection(){const N=this._fakeSelectionContainer;N&&N.remove()}_updateFocus(){if(this.isFocused){const N=this.selection.editableElement;N&&this.domConverter.focus(N)}}}r.a=R,s.i(T.a)(R,V.a)},function(o,r,s){'use strict';var d=s(0);class u{constructor(f,h,w){if(this.textNode=f,0>h||h>f.data.length)throw new d.a('view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.');if(0>w||h+w>f.data.length)throw new d.a('view-textproxy-wrong-length: Given length value is incorrect.');this.data=f.data.substring(h,h+w),this.offsetInText=h}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(f){return'textProxy'==f}getAncestors(f={includeNode:!1,parentFirst:!1}){const h=[];for(let w=f.includeNode?this.textNode:this.parent;null!==w;)h[f.parentFirst?'push':'unshift'](w),w=w.parent;return h}}r.a=u},function(o,r,s){'use strict';var d=s(2),u=s(328),f=s(329);class h extends d.a{static get pluginName(){return'enter/enter'}init(){const w=this.editor,C=w.editing.view;C.addObserver(f.a),w.commands.set('enter',new u.a(w)),this.listenTo(C,'enter',(T,P)=>{w.execute('enter'),P.preventDefault()},{priority:'low'})}}r.a=h},function(o,r,s){'use strict';function d(C,T,P,S){const E=P.isCollapsed,O=P.getFirstRange(),V=O.start.parent,F=O.end.parent;if(!(S.limits.has(V.name)||S.limits.has(F.name))){if(V.root==V)return void(E||C.deleteContent(P,T));if(E)u(T,P,O.start);else{const R=O.start.isAtStart&&O.end.isAtEnd;C.deleteContent(P,T,{merge:R}),R||(V==F?u(T,P,P.focus):P.collapse(F))}}}function u(C,T,P){if(P.isAtEnd){const S=P.parent,E=new S.constructor(S.name,S.getAttributes());C.insert(h.a.createAfter(P.parent),E)}else C.split(P);T.collapse(P.parent.nextSibling)}var f=s(11),h=s(1);class w extends f.a{_doExecute(){const C=this.editor.document,T=C.batch();C.enqueueChanges(()=>{d(this.editor.data,T,C.selection,C.schema),this.fire('afterExecute',{batch:T})})}}r.a=w},function(o,r,s){'use strict';var d=s(50),u=s(116),f=s(23);class h extends d.a{constructor(w){super(w),w.on('keydown',(C,T)=>{this.isEnabled&&T.keyCode==f.d.enter&&w.fire('enter',new u.a(w,T.domEvent))})}observe(){}}r.a=h},function(o,r,s){'use strict';function d(V,F){return Array.prototype.concat(...V.map((R)=>[R,F]))}var u=s(77),f=s(170),h=s(2),w=s(378),C=s(369),T=s(78),P=s(6),S=s(508),E=s.n(S);class O extends h.a{static get requires(){return[u.a,f.a]}static get pluginName(){return'heading/heading'}init(){const V=this.editor,F=new T.a,R=this._getLocalizedOptions(),N=[],M=V.t,I=M('Choose heading'),L=M('Heading');for(let q of R){const z=V.commands.get(q.modelElement),K=new w.a({commandName:q.modelElement,label:q.title,class:q.class});K.bind('isActive').to(z,'value'),F.add(K),N.push(z)}const D=new w.a({withText:!0,items:F,tooltip:L});D.bind('isEnabled').to(...d(N,'isEnabled'),(...q)=>q.some((z)=>z)),D.bind('label').to(...d(N,'value'),(...q)=>{const z=q.findIndex((K)=>K);return R[z]?R[z].title:I}),V.ui.componentFactory.add('headings',(q)=>{const z=s.i(C.a)(D,q);return P.a.extend(z.template,{attributes:{class:['ck-heading-dropdown']}}),this.listenTo(z,'execute',(K)=>{V.execute(K.source.commandName),V.editing.view.focus()}),z})}_getLocalizedOptions(){const V=this.editor,F=V.t,R={Paragraph:F('Paragraph'),'Heading 1':F('Heading 1'),'Heading 2':F('Heading 2'),'Heading 3':F('Heading 3')};return V.config.get('heading.options').map((N)=>{const M=R[N.title];return M&&M!=N.title&&(N=Object.assign({},N,{title:M})),N})}}r.a=O},function(o,r,s){'use strict';var d=s(3),u=s(11),f=s(57),h=s(1),w=s(64);class C extends u.a{constructor(T,P){super(T),Object.assign(this,P),this.set('value',!1),this.listenTo(T.document,'changesDone',()=>{this.refreshValue(),this.refreshState()})}_doExecute(T={}){const P=this.editor,S=P.document,E=this.value;S.enqueueChanges(()=>{const O=T.batch||S.batch();for(let V of S.selection.getSelectedBlocks())if(!E)V.is(this.modelElement)||O.rename(V,this.modelElement);else if(V.is(this.modelElement)){const F=new f.a;F.addRange(d.a.createIn(V)),P.execute('paragraph',{selection:F,batch:O})}})}refreshValue(){const T=s.i(w.a)(this.editor.document.selection.getSelectedBlocks());this.value=!!T&&T.is(this.modelElement)}_checkEnabled(){const T=s.i(w.a)(this.editor.document.selection.getSelectedBlocks());return!!T&&this.editor.document.schema.check({name:this.modelElement,inside:h.a.createBefore(T)})}}r.a=C},function(o,r,s){'use strict';var d=s(2),u=s(171),f=s(504),h=s(341),w=s(511),C=s.n(w);class T extends d.a{static get requires(){return[u.a,f.a,h.a]}static get pluginName(){return'image/image'}}r.a=T},function(o,r,s){'use strict';function f(T,P,S,E){const O=T.name.split(':'),V=O[0]+':'+O[1];if(S.consume(P.item,V)){const F=E.mapper.toViewElement(P.item),R=F.getChild(0);'removeAttribute'==O[0]?R.removeAttribute(P.attributeKey):R.setAttribute(P.attributeKey,P.attributeNewValue)}}var h=s(5),w=s(1),C=s(13);r.b=function(){return(T,P,S,E)=>{const O=P.input;if(S.test(O,{name:!0,class:'image'})&&E.schema.check({name:'image',inside:P.context,attributes:'src'})){const V=O.getChild(0);if(V&&'img'==V.name&&S.test(V,{name:!0,attribute:'src'})){S.consume(O,{name:!0,class:'image'}),S.consume(V,{name:!0,attribute:'src'});const F=new h.a('image',{src:V.getAttribute('src')});S.consume(V,{attribute:['alt']})&&F.setAttribute('alt',V.getAttribute('alt')),P.context.push(F);const R=E.convertChildren(O,S,P),N=w.a.createAt(F,'end');C.a.insert(N,R),P.context.pop(),P.output=F}}}},r.a=function(T,P){for(let S of T)S.on(`addAttribute:${P}:image`,f),S.on(`changeAttribute:${P}:image`,f),S.on(`removeAttribute:${P}:image`,f)}},function(o,r,s){'use strict';var d=s(2),u=s(335),f=s(509),h=s.n(f);class w extends d.a{static get requires(){return[u.a]}static get pluginName(){return'image/imagecaption'}}r.a=w},function(o,r,s){'use strict';function d(I,L,D,q){if('insert'===L){const z=new C.a({boundaries:D.range,ignoreElementEnd:!0});for(let K of z){const $=K.item;'elementStart'==K.type&&s.i(R.b)($)&&!s.i(N.c)($)&&q.document.enqueueChanges(()=>{s.i(N.c)($)||q.insert(O.a.createAt($,'end'),new T.a('caption'))})}}}function u(I,L=!0){return(D,q,z,K)=>{const $=q.item;if(($.childCount||L)&&s.i(R.b)($.parent)){if(!z.consume(q.item,'insert'))return;const H=K.mapper.toViewElement(q.range.start.parent),W=I instanceof S.a?I.clone(!0):I();$.childCount||W.addClass('ck-hidden'),f(W,q.item,H,K.mapper)}}}function f(I,L,D,q){const z=V.a.createAt(D,'end');E.a.insert(z,I),q.bindElements(L,I)}function h(I){const L=I.getAncestors({includeNode:!0}),D=L.find((q)=>'caption'==q.name);return D&&D.parent&&'image'==D.parent.name?D:null}var w=s(2),C=s(33),T=s(5),P=s(41),S=s(21),E=s(76),O=s(1),V=s(26),F=s(38),R=s(42),N=s(336);class M extends w.a{init(){const I=this.editor,L=I.document,D=I.editing.view,q=L.schema,z=I.data,K=I.editing,$=I.t;this._createCaption=s.i(N.a)(D,$('Enter image caption')),q.registerItem('caption'),q.allow({name:'$inline',inside:'caption'}),q.allow({name:'caption',inside:'image'}),q.limits.add('caption'),L.on('change',d),s.i(F.a)().for(z.viewToModel).from(N.b).toElement('caption'),z.modelToView.on('insert:caption',u(new P.a('figcaption'),!1)),K.modelToView.on('insert:caption',u(this._createCaption)),K.modelToView.on('insert',(H,W)=>this._fixCaptionVisibility(W.item),{priority:'high'}),K.modelToView.on('remove',(H,W)=>this._fixCaptionVisibility(W.sourcePosition.parent),{priority:'high'}),this.listenTo(D,'render',()=>this._updateCaptionVisibility(),{priority:'high'})}_updateCaptionVisibility(){const I=this.editor.editing.mapper,L=this.editor.editing.view.selection,D=L.getSelectedElement();let q;if(this._lastSelectedCaption&&!this._lastSelectedCaption.childCount&&this._lastSelectedCaption.addClass('ck-hidden'),D&&s.i(R.a)(D)){const z=I.toModelElement(D),K=s.i(N.c)(z);q=I.toViewElement(K)}s.i(N.d)(L.editableElement)&&(q=L.editableElement),q&&(q.removeClass('ck-hidden'),this._lastSelectedCaption=q)}_fixCaptionVisibility(I){const L=h(I),D=this.editor.editing.mapper;if(L){const q=D.toViewElement(L);q&&(L.childCount?q.removeClass('ck-hidden'):q.addClass('ck-hidden'))}}}r.a=M},function(o,r,s){'use strict';var w=s(5),C=s(74),T=s(324),P=s(151);r.a=function(E,O){return()=>{const V=new C.a('figcaption');return V.document=E,V.setCustomProperty(S,!0),s.i(T.a)(V,O),s.i(P.c)(V)}},r.d=function(E){return!!E.getCustomProperty(S)},r.c=function(E){for(let O of E.getChildren())if(O instanceof w.a&&'caption'==O.name)return O;return null},r.b=function(E){const O=E.parent;return'figcaption'==E.name&&O&&'figure'==O.name&&O.hasClass('image')?{name:!0}:null};const S=Symbol('imageCaption')},function(o,r,s){'use strict';var d=s(2),u=s(340),f=s(22);class h extends d.a{static get requires(){return[u.a]}static get pluginName(){return'image/imagestyle'}init(){const w=this.editor.config.get('image.styles');for(let T of w)this._createButton(T);const C=this.editor.config.get('image.defaultToolbar');C&&(C.length&&C.push('|'),w.forEach((T)=>C.push(T.name)))}_createButton(w){const C=this.editor,T=C.commands.get(w.name);C.ui.componentFactory.add(w.name,(P)=>{const S=new f.a(P);return S.set({label:w.title,icon:w.icon,tooltip:!0}),S.bind('isEnabled').to(T,'isEnabled'),S.bind('isOn').to(T,'value'),this.listenTo(S,'execute',()=>C.execute(w.name)),S})}}r.a=h},function(o,r,s){'use strict';function f(P,S,E,O){const V=S.input,F=S.output;if(E.test(V,{class:P.className})&&s.i(T.b)(F)){const R=[...F.getAttributeKeys(),'imageStyle'];O.schema.check({name:'image',inside:S.context,attributes:R})&&(E.consume(V,{class:P.className}),F.setAttribute('imageStyle',P.value))}}function h(P,S){for(let E of S)if(E.value===P)return E}function w(P,S,E){return S&&('changeAttribute'==P||'removeAttribute'==P)&&(E.removeClass(S.className),!0)}function C(P,S,E){return S&&('addAttribute'==P||'changeAttribute'==P)&&(E.addClass(S.className),!0)}var T=s(42);r.a=function(P){return(S,E,O,V)=>{const F=S.name.split(':')[0],R=F+':imageStyle';if(O.test(E.item,R)){const N=h(E.attributeNewValue,P),M=h(E.attributeOldValue,P),I=V.mapper.toViewElement(E.item);(w(F,M,I)||C(F,N,I))&&O.consume(E.item,R)}}},r.b=function(P){const S=P.filter((E)=>null!==E.value);return(E,O,V,F)=>{for(let R of S)f(R,O,V,F)}}},function(o,r,s){'use strict';var d=s(11),u=s(42);class f extends d.a{constructor(h,w){super(h),this.set('value',!1),this.style=w,this.listenTo(h.document,'changesDone',()=>{this._updateValue(),this.refreshState()})}_updateValue(){const h=this.editor.document,w=h.selection.getSelectedElement();return w?void(null===this.style.value?this.value=!w.hasAttribute('imageStyle'):this.value=w.getAttribute('imageStyle')==this.style.value):void(this.value=!1)}_checkEnabled(){const h=this.editor.document.selection.getSelectedElement();return s.i(u.b)(h)}_doExecute(h={}){if(this.value)return;const w=this.editor,C=w.document,T=C.selection,P=T.getSelectedElement();C.enqueueChanges(()=>{const S=h.batch||C.batch();S.setAttribute(P,'imageStyle',this.style.value)})}}r.a=f},function(o,r,s){'use strict';var d=s(2),u=s(339),f=s(171),h=s(338),w=s(517),C=s.n(w),T=s(518),P=s.n(T);class S extends d.a{static get requires(){return[f.a]}init(){const E=this.editor,O=E.t,V=E.document,F=V.schema,R=E.data,N=E.editing;E.config.define('image.styles',[{name:'imageStyleFull',title:O('Full size image'),icon:C.a,value:null},{name:'imageStyleSide',title:O('Side image'),icon:P.a,value:'side',className:'image-style-side'}]);const M=E.config.get('image.styles');F.allow({name:'image',attributes:'imageStyle',inside:'$root'});const I=s.i(h.a)(M);N.modelToView.on('addAttribute:imageStyle:image',I),R.modelToView.on('addAttribute:imageStyle:image',I),N.modelToView.on('changeAttribute:imageStyle:image',I),R.modelToView.on('changeAttribute:imageStyle:image',I),N.modelToView.on('removeAttribute:imageStyle:image',I),R.modelToView.on('removeAttribute:imageStyle:image',I),R.viewToModel.on('element:figure',s.i(h.b)(M),{priority:'low'});for(let L of M)E.commands.set(L.name,new u.a(E,L))}}r.a=S},function(o,r,s){'use strict';var d=s(2),u=s(22),f=s(343),h=s(364),w=s(178),C=s(173),T=s(344),P=s(172),S=s(516),E=s.n(S),O=s(510),V=s.n(O);class F extends d.a{static get requires(){return[f.a]}static get pluginName(){return'image/imagetextalternative'}init(){this._createButton();const R=this.editor.config.get('image.defaultToolbar');return R&&(R.length&&R.push('|'),R.push('imageTextAlternative')),this._createBalloonPanel().then((N)=>{this.balloonPanel=N,this.form=N.content.get(0)})}_createButton(){const R=this.editor,N=R.commands.get('imageTextAlternative'),M=R.t;R.ui.componentFactory.add('imageTextAlternative',(I)=>{const L=new u.a(I);return L.set({label:M('Change image text alternative'),icon:E.a,tooltip:!0}),L.bind('isEnabled').to(N,'isEnabled'),this.listenTo(L,'execute',()=>this._showBalloonPanel()),L})}_createBalloonPanel(){const R=this.editor,N=new P.a(R),M=new T.a(R.locale);this.listenTo(M,'submit',()=>{R.execute('imageTextAlternative',{newValue:M.lebeledInput.inputView.element.value}),this._hideBalloonPanel()});const I=R.plugins.get(C.a);return I&&this.listenTo(N,'change:isVisible',()=>{N.isVisible?(I.hide(),I.isEnabled=!1):(I.show(),I.isEnabled=!0)}),this.listenTo(M,'cancel',()=>this._hideBalloonPanel()),s.i(h.a)({emitter:N,activator:()=>N.isVisible,callback:()=>this._hideBalloonPanel()}),s.i(w.a)({emitter:N,activator:()=>N.isVisible,contextElement:N.element,callback:()=>this._hideBalloonPanel()}),Promise.all([N.content.add(M),R.ui.view.body.add(N)]).then(()=>N)}_showBalloonPanel(){const R=this.editor,N=R.commands.get('imageTextAlternative');this.form.lebeledInput.value=N.value||'',this.balloonPanel.attach(),this.form.lebeledInput.select()}_hideBalloonPanel(){const R=this.editor;this.balloonPanel.detach(),R.editing.view.focus()}}r.a=F},function(o,r,s){'use strict';var d=s(11),u=s(42);class f extends d.a{constructor(h){super(h),this.set('value',!1),this.listenTo(h.document,'changesDone',()=>{this._updateValue(),this.refreshState()})}_updateValue(){const h=this.editor.document,w=h.selection.getSelectedElement();this.value=s.i(u.b)(w)&&w.hasAttribute('alt')&&w.getAttribute('alt')}_checkEnabled(){const h=this.editor.document.selection.getSelectedElement();return s.i(u.b)(h)}_doExecute(h){const w=this.editor,C=w.document,T=C.selection.getSelectedElement();C.enqueueChanges(()=>{const P=h.batch||C.batch();P.setAttribute(T,'alt',h.newValue)})}}r.a=f},function(o,r,s){'use strict';var d=s(342),u=s(2);class f extends u.a{init(){this.editor.commands.set('imageTextAlternative',new d.a(this.editor))}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(22),f=s(6),h=s(181),w=s(180),C=s(179);class T extends d.a{constructor(P){super(P);const S=this.locale.t;this.lebeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(S('Save')),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(S('Cancel'),'cancel'),f.a.extend(this.saveButtonView.template,{attributes:{class:['ck-button-action']}}),this.template=new f.a({tag:'form',attributes:{class:['cke-text-alternative-form']},children:[this.lebeledInput,{tag:'div',attributes:{class:['cke-text-alternative-form__actions']},children:[this.saveButtonView,this.cancelButtonView]}]}),s.i(C.a)({view:this})}_createButton(P,S){const E=new u.a(this.locale);return E.label=P,E.withText=!0,S&&E.delegate('execute').to(this,S),E}_createLabeledInputView(){const P=this.locale.t,S=new h.a(this.locale,w.a);return S.label=P('Text alternative'),S}}r.a=T},function(o,r,s){'use strict';function d(I){return I.parent.getAncestors().find((L)=>L instanceof w.a)}var u=s(2),f=s(318),h=s(347),w=s(175),C=s(178),T=s(22),P=s(182),S=s(348),E=s(520),O=s.n(E),V=s(521),F=s.n(V),R=s(512),N=s.n(R);class M extends u.a{static get requires(){return[h.a]}static get pluginName(){return'link/link'}init(){this.editor.editing.view.addObserver(f.a),this.balloonPanelView=this._createBalloonPanel(),this.formView=this._createForm(),this._createToolbarLinkButton(),this._createToolbarUnlinkButton()}_createToolbarLinkButton(){const I=this.editor,L=I.commands.get('link'),D=I.t;I.keystrokes.set('CTRL+K',()=>this._showPanel()),I.ui.componentFactory.add('link',(q)=>{const z=new T.a(q);return z.isEnabled=!0,z.label=D('Link'),z.icon=O.a,z.keystroke='CTRL+K',z.tooltip=!0,z.bind('isEnabled').to(L,'isEnabled'),this.listenTo(z,'execute',()=>this._showPanel()),z})}_createToolbarUnlinkButton(){const I=this.editor,L=I.t,D=I.commands.get('unlink');I.ui.componentFactory.add('unlink',(q)=>{const z=new T.a(q);return z.isEnabled=!1,z.label=L('Unlink'),z.icon=F.a,z.tooltip=!0,z.bind('isEnabled').to(D,'isEnabled'),this.listenTo(z,'execute',()=>I.execute('unlink')),z})}_createBalloonPanel(){const I=this.editor,L=I.editing.view,D=new P.a(I.locale);return D.maxWidth=300,I.ui.focusTracker.add(D.element),this.listenTo(L,'click',()=>{const q=L.selection,z=d(q.getFirstPosition());q.isCollapsed&&z&&(this._attachPanelToElement(),this.listenTo(L,'render',()=>{const K=d(q.getFirstPosition());q.isCollapsed&&z===K?this._attachPanelToElement(z):this._hidePanel()}),this.listenTo(D,'change:isVisible',()=>this.stopListening(L,'render')))}),I.keystrokes.set('Tab',(q,z)=>{D.isVisible&&!this.formView.focusTracker.isFocused&&(this.formView.focus(),z())}),I.keystrokes.set('Esc',(q,z)=>{D.isVisible&&(this._hidePanel(!0),z())}),s.i(C.a)({emitter:D,activator:()=>D.isVisible,contextElement:D.element,callback:()=>this._hidePanel()}),I.ui.view.body.add(D),D}_createForm(){const I=this.editor,L=new S.a(I.locale);return L.urlInputView.bind('value').to(I.commands.get('link'),'value'),this.listenTo(L,'submit',()=>{I.execute('link',L.urlInputView.inputView.element.value),this._hidePanel(!0)}),this.listenTo(L,'unlink',()=>{I.execute('unlink'),this._hidePanel(!0)}),L.keystrokes.set('Esc',(D,q)=>{this._hidePanel(!0),q()}),this.listenTo(L,'cancel',()=>this._hidePanel(!0)),this.balloonPanelView.content.add(L),L}_attachPanelToElement(I){const L=this.editor.editing.view,D=I||d(L.selection.getFirstPosition()),q=D?L.domConverter.getCorrespondingDomElement(D):L.domConverter.viewRangeToDom(L.selection.getFirstRange());this.balloonPanelView.attachTo({target:q,limiter:L.domConverter.getCorrespondingDomElement(L.selection.editableElement)})}_hidePanel(I){this.balloonPanelView.hide(),I&&this.editor.editing.view.focus()}_showPanel(){this._attachPanelToElement(),this.formView.urlInputView.select()}}r.a=M},function(o,r,s){'use strict';var d=s(11),u=s(25),f=s(3),h=s(99),w=s(154),C=s(174);class T extends d.a{constructor(P){super(P),this.set('value',void 0),this.listenTo(this.editor.document.selection,'change:attribute',()=>{this.value=this.editor.document.selection.getAttribute('linkHref')})}_checkEnabled(){const P=this.editor.document;return s.i(w.a)('linkHref',P.selection,P.schema)}_doExecute(P){const S=this.editor.document,E=S.selection;S.enqueueChanges(()=>{const O=S.batch();if(E.isCollapsed){const V=E.getFirstPosition(),F=V.parent;if(E.hasAttribute('linkHref')){const R=s.i(C.a)(E.getFirstPosition(),E.getAttribute('linkHref'));O.setAttribute(R,'linkHref',P),E.setRanges([R])}else if(S.schema.check({name:'$text',attributes:'linkHref',inside:F.name})){const R=new u.a(P,{linkHref:P});O.insert(V,R),E.setRanges([f.a.createOn(R)])}}else{const V=s.i(h.a)('linkHref',E.getRanges(),S.schema);for(let F of V)O.setAttribute(F,'linkHref',P)}})}}r.a=T},function(o,r,s){'use strict';var d=s(2),u=s(37),f=s(38),h=s(175),w=s(346),C=s(349);class T extends d.a{init(){const P=this.editor,S=P.data,E=P.editing;P.document.schema.allow({name:'$inline',attributes:'linkHref'}),s.i(u.a)().for(S.modelToView,E.modelToView).fromAttribute('linkHref').toElement((O)=>new h.a('a',{href:O})),s.i(f.a)().for(S.viewToModel).fromElement('a').toAttribute((O)=>({key:'linkHref',value:O.getAttribute('href')})),P.commands.set('link',new w.a(P)),P.commands.set('unlink',new C.a(P))}}r.a=T},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(118),h=s(22),w=s(181),C=s(180),T=s(179),P=s(65),S=s(117),E=s(66);class O extends d.a{constructor(V){super(V);const F=V.t;this.focusTracker=new P.a,this.keystrokes=new E.a,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(F('Save')),this.saveButtonView.type='submit',this.cancelButtonView=this._createButton(F('Cancel'),'cancel'),this.unlinkButtonView=this._createButton(F('Unlink'),'unlink'),this._focusables=new f.a,this._focusCycler=new S.a({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:'shift + tab',focusNext:'tab'}}),u.a.extend(this.saveButtonView.template,{attributes:{class:['ck-button-action']}}),this.template=new u.a({tag:'form',attributes:{class:['ck-link-form']},children:[this.urlInputView,{tag:'div',attributes:{class:['ck-link-form__actions']},children:[this.saveButtonView,this.cancelButtonView,this.unlinkButtonView]}]}),s.i(T.a)({view:this});const R=[this.urlInputView,this.saveButtonView,this.cancelButtonView,this.unlinkButtonView];R.forEach((N)=>{this._focusables.add(N),this.focusTracker.add(N.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const V=this.locale.t,F=new w.a(this.locale,C.a);return F.label=V('Link URL'),F}_createButton(V,F){const R=new h.a(this.locale);return R.label=V,R.withText=!0,F&&R.delegate('execute').to(this,F),R}}r.a=O},function(o,r,s){'use strict';var d=s(11),u=s(174);class f extends d.a{constructor(h){super(h),this.listenTo(h.document.selection,'change:attribute',()=>this.refreshState())}_doExecute(){const h=this.editor.document,w=h.selection;h.enqueueChanges(()=>{const C=w.isCollapsed?[s.i(u.a)(w.getFirstPosition(),w.getAttribute('linkHref'))]:w.getRanges(),T=h.batch();for(let P of C)T.removeAttribute(P,'linkHref')})}_checkEnabled(){return this.editor.document.selection.hasAttribute('linkHref')}}r.a=f},function(o,r,s){'use strict';function F(Q,Y,X){const ee=Q.nodeBefore;let te=Q.nodeAfter;if(te&&'listItem'==te.name){const ae=ee&&ee.is('listItem')?ee.getAttribute('indent')+1:0;let ne=te.getAttribute('indent')-ae;const ie=[];for(;te&&'listItem'==te.name&&te.getAttribute('indent')>ae;){ne>te.getAttribute('indent')&&(ne=te.getAttribute('indent'));const oe=te.getAttribute('indent')-ne;ie.push({item:te,indent:oe}),te=te.nextSibling}0{for(let oe of ie.reverse())X.setAttribute(oe.item,'indent',oe.indent)})}}function R(Q,Y,X,ee){let te=Q[Y?'nodeBefore':'nodeAfter'];if(!te||!te.is('listItem')||0===te.getAttribute('indent'))return;const ae=q(te,!Y);if(!ae||ae==te)return;const ne=ae.getAttribute('indent'),ie=ae.getAttribute('type');X.enqueueChanges(()=>{for(;te&&te.is('listItem')&&te.getAttribute('indent')>=ne;)te.getAttribute('type')!=ie&&te.getAttribute('indent')==ne&&ee.setAttribute(te,'type',ie),te=te[Y?'previousSibling':'nextSibling']})}function N(Q,Y){const X='numbered'==Q.getAttribute('type')?'ol':'ul',ee=new z.a,te=new W.a(X,null);return te.appendChildren(ee),Y.bindElements(Q,ee),ee}function M(Q,Y){const X=Y.getNext?'nextSibling':'previousSibling',ee=Y.getNext?'nodeAfter':'nodeBefore',te=!!Y.checkAllSiblings,ae=!!Y.sameIndent,ne=!!Y.biggerIndent,ie=!!Y.smallerIndent,oe=!!Y.isMapped,re=Q instanceof K.a?Q.getAttribute('indent'):Y.indent;for(let se=Q instanceof K.a?Q[X]:Q[ee],le;se&&'listItem'==se.name;){if(le=se.getAttribute('indent'),ae&&re==le||ne&&rele){if(!oe||Y.mapper.toViewElement(se))return se;se=se[X];continue}if(!te)return null;se=se[X]}return null}function I(Q,Y){return Q&&Y&&('ul'==Q.name||'ol'==Q.name)&&Q.name==Y.name?J.a.mergeContainers(U.a.createAfter(Q)):null}function L(Q,Y,X,ee){const te=Y.parent;let ae,ne=M(Q,{sameIndent:!0,smallerIndent:!0,checkAllSiblings:!0});if(ne&&ne.getAttribute('indent')==Q.getAttribute('indent')){let oe=X.toViewElement(ne);ae=J.a.breakContainer(U.a.createAfter(oe))}else ne=Q.previousSibling,ae=ne&&'listItem'==ne.name?ne.getAttribute('indent')=X;)Q=Q[ee],Q.getAttribute('indent')==X&&(te=Q);return te}var z=s(354),K=s(5),$=s(1),H=s(13),W=s(41),U=s(26),Z=s(34),G=s(51),J=s(76);r.e=function(Q,Y,X,ee){if(X.test(Y.item,'insert')&&X.test(Y.item,'addAttribute:type')&&X.test(Y.item,'addAttribute:indent')){X.consume(Y.item,'insert'),X.consume(Y.item,'addAttribute:type'),X.consume(Y.item,'addAttribute:indent');const te=Y.item,ae=N(te,ee.mapper);L(te,ae,ee.mapper)}},r.f=function(Q,Y,X,ee){if(!X.consume(Y.item,'changeAttribute:type'))return;const te=ee.mapper.toViewElement(Y.item);J.a.breakContainer(U.a.createBefore(te)),J.a.breakContainer(U.a.createAfter(te));let ae=te.parent;const ne='numbered'==Y.attributeNewValue?'ol':'ul';ae=J.a.rename(ae,ne),I(ae,ae.nextSibling),I(ae.previousSibling,ae)},r.g=function(Q,Y,X,ee){if(X.consume(Y.item,'remove')){const te=ee.mapper.toViewPosition(Y.sourcePosition),ae=te.nodeAfter.is('li')?te.nodeAfter:te.nodeAfter.getChild(0);J.a.breakContainer(U.a.createBefore(ae)),J.a.breakContainer(U.a.createAfter(ae));const ne=ae.parent,ie=ne.previousSibling,oe=Z.a.createOn(ne);J.a.remove(oe),ie&&ie.nextSibling&&I(ie,ie.nextSibling),D(Y.item.getAttribute('indent')+1,Y.sourcePosition,oe.start,ae,ee.mapper),'$graveyard'==Y.item.root.rootName&&ee.mapper.unbindModelElement(Y.item)}},r.i=function(Q,Y,X,ee){if(!X.consume(Y.item,'changeAttribute:indent'))return;const te=ee.mapper.toViewElement(Y.item);J.a.breakContainer(U.a.createBefore(te)),J.a.breakContainer(U.a.createAfter(te));const ae=te.parent,ne=ae.previousSibling,ie=Z.a.createOn(ae);J.a.remove(ie);let oe;ne&&ne.nextSibling&&(oe=I(ne,ne.nextSibling)),oe||(oe=ie.start),D(Y.attributeOldValue+1,Y.range.start,ie.start,te,ee.mapper),L(Y.item,te,ee.mapper,oe)},r.d=function(Q,Y,X,ee){if('listItem'!=Y.item.name){let te=ee.mapper.toViewPosition(Y.range.start);const ae=[];for(;('ul'==te.parent.name||'ol'==te.parent.name)&&(te=J.a.breakContainer(te),'li'==te.parent.name);){const ne=te,ie=U.a.createAt(te.parent,'end');if(!ne.isEqual(ie)){const oe=J.a.remove(new Z.a(ne,ie));ae.push(oe)}te=U.a.createAfter(te.parent)}if(0ne.is('ul')||ne.is('ol')),ae=new G.a({startPosition:U.a.createAt(ee,0)});for(let ne of ae)if('elementStart'==ne.type&&ne.item.is('li')){Y.viewPosition=ne.previousPosition;break}else if('elementEnd'==ne.type&&ne.item==te){Y.viewPosition=ne.nextPosition;break}}},r.c=function(Q,Y){const X=Y.viewPosition,ee=X.parent,te=Y.mapper;if('ul'==ee.name||'ol'==ee.name){if(!X.isAtEnd){const ae=te.toModelElement(X.nodeAfter);Y.modelPosition=$.a.createBefore(ae)}else{const ae=te.toModelElement(X.nodeBefore),ne=te.getModelLength(X.nodeBefore);Y.modelPosition=$.a.createBefore(ae).getShiftedBy(ne)}Q.stop()}else if('li'==ee.name&&X.nodeBefore&&('ul'==X.nodeBefore.name||'ol'==X.nodeBefore.name)){const ae=te.toModelElement(ee);let ne=1,ie=X.nodeBefore;for(;ie&&(ie.is('ul')||ie.is('ol'));)ne+=te.getModelLength(ie),ie=ie.previousSibling;Y.modelPosition=$.a.createBefore(ae).getShiftedBy(ne),Q.stop()}},r.a=function(Q){return(Y,X,ee,te)=>{if('remove'==X)F(ee.sourcePosition,Q,te),R(ee.sourcePosition,!1,Q,te);else if('move'==X)F(ee.sourcePosition,Q,te),R(ee.sourcePosition,!1,Q,te),F(ee.range.start,Q,te),R(ee.range.start,!1,Q,te),F(ee.range.end,Q,te),R(ee.range.end,!0,Q,te);else if('rename'==X&&'listItem'==ee.oldName&&'listItem'!=ee.newName){const ae=ee.element;Q.enqueueChanges(()=>{te.removeAttribute(ae,'indent').removeAttribute(ae,'type')});const ne=$.a.createAfter(ee.element);F(ne,Q,te)}else'insert'==X&&(F(ee.range.start,Q,te),R(ee.range.start,!1,Q,te),F(ee.range.end,Q,te),R(ee.range.end,!0,Q,te))}}},function(o,r,s){'use strict';function d(C,T){const P=u(C,!1);if(P)return void T.setAttribute(C,'type',P.getAttribute('type'));const S=u(C,!0);S&&T.setAttribute(C,'type',S.getAttribute('type'))}function u(C,T){for(let P=C[T?'nextSibling':'previousSibling'];P&&P.is('listItem')&&P.getAttribute('indent')>=C.getAttribute('indent');){if(P.getAttribute('indent')==C.getAttribute('indent'))return P;P=P[T?'nextSibling':'previousSibling']}return null}var f=s(11),h=s(64);class w extends f.a{constructor(C,T){super(C),this._indentBy='forward'==T?1:-1,this.listenTo(C.document,'changesDone',()=>{this.refreshState()})}_doExecute(){const C=this.editor.document,T=C.batch();let P=Array.from(C.selection.getSelectedBlocks());C.enqueueChanges(()=>{const S=P[P.length-1];for(let E=S.nextSibling;E&&'listItem'==E.name&&E.getAttribute('indent')>S.getAttribute('indent');)P.push(E),E=E.nextSibling;0>this._indentBy&&(P=P.reverse());for(let O of P){const V=O.getAttribute('indent')+this._indentBy;0>V?T.rename(O,'paragraph'):T.setAttribute(O,'indent',V)}0>this._indentBy&&(P=P.reverse());for(let O of P)d(O,T)})}_checkEnabled(){const C=s.i(h.a)(this.editor.document.selection.getSelectedBlocks());if(!C||!C.is('listItem'))return!1;if(0=T;){if(S.getAttribute('indent')==T)return S.getAttribute('type')==P;S=S.previousSibling}return!1}return!0}}r.a=w},function(o,r,s){'use strict';var d=s(176),u=s(523),f=s.n(u),h=s(522),w=s.n(h),C=s(2),T=s(23),P=s(22);class S extends C.a{static get requires(){return[d.a]}static get pluginName(){return'list/list'}init(){const E=this.editor.t;this._addButton('numberedList',E('Numbered List'),f.a),this._addButton('bulletedList',E('Bulleted List'),w.a),this.listenTo(this.editor.editing.view,'enter',(O,V)=>{const F=this.editor.document,R=F.selection.getLastPosition().parent;F.selection.isCollapsed&&'listItem'==R.name&&R.isEmpty&&(this.editor.execute('outdentList'),V.preventDefault(),O.stop())}),this.listenTo(this.editor.editing.view,'keydown',(O,V)=>{let F;if(V.keystroke==s.i(T.a)('Tab')?F='indentList':V.keystroke==s.i(T.a)('Shift+Tab')&&(F='outdentList'),F){const R=this.editor.commands.get(F);R.isEnabled&&(this.editor.execute(F),V.preventDefault(),O.stop())}})}_addButton(E,O,V){const F=this.editor,R=F.commands.get(E);F.ui.componentFactory.add(E,(N)=>{const M=new P.a(N);return M.set({label:O,icon:V,tooltip:!0}),M.bind('isOn','isEnabled').to(R,'value','isEnabled'),this.listenTo(M,'execute',()=>F.execute(E)),M})}}r.a=S},function(o,r,s){'use strict';function d(C,T,P){const S=T?C[0]:C[C.length-1];if(S.is('listItem'))for(let E=S[T?'previousSibling':'nextSibling'],O=S.getAttribute('indent');E&&E.is('listItem')&&E.getAttribute('indent')>=P;)O>E.getAttribute('indent')&&(O=E.getAttribute('indent')),E.getAttribute('indent')==O&&C[T?'unshift':'push'](E),E=E[T?'previousSibling':'nextSibling']}var u=s(11),f=s(1),h=s(64);class w extends u.a{constructor(C,T){super(C),this.type='bulleted'==T?'bulleted':'numbered',this.set('value',!1),this.listenTo(C.document,'changesDone',()=>{this.refreshValue(),this.refreshState()})}refreshValue(){const C=s.i(h.a)(this.editor.document.selection.getSelectedBlocks());this.value=C&&C.is('listItem')&&C.getAttribute('type')==this.type}_doExecute(C={}){const T=this.editor.document,P=Array.from(T.selection.getSelectedBlocks()),S=!0===this.value;T.enqueueChanges(()=>{const E=C.batch||T.batch();if(S){let O=P[P.length-1].nextSibling,V=_NumberPOSITIVE_INFINITY,F=[];for(;O&&'listItem'==O.name&&0!==O.getAttribute('indent');){const R=O.getAttribute('indent');R{this.refreshValue(),this.refreshState()})}_doExecute(w={}){const C=this.editor.document;C.enqueueChanges(()=>{const T=w.batch||C.batch(),P=(w.selection||C.selection).getSelectedBlocks();for(let S of P)S.is('paragraph')||T.rename(S,'paragraph')})}refreshValue(){const w=s.i(f.a)(this.editor.document.selection.getSelectedBlocks());this.value=!!w&&w.is('paragraph')}_checkEnabled(){const w=s.i(f.a)(this.editor.document.selection.getSelectedBlocks());return!!w&&this.editor.document.schema.check({name:'paragraph',inside:u.a.createBefore(w)})}}r.a=h},function(o,r,s){'use strict';var d=s(2),u=s(357),f=s(279),h=s(277),w=s(330),C=s(332),T=s(334),P=s(337),S=s(173),E=s(278),O=s(345),V=s(352),F=s(77);class R extends d.a{static get requires(){return[u.a,f.a,h.a,w.a,C.a,T.a,P.a,S.a,E.a,O.a,V.a,F.a]}}r.a=R},function(o,r,s){'use strict';var d=s(2),u=s(282),f=s(327),h=s(363),w=s(383);class C extends d.a{static get requires(){return[u.a,f.a,h.a,w.a]}}r.a=C},function(o,r,s){'use strict';var d=s(2),u=s(359),f=s(360);class h extends d.a{static get pluginName(){return'typing/delete'}init(){const w=this.editor,C=w.editing.view;C.addObserver(f.a),w.commands.set('forwardDelete',new u.a(w,'forward')),w.commands.set('delete',new u.a(w,'backward')),this.listenTo(C,'delete',(T,P)=>{w.execute('forward'==P.direction?'forwardDelete':'delete',{unit:P.unit}),P.preventDefault()})}}r.a=h},function(o,r,s){'use strict';var d=s(11),u=s(57),f=s(177),h=s(184);class w extends d.a{constructor(C,T){super(C),this.direction=T,this._buffer=new f.a(C.document,C.config.get('typing.undoStep'))}_doExecute(C={}){const T=this.editor.document,P=this.editor.data;T.enqueueChanges(()=>{this._buffer.lock();const S=u.a.createFromSelection(T.selection);if(S.isCollapsed&&P.modifySelection(S,{direction:this.direction,unit:C.unit}),S.isCollapsed)return;let E=0;S.getFirstRange().getMinimalFlatRanges().forEach((O)=>{E+=s.i(h.a)(O.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),P.deleteContent(S,this._buffer.batch,{merge:!0}),this._buffer.input(E),T.selection.setRanges(S.getRanges(),S.isBackward),this._buffer.unlock()})}}r.a=w},function(o,r,s){'use strict';var d=s(50),u=s(116),f=s(23);class h extends d.a{constructor(w){super(w),w.on('keydown',(C,T)=>{const P={};if(T.keyCode==f.d.delete)P.direction='forward',P.unit='character';else if(T.keyCode==f.d.backspace)P.direction='backward',P.unit='codePoint';else return;P.unit=T.altKey?'word':P.unit,w.fire('delete',new u.a(w,T.domEvent,P))})}observe(){}}r.a=h},function(o,r,s){'use strict';function d(R){return!!R.ctrlKey||F.includes(R.keyCode)}function u(R,N){return R instanceof C.a&&N instanceof C.a?R.data===N.data:R===N}var f=s(2),h=s(3),w=s(26),C=s(29),T=s(185),P=s(387),S=s(23),E=s(362);class O extends f.a{static get pluginName(){return'typing/input'}init(){const R=this.editor,N=R.editing.view,M=new E.a(R,R.config.get('typing.undoStep')||20);R.commands.set('input',M),this.listenTo(N,'keydown',(I,L)=>{this._handleKeydown(L,M.buffer)},{priority:'lowest'}),this.listenTo(N,'mutations',(I,L,D)=>{this._handleMutations(L,D)})}_handleKeydown(R,N){const M=this.editor.document;d(R)||M.selection.isCollapsed||(N.lock(),M.enqueueChanges(()=>{this.editor.data.deleteContent(M.selection,N.batch)}),N.unlock())}_handleMutations(R,N){new V(this.editor).handle(R,N)}}r.a=O;class V{constructor(R){this.editor=R,this.editing=this.editor.editing}handle(R,N){for(let M of R)this._handleTextMutation(M,N),this._handleTextNodeInsertion(M)}_handleTextMutation(R,N){if('text'!=R.type)return;const M=R.newText.replace(/\u00A0/g,' '),I=R.oldText.replace(/\u00A0/g,' '),L=s.i(T.a)(I,M);let D=null,q=null;for(let G=0;G=R;R++)F.push(R)},function(o,r,s){'use strict';var d=s(11),u=s(177);class f extends d.a{constructor(h,w){super(h),this._buffer=new u.a(h.document,w)}destroy(){super.destroy(),this._buffer.destroy(),this._buffer=null}get buffer(){return this._buffer}_doExecute(h={}){const w=this.editor.document,C=h.text||'',T=C.length,P=h.range||w.selection.getFirstRange(),S=h.resultRange;w.enqueueChanges(()=>{const E=P.isCollapsed;this._buffer.lock(),E||this._buffer.batch.remove(P),this._buffer.batch.weakInsert(P.start,C),S?this.editor.data.model.selection.setRanges([S]):E&&this.editor.data.model.selection.collapse(P.start.getShiftedBy(T)),this._buffer.unlock(),this._buffer.input(T)})}}r.a=f},function(o,r,s){'use strict';var d=s(2),u=s(361),f=s(358);class h extends d.a{static get requires(){return[u.a,f.a]}static get pluginName(){return'typing/typing'}}r.a=h},function(o,r,s){'use strict';var u=s(23);r.a=function({emitter:f,activator:h,callback:w}){f.listenTo(document,'keydown',(C,{keyCode:T})=>{T==u.d.esc&&h()&&w()})}},function(o,r,s){'use strict';var d=s(0);r.a=class{constructor(f){this.editor=f,this._components=new Map}add(f,h){if(this._components.get(f))throw new d.a('componentfactory-item-exists: The item already exists in the component factory.',{name:f});this._components.set(f,h)}create(f){const h=this._components.get(f);if(!h)throw new d.a('componentfactory-item-missing: There is no such UI component in the factory.',{name:f});return h(this.editor.locale)}}},function(o,r,s){'use strict';var u=s(22),f=s(368),h=s(367);r.a=function(w,C){const T=new u.a(C);T.bind('label','isOn','isEnabled','withText','keystroke','tooltip').to(w);const P=new h.a(C);return new f.a(C,T,P)}},function(o,r,s){'use strict';var d=s(9),u=s(6);class f extends d.a{constructor(h){super(h);const w=this.bindTemplate;this.set('isVisible',!1),this.children=this.createCollection(),this.template=new u.a({tag:'div',attributes:{class:['ck-reset','ck-dropdown__panel',w.if('isVisible','ck-dropdown__panel-visible')]},children:this.children})}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6),f=s(65),h=s(66);class w extends d.a{constructor(C,T,P){super(C),u.a.extend(T.template,{attributes:{class:['ck-dropdown__button']}}),this.buttonView=T,this.panelView=P,this.set('isOpen',!1),this.focusTracker=new f.a,this.keystrokes=new h.a,this.template=new u.a({tag:'div',attributes:{class:['ck-dropdown']},children:[T,P]}),this.listenTo(T,'execute',()=>this.isOpen=!this.isOpen),P.bind('isVisible').to(this,'isOpen')}init(){this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);const C=(T,P)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,P())};return this.keystrokes.set('arrowdown',(T,P)=>{this.isOpen||(this.isOpen=!0,P())}),this.keystrokes.set('arrowright',(T,P)=>{this.isOpen&&P()}),this.keystrokes.set('arrowleft',C),this.keystrokes.set('esc',C),super.init()}focus(){this.buttonView.focus()}}r.a=w},function(o,r,s){'use strict';function u(C){C.listenTo(document,'click',(T,{target:P})=>{C.element==P||C.element.contains(P)||(C.isOpen=!1)})}var f=s(377),h=s(376),w=s(366);r.a=function(C,T){const P=s.i(w.a)(C,T),S=P.listView=new f.a(T);return S.items.bindTo(C.items).using((E)=>{const O=new h.a(T);return O.bind(...Object.keys(E)).to(E),O}),S.items.delegate('execute').to(P),P.panelView.children.add(S),P.on('change:isOpen',(E,O,V)=>{V?u(P):P.stopListening(document)}),P.on('execute',()=>{P.isOpen=!1}),P.keystrokes.set('arrowdown',(E,O)=>{P.isOpen&&(S.focus(),O())}),P.keystrokes.set('arrowup',(E,O)=>{P.isOpen&&(S.focusLast(),O())}),P}},function(o,r,s){'use strict';var d=s(9),u=s(6);class f extends d.a{constructor(h,w){super(h);const C=this.bindTemplate;w&&(this.element=this.editableElement=w),this.template=new u.a({tag:'div',attributes:{class:[C.to('isFocused',(T)=>T?'ck-focused':'ck-blurred'),'ck-editor__editable'],contenteditable:C.to('isReadOnly',(T)=>!T)}}),this.set('isReadOnly',!1),this.set('isFocused',!1),this.externalElement=w}init(){return this.externalElement?this.template.apply(this.externalElement):this.editableElement=this.element,super.init()}destroy(){return this.externalElement&&this.template.revert(this.externalElement),super.destroy()}}r.a=f},function(o,r,s){'use strict';var d=s(370),u=s(6);class f extends d.a{constructor(h,w){super(h,w);const C=this.bindTemplate,T=this.t;this.set('name',null);u.a.extend(this.template,{attributes:{role:'textbox','aria-label':C.to('name',(S)=>{return T('Rich Text Editor, %0',[S])}),class:'ck-editor__editable_inline'}})}}r.a=f},function(o,r,s){'use strict';var d=s(373),u=s(70),f=s(6);class h extends d.a{constructor(w){super(w);const C=this.t,T=s.i(u.a)();this.set('width',null),this.set('height',null),this.top=this.createCollection(),this.main=this.createCollection(),this.template=new f.a({tag:'div',attributes:{class:['ck-reset','ck-editor','ck-rounded-corners'],role:'application',dir:'ltr',lang:w.lang,'aria-labelledby':`cke-editor__aria-label_${T}`},children:[{tag:'span',attributes:{id:`cke-editor__aria-label_${T}`,class:'cke-voice-label'},children:[C('Rich Text Editor')]},{tag:'div',attributes:{class:'ck-editor__top ck-reset_all',role:'presentation'},children:this.top},{tag:'div',attributes:{class:'ck-editor__main',role:'presentation'},children:this.main}]})}}r.a=h},function(o,r,s){'use strict';var d=s(9),u=s(6);class f extends d.a{constructor(h){super(h),this.body=this.createCollection()}init(){return Promise.resolve().then(()=>this._renderBodyCollection()).then(()=>super.init())}destroy(){return this._bodyCollectionContainer.remove(),super.destroy()}_renderBodyCollection(){const h=this._bodyCollectionContainer=new u.a({tag:'div',attributes:{class:['ck-body','ck-rounded-corners','ck-reset_all']},children:this.body}).render();document.body.appendChild(h)}}r.a=f},function(o,r,s){'use strict';var d=s(9),u=s(6);class f extends d.a{constructor(){super();const h=this.bindTemplate;this.set('content'),this.set('viewBox','0 0 20 20'),this.template=new u.a({tag:'svg',ns:'http://www.w3.org/2000/svg',attributes:{class:'ck-icon',viewBox:h.to('viewBox')}}),this.on('change:content',(w,C,T)=>{for(const P=new DOMParser().parseFromString(T.trim(),'image/svg+xml').firstChild;0{this.focusTracker.add(P.element)}),this.items.on('remove',(T,P)=>{this.focusTracker.remove(P.element)})}init(){return this.keystrokes.listenTo(this.element),super.init()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}r.a=C},function(o,r,s){'use strict';var d=s(45),u=s(4),f=s(31);class h{constructor(w,C){C&&s.i(d.a)(this,C),w&&this.set(w)}}r.a=h,s.i(u.a)(h,f.a)},function(o,r){'use strict';r.a=function({origin:u,originKeystrokeHandler:f,originFocusTracker:h,toolbar:w}){h.add(w.element),f.set('Alt+F10',(C,T)=>{h.isFocused&&!w.focusTracker.isFocused&&(w.focus(),T())}),w.keystrokes.set('Esc',(C,T)=>{w.focusTracker.isFocused&&(u.focus(),T())})}},function(o,r,s){'use strict';var d=s(63),u=s(6),f=s(183),h=s(187);const w=s.i(h.a)('px');class C extends f.a{constructor(T){super(T);const P=this.bindTemplate;this.set('isActive',!1),this.set('isSticky',!1),this.set('limiterElement',null),this.set('limiterOffset',50),this.set('_marginLeft',null),this.set('_isStickyToTheLimiter',!1),u.a.extend(this.template,{attributes:{class:[P.if('isSticky','ck-toolbar_sticky'),P.if('_isStickyToTheLimiter','ck-toolbar_sticky_bottom-limit')],style:{width:P.to('isSticky',(S)=>{return S?w(this._elementPlaceholder.getBoundingClientRect().width):null}),bottom:P.to('_isStickyToTheLimiter',(S)=>{return S?w(this.limiterOffset):null}),marginLeft:P.to('_marginLeft')}}}),this._elementPlaceholder=new u.a({tag:'div',attributes:{class:['ck-toolbar__placeholder'],style:{display:P.to('isSticky',(S)=>S?'block':'none'),height:P.to('isSticky',(S)=>{return S?w(this._toolbarRect.height):null})}}}).render()}init(){super.init(),this.element.parentNode.insertBefore(this._elementPlaceholder,this.element),this.listenTo(d.a.window,'scroll',()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,'change:isActive',()=>{this._checkIfShouldBeSticky()})}destroy(){return super.destroy().then(()=>{this._elementPlaceholder.remove()})}_checkIfShouldBeSticky(){const T=this._limiterRect=this.limiterElement.getBoundingClientRect(),P=this._toolbarRect=this.element.getBoundingClientRect();this.isSticky=this.isActive&&0>T.top&&this._toolbarRect.height+this.limiterOffset{const w=h.batch.deltas[h.batch.deltas.length-1],C=w.baseVersion+w.operations.length,T=Array.from(this.editor.document.history.getDeltas(C)).filter((P)=>{return!this._createdBatches.has(P.batch)});this._restoreSelection(h.selection.ranges,h.selection.isBackward,T),this._redo(h.batch)}),this.refreshState()}_redo(h){const w=this.editor.document,C=w.batch();this._createdBatches.add(C);const T=h.deltas.slice();T.reverse();for(let P of T){const S=P.baseVersion+P.operations.length;let E=[P.getReversed()];for(let O of w.history.getDeltas(S))this._createdBatches.has(O.batch)||(E=s.i(u.a)(E,[O],!0).deltasA);for(let O of E){O.baseVersion=w.version,C.addDelta(O);for(let V of O.operations)w.applyOperation(V)}}}}r.a=f},function(o,r,s){'use strict';var d=s(2),u=s(385),f=s(22),h=s(525),w=s.n(h),C=s(524),T=s.n(C);class P extends d.a{static get requires(){return[u.a]}static get pluginName(){return'undo/undo'}init(){const S=this.editor,E=S.t;this._addButton('undo',E('Undo'),'CTRL+Z',w.a),this._addButton('redo',E('Redo'),'CTRL+Y',T.a),S.keystrokes.set('CTRL+Z','undo'),S.keystrokes.set('CTRL+Y','redo'),S.keystrokes.set('CTRL+SHIFT+Z','redo')}_addButton(S,E,O,V){const F=this.editor,R=F.commands.get(S);F.ui.componentFactory.add(S,(N)=>{const M=new f.a(N);return M.set({label:E,icon:V,keystroke:O,tooltip:!0}),M.bind('isEnabled').to(R,'isEnabled'),this.listenTo(M,'execute',()=>F.execute(S)),M})}}r.a=P},function(o,r,s){'use strict';var d=s(119),u=s(106);class f extends d.a{_doExecute(h=null){let w=h?this._stack.findIndex((T)=>T.batch==h):this._stack.length-1;const C=this._stack.splice(w,1)[0];this.editor.document.enqueueChanges(()=>{const T=this._undo(C.batch),P=this.editor.document.history.getDeltas(C.batch.baseVersion);this._restoreSelection(C.selection.ranges,C.selection.isBackward,P),this.fire('revert',C.batch,T)}),this.refreshState()}_getItemIndexFromBaseVersion(h){for(let w=0;w{this._batchRegistry.has(P)||'transparent'==P.type||(this._redoCommand._createdBatches.has(P)?this._undoCommand.addBatch(P):!this._undoCommand._createdBatches.has(P)&&(this._undoCommand.addBatch(P),this._redoCommand.clearStack()),this._batchRegistry.add(P))},{priority:'highest'}),this.listenTo(this._undoCommand,'revert',(w,C,T)=>{this._redoCommand.addBatch(T)})}}r.a=h},function(o,r,s){'use strict';var d=s(97);r.a=class{constructor(f,h){this._config={},h&&this.define(h),f&&this._setObjectToTarget(this._config,f)}set(f,h){this._setToTarget(this._config,f,h)}define(f,h){this._setToTarget(this._config,f,h,!0)}get(f){return this._getFromSource(this._config,f)}_setToTarget(f,h,w,C=!1){if(s.i(d.a)(h))return void this._setObjectToTarget(f,h,C);const T=h.split('.');h=T.pop();for(let P of T)s.i(d.a)(f[P])||(f[P]={}),f=f[P];return s.i(d.a)(w)?(s.i(d.a)(f[h])||(f[h]={}),f=f[h],void this._setObjectToTarget(f,w,C)):void(C&&'undefined'!=typeof f[h]||(f[h]=w))}_getFromSource(f,h){const w=h.split('.');h=w.pop();for(let C of w){if(!s.i(d.a)(f[C])){f=null;break}f=f[C]}return f?f[h]:void 0}_setObjectToTarget(f,h,w){Object.keys(h).forEach((C)=>{this._setToTarget(f,C,h[C],w)})}}},function(o,r){'use strict';r.a=function(u,f){function h(){P&&(C.push(P),P=null)}function w(S){return P&&P.type==S}const C=[];let T=0,P;return u.forEach((S)=>{'equal'==S?(h(),T++):'insert'==S?(w('insert')?P.values.push(f[T]):(h(),P={type:'insert',index:T,values:[f[T]]}),T++):w('delete')?P.howMany++:(h(),P={type:'delete',index:T,howMany:1})}),h(),C}},function(o,r,s){'use strict';var u=s(186);r.a=function(f,h){const w=s.i(u.a)(f),C=s.i(u.a)(h);let T=0;for(;w[T]==C[T]&&w[T];)T++;return 0==T?null:w[T-1]}},function(o,r){'use strict';r.a=function(u){return u instanceof HTMLTextAreaElement?u.value:u.innerHTML}},function(o,r,s){'use strict';var u=s(63);r.a=function(f){for(;f&&'html'!=f.tagName.toLowerCase();){if('static'!=u.a.window.getComputedStyle(f).position)return f;f=f.parentElement}return null}},function(o,r){'use strict';r.a=function(u){let f=0;for(;u.previousSibling;)u=u.previousSibling,f++;return f}},function(o,r){'use strict';r.a=function(u,f,h){u.insertBefore(h,u.childNodes[f]||null)}},function(o,r){'use strict';r.a=function(u){return'[object Range]'==Object.prototype.toString.apply(u)}},function(o,r,s){'use strict';function u(P,S,E){const{left:O,top:V,name:F}=P(S,E);return[F,E.clone().moveTo(O,V)]}function f(P,S,E,O,V){let F=0,R=0,N,M;const I=E.getArea();return P.some((L)=>{function D(){R=$,F=K,N=z,M=q}const[q,z]=u(L,S,E);let K,$;if(O)if(V){const H=O.getIntersection(V);K=H?H.getIntersectionArea(z):0}else K=O.getIntersectionArea(z);return V&&($=V.getIntersectionArea(z)),V&&!O?$>R&&D():!V&&O?K>F&&D():$>R&&K>=F?D():$>=R&&K>F&&D(),K===I}),N?[M,N]:null}function h({left:P,top:S}){const{scrollX:E,scrollY:O}=w.a.window;return{left:P+E,top:S+O}}var w=s(63),C=s(395),T=s(390);r.a=function({element:P,target:S,positions:E,limiter:O,fitInViewport:V}){const F=s.i(T.a)(P.parentElement),R=new C.a(P),N=new C.a(S);let M,I;if(!O&&!V)[I,M]=u(E[0],N,R);else{const q=O&&new C.a(O),z=V&&C.a.getViewportRect();[I,M]=f(E,N,R,q,z)||u(E[0],N,R)}let{left:L,top:D}=h(M);if(F){const q=h(new C.a(F)),z=w.a.window.getComputedStyle(F);L-=q.left,D-=q.top,L+=F.scrollLeft,D+=F.scrollTop,L-=parseInt(z.borderLeftWidth,10),D-=parseInt(z.borderTopWidth,10)}return{left:L,top:D,name:I}}},function(o,r,s){'use strict';var d=s(63),u=s(393),f=s(486);const h=['top','right','bottom','left','width','height'];class w{constructor(C){(s.i(f.a)(C)||s.i(u.a)(C))&&(C=C.getBoundingClientRect()),h.forEach((T)=>this[T]=C[T])}clone(){return new w(this)}moveTo(C,T){return this.top=T,this.right=C+this.width,this.bottom=T+this.height,this.left=C,this}moveBy(C,T){return this.top+=T,this.right+=C,this.left+=C,this.bottom+=T,this}getIntersection(C){const T={top:_Mathmax(this.top,C.top),right:_Mathmin(this.right,C.right),bottom:_Mathmin(this.bottom,C.bottom),left:_Mathmax(this.left,C.left)};return T.width=T.right-T.left,T.height=T.bottom-T.top,0>T.width||0>T.height?null:new w(T)}getIntersectionArea(C){const T=this.getIntersection(C);return T?T.getArea():0}getArea(){return this.width*this.height}static getViewportRect(){const{innerWidth:C,innerHeight:T}=d.a.window;return new w({top:0,right:C,bottom:T,left:0,width:C,height:T})}}r.a=w},function(o,r){'use strict';r.a=function(u){const f=u.parentNode;f&&f.removeChild(u)}},function(o,r){'use strict';r.a=function(u,f){u instanceof HTMLTextAreaElement&&(u.value=f),u.innerHTML=f}},function(o,r){'use strict';r.a=class{constructor(){this._replacedElements=[]}replace(u,f){this._replacedElements.push({element:u,newElement:f}),u.style.display='none',f&&u.parentNode.insertBefore(f,u.nextSibling)}restore(){this._replacedElements.forEach(({element:u,newElement:f})=>{u.style.display='',f&&f.remove()}),this._replacedElements=[]}}},function(o,r){'use strict';const u=navigator.userAgent.toLowerCase(),f={mac:function(h){return-1=f?u:f)),u}},function(o,r,s){'use strict';var u=s(15),f=Object.create;r.a=function(h){return s.i(u.a)(h)?f(h):{}}},function(o,r,s){'use strict';var u=s(16),f=s(496);r.a=function(h,w,C,T){var P=h.length;for(C=s.i(u.a)(C),0>C&&(C=-C>P?0:P+C),T=void 0===T||T>P?P:s.i(u.a)(T),0>T&&(T+=P),T=C>T?0:s.i(f.a)(T);Ch?w:0,s.i(u.a)(h,w)?f[h]:void 0}},function(o,r,s){'use strict';var u=s(125);r.a=function(f){return function(h){return s.i(u.a)(h,f)}}},function(o,r,s){'use strict';var u=s(67),f=s(87),h=s(36),w=s(53),C=s(15),T=s(54);r.a=function(P,S,E,O){S=s.i(w.a)(S,P)?[S]:s.i(f.a)(S);for(var V=-1,F=S.length,N=P,M;null!=N&&++Vh||P&&S&&O&&!E&&!V||C&&S&&O||!w&&O||!T)return 1;if(!C&&!P&&!V&&fP?void 0:S,P=1),w=Object(w);++TT)return!1;var P=C.length-1;return T==P?C.pop():h.call(C,T,1),!0}},function(o,r,s){'use strict';var u=s(84);r.a=function(f){var h=this.__data__,w=s.i(u.a)(h,f);return 0>w?void 0:h[w][1]}},function(o,r,s){'use strict';var u=s(84);r.a=function(f){return-1C?w.push([f,h]):w[C][1]=h,this}},function(o,r,s){'use strict';var u=s(402),f=s(80),h=s(188);r.a=function(){this.__data__={hash:new u.a,map:new(h.a||f.a),string:new u.a}}},function(o,r,s){'use strict';var u=s(88);r.a=function(f){return s.i(u.a)(this,f)['delete'](f)}},function(o,r,s){'use strict';var u=s(88);r.a=function(f){return s.i(u.a)(this,f).get(f)}},function(o,r,s){'use strict';var u=s(88);r.a=function(f){return s.i(u.a)(this,f).has(f)}},function(o,r,s){'use strict';var u=s(88);r.a=function(f,h){return s.i(u.a)(this,f).set(f,h),this}},function(o,r,s){'use strict';var u=s(125),f=s(35);r.a=function(h,w){return 1==w.length?h:s.i(u.a)(h,s.i(f.a)(w,0,-1))}},function(o,r){'use strict';r.a=function(f){return this.__data__.set(f,'__lodash_hash_undefined__'),this}},function(o,r){'use strict';r.a=function(u){return this.__data__.has(u)}},function(o,r){'use strict';r.a=function(u){var f=-1,h=Array(u.size);return u.forEach(function(w){h[++f]=[w,w]}),h}},function(o,r,s){'use strict';var u=s(80);r.a=function(){this.__data__=new u.a}},function(o,r){'use strict';r.a=function(u){return this.__data__['delete'](u)}},function(o,r){'use strict';r.a=function(u){return this.__data__.get(u)}},function(o,r){'use strict';r.a=function(u){return this.__data__.has(u)}},function(o,r,s){'use strict';var u=s(80),f=s(120);r.a=function(w,C){var T=this.__data__;return T instanceof u.a&&T.__data__.length==200&&(T=this.__data__=new f.a(T.__data__)),T.set(w,C),this}},function(o,r,s){'use strict';var d=s(490),u=s(498),f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,h=/\\(\\)?/g,w=s.i(d.a)(function(C){var T=[];return s.i(u.a)(C).replace(f,function(P,S,E,O){T.push(E?O.replace(h,'$1'):S||P)}),T});r.a=w},function(o,r,s){'use strict';var d=s(208),u=s(209),f=s(210),h=s(211),w=s(212),C=s(213),T=s(142),P=s(143),S=s(214),E=s(215),O=s(216),V=s(217),F=s(218),R=s(219),N=s(220),M=s(221),I=s(222),L=s(223),D=s(144),q=s(226),z=s(227),K=s(228),$=s(229),H=s(230),W=s(232),U=s(19),Z=s(233),G=s(234),J=s(235),Q=s(148),Y=s(236),X=s(237),ee=s(238),te=s(239),ae=s(240),ne=s(241),ie=s(242),oe=s(243),re=s(244),se=s(245),le=s(246),de=s(247),ce=s(248),ue=s(249),me=s(250),ge=s(251),pe=s(252),fe=s(253),he=s(254),be=s(256),_e=s(257),ye=s(258),we=s(259),ve=s(260),ke=s(261),Ce=s(98),xe=s(149),Te=s(262),Pe=s(263),Ae=s(264),Se=s(265),Ee=s(266),Oe=s(267),Ve=s(268),Fe=s(269);r.a={chunk:d.a,compact:u.a,concat:f.a,difference:h.a,differenceBy:w.a,differenceWith:C.a,drop:T.a,dropRight:P.a,dropRightWhile:S.a,dropWhile:E.a,fill:O.a,findIndex:V.a,findLastIndex:F.a,first:R.a,flatten:N.a,flattenDeep:M.a,flattenDepth:I.a,fromPairs:L.a,head:D.a,indexOf:q.a,initial:z.a,intersection:K.a,intersectionBy:$.a,intersectionWith:H.a,join:W.a,last:U.a,lastIndexOf:Z.a,nth:G.a,pull:J.a,pullAll:Q.a,pullAllBy:Y.a,pullAllWith:X.a,pullAt:ee.a,remove:te.a,reverse:ae.a,slice:ne.a,sortedIndex:ie.a,sortedIndexBy:oe.a,sortedIndexOf:re.a,sortedLastIndex:se.a,sortedLastIndexBy:le.a,sortedLastIndexOf:de.a,sortedUniq:ce.a,sortedUniqBy:ue.a,tail:me.a,take:ge.a,takeRight:pe.a,takeRightWhile:fe.a,takeWhile:he.a,union:be.a,unionBy:_e.a,unionWith:ye.a,uniq:we.a,uniqBy:ve.a,uniqWith:ke.a,unzip:Ce.a,unzipWith:xe.a,without:Te.a,xor:Pe.a,xorBy:Ae.a,xorWith:Se.a,zip:Ee.a,zipObject:Oe.a,zipObjectDeep:Ve.a,zipWith:Fe.a}},function(o,r,s){'use strict';var d=s(208),u=s(209),f=s(210),h=s(211),w=s(212),C=s(213),T=s(142),P=s(143),S=s(214),E=s(215),O=s(216),V=s(217),F=s(218),R=s(219),N=s(220),M=s(221),I=s(222),L=s(223),D=s(144),q=s(226),z=s(227),K=s(228),$=s(229),H=s(230),W=s(232),U=s(19),Z=s(233),G=s(234),J=s(235),Q=s(148),Y=s(236),X=s(237),ee=s(238),te=s(239),ae=s(240),ne=s(241),ie=s(242),oe=s(243),re=s(244),se=s(245),le=s(246),de=s(247),ce=s(248),ue=s(249),me=s(250),ge=s(251),pe=s(252),fe=s(253),he=s(254),be=s(256),_e=s(257),ye=s(258),we=s(259),ve=s(260),ke=s(261),Ce=s(98),xe=s(149),Te=s(262),Pe=s(263),Ae=s(264),Se=s(265),Ee=s(266),Oe=s(267),Ve=s(268),Fe=s(269),Re=s(479);s.d(r,'a',function(){return Re.a})},function(o,r,s){'use strict';var d=s(67),u=s(137),f=s(439),h=s(95),w=s(91),C=s(489),T=Object.prototype,P=T.propertyIsEnumerable,S=!P.call({valueOf:1},'valueOf'),E=s.i(f.a)(function(O,V){if(S||s.i(w.a)(V)||s.i(h.a)(V))return void s.i(u.a)(V,s.i(C.a)(V),O);for(var F in V)s.i(d.a)(O,F,V[F])});r.a=E},function(o,r,s){'use strict';var u=s(193);r.a=function(f,h){return s.i(u.a)(f,!0,!0,h)}},function(o,r){'use strict';r.a=function(u){return function(){return u}}},function(o,r,s){'use strict';var u=s(416),f=s(447);r.a=function(h,w){return null!=h&&s.i(f.a)(h,w,u.a)}},function(o,r,s){'use strict';(function(d){var u=s(483),f=s(30),h={'function':!0,object:!0},w=h[typeof exports]&&exports&&!exports.nodeType?exports:void 0,C=h[typeof d]&&d&&!d.nodeType?d:void 0,T=C&&C.exports===w?w:void 0,P=T?f.a.Buffer:void 0,S=P?function(E){return E instanceof P}:s.i(u.a)(!1);r.a=S}).call(r,s(272)(o))},function(o,r,s){'use strict';var u=s(46),f=s(97);r.a=function(h){return!!h&&1===h.nodeType&&s.i(u.a)(h)&&!s.i(f.a)(h)}},function(o,r,s){'use strict';var u=s(128);r.a=function(f,h){return s.i(u.a)(f,h)}},function(o,r,s){'use strict';var u=s(96),f=s(46),G={};G['[object Float32Array]']=G['[object Float64Array]']=G['[object Int8Array]']=G['[object Int16Array]']=G['[object Int32Array]']=G['[object Uint8Array]']=G['[object Uint8ClampedArray]']=G['[object Uint16Array]']=G['[object Uint32Array]']=!0,G['[object Arguments]']=G['[object Array]']=G['[object ArrayBuffer]']=G['[object Boolean]']=G['[object DataView]']=G['[object Date]']=G['[object Error]']=G['[object Function]']=G['[object Map]']=G['[object Number]']=G['[object Object]']=G['[object RegExp]']=G['[object Set]']=G['[object String]']=G['[object WeakMap]']=!1;var J=Object.prototype,Q=J.toString;r.a=function(Y){return s.i(f.a)(Y)&&s.i(u.a)(Y.length)&&!!G[Q.call(Y)]}},function(o,r,s){'use strict';var u=s(421),f=s(203),h=s(36),w=s(91),C=Object.prototype,T=C.hasOwnProperty;r.a=function(P){for(var S=-1,E=s.i(w.a)(P),O=s.i(u.a)(P),V=O.length,F=s.i(f.a)(P),N=F||[],M=N.length,I;++Sw?-1:1;return C*1.7976931348623157e308}return w===w?w:0}},function(o,r,s){'use strict';var u=s(412),f=s(16);r.a=function(w){return w?s.i(u.a)(s.i(f.a)(w),0,4294967295):0}},function(o,r,s){'use strict';var d=s(441),u=s(69),f=s.i(d.a)(u.a);r.a=f},function(o,r,s){'use strict';var u=s(428);r.a=function(f){return null==f?'':s.i(u.a)(f)}},function(o,r,s){'use strict';var d=s(503);r.a=class{constructor(f){this.lang=f||'en',this.t=(...h)=>this._t(...h)}_t(f,h){let w=s.i(d.a)(this.lang,f);return h&&(w=w.replace(/\%(\d+)/g,(C,T)=>{return T{I&&I.hasClass(O.d)&&I.removeClass(O.d);const K=z.viewSelection,$=K.getSelectedElement();$&&s.i(O.b)($)&&(K.setFake(!0,{label:s.i(O.e)($)}),$.addClass(O.d),I=$)},{priority:'low'}),M.addObserver(w.a),this.listenTo(M,'mousedown',(...L)=>this._onMousedown(...L)),this.listenTo(M,'keydown',(...L)=>this._onKeydown(...L),{priority:'high'})}_onMousedown(M,I){const L=this.editor,D=L.editing.view;let q=I.target;if(f(q))return;if(!s.i(O.b)(q)&&(q=q.findAncestor(O.b),!q))return;I.preventDefault(),D.isFocused||D.focus();const z=L.editing.mapper.toModelElement(q);L.document.enqueueChanges(()=>{this._setSelectionOverElement(z)})}_onKeydown(M,I){const L=I.keyCode,D=L==V.d.delete||L==V.d.arrowdown||L==V.d.arrowright;(u(L)&&this._handleDelete(D)||d(L)&&this._handleArrowKeys(D))&&(I.preventDefault(),M.stop())}_handleDelete(M){const I=this.editor.document,L=I.selection;if(!L.isCollapsed)return;const D=this._getObjectElementNextToSelection(M);if(D)return I.enqueueChanges(()=>{const q=L.anchor.parent;if(q.isEmpty){const z=I.batch();z.remove(q)}this._setSelectionOverElement(D)}),!0}_handleArrowKeys(M){const I=this.editor.document,L=I.schema,D=I.selection,q=D.getSelectedElement();if(q&&L.objects.has(q.name)){const K=M?D.getLastPosition():D.getFirstPosition(),$=I.getNearestSelectionRange(K,M?'forward':'backward');return $&&I.enqueueChanges(()=>{D.setRanges([$])}),!0}if(!D.isCollapsed)return;const z=this._getObjectElementNextToSelection(M);if(z instanceof P.a&&I.schema.objects.has(z.name))return I.enqueueChanges(()=>{this._setSelectionOverElement(z)}),!0}_setSelectionOverElement(M){this.editor.document.selection.setRanges([C.a.createOn(M)])}_getObjectElementNextToSelection(M){const I=this.editor.document,L=I.schema,D=I.selection,q=this.editor.data,z=T.a.createFromSelection(D);q.modifySelection(z,{direction:M?'forward':'backward'});const K=M?z.focus.nodeBefore:z.focus.nodeAfter;return K instanceof P.a&&L.objects.has(K.name)?K:null}}r.a=N},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(o){o.exports='\n\n \n bold\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n italic\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n'},function(o){o.exports='\n'},function(o){o.exports='\n'},function(o){o.exports='\n\n \n quote\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n link\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n unlink\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n bulletedlist\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n numberedlist\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n redo\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){o.exports='\n\n \n undo\n Created with Sketch.\n \n \n \n \n \n \n \n \n'},function(o){var s=function(){return this}();try{s=s||Function('return this')()||(1,eval)('this')}catch(d){'object'==typeof window&&(s=window)}o.exports=s},function(o,r,s){o.exports=s(273)}]); +//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/build/app.js.map b/build/app.js.map new file mode 100644 index 00000000000..5b6e84dd2d7 --- /dev/null +++ b/build/app.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./~/@ckeditor/ckeditor5-engine/src/view/writer.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/rest.js","webpack:///webpack/bootstrap 7897e2108f2124e1315c","webpack:///./~/@ckeditor/ckeditor5-utils/src/ckeditorerror.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/position.js","webpack:///./~/@ckeditor/ckeditor5-core/src/plugin.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/range.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/mix.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/element.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/template.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/emittermixin.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/view.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIteratee.js","webpack:///./~/@ckeditor/ckeditor5-core/src/command/command.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isArray.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/writer.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isArrayLikeObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/toInteger.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/batch.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/deltafactory.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/last.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/delta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/element.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/button/buttonview.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/keyboard.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseFlatten.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/text.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/position.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayMap.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/text.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_root.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/observablemixin.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/operation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/treewalker.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/range.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseSlice.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isIndex.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/buildmodelconverter.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/buildviewconverter.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/removeoperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/containerelement.js","webpack:///./~/@ckeditor/ckeditor5-image/src/image/utils.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/isiterable.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseUniq.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/extend.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isObjectLike.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isSymbol.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/log.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/documentfragment.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/observer.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/treewalker.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getNative.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isKey.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_toKey.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/eq.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/node.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/selection.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/textproxy.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/filler.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/selection.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/comparearrays.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/global.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/first.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/focustracker.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/keystrokehandler.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_assignValue.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseDifference.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/keys.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/uid.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/nodelist.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/editableelement.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/node.js","webpack:///./~/@ckeditor/ckeditor5-paragraph/src/paragraph.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/collection.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_ListCache.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_SetCache.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayFilter.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayPush.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_assocIndexOf.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseSortedIndex.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseWhile.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_castPath.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getMapData.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isHostObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isIterateeCall.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isPrototype.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_nativeCreate.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_setToArray.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/clone.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isArrayLike.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isLength.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isPlainObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/unzip.js","webpack:///./~/@ckeditor/ckeditor5-core/src/command/helpers/getschemavalidranges.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/model-to-view-converters.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/insertdelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/mergedelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/movedelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/removedelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/splitdelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/transform.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/unwrapdelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/wrapdelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/liverange.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/reinsertoperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/attributeelement.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/documentfragment.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/focuscycler.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/viewcollection.js","webpack:///./~/@ckeditor/ckeditor5-undo/src/basecommand.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_MapCache.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Stack.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Symbol.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayIncludes.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayIncludesWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseGet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIndexOf.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIntersection.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIsEqual.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseProperty.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_basePullAll.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseSortedIndexBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseUnary.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseXor.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cacheHas.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_castArrayLikeObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneArrayBuffer.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_copyObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getPrototype.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getTag.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_mapToArray.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/debounce.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/drop.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/dropRight.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/head.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isArguments.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isFunction.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isString.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/pullAll.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/unzipWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/tomap.js","webpack:///./~/@ckeditor/ckeditor5-widget/src/utils.js","webpack:///./~/@ckeditor/ckeditor5-basic-styles/src/boldengine.js","webpack:///./~/@ckeditor/ckeditor5-basic-styles/src/italicengine.js","webpack:///./~/@ckeditor/ckeditor5-core/src/command/helpers/isattributeallowedinselection.js","webpack:///./~/@ckeditor/ckeditor5-core/src/command/toggleattributecommand.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/mapper.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/model-selection-to-view-converters.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/modelconversiondispatcher.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/attributedelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/renamedelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/weakinsertdelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/liveposition.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/domconverter.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/emptyelement.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/matcher.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/uielement.js","webpack:///./~/@ckeditor/ckeditor5-heading/src/headingengine.js","webpack:///./~/@ckeditor/ckeditor5-image/src/image/imageengine.js","webpack:///./~/@ckeditor/ckeditor5-image/src/image/ui/imageballoonpanelview.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagetoolbar.js","webpack:///./~/@ckeditor/ckeditor5-link/src/findlinkrange.js","webpack:///./~/@ckeditor/ckeditor5-link/src/linkelement.js","webpack:///./~/@ckeditor/ckeditor5-list/src/listengine.js","webpack:///./~/@ckeditor/ckeditor5-typing/src/changebuffer.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/labeledinput/labeledinputview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/count.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/diff.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/getancestors.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/tounit.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Map.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Set.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Uint8Array.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_apply.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayReduce.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseClone.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseFindIndex.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseHas.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_basePullAt.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseSortedUniq.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseTimes.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseZipObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_copyArray.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_equalArrays.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getSymbols.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_indexKeys.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_indexOfNaN.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isStrictComparable.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_matchesStrictComparable.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_toSource.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/chunk.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/compact.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/concat.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/difference.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/differenceBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/differenceWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/dropRightWhile.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/dropWhile.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/fill.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/findIndex.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/findLastIndex.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/first.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/flatten.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/flattenDeep.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/flattenDepth.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/fromPairs.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/get.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/identity.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/indexOf.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/initial.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/intersection.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/intersectionBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/intersectionWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isNative.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/join.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/lastIndexOf.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/nth.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/pull.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/pullAllBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/pullAllWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/pullAt.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/remove.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/reverse.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/slice.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/sortedIndex.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/sortedIndexBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/sortedIndexOf.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/sortedLastIndex.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/sortedLastIndexBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/sortedLastIndexOf.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/sortedUniq.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/sortedUniqBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/tail.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/take.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/takeRight.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/takeRightWhile.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/takeWhile.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/toNumber.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/union.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/unionBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/unionWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/uniq.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/uniqBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/uniqWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/without.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/xor.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/xorBy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/xorWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/zip.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/zipObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/zipObjectDeep.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/zipWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/objecttomap.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/unicode.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///./js/app.js","webpack:///./~/@ckeditor/ckeditor5-autoformat/src/autoformat.js","webpack:///./~/@ckeditor/ckeditor5-autoformat/src/blockautoformatengine.js","webpack:///./~/@ckeditor/ckeditor5-autoformat/src/inlineautoformatengine.js","webpack:///./~/@ckeditor/ckeditor5-basic-styles/src/bold.js","webpack:///./~/@ckeditor/ckeditor5-basic-styles/src/italic.js","webpack:///./~/@ckeditor/ckeditor5-block-quote/src/blockquote.js","webpack:///./~/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js","webpack:///./~/@ckeditor/ckeditor5-block-quote/src/blockquoteengine.js","webpack:///./~/@ckeditor/ckeditor5-clipboard/src/clipboard.js","webpack:///./~/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js","webpack:///./~/@ckeditor/ckeditor5-clipboard/src/datatransfer.js","webpack:///./~/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js","webpack:///./~/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js","webpack:///./~/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js","webpack:///./~/@ckeditor/ckeditor5-core/src/editor/editor.js","webpack:///./~/@ckeditor/ckeditor5-core/src/editor/standardeditor.js","webpack:///./~/@ckeditor/ckeditor5-core/src/plugincollection.js","webpack:///./~/@ckeditor/ckeditor5-editor-classic/src/classic.js","webpack:///./~/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js","webpack:///./~/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/controller/deletecontent.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/controller/getselectedcontent.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/controller/insertcontent.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/controller/modifyselection.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/view-selection-to-model-converters.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/view-to-model-converters.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/conversion/viewconversiondispatcher.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/basic-deltas.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/basic-transformations.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/delta/markerdelta.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/document.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/history.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/liveselection.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/markercollection.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/operation/transform.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/rootelement.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/model/schema.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/document.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/placeholder.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/renderer.js","webpack:///./~/@ckeditor/ckeditor5-engine/src/view/textproxy.js","webpack:///./~/@ckeditor/ckeditor5-enter/src/enter.js","webpack:///./~/@ckeditor/ckeditor5-enter/src/entercommand.js","webpack:///./~/@ckeditor/ckeditor5-enter/src/enterobserver.js","webpack:///./~/@ckeditor/ckeditor5-heading/src/heading.js","webpack:///./~/@ckeditor/ckeditor5-heading/src/headingcommand.js","webpack:///./~/@ckeditor/ckeditor5-image/src/image.js","webpack:///./~/@ckeditor/ckeditor5-image/src/image/converters.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagecaption.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionengine.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagecaption/utils.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagestyle.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagestyle/converters.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleengine.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagetextalternative.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeengine.js","webpack:///./~/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js","webpack:///./~/@ckeditor/ckeditor5-link/src/link.js","webpack:///./~/@ckeditor/ckeditor5-link/src/linkcommand.js","webpack:///./~/@ckeditor/ckeditor5-link/src/linkengine.js","webpack:///./~/@ckeditor/ckeditor5-link/src/ui/linkformview.js","webpack:///./~/@ckeditor/ckeditor5-link/src/unlinkcommand.js","webpack:///./~/@ckeditor/ckeditor5-list/src/converters.js","webpack:///./~/@ckeditor/ckeditor5-list/src/indentcommand.js","webpack:///./~/@ckeditor/ckeditor5-list/src/list.js","webpack:///./~/@ckeditor/ckeditor5-list/src/listcommand.js","webpack:///./~/@ckeditor/ckeditor5-list/src/viewlistitemelement.js","webpack:///./~/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js","webpack:///./~/@ckeditor/ckeditor5-presets/src/article.js","webpack:///./~/@ckeditor/ckeditor5-presets/src/essentials.js","webpack:///./~/@ckeditor/ckeditor5-typing/src/delete.js","webpack:///./~/@ckeditor/ckeditor5-typing/src/deletecommand.js","webpack:///./~/@ckeditor/ckeditor5-typing/src/deleteobserver.js","webpack:///./~/@ckeditor/ckeditor5-typing/src/input.js","webpack:///./~/@ckeditor/ckeditor5-typing/src/inputcommand.js","webpack:///./~/@ckeditor/ckeditor5-typing/src/typing.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/bindings/escpresshandler.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/componentfactory.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/dropdown/createdropdown.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/dropdown/list/createlistdropdown.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/icon/iconview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/label/labelview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/list/listitemview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/list/listview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/model.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/toolbar/sticky/stickytoolbarview.js","webpack:///./~/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js","webpack:///./~/@ckeditor/ckeditor5-undo/src/redocommand.js","webpack:///./~/@ckeditor/ckeditor5-undo/src/undo.js","webpack:///./~/@ckeditor/ckeditor5-undo/src/undocommand.js","webpack:///./~/@ckeditor/ckeditor5-undo/src/undoengine.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/config.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/difftochanges.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/indexof.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/insertat.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/isrange.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/position.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/rect.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/remove.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/elementreplacer.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/env.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/eventinfo.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_DataView.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Hash.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Promise.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Reflect.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_WeakMap.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_addMapEntry.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_addSetEntry.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayEach.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arraySome.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseAssign.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseAt.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseClamp.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseCreate.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseFill.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseGetAllKeys.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseHasIn.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIndexOfWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIsEqualDeep.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIsMatch.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseKeys.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseKeysIn.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseMatches.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseMatchesProperty.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseNth.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_basePropertyDeep.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseSet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseToPairs.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseToString.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_checkGlobal.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneBuffer.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneDataView.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneMap.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneRegExp.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneSet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneSymbol.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneTypedArray.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_compareAscending.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_copySymbols.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_createAssigner.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_createSet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_createToPairs.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_equalByTag.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_equalObjects.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getAllKeys.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getLength.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getMatchData.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_hasPath.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_hashClear.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_hashDelete.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_hashGet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_hashHas.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_hashSet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_initCloneArray.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_initCloneByTag.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_initCloneObject.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isFlattenable.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isKeyable.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_iteratorToArray.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_listCacheClear.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_listCacheDelete.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_listCacheGet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_listCacheHas.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_listCacheSet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_mapCacheClear.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_mapCacheDelete.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_mapCacheGet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_mapCacheHas.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_mapCacheSet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_parent.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_setCacheAdd.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_setCacheHas.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_setToPairs.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_stackClear.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_stackDelete.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_stackGet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_stackHas.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_stackSet.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_stringToPath.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/array.default.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/array.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/assignIn.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/cloneDeepWith.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/constant.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/hasIn.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isBuffer.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isElement.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isEqual.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isTypedArray.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/keysIn.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/memoize.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/noop.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/now.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/property.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/throttle.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/toFinite.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/toLength.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/toPairs.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/lib/lodash/toString.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/locale.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/mapsequal.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/priorities.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/spy.js","webpack:///./~/@ckeditor/ckeditor5-utils/src/translation-service.js","webpack:///./~/@ckeditor/ckeditor5-widget/src/widget.js","webpack:///./~/@ckeditor/ckeditor5-block-quote/theme/theme.scss","webpack:///./~/@ckeditor/ckeditor5-editor-classic/theme/theme.scss","webpack:///./~/@ckeditor/ckeditor5-engine/theme/placeholder.scss","webpack:///./~/@ckeditor/ckeditor5-heading/theme/theme.scss","webpack:///./~/@ckeditor/ckeditor5-image/theme/imagecaption/theme.scss","webpack:///./~/@ckeditor/ckeditor5-image/theme/imagetextalternative/theme.scss","webpack:///./~/@ckeditor/ckeditor5-image/theme/theme.scss","webpack:///./~/@ckeditor/ckeditor5-link/theme/theme.scss","webpack:///./~/@ckeditor/ckeditor5-widget/theme/theme.scss","webpack:///./~/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg","webpack:///./~/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg","webpack:///./~/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg","webpack:///./~/@ckeditor/ckeditor5-core/theme/icons/object-center.svg","webpack:///./~/@ckeditor/ckeditor5-core/theme/icons/object-right.svg","webpack:///./~/@ckeditor/ckeditor5-core/theme/icons/quote.svg","webpack:///./~/@ckeditor/ckeditor5-link/theme/icons/link.svg","webpack:///./~/@ckeditor/ckeditor5-link/theme/icons/unlink.svg","webpack:///./~/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg","webpack:///./~/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg","webpack:///./~/@ckeditor/ckeditor5-undo/theme/icons/redo.svg","webpack:///./~/@ckeditor/ckeditor5-undo/theme/icons/undo.svg","webpack:///(webpack)/buildin/global.js"],"names":[],"mappings":";;;;oCAilBA,sDChjBA,kCChCA,cAMA,MACA,eAGA,mBACA,GACA,EACA,KAIA,mDAGA,KAGA,OACA,OAIA,IAzBA,iBA4BA,MAGA,iBAA2C,OAAc,EAGzD,qBACA,OACA,8BACA,CACA,gBACA,kBAGA,GAGA,iBACA,YACA,qBAA2B,UAA0B,UACrD,YAAiC,OAAe,EAChD,mBACA,GACA,CAGA,mBAAsD,+CAA+D,EAGrH,MAGA,+BC9CA,aACA,qBAaA,iBACA,CACA,0BAGA,UAKA,aAOA,0BACA,CAQA,0BACA,oBACA,EACA,sEC7DA,OAoCA,IACA,OAOA,iBACA,4BAMA,kCAGA,iFAOA,mHAAsH,MAItH,yBACA,OASA,eA+BA,YACA,CAQA,aACA,sBACA,KAKA,cACA,+BACA,CAcA,aACA,YAEA,eAAkB,qBAA0B,EAC5C,2CAGA,WACA,EAUA,YACA,uCACA,OASA,eACA,iCAEA,4DACA,IAQA,gBACA,8DACA,IAQA,iBACA,gEACA,IAQA,gBACA,OACA,gBAQA,cACA,iCACA,SAQA,eACA,iBACA,WAGA,yCAEA,YAEA,SADA,EAGA,OACA,aAEA,SACA,gBAGA,4BACA,GAEA,SAGA,OAuBA,2BAA4C,KAC5C,iBAEA,qBACA,iBAEA,KACA,QAUA,gBACA,2BACA,EAOA,eACA,uBACA,0BAEA,iCAAqC,CAErC,gBASA,iBACA,iBACA,KAIA,oCAEA,oEAEA,2BACA,EASA,gBACA,4BAEA,iBACA,wBAEA,EACA,CAUA,WACA,OACA,4BAiCA,YACA,OACA,6BAQA,WACA,OACA,2BAYA,cACA,OACA,OACA,wBAEA,UACA,OACA,OAEA,aACA,gCACA,6BACA,GAEA,UACA,+BACA,0BACA,MAEA,MACA,QAIA,sBAEA,oCACA,cACA,GAGA,wCACA,iBACA,UAGA,gCACA,OACA,SACA,QAAI,KACJ,IACA,aAGA,gCACA,EACA,CACA,CAWA,+BACA,4BAGA,sBACA,WAGA,MAEA,kFAEA,oBAEA,aAGA,gBAEA,CACG,qEAEH,uBAEA,4BAEA,yBAGA,SAGA,iBAEA,CACA,CAEA,OACA,EAaA,kCACA,4BAGA,sBACA,WAGA,MAEA,uGAGA,eAEG,sEAEH,uBAEA,sBAGA,gBAEA,EAEA,OACA,EAgBA,iCAEA,wCAGA,0CAEA,4BAGA,uBAIA,oCAGA,GACA,CA6BA,kBACA,uBAGA,6BAKA,2CAIA,8CAEA,IACA,CAqBA,qBACA,gBACA,kCAEA,WAEA,KACA,aACI,kBACJ,qCACI,MACJ,mCACI,GACJ,MAGA,2CAEA,EAQA,sBACA,OAOA,wFAAiG,MAGjG,qDACA,UAQA,uBACA,OAOA,0FAAmG,MAGnG,qDACA,YASA,sCACA,4BAMA,kCAGA,yGAEA,wBAEA,mBACA,EAQA,6BACA,+BACA,QAQA,qBACA,IACA,iDAGA,sBAOA,eACA,KACA,iHAAK,YAIL,wCACA,KACA,MAOA,wCC9vBA,QAgBA,GACA,OAeA,eAOA,aACA,CAgDA,QAOA,aAOA,WACA,QAEA,6DCzGA,QAeA,GACA,OASA,sBAOA,mCAQA,+DACA,EAcA,qBACA,eAA0B,iBAC1B,qBAQA,kBACA,gCACA,IAQA,aACA,qCACA,MAOA,WACA,mBACA,IAQA,oBACA,+CACA,IAQA,iBACA,gEACA,IASA,WACA,wDACA,IAQA,kBACA,uDACA,MAwBA,iBACA,MAEA,iCAGA,4BAGA,kCAGA,gCAGA,8BAIA,gCAGA,OACA,CAkBA,mBACA,2BAGA,YACA,aAEA,mCAGA,aAGA,+BAGA,WAGA,aACA,EAGA,OACA,KAyCA,uBACA,MACA,2CAEA,yCACA,WAGA,+BACA,qBAEA,OACA,oCAGA,4BACA,KACA,aACA,MAGA,2CACA,mCACA,SAEA,OACA,oCAGA,cACA,cACA,EAEA,OACA,EAWA,WAAwB,KACxB,qBAEA,aACA,EAiBA,WAAwB,KACxB,cACA,OAEA,oCAEA,eACA,WAEA,IAeA,eAA4B,KAC5B,cAEA,qBAEA,WAEA,qBACA,WAEA,YAYA,yBACA,0BAGA,kBAEA,2DACA,sBACA,gBAAoB,MAAmB,WACvC,cACA,kCACA,OACA,yBACA,4BACA,YAGA,gCAEA,eACA,CAIA,OACA,EAYA,0BACA,0BAEA,mBACA,aAAmB,QAAmB,OACtC,iCAEA,mBACA,eAQA,YAAkB,MAAmB,WACrC,WAEA,eAAuB,MAAmB,WAC1C,WAEA,sDACA,gBAEA,EACA,CAEA,OACA,EAaA,2CACA,IACA,qDAEA,gDAEA,uFAIA,6CACI,uBAOJ,sFACA,+DACA,+CAEA,wBACA,GAMA,yFACA,8CACA,qEAEA,mBACA,GACA,CAEA,uCAEA,EAqCA,0CACA,6BAKA,SACA,kBACA,MACA,kCACA,mDAIA,yCAEA,8BACA,qBAEA,wDACA,8CAEA,IAEA,EAYA,6BACA,qBACA,8CAEA,sBACA,GAEA,IAEA,kCAEA,yBACA,SAEA,kCAEA,GAEA,iBACA,0CACA,wCAEG,IAEH,mBACA,QACA,2CAIA,2CAEA,YACA,mCAKA,aACA,aACA,gCACA,8BAIA,KACA,CAUA,uCACA,SACA,mBAEA,uCACA,EAWA,4CACA,WACA,sCACA,mCAEA,GAQA,0BACA,2BACA,IASA,mBACA,iDACA,UAQA,mBACA,8DACA,WAiBA,2BACA,IAMA,2BACG,sFACH,0CAMA,cAGA,mCAGA,0BAKA,wBAIA,iBAA6B,EAAQ,yBAErC,OADA,wCAUA,mBAA6B,MAAmB,6BAEhD,KADA,sCAQA,WACA,EASA,qBACA,4DACA,GACA,uBC5uBA,aA+BA,IACA,gBACA,gBACA,mEACA,iBACA,aAIA,sDACA,KAEA,kDACA,GACA,EACA,kCCkQA,aAEA,OACA,4BAGA,cACA,QAIA,yDACA,4BA5TA,QAmBA,IACA,mBASA,mBACA,OAOA,aAQA,oBAEA,KACA,yBAEA,EAQA,iBACA,uBACA,MAQA,gBACA,uBACA,SAQA,cACA,OACA,oBAqBA,aACA,OACA,yBAIA,2BAFA,IAUA,YACA,+BACA,EAOA,cACA,8BACA,WAQA,iBACA,oCACA,EAUA,uBACA,0CACA,EASA,YACA,SACA,wCACA,yBAEA,uDACA,EAmBA,iBACA,qCACA,EAOA,kBACA,qCACA,EASA,oBACA,KAEA,eACA,YAGA,kCACA,EAUA,sBACA,sCAEA,eACA,YAGA,WACA,EAaA,iBACA,OAEA,mBACA,gBAGA,SACA,EAOA,SACA,aAEA,wBAEA,6BACA,GAEA,8BACA,4BAEA,SAEA,OACA,EASA,mBACA,OAEA,mBACA,CAEA,oBACA,WAEA,uBAGA,wBAGA,GAEA,kCACA,EACA,MAKY,gCColBZ,cACA,SAWA,SACA,cAGA,qBACA,aACE,mBAKF,KAQY,CACZ,iBACA,qBAEA,qBACA,gBAIA,IACA,EACA,EAOgG,CAChG,iBAAiD,CAAO,SACxD,aAMA,oCACA,OAEA,eAGA,MACA,OAEA,gBAEA,GAOa,CACb,cACA,OACA,QACA,gBACA,EAEA,UACA,gBACA,EAEA,EASa,CACb,oBACA,OACA,QACA,yBACA,GAEA,UACA,yBACA,GAEA,EAQa,CACb,iBACA,OACA,QACA,cACA,EAEA,UACA,cACA,IAEA,EAKa,CACb,cACA,4BAYA,2CACA,WAEA,GAEA,SACA,GAWmD,CACnD,cACA,IACA,yBACE,OACF,QAGA,OACA,4BAGA,cAGA,aACA,IACA,iBAGA,wBAEA,WACA,iBACA,oBAEA,gCACA,kBACA,WAEA,kBAMA,iBACA,EAEA,OACA,GAsBkB,CAClB,cACA,cACA,WACA,sCAGA,aAEA,GAmBoB,CACpB,cACA,cACA,SAGA,UACA,GAWmD,CACnD,cACA,OACA,OAEA,IAgBiD,CACjD,cACA,kBACA,oBAEA,MAiBkB,CAClB,iBACA,kBACA,kBAEA,KAOa,CACb,iBACA,UACA,IACE,KACF,IAEA,MAAY,EAAK,IAAG,EAEpB,EAea,CACb,iBACA,cACA,OACA,sBAEA,eAGA,GAMiD,CACjD,iBACA,OACA,iBACA,gBAGA,kCAGA,gBACA,qBACA,oBAGA,0CAGA,oBACA,yBAGA,sCACA,oCAMA,qBAGA,8GAEA,mBACA,iCAEA,GACA,CAMa,CACb,cACA,YACA,MAKa,CACb,cACA,qBACA,IAKa,CACb,cACA,qBACA,GAKa,CACb,cACA,qBACA,IAKA,CACA,YACA,OACA,CACA,YACA,YAEA,cAMkB,CAClB,cACA,oBACA,WAkPA,+DA5jDA,QAqBA,IA4BA,QAMA,gBACA,wBAUA,WAiDA,gCACA,IASA,SACA,2BACA,CAGA,8BAEA,eACA,EAoCA,UACA,yBAEA,qBACA,MACA,GACA,8BAGA,cACA,EAQA,WACA,UAMA,0BAGA,wIACA,YAiBA,mBACA,OACA,UACA,eACA,qBACA,aACA,4BAEA,aAEA,cACA,eACA,sDAEA,aAEA,EAwDA,qBACA,IAQA,sBAGA,qGACA,KAQA,gBACA,IAEA,aAEA,oBAGA,8BAGA,KAOA,iBAGA,mHACA,sBAEA,wBAEA,GAQA,mBACA,WAEA,WACA,mDA1SA,oCA6SA,6BACA,gCACA,yBAEA,IACA,EAQA,gBACA,WAGA,WACA,0BAEA,+CAaA,WACA,6BACA,aACA,eACA,IAUA,wCAGA,IACA,EAQA,sBACA,cAEA,WAIA,wBACA,WAEA,0BAEA,iCAGA,uBAGA,IACA,uBAUA,0CAmBA,WAQA,yBAIA,SACA,gBAGA,2BACA,QACA,mBACA,IAEA,SASA,kBACA,wDAmBA,eACA,gBAGA,OAUA,6BAEA,8BAEA,iBAEA,MACA,6BAIA,KA4BA,6BACA,aAEA,sBACA,aAQA,MACA,2BACA,SACA,iBACA,IAWA,uBAEA,EACA,CAQA,2BACA,aACA,0DACA,SACA,kBAEA,qBACA,cACA,YACA,cAEA,iBACA,sBAEA,QACI,YACJ,IACA,sBAGA,oBACA,aACA,cAEA,qBAEA,mBACA,oBACA,MACA,yBAEA,IACA,wBAKA,aACA,6BAEA,GASA,oBACA,SAIA,iDACA,4CACA,uBAEA,8CACA,GAEA,MACA,wCAEA,GACA,CAcA,mBAAqB,sBAAwB,SAC7C,aAGA,mBAEA,aAEA,mBAEA,qBAIA,yDAEA,KACA,qBAEA,GAWA,+BACA,kBAWA,sBACA,IAIA,WACA,KAKA,8BAHA,kCAIA,wBAGA,IACA,6BAEA,uBAEA,GAEA,YAAkB,iBAAgC,OAClD,gEAEA,IACA,SAEA,YAMA,KACA,QAMA,gBACA,oBA8BA,GASA,aACA,+BAEA,qDACA,EAeA,oCACA,sBAEA,0EAGA,QACA,qEACA,GACA,CAYA,EACA,mBAUA,mCACA,mBACA,yBACA,OACA,qEAEA,kDAGA,IAEA,0CAGA,QACA,uCACA,GACA,CAQA,EACA,mBAIA,aACA,yBAEA,wBACA,gBAca,iCCrfb,eACA,GACA,iBAEA,OAOA,CACA,aACA,UACA,EAIA,CACA,aACA,UACA,2CACA,CAIA,aACA,OAEA,CACA,YACA,OACA,CACA,aAEA,eAMA,CACA,eACA,WAGA,QAEA,GASA,aAEA,IAGA,UAKA,WACA,WAQA,SAEA,aAGA,IACA,yBAGA,KAEA,6BAGA,gBAKA,aACA,8BAIA,8BACA,EACA,CAKA,CACA,eACA,cAEA,OACA,EAGA,kBAEA,qBAAiB,oBAAkC,OACnD,wBAEA,eAGA,SACA,EAIA,CACA,eACA,IAEA,mDAGA,SAUA,WARA,8CAGA,OAIA,IAQuB,CACvB,iBACA,kBACA,CACA,EAEA,6BAGA,WAJG,8BAMH,gBAEA,kBACA,EACA,CAoBA,mCA5MA,aACA,mBACA,WAGA,QACA,IAUA,MAjYA,EAEA,eACA,wBAQA,eAoBA,QAAkC,KAClC,QACA,kBACA,eAEA,YACA,UACA,qBACA,cAIA,kBAEA,IAEA,gBAAmB,MAAsB,OACzC,uBACA,cACA,GAEA,KACA,KAIA,CACA,UAEA,EACA,CAeA,aACA,sBAEA,GAGA,mBACA,UAGA,EACA,EAWA,YACA,gBAEA,eACA,aAAmB,MAAsB,OACzC,mBACA,eAEA,qBACA,GAKA,KAeA,mBACA,WAgBA,OACA,UAGA,cAEA,KACA,MAGA,OAEA,QACA,aACA,SACA,EAIA,8BACA,oBAGA,cAGA,YACA,EAiBA,sBACA,YACA,UACA,aACA,uBAGA,uBAKA,MACA,UAGA,aACA,UACA,eAEA,sBACA,EAEA,WACA,YACA,+BAEA,YACA,EAEA,KACA,SACA,2BAEA,qBACA,EACA,CAYA,cACA,yCACA,OACA,kBAGA,kBAGA,QAEA,eAOA,gBAEA,aAAmB,MAAsB,0CAIzC,SAEA,sBAEA,qCAIA,kBAIA,QAfA,KAkBA,sBACA,+BACA,2BAEA,KACA,SAGA,GACA,SAEA,EACA,CAoBA,gBACA,OACA,WACA,MACA,oCAGA,qBACA,6BAEA,GACA,UAIA,uCAFA,KAGA,CAEA,EAcA,qBACA,SAIA,iBACA,oBACG,iBACH,2BACG,OACH,+BAEA,GACA,YAEA,EACA,CAGA,OAUA,iDTvXA,mBA8BA,aACA,IACA,8BAEA,WA/BA,oEAgCA,aACA,WACA,aACA,iBACA,WAEA,OACA,YAEA,UACA,6BACA,kCACA,uCAEA,kBACA,UACA,MACA,UAEA,eACA,kBACA,EACA,CAEA,uFU/DA,OAoDA,IACA,OAMA,eAOA,aAUA,cASA,WAQA,qCASA,gCAGA,yDACA,UACA,CAsBA,EAQA,cACA,aACA,cAIA,cACA,eAKA,mDACA,UAHA,IAQA,eACA,eACA,CASA,mBACA,aACA,mBAGA,+CACA,KAmCA,mBACA,YAEA,sCAEA,GACA,CA2DA,eACA,UACA,QAGA,gBACA,6BAEA,EAOA,OACA,SAMA,oBAGA,+EAEA,mBACA,qDACA,QAEA,YACA,MACA,QACA,EAOA,UACA,MAEA,yDAEA,wCACA,8BAEA,oDACA,8CAEA,iBACA,EAQA,uBACA,cACA,MACA,wBACA,qBACA,oBAEA,KAIA,EAEA,SACA,SACA,QAEA,gBACA,yFCnVA,SACA,WAGA,OACA,qBAEA,EACA,QAEA,IACA,4BACA,mBACA,aAEA,YACA,EAEA,gCCqGA,eACA,GACA,qBArIA,QAwBA,GACA,OAMA,eAOA,aASA,WAIA,qBACA,6CACA,kBACA,eAEA,EAEA,UACA,MACA,eASA,eACA,SAAgB,CAChB,uCAEA,oBACA,SAQA,YACA,MACA,2BAEA,EAQA,WACA,wBACA,QACA,cASA,UACA,yBACA,QACA,cAQA,cAYA,QAMA,WAUA,oBCzHA,aACA,YAEA,4CCsDA,aACA,OAMA,gBAIA,gIAGA,WACA,WAGA,gEAIA,0BAEA,OACA,CAQA,CAyEA,aACA,MAEA,kBACA,YAIA,cAAiB,MAAkB,OACnC,OACA,uCACG,2BACH,mCACG,4DACH,oBACA,UAEG,sBACH,eAMA,cAAiB,MAAuB,WACxC,WACA,SAEA,2CAEA,4CACA,kBAEA,IAEA,OACA,EAYA,CACA,eACA,sBACA,gBAGA,+CAEA,iCAGA,sCAGA,wBACA,EACA,CASA,CACA,aACA,WACA,aAEA,YACA,oBACA,gBAEA,yBAEA,wCACA,8CAEA,uCACA,GACA,CAUA,CACA,eACA,WACA,oBAEA,+BACA,4BACA,IAGA,WACA,MAEA,iBACA,IAmBA,+DA/TA,MAiCA,EAkBA,IAjBA,CACA,OAiBA,aACA,KAGA,0CACA,OAGA,SACA,aAIA,gCAGA,WACA,YAEA,4BACA,GAQA,EA5CA,SACA,KA8EA,aAEA,OAMA,gBAIA,gIAIA,qEAEA,sBACA,EAQA,EAxGA,aAyGA,eAEA,KACA,WAGA,+BAIA,oCAEA,EACA,2BAMA,oBAJA,gBAKA,MAGA,sBACA,MAOA,EAvIA,gBAwIA,aAEA,uBACA,KAQA,EAhJA,gECfA,QACA,WACA,8BACA,EAEA,iBCRA,iBACA,WACA,aACA,4BACA,cAEA,wCCHA,SACA,WACA,gBACA,OAEA,uBACA,CAEA,wCCnCA,GA8BA,IA8GA,aACA,gBAOA,YACA,KACA,uEAAI,MAGJ,mBACA,GA3HA,OAOA,2BAOA,eAQA,OAYA,oBACA,CASA,kBACA,wDACA,IASA,YACA,gBACA,sBAEA,GACA,CAOA,iBACA,mBACA,eAEA,UACA,MAoCA,wCC3IA,OAWA,KAEA,WASA,KA0CA,IAzCA,KAQA,qBACA,aAOA,sBACA,KACA,yEAAK,QAIL,4BAEA,kBAEA,kBACA,yCAGA,UACA,EAOA,mBACA,mBACA,EACA,kBCnDA,iBACA,WACA,kBACA,eACA,SAEA,wCCnBA,QAmBA,IACA,OAIA,cAQA,YAQA,UACA,aASA,kBACA,OACA,6CAGA,YACA,IAKA,mBACA,mBACA,yBAEA,GAQA,yBACA,OACA,EAcA,gBACA,gBACA,0BAEA,GACA,CAOA,QACA,gBAEA,8BACA,4BAGA,eACA,EAaA,cACA,gBAEA,qCACA,4BAGA,4BAEA,oBAAkB,iBAA6B,OAC/C,wFAGA,QACA,EAOA,SACA,gBAEA,4CAGA,mBAEA,MACA,CASA,uBACA,OACA,0BAUA,uBACA,OACA,EACA,QAEA,8CC4fA,eACA,SACA,4CACA,SAEA,QACA,sCAEA,OAMkB,CAClB,eACA,iBACA,SACA,6BACA,GAKY,CACZ,aAEA,OACA,4BAGA,cACA,QAIA,yDACA,6CAntBA,QA4BA,KACA,mBAeA,mBACA,IAQA,kBAQA,uBACA,YAEA,WASA,QAEA,aACA,yBASA,oBAEA,8BAEA,yBACA,yBACA,sBACA,QAQA,iBAEA,qBAEA,0CACA,6BAUA,oCACA,IAQA,iBACA,uBACA,MAQA,cACA,OACA,0BAWA,aACA,OACA,yBAIA,2BAFA,IAWA,SACA,MAEA,SACA,oBACA,6BAKA,uDAIA,kCACA,iCAGA,0CAGA,0CAEA,gBACA,CAUA,kBACA,4CACA,EAQA,YACA,uBACA,EAQA,iBACA,+BACA,EAOA,cACA,8BACA,WAOA,oBACA,CACA,4BAGA,SACA,2BAKA,kCACA,YAEA,EAUA,iBACA,mBAEA,UACA,uDAGA,WACA,sDAEA,UAQA,gBACA,IACA,iBACA,8CAMA,0BACA,wBACA,OAEA,uBACA,WAAuB,IAAc,KAGrC,UACA,EAEA,CACA,MAEA,wBACA,EAQA,gBACA,OACA,WAGA,qBACA,WAGA,oCACA,EASA,kBACA,+BAEA,MACA,2BACG,GACH,0BAEA,qBAEA,EAWA,oBACA,6BACA,YAEA,MAEA,eACA,YAEA,+BACA,GACA,IAGA,UACA,EASA,mBACA,sCAGA,MACA,cACA,sCASA,YACA,cACA,oCASA,+BACA,EAUA,sBACA,6BAEA,gBAAsB,MAAqB,EAC3C,6BAGA,oCACA,EAUA,aACA,kBACA,IAIA,mBACA,EAIA,yBACA,KAIA,8EACA,oCACA,KAIA,6BACA,8CACA,EAKA,2BACA,4BACA,GAKA,6BACA,iDACA,EAIA,SACA,QAWA,eACA,+BACA,uCACA,GAWA,kBACA,+BACA,0CACA,GAWA,eACA,aACA,yBACA,GAIA,SACA,QAOA,gBACA,sBACA,MAeA,cACA,kCAEA,kBACA,qBAEA,eACA,wBAEA,GACA,yBAEA,EASA,YACA,yBACA,EAOA,gBACA,qBACA,MAWA,eACA,aACA,wBACA,GAIA,SACA,QAWA,kBACA,+BACA,yCACA,GAWA,mBACA,oBACA,kBAEA,UACA,YACA,SAGA,OACA,MAEA,OACA,KASA,uBACA,8BACA,EAQA,qBACA,mCACA,EAQA,wBACA,sCACA,EAQA,uBACA,8BACA,SAQA,MAMkB,sDC7qBlB,SAmBA,IACA,mBAIA,eACA,OAQA,YASA,kBAiBA,sBAQA,2BASA,mBAQA,oBAQA,yBAQA,wBASA,6BAWA,+BACA,QACA,eACA,aACA,wCAUA,oBAEA,mCACA,KAEA,oBACA,OACA,CACA,kCACA,qDACA,0CACA,0BAEA,kDACA,4BACA,MAEA,iCAGA,sBACA,CACA,KAEA,kBACA,CAGA,qCACA,CACA,WAMA,gBACA,qBACA,GACA,gBAEA,mBAGA,MACA,oBAIA,aAEA,gBASA,KAKA,OACA,eAEA,uCACA,0BAEA,+BAEA,yDAGA,0CACA,GAEA,yBACA,OAKA,QACA,cACA,OAcA,yBACA,MACA,IACA,yBAEA,MACA,eAGA,gBACA,qBACK,MACL,aAAe,IAAU,KAAkB,MAAY,MAGvD,EAEA,CACA,QACA,sCCzNA,aACA,IAEA,MACA,uBAaA,wBACA,qBACA,uBAGA,iBAhBA,gBAOA,0DAAwE,CAGxE,cAOA,EAmBA,CAwEA,aACA,gBACA,WA8BA,2BAvLA,IAgFA,WACA,OACA,yBAGA,IACA,mCACA,qBACA,EAQA,EAvEA,IAwEA,WACA,WAEA,cACA,KACA,2CAIA,IACA,GAjFA,QAmFA,UACA,SACA,WACA,WACA,cACA,aACA,aACA,SACA,SACA,OACA,OAIA,OAGA,YACA,cACA,YAIA,mBAAqB,GAAY,UACjC,6BAEA,sBACA,CAGA,WAAqB,GAAY,MACjC,YAIA,YAAsB,IAAa,OACnC,mBAGA,QACA,GA3HA,OAUA,gCCtBA,qBACA,QACA,MAEA,iBACA,SAEA,aACA,SACA,UACA,GAEA,gBAEA,cAEK,IACL,gBAEA,EACA,OACA,EAEA,iBAxBA,4BCbA,qBAqBA,IACA,mBAOA,iBACA,OAOA,gBACA,EAKA,iBACA,kBACA,MAKA,MACA,OACA,SAKA,QACA,6BACA,gBAOA,SACA,aAEA,4BAEA,KACA,CAQA,mBACA,uBACA,WACA,8DCnFA,OAiBA,IACA,OAOA,iBAOA,aAOA,cACA,CASA,gBACA,uBACA,QAGA,wCACA,IASA,iBACA,uBACA,QAGA,0CACA,IAQA,gBACA,OACA,gBAQA,cACA,oEAEA,gCACA,CAQA,WACA,oBACA,IAQA,sBACA,YAEA,0BACA,YACA,WAEA,kBAIA,YACA,EAQA,gBACA,4BAEA,iBACA,wBAEA,EACA,CAkBA,2BAA4C,KAC5C,iBAEA,qBACA,iBAEA,KACA,QAOA,eACA,uBACA,0BAEA,iCAAqC,CAErC,gBAQA,WACA,8CACA,MAYA,YACA,OACA,6BAYA,WACA,OACA,4BASA,eACA,iBACA,SAIA,0BACA,8CAIA,qBACA,mBAGA,4BAEA,MAEA,UACA,OAEA,SAEA,gBACA,oBACA,EAEA,UACA,uBACA,EAEA,MACA,YAIA,aACA,SACA,SAGA,sBACA,uBAEA,2BACA,OAAG,iBACH,mBAEA,2BACA,OAEA,mBAGA,0BACA,OAoBA,qBACA,gBACA,kCAEA,SAEA,KACA,wCACI,mBACJ,qCACI,MACJ,mCACI,GACJ,MAGA,kBAEA,EAQA,sBAEA,SACA,2DAGA,cAOA,uFAAgG,MAGhG,kCACA,EAQA,uBAEA,SACA,uCAGA,oBAOA,yFAAkG,MAGlG,4BACA,MAQA,6BACA,4BACA,OACA,MAOA,iBCxXA,iBACA,aACA,YACA,MACA,eAEA,OACA,iBAEA,SACA,EAEA,qECpBA,QAmBA,IACA,mBAWA,qBACA,OAOA,8CAOA,gBAOA,6CAUA,QACA,WAKA,WACA,OACA,MAMA,QACA,wFACA,oCAEA,SACA,CAgBA,qBACA,+EACA,QAMA,cACA,+EAEA,gGACA,0BAEA,SACA,CAKA,WACA,2BACA,6BACA,6BACA,6BAKA,eAMA,WACA,KAEG,4GAMH,mBACA,KAEG,iHAMH,iBACA,KAEG,wJACH,kGACA,uCAEA,wEAMA,iBACA,KAGA,sGAGA,wFAEA,sBACA,qBACA,qBAEA,EAKA,uBACA,OACA,sCASA,qBACA,qCACA,mCAEA,oCAEA,sBACA,aAGA,aACA,CACA,yBC7MA,qBAeA,IACA,mBAMA,eACA,CAUA,mBACA,CAOA,QACA,mBACA,KAKA,MACA,OACA,SAOA,WACA,aACA,KAEA,YACA,yBAEA,iBACA,CASA,aACA,sBAIA,8BACA,KACA,6DC9EA,KAMA,mEACA,SAIA,oCACA,SAIA,8CAGA,8BAGA,mCAGA,mCAQA,QACA,sBACA,kBAEA,gFCyOA,aAEA,KAQA,+BACA,UAgDA,iCACA,UA+BA,iCACA,UAEA,OAK2C,CAC3C,gBAEA,cACA,+BACA,YAGA,uBAMA,4BAIA,uGAMA,uBAGA,2HAEA,qCAMA,gBAKA,iFACA,sBAEA,WAEA,cAGA,KACA,+CAGA,kCAGA,OAGA,mCACA,oBACA,EACA,EAMa,CACb,aACA,qBACA,mBAmBa,CACb,gBAEA,OAMA,qBAGA,8EAAiB,CACjB,UAEA,SACA,gDAGA,sBACA,IACA,gCACG,WACH,qBAAqB,cACrB,oBAEA,sBAEA,qEAEA,GACA,CAOkB,CAClB,mBACA,WACA,WACA,KAEA,QACA,aAIA,eAEA,GACA,WAEA,EAuC8E,CAC9E,aACA,IAEA,8BAIA,oBACA,6CAEA,4BACA,mCACA,EACA,EACA,EAOkB,CAClB,eACA,WACA,WACA,MAOA,KACA,mDAEA,cACA,YAGA,sBACA,QAEA,UAEA,EAO4E,CAC5E,eACA,gBACA,WACA,MAIA,WACA,qDACA,uBAIA,GACA,kBACA,OACA,KAEA,EAEA,EACA,yBApnBA,QAYA,IAEA,eACA,uBACA,6BAUA,qBAeA,SAEA,aACA,GAOA,wCANA,cACA,GAAI,EAEJ,QAKA,mBAEA,wBAgBA,iBAGA,sGACA,CACA,cAEA,qBACA,cACA,EAEA,QACA,eAIA,gBACA,aACA,6BAEA,GAGA,YACA,CAqBA,YACA,kBAMA,iBAGA,uFAMA,qBAGA,iEAEA,mBAEA,kBACA,UAMA,iBAEA,yEAEA,cASA,2BACA,SAAoB,QAEpB,eACA,WACA,EAaA,GACA,IAEA,cACA,gBACA,EACA,iBAEA,EAYA,cAEA,UACA,OAGA,oBACA,UAEA,eACA,OAMA,iBAGA,6EACA,eACA,aAEA,oBAEA,KACA,OACA,WACA,OAEA,YAEA,KACA,eAGA,kBACA,kBACA,wBAEA,UAEA,YACA,EACA,EACA,uBACA,sBACA,SAEA,KACA,UAEA,OAkBA,OAKwD,EAsWxD,WAeA,sBCroBA,qBAeA,IACA,OAKA,eASA,kBA8CA,CAQA,SACA,kBAEA,+CAGA,mBAEA,MACA,CAOA,uBACA,OACA,kCASA,mBACA,mBACA,YACA,sCC2OA,qBACA,OACA,CACA,cACA,MACA,OACA,mBACA,eACA,SAGA,GAsCA,gCA9YA,OAiBA,GACA,OAmBA,aAA0B,KAC1B,sBAMA,4BAGA,yHAEA,2BACA,uBACA,KACA,wFAAK,CAUL,6BAaA,gCAWA,qBACA,uCAEA,uFAUA,oCASA,kCAWA,kCAQA,wFAQA,wEASA,uCACA,MAKA,oBACA,OACA,KAcA,QACA,WAEA,EACA,UACA,gBAEA,gBAAM,QAAc,cACjB,oBAEH,IACA,kBACA,sBAEA,EAQA,OACA,OACA,+BAEA,aAEA,WAUA,QACA,cACA,uCACA,iBAGA,gDACA,gBAAW,CAIX,uEACA,aAAW,CAGX,yCAEA,yBACA,iBAEA,UAMA,sBALA,uBAEA,iBAKA,yBACG,uBACH,OAEA,UACA,mBACI,MACJ,SAEA,iEACA,0BAGA,cACA,MAEA,cAEA,gCAEA,oBACA,gBAEA,iBACA,EAEA,eACA,QACA,uBACA,wBAEA,YACA,sBAEA,2BAGA,EAUA,YACA,cACA,uCACA,iBAGA,mCACA,mBAAW,CAIX,0EACA,aAAW,CAIX,yCAEA,0BACA,cAEA,cACA,uBAYA,yBAEG,mBAbH,yBACA,sBAEA,OACA,sBAEA,+BAGA,wBAKA,OAEA,UACA,mBACI,MACJ,SAEA,uEACA,4BAGA,mBACA,CAEA,cAEA,kCAEA,oBACA,gBAEA,iBACA,EAEA,eACA,oBACA,wBAEA,8BAEA,EACA,sCCwEA,aACA,iDAKA,qBAzaA,QAcA,IACA,OASA,sBAMA,mCAOA,+DACA,EAaA,qBACA,eAA0B,iBAC1B,qBAOA,kBACA,gCACA,IAQA,aACA,qCACA,MAOA,WACA,mBACA,IAkBA,cACA,4CAAsE,WACtE,gDAGA,iCACA,iCAGA,gCACA,8BAGA,iBACA,EAkBA,aACA,0CACA,wCAAkE,WAClE,iBACA,cAGA,0BACA,sBAGA,YACA,6BAGA,iBACA,EAQA,WACA,iEACA,IAQA,oBACA,+CACA,IASA,iBACA,gEACA,IA8BA,iBACA,MAEA,iCAGA,4BAGA,kCAGA,gCAGA,8BAIA,gCAGA,OACA,CAuBA,mBACA,2BAGA,YACA,aAEA,mCAGA,aAGA,+BAGA,WAGA,aACA,EAGA,OACA,KAWA,WAAwB,KACxB,qBAEA,aACA,EAgBA,WAAwB,KACxB,cACA,OAEA,oCAEA,eACA,WAEA,IAeA,eAA4B,KAC5B,cAEA,qBAEA,WAEA,qBACA,WAEA,YAQA,kBACA,uDACA,MAWA,4CACA,WACA,gBACA,aAEA,GAQA,0BACA,2BACA,IAUA,uCACA,SACA,mBAEA,uCACA,EASA,mBACA,iDACA,WAQA,mBACA,4DACA,EACA,MAEA,iBC1ZA,iBACA,eACA,QACA,MAEA,OACA,iBAEA,WACA,EACA,SAEA,iBACA,OAEA,kBACA,OACA,YAEA,SACA,EAEA,iBC9BA,aACA,MAYA,uBACA,aACA,kBAXA,iBAYA,IACA,+BACA,qBACA,CAEA,oFCrBA,GAmFA,IA8TA,UACA,WACA,EAUA,EAzUA,OAIA,cAOA,MAQA,2BACA,IASA,UACA,0BAEA,EACA,IASA,eACA,mBACA,MACA,eACA,WAGA,MACA,IASA,iBACA,mBACA,MACA,gBACA,WAGA,MACA,IASA,cACA,mBACA,MACA,cACA,WAGA,MACA,IAmBA,gBACA,4BAEA,EACA,IAoCA,aACA,wDAEA,2BACA,aAEA,4DAEA,6CAA2E,CACvE,cAEJ,8DAEA,kDAA2E,CAC3E,gEAA8E,CAC9E,gEAAgF,CAEhF,mEAAkG,CAElG,+CAEA,gDAA0E,CAC1E,8DAA+E,CAE/E,iEAA6F,CAG7F,aA2CA,WACA,gCACA,IAMA,mCACA,KAIA,+JAEA,yCAEA,gDAA+E,CAC/E,8DAAkF,CAClF,YACA,CAiCA,iBACA,IAMA,sCAIA,8HAEA,GAIG,EAGH,mBAEA,YACA,OAAa,aACb,EAGA,aACA,OAAa,aACb,EAIA,EAGA,wCACA,SAAoB,+BAEpB,0DACA,sDACA,sDACA,EACA,CAOA,iCCwEA,mBACA,gBACA,aACA,WAGA,GACA,MAEA,sBACA,6BAEA,aACA,cACA,mBACA,WAGA,wBACA,2BAEA,MAMA,+CAnfA,IAoFA,IAgaA,UACA,WACA,IAjaA,OAIA,cAOA,MAQA,qBACA,QASA,UACA,0BAEA,EACA,IAWA,eACA,kBAAqB,MACrB,GAYA,wBACA,IACA,kBAEA,YACA,EAgBA,QACA,oBACA,iBAGA,oBACA,SACA,EACA,oBAGA,OACA,IA+BA,aACA,oCACA,oBAEA,EACA,IAuBA,gBACA,oCACA,qBAEA,EACA,IAgBA,aACA,8BACA,kBAGA,4BAGA,UAKA,iBAEA,kDAGA,kBAEA,uCAAwC,mCACxC,UAIA,4CACA,OAKA,wBAGA,uCACA,oBACA,oBAGA,aAGA,eAGA,EACA,KACA,CACA,CAEA,EACA,SAiBA,iBACA,8BACA,kBAGA,4BAGA,UAKA,iBAEA,oCACA,OAKA,WACA,8CAIA,2CAAsF,aAGtF,kBAGA,GACA,KACA,CACA,CAEA,EACA,MAmCA,YACA,8BACA,gBAGA,8BAGA,WACA,EAGA,UAGA,oBACA,cAGA,yBAAkD,kCAIlD,kCACA,sDACA,KAKA,kGAEA,qCAIA,iBAGA,EAEA,MACA,CAEA,EACA,SASA,kBAEA,yBAGA,mBACA,kCACA,cAEA,2BAGA,2BACA,sBAA8C,CAE9C,YACA,CAIA,gFCvdA,QAsBA,GACA,mBAQA,mBACA,OAQA,wCAQA,+BACA,GAKA,WACA,OACA,QAMA,QACA,4CAEA,8CACA,YAMA,cACA,oEACA,EAKA,WAKA,cACA,2CAEA,6CAEA,SAAU,CACV,QAKA,uBACA,OACA,wCASA,qBACA,IAEA,qBACA,QAEA,yBAGA,wBAIA,gDACA,YACA,6DCzHA,OAgBA,KACA,mBAUA,mBACA,yBACA,mCAEA,gBAmBA,QACA,sBAKA,WACA,OACA,QAQA,2BACA,iCACA,EAQA,4BACA,6BACA,CAMA,cACA,sFACA,EAMA,QACA,mDACA,iEAEA,gBACA,CAKA,WAEA,6BACA,6BACA,eAEA,+DAKA,kEACA,+CAEA,IAGA,cACA,UAKA,uBACA,OACA,wCASA,qBACA,qCAEA,+BAEA,mEACA,2BAEA,oBACA,CACA,yBClJA,aA+EA,YAEA,8BACA,aArCA,IACA,mBAMA,mBACA,WAQA,wBACA,CAKA,aACA,OACA,mDAIA,mCAFA,EAGA,MAIyB,wDCvDzB,aACA,4BAEA,iBAAgC,CAEhC,gBACA,oBACA,oBAEA,gBAAsB,IAAa,KAAQ,GAC3C,CACA,GAOA,EAzCA,IA0CA,WACA,0CACA,EAQA,EA1CA,IA2CA,WACA,0BACA,iBA3CA,eAUA,0BCtBA,aAcA,IACA,WACA,sBACA,8FCTA,QAWA,eACA,QACA,IACA,QACA,OACA,KACA,OAEA,KACA,EACA,OAEA,eAbA,IAcA,uBACA,MACA,kBAEA,GACA,OACA,SACA,IAEA,aAEA,EACA,kBACA,SACA,YAEA,kBACA,WACA,aACA,OACA,eACA,UAGA,OACA,UAEA,UACA,EACA,YACA,SACA,UAEA,UAEA,GACA,OACA,EAEA,4ECvEkB,kBCuBlB,iBACA,WACA,YACA,kBAEA,wCCzBA,aAUA,cAmBA,aACA,WACA,OACA,wCACA,IA9BA,iBAgCA,iBCIA,aACA,QAWA,WACA,iBACA,EAYA,WACA,gBACA,EAGA,uCCmNA,aAEA,OACA,4BAGA,cACA,QAIA,yDACA,2BAxSA,QAqBA,IACA,OAOA,eAQA,iBAQA,uBAEA,KACA,yBAEA,EAOA,oBACA,aACA,aAQA,iBACA,uBACA,MAQA,gBACA,uBACA,SAQA,cACA,OACA,oBAQA,WACA,OACA,KAQA,aACA,OACA,KAUA,MACA,OACA,qBAQA,YACA,+BACA,EAOA,cACA,8BACA,WAQA,iBACA,oCACA,EAUA,uBACA,0CACA,EAOA,UACA,CACA,QAqBA,iBACA,qCACA,EAOA,kBACA,qCACA,EASA,oBACA,KAEA,eACA,YAGA,kCACA,EAUA,sBACA,sCAEA,eACA,YAGA,WACA,EAQA,SACA,IAEA,wBACA,mBAGA,gBACA,EASA,mBACA,IAEA,kBACA,KAEA,yBAGA,wBAIA,iBACA,EACA,MAKY,wCC3RZ,QAkBA,GACA,OAMA,eAOA,eAQA,OACA,YAYA,SACA,MACA,YAQA,UACA,MACA,YAKA,UACA,MACA,eACA,eASA,QAEA,+ECpFA,QAiBA,GACA,OAmBA,aAA0B,KAC1B,sBAMA,4BAGA,2IACA,iCACA,KACA,uFAAK,aAeL,0CASA,qBACA,uCAEA,iFASA,sCASA,oCASA,kCAUA,kCAQA,wFAQA,wEACA,IAKA,oBACA,OACA,KAcA,QACA,SAEA,EACA,UAEA,UAAM,QAAc,cACjB,oBAEH,IACA,kBAEA,EAQA,OACA,OACA,+BAEA,aAEA,WAUA,QACA,mCACA,uBACA,aAGA,wCACA,iBAAW,CAIX,uEACA,aAAW,CAIX,YAGA,uBACA,MAEA,6CAEA,QAGA,mBACA,OACA,qBAGA,uBACA,iBACA,UAKA,qBAHA,iBAKA,+CACG,uBACH,SACA,oCACA,iBAEA,OAEA,qBACA,SAGA,iBACA,0CACA,qBACA,qBAGA,MAGA,uBAEA,uCAEA,EAAG,uBACH,IAEA,WACA,mBACI,MAEJ,uEAEA,aACA,MAEA,4BAEA,oBACA,gBAEA,uCACA,EAEA,0BACA,iBAEA,OACA,sBAEA,iDAGA,EAUA,YACA,mCACA,uBACA,aAGA,2BACA,mBAAW,CAIX,0EACA,aAAW,CAIX,YAGA,uBACA,MAEA,gDAEA,QAGA,8BACA,EACA,4BAGA,kBACA,iBACA,WAUA,uBAEA,+CAEG,mBAbH,0BAEA,OACA,sBAEA,qDAGA,wBAMA,SACA,2CACA,sBAEA,OAEA,yBACA,SAGA,kCACA,+BAEA,mCACA,YACA,0BACA,EAEA,QAGA,8BAEA,uCAEA,EAAG,uBACH,IAEA,6BAEA,oEAEA,aACA,CACA,QAGA,YAEA,6BAEA,wBAEA,uCACA,EAEA,2BACA,iBAEA,+CAEA,EAaA,8BAKA,oBAEA,qDACA,sFACA,8BASA,+BAPA,wBAEA,IAMA,qGACA,+BASA,gCAPA,wBAEA,KAMA,CACA,cACA,MACA,OACA,mBACA,eACA,SAGA,GACA,MAwCA,wCC7dA,SACA,aACA,SACA,sBACA,QAEA,gDCXA,MACA,qDASA,YACA,aACA,aACA,GAEA,qBACA,mCACA,gCAGA,uBACA,yBACA,EAEA,wCCzBA,QASA,WACA,iCACA,SAEA,WACA,0BANA,QAOA,CAEA,iBCWA,iBACA,aACA,0BACA,CAEA,wCCpCA,SAuCA,GACA,OASA,eASA,aAQA,0BACA,EAWA,YACA,IAEA,YACA,aAGA,SAMA,yDAGA,wFACA,EAYA,kBACA,IAEA,YACA,aAGA,SAMA,+DAGA,wFACA,EAWA,iBACA,OACA,EAUA,gBACA,aACA,6BAIA,WADA,IASA,kBACA,cAEA,kDACA,IAQA,sBACA,cAEA,kDACA,IASA,WACA,OAEA,YACA,YAGA,aACA,EASA,eAEA,mBACA,KAIA,yBACA,IAOA,QACA,mBACA,OAkBA,UACA,MACA,gBAEA,OACA,oBACA,iBAGA,aACA,EAWA,gBAA0B,gBAAyC,gBACnE,MACA,wCAEA,OACA,qCACA,OAGA,aACA,EAKA,SACA,iCACA,MAQA,gBACA,wBACA,EAQA,gBACA,wBACA,EAUA,gBACA,oBACA,SAOA,mBACA,oBACA,MAQA,kBACA,mBACA,EAOA,mBACA,sBACA,EAQA,mBACA,2BACA,EAKA,kBACA,aACA,OAOA,SACA,IAEA,yBACA,6BAGA,SACA,CAqBA,sCCkUA,eACA,cAIA,WAIA,qDACA,OAGA,CACA,eACA,+BAAkD,gBAClD,mCAIA,gCAEA,IACA,oDA9tBA,SAsBA,KACA,OAIA,cAOA,MAQA,2BAQA,0BACA,IAcA,aACA,0BACA,0CAEA,0CACA,KAEA,OACA,KAWA,YACA,0BACA,0CAEA,4CACA,GAEA,OACA,KASA,kBACA,sBAEA,eACA,wBAIA,WAOA,iBACA,qBACA,MAQA,iBACA,+BACA,kBASA,WACA,uBACA,WACG,YACH,oBAGA,kEACA,OAGA,mCACA,IAEA,qBACA,wBACA,CACA,KACA,KAGA,KACA,EAEA,QAEA,CACA,QAOA,aACA,mBACA,kCAEA,EAYA,gBACA,OAEA,uBACA,gCACA,YAIA,mCACA,IAYA,eACA,OAEA,uBACA,6BACA,UAIA,mCACA,IAWA,mBACA,cAEA,yDACA,IAWA,kBACA,cAEA,sDACA,IAkBA,iBACA,iBACA,6BAEA,2BAA8B,CAC9B,iBAOA,kBACA,CACA,6BACA,4CAA+B,CAE/B,kBAaA,kBACA,cAGA,uBACA,kBACA,oBAGA,6HACA,kBACA,EACA,EAGA,sCAIA,QAEA,+BACA,mBAGA,6BAEA,2BAA8B,CAC9B,kBAOA,SACA,gCACA,WAYA,cACA,wBACA,eAEA,mBACA,GASA,kBACA,cAEA,mBACA,oCAEA,IASA,gBACA,cAEA,kBACA,oCAEA,IAYA,cACA,IAMA,iCAGA,8HAEA,MAIA,gDAEA,oBACA,aAGA,YACA,mDAEA,+BAEA,IAQA,gBACA,wBACA,EAUA,gBACA,oBACA,SAOA,mBACA,oBACA,MAQA,gBACA,wBACA,EAUA,kBACA,uBACA,gCACA,oBAEA,qCAAmC,iBACnC,iBACA,CAWA,mBACA,mBACA,wBAEA,gCAAmC,mBAEnC,kBAYA,kBACA,wBACA,sBAEA,gCAAmC,mBAEnC,kBAWA,mBACA,eAEA,4BAEA,oEAEA,wBAEA,wBACA,YAIA,eAEA,+BAAmC,6BACnC,iBACA,CASA,qBACA,IACA,0BAGA,mBACA,0BACA,kBAEA,2CACA,IAuBA,qBACA,YAEA,yCACA,mBAEA,GACA,SAGA,qBACA,2CACA,aAIA,sBAEA,GACA,SAEA,GACA,CASA,8BACA,YACA,qBAEA,GACA,CASA,cACA,kBACA,oBAGA,+GACA,yCACA,GAQA,eACA,WAAkB,iBAAyB,OAC3C,qCAQA,aACA,KACA,6GAAM,6CAIN,IAOA,YACA,cACA,KAQA,mBACA,MACA,4BAEA,WAwBA,QAEA,WAGA,sBCtsBA,qBAuCA,GACA,OAWA,mBAOA,kBAEA,WAMA,yBAGA,4FAMA,yBAQA,iGAQA,qBACA,CASA,kBACA,yCACA,gDASA,iBACA,kBACA,MASA,gBACA,gCACA,qCAaA,gBACA,wCACA,UAQA,aACA,sBACA,MAQA,WACA,sBACA,IASA,eACA,sBACA,QAUA,MACA,OACA,cAQA,UACA,uBAEA,gBACA,kCAGA,cACA,CAWA,gBAA0B,gBAAyC,gBACnE,MACA,wCAEA,OACA,qCACA,OAGA,aACA,EAQA,gBACA,mCACA,EAQA,gBACA,mCACA,EAUA,gBACA,sBACA,eAOA,mBACA,sBACA,kBACA,sCCjLA,aACA,gDACA,CAUA,CA0DA,eACA,6BACA,+CAEA,6DACA,yBACA,iCAEA,0BACA,YACA,oBACA,KACA,eACA,6BACA,EACA,CACA,CACA,wDA1EA,WACA,4BACA,EAWA,MACA,WACA,UACA,gBAEA,KAEA,IAEA,EAxHA,IAqIA,aACA,aAEA,SACA,gBACA,kBAGA,kBACA,EAOA,EAzGA,IA0GA,WACA,gBACA,EAEA,EAhGA,SAbA,yBACA,uBAEA,aACA,GAaA,0BAJA,QAKA,cAIA,EACA,SAEA,UAAgB,IAA0B,EAC1C,OAaA,SAqCA,WAWA,+CCpIA,QAmCA,KACA,mBAqBA,eACA,OAQA,QACA,aAKA,WACA,qEAEA,4BACA,0BACA,MACA,2BAEA,EAAI,EAAG,iBACP,YACA,EAWA,YACA,MACA,wDAEA,GACA,4EClGA,OA+BA,IACA,OAIA,cAOA,MAQA,gBAQA,2BAQA,oCACA,EAeA,cAAoC,KACpC,cACA,yCAEA,aACA,SAQA,aACA,aACA,OAQA,yBACA,aACA,mBAWA,aACA,kBACA,aAEA,+CACA,qCAEA,oCACA,EAQA,YACA,kBACA,aAEA,+CACA,uCAEA,kCACA,EAQA,kBACA,6CACA,WAOA,iBACA,qBACA,MAOA,iBACA,+BACA,kBAQA,sBACA,aACA,mBAGA,gBACA,IAiBA,cACA,kBACA,oBAGA,gEACA,6BACA,YACA,SAOA,aACA,mBACA,kCAEA,EAUA,gBACA,OAEA,uBACA,gCACA,YAIA,mCACA,IASA,eACA,OAEA,uBACA,6BACA,UAIA,mCACA,IASA,mBACA,cAEA,yDACA,IASA,kBACA,cAEA,sDACA,IASA,WACA,mBACA,OAGA,oDACA,mBAGA,+BACA,WACG,YACH,oBAGA,kEACA,OAGA,mCACA,IAEA,qBACA,wBACA,CACA,KACA,KAGA,KACA,EAEA,QAEA,CACA,QAOA,kBACA,cACA,cACA,qBAEA,UAYA,eACA,MAEA,0BACA,kBACA,oBAGA,gEACA,EAEA,2BACA,YACA,SAOA,SACA,gBACA,mCAEA,mDACA,WAYA,cACA,wBACA,eAEA,mBACA,GASA,kBACA,cAEA,mBACA,oCAEA,IASA,gBACA,cAEA,kBACA,oCAEA,IAYA,cACA,IAMA,iCAGA,6HAEA,MAIA,gDAEA,oBAEA,MACA,mDAEA,+BAEA,IASA,qBACA,IACA,0BAGA,mBACA,0BACA,kBAEA,2CACA,IASA,8BACA,YACA,kBAEA,GACA,CAWA,cACA,mBACA,4BAQA,YACA,KACA,4GAAM,gCAKN,0CACA,GACA,QAEA,WAUA,oBC1hBA,aAwBA,IACA,aACA,6BAEA,kBAAiB,IAAY,EAC7B,eAEA,SAKA,sBAEA,OACE,kBAEF,OAGA,SAEA,WAIA,iBCzBA,iBAAgB,iCCzBhB,aAcA,IACA,WACA,WAEA,gBACA,KAGA,OACA,6DCvBA,OA4BA,GACA,OACA,cAQA,UAQA,oCAQA,uBAQA,gCACA,IAOA,OACA,uBACA,iBAGA,qFAAkE,CAClE,wDAAuD,CACvD,mCACA,EAOA,UACA,UACA,2BAGA,sBACA,wBACA,yBAEA,GAQA,UACA,mBAEA,2CACA,OACA,YASA,QACA,2CACA,qBACA,UACA,YAAG,EACH,EASA,QAEA,gBACA,sDCrIA,QAyBA,IAqFA,IApFA,KAIA,cAOA,8BAQA,yBACA,IAOA,YACA,4CACA,YACA,EACA,EAWA,SACA,kBACA,0BAEA,GACA,SAEA,2BAEA,GAQA,SACA,kBACA,0BAEA,OACA,EAGA,qBACA,WACA,GACA,mBACA,iBAGA,GACA,QAKA,UACA,qBACA,oBACA,eACA,yCC3GA,aAGA,cAWA,mBACA,eACA,SACA,2BACA,qBACA,WAEA,EAEA,mFClBA,SAaA,iBACA,QACA,IACA,IACA,SACA,OACA,SAEA,WACA,QAEA,GACA,0BAEA,KACA,KACA,IAEA,QACA,QApBA,QAqBA,IACA,eAEA,IACA,kBACA,SACA,YAEA,kBACA,WACA,WACA,EACA,eACA,UAGA,cACA,EACA,YACA,WAEA,EACA,OACA,EAEA,mFChCA,QACA,WACA,gBACA,oBACA,oBAEA,kBACA,KAEA,UAEA,mBACA,eACA,MALA,4BAMA,QACA,yBAGA,SACA,EAEA,iBCvDA,aAcA,IACA,UACA,OAEA,cAAiB,EAAO,IACxB,kEAGA,SACA,0CCvBA,QAgBA,GACA,OAMA,eAOA,MAEA,UACA,sBAEA,EAOA,oBACA,2BACA,WAQA,aACA,oBACA,MAQA,gBACA,iDACA,EAQA,WACA,wBACA,IAQA,gBACA,6BAEA,oBACA,CASA,sBACA,2BAEA,4EACA,EAWA,iBACA,mBACA,mBAGA,8BAEA,OAMA,gBAGA,oHACA,EAWA,iBACA,OAEA,2BACA,gBACA,oCAGA,QACA,UAEA,OAMA,gBAGA,mGACA,MAQA,iBAEA,aACA,oBAMA,oBAIA,2HACA,EASA,mBACA,6BACA,EAQA,SACA,+BACA,SACA,oEC3MA,QAqBA,KACA,mBAmBA,uBACA,OAQA,kCAQA,YAQA,gCAQA,gCACA,CAKA,WACA,OACA,sBACG,eACH,qBAEA,kBAEA,iBAMA,QACA,mEACA,YAMA,cACA,+EACA,EAKA,WAEA,oCACA,kEASA,mBACA,KACA,yHAAM,gCAIN,8EAQA,cACA,KACA,qFAAM,iBAQN,qCACA,UAEA,MAGA,kDAEA,UAAU,oEACV,SAKA,uBACA,OACA,2CASA,qBACA,oEACA,YACA,yBC7KA,qBAoBA,IACA,mBAKA,QACA,mBACA,YAMA,cACA,+BACA,EAKA,WAEA,CAKA,uBACA,OACA,oCACA,6DCnDA,OAYA,IAEA,eAQA,YACA,mBAIA,mBACA,WAQA,YAYA,0BAUA,eAEA,eACA,+BACA,EAEA,gBACA,2BAMA,iBAGA,qGAEA,0BACA,GACA,EACA,iDAKA,mCACA,0DACA,IAAG,EAAG,UACN,QACA,QAEA,6DC1FA,OAiBA,GACA,OAMA,cAOA,aACA,IAWA,YACA,IAEA,YACA,aAIA,UAMA,qDAGA,uFACA,EAQA,kBACA,cAEA,kDACA,IAQA,sBACA,cAEA,kDACA,IAQA,WACA,OAEA,YACA,YAGA,aACA,EASA,eAEA,8BACA,eAEA,SAEA,IAWA,gBAA0B,gBAAyC,gBACnE,MACA,wCAEA,OACA,qCACA,OAGA,aACA,EAKA,SACA,iCACA,MAOA,iBACA,uBAEA,QACA,kCAEA,EAmCA,MA+BA,EAEA,8C7E5CA,cACA,aACA,aAGA,gBACA,cAIA,oDACA,aACA,aACA,gBAEA,sBACA,IAEA,yBACA,kBAGA,aACA,SAIA,4BACA,oBAGA,8EAEA,aACA,uCACA,kBAIA,sBACA,IAEA,OACA,GAoBA,CA2EA,iBACA,2BAGA,MAEA,eAEA,QAMA,kBAGA,qDAEA,sCACA,uBACA,SAGA,OACA,0BAGA,eACA,QAGA,oBAEA,uBAEA,GAaA,CACA,cACA,MAGA,OACA,sBAIA,WAAQ,UAAmC,UAC3C,aAEA,uBAGA,sCAGA,SACA,oBACA,iCAGA,aACA,GAYA,CA+DA,iBACA,IAEA,0BACA,MAEA,mBACA,aAEA,gBAEA,YAEA,6BACA,EACA,WAGA,gBACA,GAcA,CACA,iBACA,mBAMA,qBAGA,2CAGA,OACA,kBAIA,gDACA,mBAEA,qCACA,UAEA,GAGA,iCACA,0BACA,0BAEA,0DACA,EAGA,MAAQ,UAAmC,UAC3C,aAGA,mCAGA,0CAGA,YAGA,qBACA,eAEA,uBAEA,wBACA,GAYA,CA0IA,cACA,WAEA,oBACA,KACA,GAEA,aACA,MAEA,OACA,GAS4C,CAC5C,oBACA,aACA,YAEA,SAGA,mBACA,qBAEA,uBACA,GAEA,eACA,iBACA,mBAGA,2CAEA,eACA,GAekD,CAClD,oBACA,aACA,aAGA,uBAMA,+BAIA,0DAMA,4BAIA,mEACA,sCAIA,SACA,kCAIA,aACA,uBAGA,gBAKA,qBACA,qCAEA,eACA,GAIA,WACA,+BAEA,mBACA,GAMA,mBAGA,QAGA,oCAGA,2BACA,2BAGA,sBAGA,+BAEA,gBAEA,GAQ8C,CAC9C,uBACA,QACA,QAGA,mBACA,sBAGA,wBACA,aACA,oBAGA,cACA,8BAGA,OACA,gBACA,kBAKA,SACA,UACA,CAEA,YACA,0CAGA,IAEA,IAGA,QAEA,mBACA,eAGA,6BACA,GAGA,oBAGA,eACA,MACA,KAEA,KAEA,kDACA,GAQ8C,CAC9C,uBACA,QACA,QAEA,mBACA,sBACA,aACA,iBACA,6BACA,yBAGA,yDAEA,aAGA,WACA,2BACA,yBAEA,uBACA,IAEA,KACA,0BAGA,IACA,IAGA,QAEA,mBACA,eAGA,cACA,GAGA,oBAGA,eACA,MACA,KAEA,KAEA,kDACA,GAUA,CACA,cACA,aAEA,wBACA,kCAGA,oBAEA,2BACA,mBAGA,GACA,EASkD,CAClD,cACA,8BACA,uDAGA,MACA,wDAIA,wCAGA,wDAGA,mEAGA,8CACA,EAOkD,CAClD,iBAEA,kBACA,0BACA,QAEA,oBACA,GASqB,CACrB,iBAEA,wCACA,SAIA,0BAEA,oCAKA,yEACA,IAKA,0BACA,kEACA,IAKA,0BAEA,iCAKA,+BACA,wCAIA,uBACA,4BACA,gCAIA,sBACA,4BACA,iBAIA,IACA,QAOqB,CACrB,iBAEA,wCACA,SAIA,0BAEA,oCAKA,2EACA,KAKA,+BACA,iBAIA,0BAEA,mEACA,IAKA,0BAEA,iCAIA,iCAIA,IAMA,4BAHA,sCAEA,mBAQa,CACb,cACA,2DACA,0EACA,UAgBA,CACA,cACA,kBACA,gCASA,oBAGA,yCACA,cAEA,cACA,EAQA,cACA,8CACA,oBAM0C,CAC1C,cACA,eACA,eAEA,uBAQA,kBAEA,wIA9rCA,IAyDA,IAxDA,CACA,gBAwDA,YACA,qBACA,OAEA,MAEA,GA0BA,EAvFA,eAwFA,YACA,aAEA,iBAMA,mCAGA,gHAMA,sBAGA,+DACA,kCACE,mBACF,aAEA,gCAEA,yCACA,sBAEA,QACA,GAEA,wBACA,GA4BA,EAtJA,kBACA,gBAsNA,YACA,aACA,iBAEA,0DAMA,6BAIA,qJACA,gEAEA,kDACA,wBAEA,KACA,EAWA,EArPA,SACA,SACA,MAoXA,eACA,GAIA,0BACA,WACA,WAIA,yCACA,aACA,QAGA,sCAEA,qBAEG,oFAEH,uCACA,uCACA,GAGA,GACA,sBAEA,IAGA,CAEA,uBACA,iBAGA,0BACA,qBAIA,SAEA,IACA,CAcA,EAhbA,OACA,OACA,aAohBA,eACA,mBAMA,qBAIA,yDACA,wCAIA,kBACA,eAIA,iBACA,uDAIA,0CAGA,yCAGA,SAGA,kCACA,UAGA,qBACA,iBAEA,kDACA,WAIA,MACA,GAWA,EA9kBA,OA+kBA,eACA,mBAMA,qBAGA,6CAGA,OACA,kBAMA,gDACA,mBAGA,wDACA,UAEA,GAGA,MAAQ,UAAmC,UAC3C,aAGA,mCAGA,YAGA,qBACA,eAEA,uBAEA,wBACA,GAaA,EAzoBA,OA0oBA,eACA,wBAEA,8CACA,qCACA,qBAEA,KACA,EAQA,EAvpBA,2BA4OA,YACA,MACA,mBAAiC,YAEjC,eAEA,mBACA,eACA,oCACA,0CAGA,yBAIA,4CAEA,MACA,EAqBA,GA63BA,2BAKqB,mC8EhkCrB,qBAEA,aAKA,uBAA0B,2BAM1B,2BAEA,mBAEA,kBAEA,mCAEA,GACA,aACA,mBAGA,cACA,OAEA,qBAEA,wCAKA,sBAAqC,CAKrC,gBAKA,uBAA0B,2BAM1B,6BAAkC,CAElC,0BAEA,4BAEA,uCAEA,uCAIA,cAEA,eACA,EAEA,CACA,eACA,OACA,OAGA,UAEA,oBACA,iBAEA,qBAGA,qBACA,WAEA,4BACA,kDACA,wCAEA,SAEA,WACA,CAEA,CACA,aACA,sBAEA,iBACA,gEACA,MAIA,SACA,sFA3OA,QA6BA,IACA,mBAIA,wBACA,OACA,qBAKA,OACA,cACA,WACA,aACA,SAGA,0CAGA,yCACA,yBACA,uBAGA,sBACA,yBACA,eAGA,gDACA,WACA,EAAG,EAAG,UAGN,wCAA8D,UAC9D,iDAAuE,UAKvE,iDACA,WACA,EAAG,EAAG,UAEN,2CACA,GACA,MAgCA,EACA,2BAcA,iFAEA,wEC/HA,QAyBA,GACA,OAOA,eAOA,MAQA,2BAQA,uCAYA,0CAYA,8CASA,QAOA,aACA,oBACA,MAaA,SACA,IACA,gBAEA,sBACA,QAEA,GAMA,iCAGA,yCAMA,iBAEA,qCACA,iBAIA,UACA,yBACG,qCAMH,kBAGA,mEAEA,uBAEA,qBAEA,GACA,IAQA,OACA,IAEA,MACA,uCACG,WACH,iCAOA,sBAGA,oEACA,IASA,YACA,IAEA,YACA,qCAEA,GAGA,sBACA,EASA,UACA,IAEA,UADA,eAGA,eACA,sBACA,sBACA,MAEA,EACA,0BAEG,KACH,sBACA,gBACA,MAEA,EACA,QAGA,QACA,MACA,yBACA,+BAGA,IAMA,gBAGA,+DACA,wBAEA,iDACA,mDACA,4CAEA,sBAEA,GACA,CAWA,SACA,0BACA,EAWA,UACA,2BACA,EAWA,YACA,6BACA,EAMA,QACA,UACA,4CACA,0CAGA,WACA,oBAEA,EAiFA,UACA,SAMA,gCAGA,2GAEA,EAOA,SACA,qCACA,GAUA,aACA,CACA,qDAEA,oCAEA,GAEA,EAQA,uBACA,cAKA,6BACA,8BACA,0CAMA,SACA,0CACA,2CACI,OACJ,WAEA,2CACA,2CAEA,cACA,EACA,CAGA,cACA,UAIA,yBAGA,mCACA,+CAEA,GACA,eAEA,EACA,EAKA,oBACA,2BACA,WAeA,QAEA,8CC7OA,aACA,wDACA,OAMoB,CACpB,aACA,sBACA,iBAMA,wBA/RA,QAoCA,KACA,YAAkC,YAkBlC,eACA,WAIA,KACA,0CAIA,4BACA,EAmBA,qBACA,WAGA,WACA,6BAGA,OACA,EAGA,YACA,CAGA,8BACA,EASA,qBACA,wBACA,GAGA,QA+BA,EACA,OAKA,eAEA,iBAGA,kBACA,CACA,EAEA,yBA0BA,QAAkC,KAElC,sBAIA,oDAIA,qCAGA,0CAEA,iBACA,qBAKA,wCACA,EAYA,QAEA,oBAEA,cAMA,4DACA,8BAEA,gBAaA,uBACA,cACA,aACA,EAKA,8BACA,qCACA,6BACA,EAEA,EACA,CAOmB,kCChQnB,aACA,QACA,eAEA,WACA,eACA,SACA,mBACA,GACA,CAEA,6CAZA,KAaA,sBACA,0BACA,oBACA,oBACA,gBAEA,wCCnBA,aACA,QACA,eAEA,uBACA,SACA,cAEA,GAEA,2BAXA,KAYA,qCACA,gBAEA,yBClBA,iBACA,aACA,YACA,MACA,SACA,EAEA,WACA,OACA,SACA,YAGA,SACA,EAEA,iBCjBA,iBACA,aACA,YACA,MACA,WAEA,WACA,YAEA,SACA,EAEA,wCCVA,QACA,aACA,aACA,OACA,yBACA,SAGA,UACA,CAEA,0DCfA,QAeA,eACA,OACA,eAEA,mCAlBA,aAaA,EAMA,WACA,aACA,MAEA,uBACA,cACA,OAEA,IAEA,CACA,OACA,EACA,yBACA,EAEA,wCC7BA,QACA,iBACA,aACA,cAEA,aACA,aAEA,WACA,0BACA,0BACA,EAEA,gDChBA,SACA,WACA,+BACA,EAEA,wCCLA,SACA,aACA,SACA,yBACA,iCACA,UACA,GAEA,iBCXA,iBACA,WAGA,IACA,kBACA,iCACA,QACA,GAAK,UAEL,OACA,EAEA,gECLA,QACA,eACA,cACA,GAEA,qBACA,WACA,wCACA,4BAEA,oBAGA,EAEA,iBC7BA,aACA,aAQA,cACA,WACA,YACA,iDAEA,aACA,CAEA,wCCdA,sBAEA,+BCCA,iBACA,WACA,QACA,YAEA,kCACA,QACA,CACA,GACA,CAEA,wCCUA,SACA,WACA,iBACA,QAEA,0DCJA,QACA,WACA,kDACA,EAEA,iBChCA,iBA6BA,WACA,OACA,kCACA,GAJA,gBAMA,yDC9BA,aAMA,+BAGA,aAGA,wBAOA,YA8BA,aACA,WACA,cACA,eAjDA,4BAkDA,GAEA,wBACA,MACA,SAEA,0CACA,kBACA,iDACA,CAEA,0EC1CA,QACA,WACA,WACA,QAEA,eACA,iCACA,aACA,GAGA,2BAFA,KAGA,yBACA,4BACA,GACA,EAEA,uDC5CA,GAqBA,IACA,eACA,MAEA,qBACA,iBAAkC,cAClC,6BAEA,WACA,UACA,UAEA,kBACA,4BACA,mCAEA,cAAwB,4BACxB,iBACA,qBAGA,QAGA,cACA,aACA,MAEA,eACA,qBAEA,GAEA,OACA,kCC4aA,eAEA,iBAAqC,iBAErC,4BAEA,cACA,MACA,iBAEA,OACA,YAIA,QASA,CA0CA,aACA,iBAEA,uBACA,mDA3fA,WACA,kBACA,qBACA,OACA,gBAEA,MAIA,oBAIA,mDAEA,oCACA,gBACA,GACA,CAWA,MACA,UACA,kBACA,qBAIA,mDACA,wBAEA,mBACA,GACA,CAcA,MACA,WACA,kBACA,OAEA,kBACA,UACA,cAEA,cACA,qBAEA,KACA,qBAGA,OAIA,sBAIA,wBAEA,kDAEA,WACA,sDAEA,GACA,CAiCA,MACA,WACA,sBAA+D,SAE/D,oBACA,yBAIA,aAAS,OAAa,kDAEtB,iDACA,GACA,CAkCA,MACA,WACA,sBAA+D,CAE/D,oBACA,yBAIA,aAAS,CAAM,gDAEf,kDACA,GACA,CA4BA,MACA,WACA,kBACA,qBACA,OACA,oCAEA,OACA,EAGA,gCACA,OAGA,oCAKA,0DACA,mCACA,kBACA,EAEA,YACA,EACA,CAuBA,MACA,WACA,kBACA,qBACA,OACA,oCAEA,MAIA,wBAIA,uCAEA,oBACA,GACA,CAiCA,MACA,WACA,kBACA,qBACA,OACA,gBAEA,MAIA,qBAIA,6CACA,wCAEA,eACA,cAEA,GACA,CAsBA,MACA,WACA,kBACA,qBACA,OACA,gBAEA,MAIA,qBAIA,gDACA,wCAEA,eACA,gBAEA,GACA,CAQA,MACA,UACA,kBACA,sBACA,UAQA,yCACA,mBAEA,gBAIA,4BACG,eAGH,oBACA,wBACA,EAGA,cAeA,cACA,kEAEA,KACA,CAIA,EArbA,IA+cA,WACA,kBACA,OAEA,kBACA,UACA,cAEA,cACA,qBAEA,KACA,qBAGA,OAIA,sBAIA,gDAGA,iCAGA,eACA,8BAEA,GACA,CAOA,iGCpiBA,OAwBA,GACA,mBAIA,WACA,OACA,QAQA,eACA,6DACA,IAQA,YACA,0DACA,IASA,uBACA,4BACA,IAKA,yBACA,OACA,IAKA,uBACA,OACA,gCAKA,uBACA,OACA,GACA,MAYA,EACA,+BACA,kBAGA,MACA,mBAGA,iBACA,+BAEA,0BACA,kBACA,gCAGA,eACA,gCAEA,wBACA,WACA,4BACA,wBAGA,qBACA,EAGA,OACA,KAAC,GAED,6GCjIA,QAuBA,GACA,mBAIA,WACA,OACA,OAQA,eACA,mEACA,IAKA,cACA,aAEA,oBACA,yCAGA,aACA,CAYA,uBACA,4BACA,IAKA,yBACA,OACA,IAKA,uBACA,OACA,+BACA,MAWA,EACA,4BACA,YACA,iBAEA,aACA,eAEA,2BAMA,oBAGA,kGAMA,oBAGA,uHACA,uCAEA,mDACA,WACA,2BACA,gCAEA,qCACA,+BACA,gCAEA,GACA,IAAC,GAED,8CCxCA,qBACA,kCACA,wBACA,6BACA,EASA,gDA3GA,OAqBA,GACA,mBAIA,WACA,OACA,MAOA,cACA,wDACA,IASA,qBACA,+DACA,IASA,qBACA,+DACA,IASA,qBACA,4BACA,IAKA,yBACA,OACA,EAKA,uBACA,OACA,8BAKA,uBACA,OACA,GACA,QAgBA,6BACA,YACA,oBAEA,oBACA,OAMA,qBAGA,sGACA,EACA,qCAGA,SACA,KAAC,GAED,8CCpGA,mBACA,gCACA,wBACA,6BACA,EAQA,0CA1CA,OAoBA,GACA,mBAIA,uBACA,OACA,gCACA,QAeA,6BACA,YACA,oBAEA,oBAEA,gCAEA,sBACA,yCAEA,OACA,mCAGA,SACA,KAAC,GAED,4GC7DA,OAuBA,KACA,mBAIA,WACA,OACA,OAOA,eACA,+DACA,IAKA,cACA,aAEA,oBACA,yCAGA,aACA,CAiBA,sBACA,4BACA,IASA,qBACA,4BACA,IAKA,yBACA,OACA,IAKA,uBACA,OACA,+BAKA,uBACA,OACA,EACA,MAWA,EACA,4BACA,YACA,iBAEA,aAEA,aAMA,qBAGA,6EAEA,8DAEA,wBACA,gCAEA,cACA,KACA,gBACA,uCACA,iBAEA,kBAEA,2BACA,gCAEA,GACA,IAAC,GAED,8CC/GA,iBACA,iBAEA,UACA,4BAEA,uBACA,EAEA,CACA,eACA,aACA,kBACA,yBAIA,UACA,EAeA,CACA,iBAEA,iCAMA,iBAGA,oBAGA,WAGA,+BAGA,UAGA,eAEA,aAAmB,MAAgB,WAEnC,WAkBA,8CAGA,yBAMA,+CAEA,gBACA,CAYA,GACA,EAIA,iBACA,kBAKA,EAEA,QACA,EAUA,CAkBA,eACA,eAIA,0CACA,WAEA,mBACA,kDACA,SAEA,GACA,KAEA,CAEA,OACA,WAIA,mBAGA,CACA,iBACA,wBAEE,4BAGF,YAEA,CAYA,CA6CA,aACA,wBACA,uBACA,MAAE,EACF,EAGA,CACA,eACA,oBACA,+BAEA,iBAEA,eAAiB,IAAa,EAC9B,2BAGA,aACA,+CAxSA,IAyKA,eACA,aAEA,GACA,SACA,aAGA,YACA,EAOA,EA7KA,IA6NA,eACA,kBACA,gBAEA,aAAiB,QAA+B,WAChD,MAEA,cAAkB,QAA+B,WACjD,MAEA,cAAmB,MAAmB,OACtC,cAAoB,MAAmB,WACvC,mBACA,kBAEA,mBACA,eAEA,kBACA,eACA,CAGA,iBACA,eACA,CAEA,iBACA,eACA,CAEA,gBACA,YAEA,YACA,QACE,KACF,SAGA,GAAS,mBACT,EAEA,EAtQA,WA0BA,2FCxCA,QAsBA,GACA,mBAIA,WACA,OACA,QAOA,eACA,+DACA,IAQA,qBACA,4BACA,IAKA,yBACA,OACA,IAKA,uBACA,OACA,gCAKA,uBACA,OACA,GACA,MASA,EACA,6BACA,IAMA,8BAGA,+FACA,iBAEA,yCAEA,mEACA,WACA,2BACA,gCAIA,uDACA,+BACA,gCAEA,GACA,IAAC,GAED,oHC7GA,QAwBA,GACA,mBAIA,WACA,OACA,MAOA,YACA,YAEA,mFACA,IAOA,cACA,YAEA,2CACA,CAQA,uBACA,4BACA,IAQA,qBACA,4BACA,IAKA,yBACA,OACA,IAKA,uBACA,OACA,8BAKA,uBACA,OACA,GACA,MAUA,EACA,6BACA,OAMA,qBAGA,0FAEA,MAMA,6BAGA,uEAMA,8BAGA,mGACA,iBAEA,uCACA,wBACA,gCAEA,yCACA,iEACA,+BACA,gCAEA,GACA,IAAC,GAED,8CCxDA,YAGA,YAEA,iDACA,mBACA,SACA,sBACA,OACA,8BAEA,eACA,EAAG,UAEH,QAYA,CACA,mBAEA,8BACA,eAEA,MAIA,6CAGA,yDAMA,cAGA,mBAGA,gCAGA,uBACA,6BAEA,mBACA,iBAEA,uBACA,EACA,iBA9JA,OAoBA,GACA,mBAMA,iBACA,SAEA,UACA,KAOA,SACA,MACA,eA6CA,MASA,EAkEA,sDChKA,QAcA,GACA,mBAQA,uBACA,OAQA,aAQA,yCAQA,4CAQA,mBACA,CAKA,WACA,OACA,QAMA,QACA,uEACA,YAMA,cACA,mFACA,EAKA,WACA,6BAEA,gDAEA,UAAU,qBACV,EAKA,SACA,eAEA,yBAEA,SACA,CAKA,uBACA,OACA,wCASA,qBACA,WACA,KACA,2CACA,2CACA,OACA,UAEA,YACA,8CC/HA,QAiBA,IACA,mBAMA,eACA,aACA,cAKA,gBACA,qBACA,CAKA,WACA,OACA,UAMA,cACA,mEAGA,gCACA,iBAEA,uBACA,CAKA,uBACA,OACA,0CACA,6DC9DA,OAoBA,GACA,mBASA,qBACA,OAOA,iBAOA,eAOA,eACA,CAKA,WACA,OACA,QAMA,QACA,mFACA,YAMA,cACA,+FACA,EAKA,WAEA,uBAEA,2BAMA,eACA,KAEG,oIAMH,iBACA,KAQA,2HAIA,4BAEA,QAAU,wBACV,SAKA,uBACA,OACA,wCASA,qBACA,+DACA,YACA,8CCvIA,QAuBA,GACA,mBAWA,uBACA,OAQA,aAQA,WAQA,gBAQA,gBACA,CAEA,WACA,OACA,sBACG,mBACH,qBAEA,sBAEA,qBAKA,QACA,kEACA,YAKA,cACA,8EACA,EAEA,WACA,kEASA,kBACA,KACA,6HAAK,yBAIL,iFAQA,cACA,KACA,yFAAK,yBAIL,YACA,qDAKA,0CAHA,UAGU,kEACV,SAKA,uBACA,OACA,+CASA,qBACA,iBAOA,eACA,KACA,2HAAK,UAIL,iEACA,YACA,yBCpKA,aAqGA,YAIA,SACA,iBAGA,iBAGA,yCACA,IACA,qBAGA,UACA,MAEA,WACA,eAGA,KACA,UAlHA,IACA,QAWA,GACA,mBAMA,mBACA,WASA,iBAQA,uBACA,CAKA,aACA,OACA,mDAIA,mCAFA,EAWA,SACA,qBAGA,0BAEA,SACA,CAUA,aACA,6CACA,QACA,MAMA,EACA,mBAIyB,gCCkGzB,aAEA,OACA,4BAGA,cACA,QAIA,yDACA,2BAlNA,QAgBA,GACA,OAOA,eAOA,MAEA,aACA,yBAEA,EAKA,oBACA,8BACA,WAQA,iBACA,uBACA,MAQA,cACA,OACA,oBAQA,WACA,OACA,KAQA,aACA,OACA,KAUA,MACA,OACA,qBASA,kBACA,4CACA,EAQA,YACA,uBACA,EAQA,iBACA,+BACA,EAOA,cACA,8BACA,WAUA,oBACA,6BACA,YAEA,MAEA,eACA,YAEA,+BACA,GACA,IAGA,UACA,EASA,sBACA,6BAEA,gBAAsB,MAAqB,EAC3C,6BAGA,oCACA,EAUA,iBACA,uBACA,EACA,QAEA,WAKY,sBCrMZ,qBAeA,IACA,OAMA,mBAOA,eAQA,gBAQA,mBAEA,qBACA,EAQA,aACA,oEACA,UAKA,iBACA,eACA,gBAKA,kBACA,eACA,iBACA,uBC3BA,aAkOA,aACA,UACA,MAnOA,OAUA,eACA,uBA0CA,gBACA,wCACA,iBAEA,GACA,wBAGA,gBACA,mCACA,MACA,KACA,GAEA,EAEA,CASA,YACA,iCACA,IASA,WACA,gDACA,IASA,WACA,+BACA,EASA,eACA,gCACA,EASA,cACA,OAGA,WACA,yCAGA,kCACA,uCAEA,qBACA,OAGA,GACA,CAEA,GACA,EAKA,aACA,kBACA,MAKA,YACA,kBACA,KAKA,YACA,kBACA,KAKA,gBACA,kBACA,SAQA,UACA,CACA,KAEA,OAWA,qBAEA,cACA,0BAEA,cACA,eAIA,oBAEA,IACA,2BAGA,QACA,SAIA,aACA,CAAG,WAEH,SACA,KACA,MAMa,gCChDb,aACA,qBACA,2CAjOA,QAmBA,GACA,mBAMA,eACA,OAGA,YAIA,mCACA,iBACA,wFAEA,GAGA,2BACA,iBACA,0BAEA,QAOA,eAUA,WAQA,gCACA,IAQA,OACA,SAMA,oBAGA,uHACA,kBACA,MACA,QACA,EAOA,UACA,IAEA,kBACA,eAGA,8BACA,EAUA,SACA,aAGA,iBAEA,gCACA,qBACA,UACA,MAGA,IACA,CAOA,aACA,qBACA,CAgCA,eACA,kBAMA,iBAGA,mFAQA,SAEA,aACA,kBACA,oBAKA,wBACA,aACA,oBAEA,EAGA,2BACA,aACA,sBAEA,EACA,EAEA,EACA,QAEA,aAMa,mCC3Gb,eAIA,aAKA,8CAGA,aAAkB,MAAwB,WAC1C,WACA,OAEA,sBACA,iBACA,eACA,GAEA,IAEA,OACA,EAEA,CACA,eACA,aACA,kBAGA,qBAAmB,MAAmB,WAEtC,IAEA,YACA,UACA,gBACA,6BACA,iBAGA,cAEA,UACA,WACA,aACA,kBACA,wBACA,iBACA,iBAQA,aACA,oBAGA,gBAEA,EAIA,OACA,WAzLA,QAgBA,EACA,mBACA,eACA,OAWA,QAQA,kCAGA,cACA,cAQA,YACA,SACA,kDACA,uDAGA,6BAAqB,SACrB,mBACA,cAKA,aACA,MACA,eACA,cAKA,gBACA,OACA,qBASA,yBACA,qBAGA,SAGA,oBACA,aAMA,OACA,0BAIA,WACA,UAEA,EAGA,GACA,gCAEA,EACA,MAGA,gCCrGA,aACA,QACA,eAEA,WACA,eACA,SACA,mBACA,GACA,CAEA,6CAZA,KAaA,sBACA,0BACA,oBACA,oBACA,gBAEA,wCCjBA,aACA,uBACA,EAEA,qDALA,KAMA,sBACA,0BACA,oBACA,oBACA,gBAEA,gDCtBA,UAEA,mDCKA,SACA,aACA,oBACA,iBAEA,iBCPA,iBACA,eACA,YACA,MAEA,WACA,YACA,IAGA,SACA,QAEA,wDCVA,QACA,aACA,8BAEA,aACA,MAEA,kBACA,kBAEA,sBACA,QAEA,wCCdA,SACA,eACA,QACA,oBAEA,eACA,MAEA,WACA,aACA,QAGA,UACA,CAEA,mFCPA,SACA,eACA,iBACA,WACA,WACA,SACA,UACA,KACA,SAEA,OACA,SACA,MACA,0BAEA,yBACA,wBACA,0BAGA,cAEA,UACA,MAEA,GACA,8BACA,SACA,YAEA,kBACA,EACA,cACA,UACA,GACA,OACA,OACA,SACA,MACA,cACA,aAEA,WAEA,MACA,CACA,UAEA,UACA,EACA,CACA,OACA,EAEA,gCCtDA,qBACA,aAGA,8CACA,uBAGA,cADA,EAGA,0BAXA,yBCZA,iBACA,WACA,mBACA,yBACA,EACA,CAEA,kECPA,aAGA,cAYA,WACA,iBACA,aACA,OACA,MACA,SAEA,MACA,0BAEA,SACA,aACA,MACA,YAEA,GACA,sBACA,cAEA,cAGA,SACA,EAEA,wCC3CA,QAoBA,iBACA,KAEA,aACA,eACA,QACA,IACA,oBACA,KAEA,gBACA,wBACA,SACA,MACA,aACA,eACA,aAEA,MACA,WACK,SACL,SACK,GACL,aACK,GACL,iBACK,MAGL,cAEA,EACA,MAEA,IAEA,CACA,iBACA,EAzDA,WAkBA,EAyCA,iBCzDA,iBACA,WACA,mBACA,UACA,EACA,CAEA,wDCAA,QACA,eACA,YACA,MAEA,aACA,KACA,MACA,uBACA,qBAEA,MAEA,mCACA,KAEA,iBCtBA,iBACA,aACA,cACA,EAEA,wCCJA,QACA,WACA,oBACA,IAEA,wCCLA,SACA,WACA,2BACA,0CACA,IACA,CAEA,wCCJA,QACA,iBACA,KAEA,iBACA,MAEA,cACA,SAEA,KACA,kBACA,KAEA,gBACA,EACA,OACA,EAEA,iBC9BA,aACA,aAQA,mBACA,WACA,iBACA,GAEA,gCC0BA,aACA,eACA,EAIA,sDAtCA,OACA,iBAEA,qBACA,iBAEA,qBAGA,6BAOA,cAGA,oBACA,gBACA,gBACA,gBACA,gBAQA,2CAQA,oBACA,0BACA,oBACA,oBACA,kBACA,cACA,QA3CA,oBA4CA,gCAEA,aACA,SACA,gBACA,gBACA,gBACA,gBACA,gBAGA,UACA,EAGA,wBC/DA,iBACA,WACA,QACA,YAEA,oCACA,WACA,EACA,GACA,CAEA,yDCZA,SAwDA,eACA,cAuBA,OACA,IAEA,WACA,WACA,cACA,GACA,CAEA,cAEA,UAEA,iBAEA,UACA,CAEA,cACA,SACA,MACA,OAEA,4BACA,EAEA,cACA,SACA,MAKA,eACA,cACA,CAEA,aACA,WACA,gBACA,KAGA,yBACA,IAEA,cACA,qBACA,GAIA,YACA,KAEA,MACA,SACA,EAEA,aAaA,WACA,WAEA,QACA,YACA,OAEA,IACA,IACA,oBAEA,MAEA,sBACA,kBACA,KAEA,EACA,OACA,6BAEA,IACA,CACA,OAhHA,IACA,EACA,KACA,KAEA,KAVA,EACA,EACA,EACA,EACA,KAOA,8BAEA,WAhBA,6CAiBA,WACA,WACA,qBACA,0CACA,gCAGA,KAiGA,iBApCA,CACA,yBAEA,OACA,MACA,QAEA,IA8BA,gBA7BA,2BACA,OAEA,EA2BA,CAEA,gDC9JA,QACA,eACA,kBACA,QAGA,+BACA,sBACA,MAEA,gDCVA,QACA,eACA,kBACA,QAGA,+BACA,OACA,qBACA,MAEA,iBCrBA,iBACA,WACA,sBACA,SAEA,wCCnBA,aAMA,cAOA,mBAGA,aAmBA,yBACA,WAEA,8BACA,wCACA,IArCA,qBAuCA,wCC1CA,aAWA,cAmBA,aACA,WAIA,6BACA,aAnCA,qBAoCA,GAjCA,4BAmCA,gDCtCA,aAUA,cAmBA,aACA,WACA,OACA,sDACA,IA9BA,iBAgCA,wCClBA,SACA,aACA,0BACA,kBACA,GACA,CAEA,yDCJA,QACA,aACA,WACA,QAEA,wBACA,SACA,SAEA,wBACA,0BACA,EACA,EAEA,gDCtCA,KAqBA,IACA,WACA,iBACA,YAEA,WAEA,gCC2CA,eACA,uBACA,EAOA,CAsCA,YACA,OACA,UAxFA,WACA,6BACA,EAcA,MACA,aACA,UACA,qBACA,wCACA,aACA,uBAEA,QACA,aAGA,OACA,CASA,EAtEA,IAiFA,WACA,6BAEA,SACA,4BAIA,EADA,EAWA,EA5FA,IA6FA,WACA,yCACA,mBAEA,gDACA,CACA,aAEA,qCAEA,sBAEA,GACA,CAIa,EA5Gb,eACA,qBAOA,WAOA,YAOA,IAPA,0ECxBA,QAYA,KAEA,QASA,OACA,mBAIA,OACA,cACA,WACA,SAGA,gCAAiC,4BAGjC,oCACA,2BACA,aAGA,2BACA,yBACA,sBACA,mBACA,4CAGA,iCACA,GACA,6DCnDA,QAYA,KAEA,QASA,SACA,mBAIA,OACA,cACA,WACA,SAGA,gCAAiC,4BAGjC,oCACA,2BACA,aAGA,uBACA,yBACA,kBACA,mBACA,6CAGA,iCACA,GACA,8CCnDA,IAqBA,IACA,eACA,MAEA,2BAAwB,qDAExB,cAGA,2BACA,iBAAmC,cACnC,iCACA,aAGA,gBAEA,4BAEA,mBAAwB,4BAExB,IAGA,aACA,aACA,MACA,CAIA,CACA,wDCrDA,QAmBA,KACA,mBAMA,iBACA,OAOA,qBASA,WAEA,gFACA,6DACA,aACA,EASA,gBACA,qBAEA,yDACA,OAuBA,YAAyB,KACzB,qBACA,aACA,gDAGA,gCACA,MACA,YACA,sBAEA,wCAEI,kBACJ,oDAGA,qBAEA,oBACA,GACA,qCAEA,4BAGA,aACA,CACA,EACA,oFCjHA,OAiCA,GACA,OAIA,cAOA,6BAQA,qCASA,6CAGA,0CACA,OAIA,iEAEA,8DACA,QAAG,EAAG,UAGN,6CACA,MACA,cAGA,4BACA,sCAEA,SACA,OACA,sCAGA,yEAEA,mDACA,EAAG,EAAG,UACN,OAWA,kBACA,gCACA,kCACA,EAOA,qBACA,6BAEA,0BACA,EAOA,sBACA,4BAEA,0BACA,EAKA,gBACA,6BACA,qCACA,QAUA,kBACA,qCACA,EAQA,iBACA,qCACA,EAQA,gBACA,qEACA,KAQA,eACA,mEACA,KASA,mBACA,SACA,cACA,SAGA,6CAEA,KACA,aASA,kBACA,SACA,eACA,SAGA,6CAEA,KACA,YA+BA,+BACA,wCACA,EAoBA,sBACA,SAEA,8CACA,6BAEA,YACA,CAKA,SACA,cAIA,SAEA,YAAkB,IAAgB,EAClC,sCAGA,UACA,EASA,qBACA,iCACA,mCACA,EAwBA,kBACA,iDACA,gDAEA,eACA,EAAG,iCACH,SACG,WACH,sBACG,eACH,mBAEA,SAEA,iBACA,qCAGA,SAEA,EA2BA,qBAEA,IAEA,KAEA,IACA,IAGA,UACA,yBAMA,UACA,gBACA,yBACA,MACA,EAIA,cACA,6CAMA,gCAEA,GAcA,+BAGA,WACA,eAEA,yBACA,6BACG,2BACH,eAIA,GACA,CAoFA,QAEA,8CC3UA,qBACA,OACA,YAGA,uBACA,GAGA,eACA,wCAEA,KACA,uCACA,GAyBA,iCA7MA,UACA,kBACA,WAEA,gBAIA,yBAIA,8BAEA,6CACA,8BACA,gCACA,WACA,EACA,CAyBA,MACA,UACA,kBACA,WAEA,eAIA,yBAIA,wBACA,6CACA,yBAEA,mBACA,qDACA,IACA,CAsDA,MACA,WACA,kBACA,qBACA,OACA,oCAEA,MAIA,mCAEA,sCACA,GACA,CAeA,MACA,WACA,kBACA,qBACA,OACA,gBAEA,MAIA,gCAEA,uCACA,GACA,CAEA,EA/LA,IAwOA,UACA,kBACA,8BAEA,cAEA,0BACA,gCAIA,uBACA,iBACA,CAKA,EAjOA,IAkOA,UACA,kCACA,yFC7PA,OA2GA,IACA,OAOA,eAA+C,KAO/C,qBAOA,8BAAgC,YAAmB,MACnD,EAkBA,mBAGA,wBAIA,kDAIA,2DAKA,qDACA,sCACG,OACH,8CACG,OACH,kDACG,gDACH,wEACG,UACH,4CAEA,SAeA,oBAEA,sCAGA,kBACA,WACA,2DACA,UACA,MACA,QAGA,gCAKA,kBACA,kCACA,sBACA,wCAEA,qBAAuC,iBAAM,KAE7C,EAEA,0CACA,WAGA,gCACA,gEAIA,mCACA,2CAEA,EACA,CAYA,iBAEA,wBACA,uBAEA,QACA,6DAEA,6BACA,EACA,2BACA,yBAEA,EAYA,mBACA,0CAEA,kCAAqC,CAAgB,aACrD,4BACA,gBACA,OAGA,GACA,EACA,CAgBA,4BAEA,gDAGA,kBACA,WACA,2DACA,0BAQyB,IAAU,KAAM,GAPzC,MACA,QACA,eACA,oBACA,oBAGA,GACA,EACA,CAYA,mBAEA,WACA,iBAGA,4BACA,aACA,0CAIA,eACA,sBAEA,uDACA,uCACA,GAWA,oBACA,uEACA,yDAEA,yBAA2B,CAAY,oBAEvC,8BACA,SACA,WACA,SAGA,oCACA,oDAEA,cAEA,mCACA,SACA,WACA,MACA,uBAIA,qCACA,qDAEA,cACA,CAcA,qBAEA,qBAIA,sEACA,qBAAgB,QAEhB,gBACA,eAUA,2BACA,YAEA,oBACA,WAEA,aAEA,yBACA,2CAEA,EAEA,OACA,EAWA,+BACA,YAEA,oBACA,mBAGA,SACA,EAUA,gCACA,YAEA,aAEA,yBACA,gCAGA,qBACA,iDAGA,SACA,EAUA,6BACA,YAEA,oBAEA,GACA,CAeA,oBACA,kBAKA,yBAEA,mCACA,eA8JA,QAEA,+DChqBA,SAoBA,IA+EA,IA9EA,KAIA,cAOA,oBAQA,sCAA0C,aAQ1C,0BACA,IASA,UAEA,wCAGA,0CACA,EAQA,UAEA,qBAGA,uCACA,EAUA,UACA,2CACA,iBACA,kCAEA,gBACA,4BAGA,UACA,EACA,iCCuDA,mBACA,aACA,wBAEA,sBAEA,GAEA,qBACA,wBACA,SAEA,uCAEA,MACA,eAEA,QAEA,mCAEA,iBAIA,uEAIA,gDAGA,wBAGA,yBACA,oBAEA,GAGA,CACA,qBACA,aAuCA,CACA,oCAGA,mBACA,6BAEA,wBACA,oBACA,EACA,YA9CA,WAIA,MAEA,EAEA,EAEA,cACA,yBAIA,SAEA,OACA,GAGA,MAGA,OACA,eAKA,6BACA,GAGA,qDA1OA,OAsBA,GACA,mBAIA,WACA,OACA,WAQA,UACA,kDACA,IAQA,YACA,uDACA,IAQA,YAEA,SACA,mBAGA,aACA,OAEA,uBACA,uCACA,oBAGA,oCACA,kBAIA,eACA,yBAEA,QAGA,QACA,IAEA,yBACA,OACA,EAKA,uBACA,OACA,mCAKA,uBACA,OACA,GACA,MASA,EACA,mBAIA,uBACA,OACA,uCAaA,EACA,uCACA,mBAEA,GACA,IAWA,GACA,wCACA,sBAEA,GACA,IAAC,GAgGD,gBACA,8CC7MA,iBACA,gBACA,6BACA,EASA,iDAxDA,OAoBA,GACA,mBAIA,WACA,OACA,QAKA,yBACA,OACA,EAKA,uBACA,OACA,gCACA,QAeA,+BACA,kBAMA,oBAGA,iHACA,wBAEA,GACA,OACA,qDAGA,UACA,IAAC,GAED,+EC9EA,QAmBA,IACA,mBAIA,uBACA,OACA,oCACA,MAqBA,EACA,mCACA,YACA,iBAEA,cAEA,eACA,6CAGA,mDACA,+BACA,gCAEA,GACA,IAAC,GAED,8CCqEA,YAGA,YAEA,iDACA,mBACA,SACA,kBACA,OACA,4BAEA,eACA,EAAG,UAEH,QAWA,CACA,iBAGA,4BACA,OAEA,SACA,OACA,eACA,4EACA,GAEA,UACA,WACA,aACA,kDAEA,wBACA,8BACA,sDAGA,uCACA,0BACI,WACJ,OACA,yEACA,EAIA,sBACA,gCAEA,kBACA,iBAEA,wBACA,EACA,+BAzMA,OA6BA,GACA,mBAUA,mBACA,YAEA,iBAMA,6BAuBA,uHAEA,sBACA,KAOA,SACA,MACA,eAyCA,MASA,EAqEA,WAOA,mCC8yBA,iBACA,gBAEA,SACA,4BAGA,gDACA,kGAxgCA,SAiCA,KA89BqB,IA79BrB,KAOA,aAA0B,KAkB1B,iCAOA,SAOA,yBAQA,kFAQA,mCAQA,uCACA,QASA,uBACA,0DACA,GASA,uBACA,uCACA,EAUA,kBACA,8BACA,gCACA,EAQA,oBACA,oCAEA,QACA,+BACA,iCAEA,kBACA,iCAEA,EACA,CAUA,2BACA,8BACA,gCACA,EAcA,eAA+C,KAC/C,iBACA,uCAEA,2BACA,EACA,6BACA,mCAGA,MAEA,WAEA,wBAEA,2BACA,mCAEI,OAEJ,qBAEA,QACA,0BAIA,kBACA,mDAEA,GAEA,+BACA,qDACA,iBAIA,SAEA,EAWA,wBAA2D,KAC3D,4BACA,oBAEA,iBACA,kBACA,2BAGA,6BAEA,GAGA,QACA,2BAEA,GASA,kBACA,kCACA,kCAEA,UACA,oCACA,4BAEA,QACA,CAaA,qBACA,WAEA,uBACA,sCAEA,OAEA,QAGA,cAEA,uBACA,QAGA,KAAW,iBACX,EAEA,SAEA,kBACA,iCAEA,SAEA,QAGA,qBACA,EAAI,KACJ,iCAEA,aAEA,QAGA,UACA,eACA,WAIA,6BACA,SAAY,iBAGZ,6BAEA,QAAW,iBAEX,EAgBA,aAAiC,KACjC,oBACA,mBAGA,wBACA,aACA,SAEA,2CAEA,6BAEA,EACA,8BACA,oCAGA,MAEA,8BAEA,QAEA,OACA,mCAEI,OAEJ,gDACA,wBAEA,KACA,0BAIA,aAEA,8BAAmC,EAAQ,KAC3C,kCAEA,MAEA,+BACA,mDACA,oBAIA,SAEA,EAUA,sBAA6C,KAC7C,WAAkB,iBAAkC,WACpD,sBACA,sBAEA,GACA,gBAEA,GACA,CASA,sBAGA,qBACA,uBAGA,2BACA,SAGA,6CAEA,MACA,QAEA,EAEA,YACA,mCAEA,aAAkB,MAA6B,eAE/C,sBACA,yBAEA,GACA,gBAEA,EAEA,OACA,EASA,kBACA,mDACA,uDAEA,qBACA,YAGA,GACA,IAcA,uBACA,oBACA,iEAGA,sBACA,aACA,uDAGA,0CACA,SAEA,QACA,aAIA,QACA,YAGA,aACA,IANA,IASA,UACA,mCAEA,MACA,mBAEA,EAAI,KACJ,kDAGA,YACA,uCAEA,EAEA,OAEA,KAcA,wBACA,mBACA,2CACG,kCACH,6CACG,eACH,iCAGA,GACA,IASA,+BACA,mCACA,EAUA,wCACA,mCACA,EAoBA,4BACA,aACA,SAGA,gBAGA,qBACA,oBAEA,SAGA,+CAEA,QACA,WAGA,+BACA,OAEA,YAEA,IACA,CAEA,KACA,4CAEA,iBACA,oBAGA,sBACA,KAEA,EAEA,IACA,CAEA,OACA,KAYA,uBACA,gBACA,4CACG,sBACH,8CACG,eACH,kCAGA,GACA,IASA,8BACA,mCACA,EAUA,uCACA,mCACA,EAiBA,2BACA,WAGA,mDACA,+BAIA,qDACA,sDAGA,GACA,IAOA,SACA,yCAEA,sCACA,KAEA,OAQA,UACA,4BACA,SAQA,aACA,4BACA,YAQA,sBACA,4BACA,sBAQA,0BACA,MACA,YAKA,oBAEA,iCACA,qCAEA,uBAEA,mBAEA,SACA,CAeA,4BACA,SAIA,+DACA,aAGA,yCACA,sCAIA,2BAEA,2BAMA,cACA,uDAUA,2BAGA,oBAiBA,IAEA,MAEA,0BAKA,2BACA,gBAIA,eATA,IAEI,MAQJ,iCAGA,sBACA,QAEA,UACA,CAWA,8BACA,OACA,aAGA,sBACA,qDACA,yBAGA,yBACA,iBAGA,0BACI,mBAEJ,iBAIA,WACA,KAeA,2BACA,gBAEA,eACA,mBAMA,eAAuC,mBAEvC,0CACA,qCAIA,gEACA,wBAIA,KACA,qBAQA,4BAIA,0DACA,6BAMA,SACA,qDAKA,QACA,CAWA,6BACA,OACA,iBAGA,2BACA,mBACA,8DAEA,yBAEA,YAEA,iBACA,oBAKA,6DAEA,SAEA,EAEA,OACA,KACA,iCCl7BA,YACA,OACA,sBAvEA,OAeA,IACA,mBAUA,mBACA,WAQA,wBACA,CAKA,aACA,OACA,+CAIA,+BAFA,EASA,oBACA,0BAMA,sCAEA,iFACA,MAIa,iBCxDb,aAmNA,eAEA,IACA,8BAGA,QAEA,eACA,yBAEA,SACA,MAKA,OACA,sCAEA,MACA,WAKA,OACA,0BAEA,MAMA,YACA,0BAEA,MAKA,UACA,CAMqB,CACrB,eAEA,oBACA,eAGA,OACA,CAOwB,CACxB,eACA,MAEA,qBACA,WAEA,wBACA,wBAEA,kBACA,mBACA,UAEA,cAEI,mBACJ,SAEA,cAEA,KACA,YAEA,KAEA,OACA,EAMwB,CACxB,eACA,MAEA,kBACA,0BACA,WAEA,4BACA,UACA,WAIA,MACA,mBAEA,KAAG,oBACH,UAEA,cAIA,YACA,EAOwB,CACxB,eACA,MAEA,qBACA,WAEA,oBACA,oBAEA,kBACA,mBACA,UAEA,cAEI,mBACJ,SAEA,cAEA,KACA,YAEA,KAEA,OACA,GA9JyB,IAjNzB,KAOA,kBACA,MAEA,yBACA,EAiFA,UACA,aAEA,oCACA,aAAY,MAIZ,0DACA,sBAGA,4BAEA,EA+BA,YACA,aACA,+BACA,aAEA,MACA,QACA,SACA,UACA,QAGA,EAGA,OACA,KAYA,eACA,MAEA,kBACA,+BACA,aAEA,GACA,UACA,SACA,UACA,QAGA,GAGA,qBACA,IAQA,iBACA,IACA,gCAGA,6BACA,OAEA,6DACA,IAEA,iDCvNA,QA8BA,IACA,mBACA,eACA,OAQA,gBACA,CACA,aACA,iBACA,yBAQA,gCAOA,6BAQA,cAQA,0FACA,MAMA,QACA,0CACA,cAKA,WACA,wBAEA,QACA,iDAEA,QAKA,SACA,OAEA,2BACA,mDAEA,QAKA,UACA,OAEA,iCACA,YAKA,UACA,OAEA,iCACA,YAQA,gBAEA,IACA,aAGA,oBAGA,kBACA,UAIA,iBACA,2BACA,yCAEA,oCACA,UAEA,EAIA,aACA,+BACA,sCAEA,oBAGA,gBACA,MACA,iBACA,wBACA,aAMA,mBACA,sDAEA,YAOA,MAEA,qBACA,2CACA,aAGA,kBACA,sCACA,OACA,oCAEA,uCACA,UACA,MACA,kCACA,0BACA,QAEA,GAIA,mCAEA,qBAEA,wBAMA,4CACA,kDAGA,gBACA,SACA,gBACA,cAEA,GAEA,kCAIA,iBACA,QAWA,sBACA,OAGA,6DACA,uEACA,CAIA,qCACA,KACA,MAiDA,mBClTA,qBASA,IAEA,eASA,YACA,mBAOA,eACA,OAQA,iBACA,MAKA,aACA,OACA,8CAIA,8BAFA,EAIA,eACA,+BACA,EAEA,gBACA,0BACA,EACA,sCCYA,YACA,OACA,sBAxEA,OAgBA,IACA,mBAUA,mBACA,WAQA,wBACA,CAKA,aACA,OACA,4CAIA,4BAFA,EASA,oBACA,0BAMA,sCAEA,2EACA,MAIa,+DCrEb,QAaA,KAEA,QAOA,YACA,mBAIA,eACA,OAKA,6BACA,SACA,CAAK,kDACL,wBAAK,kEACL,uBAAK,kEACL,uBAAK,kEAGL,yBAKA,sBACA,QACA,IAKA,OACA,cACA,WACA,SACA,uBAEA,+BAEA,oBAEA,kDAGA,yCACA,2BACA,0BAGA,8BACA,2BACA,yBAGA,sDAGA,IAKA,YAGA,cACA,wBACA,wBAEA,mBACA,yCACA,iDACA,WACA,2BAEA,4BACA,6BAEA,EAEA,EACA,sCCpCA,YACA,yBAA6C,OAAiB,iBAC9D,wDA/CA,KACA,mBAIA,OACA,cACA,WACA,aACA,WACA,SACA,YAGA,iBACA,6BACA,yBAAiB,8CACjB,wBAGA,0BACA,yBACA,uBAGA,sBACA,yBACA,sCAEA,yDACA,8CAGA,6CACA,OACA,MASY,yDClEZ,SAYwB,IAExB,YACA,sBAMA,WACA,OACA,cACA,gCACA,OAEA,IAOA,YACA,OACA,oBACA,gCACA,OAEA,IASA,GACA,mBAIA,eACA,SAEA,oBACA,oBAGA,mEACA,KACA,QAEA,QAGA,6BACA,qBAEA,iCACA,SAEA,QAAG,EAAG,UASN,2CACA,MACA,SAAG,EACH,IAKA,OAEA,6CAEA,eACA,MAKA,SACA,MACA,gEACA,wEACA,iBAKA,SACA,MACA,kEACA,6EACA,iBAOA,UACA,6BAEA,mBACA,kDACA,sCAEA,QACA,qECjIA,QAuBA,KACA,mBAIA,wBACA,OACA,oBAKA,eACA,OAEA,gBAQA,gCACA,YAKA,YACA,cACA,qDAGA,6BAIA,oCACA,GACA,UAGA,kCACA,YACA,CAOA,wDAGA,mCAGA,6CAGA,wDACA,MACA,gBAEA,MAAG,EAAG,UAGN,sEACA,aACA,gBAEA,MAEA,eACA,GAKA,OACA,4CAEA,iCACA,gBAEA,QAKA,OACA,aACA,QACA,sCCtFA,iBAGA,qCAEA,aAEA,yCACA,KACA,0BAGA,wDACA,iBA5CA,GAmBA,IACA,aACA,8BACA,MAQmD,mBC9BnD,qBAiBA,KACA,mBACA,sCCsGA,aACA,OAEA,iBACA,+BACA,4BACA,mBAKA,SACA,oCArIA,QAmCA,KACA,mBAIA,sBACA,QACA,IAKA,OACA,cAMA,oBACA,iCACA,kBACA,MACA,kBACA,QAEA,mDAGA,wCACA,SAEA,wEAAoF,UAIpF,mDACA,IACA,+BACA,gBACA,yCAIA,EAAG,EAAG,UAEN,iDACA,2CAEA,qCACA,uCACA,uCAEA,mCAA6D,UAC7D,4CACA,mCAA0D,UAC1D,4CAIA,sDACA,sDAEA,wCACA,mCAA0D,UAC1D,2CACA,mCAAuD,UAEvD,2DACA,wDAEA,uCAAiD,UACjD,2CAAiD,UACjD,2CAAqD,UACrD,uCAGA,6CACA,qDAGA,mDACA,mDACA,YACA,yBCvHA,qBA4BA,KACA,OAOA,oBAOA,eASA,YAQA,aAQA,OAEA,4CACA,eACA,EAEA,oCACA,MACA,QAEA,qBAEA,oDAEA,iEAsBA,yBAQA,YACA,aACA,mCAGA,cACA,MAQA,SACA,YAEA,kBACA,YAEA,UAKA,OACA,MACA,WAKA,SACA,MACA,WAKA,UACA,iCACA,iEACA,8EACA,yBAaA,YAEA,yCACA,qCAEA,UAQA,UACA,kBACA,iBACA,eAEA,EACA,uBC3LA,aAsBA,IACA,SAA8C,kCAA+C,kBAC7F,kCAAgD,CAAS,YACzD,kBACA,IAEA,GACA,mBC7BA,aAgBA,IACA,SAAwC,CAAO,QAC/C,sCACA,GACA,wBACA,SAAE,EAAG,CACL,uDCtBA,OAgBA,GACA,mBAIA,eACA,OAQA,YAQA,kBAEA,mBAEA,mCACA,KACA,mBACA,MACA,OAIA,2CAKA,+DACA,GAKA,SACA,cACA,QAKA,QACA,cACA,OACA,4DCvEA,QAmBA,KACA,mBAOA,iBACA,OAEA,WAAyB,sBAQzB,YAQA,kBAOA,8CAOA,0CAEA,yBACA,KAEA,eACA,MACA,eAGA,YASA,oBACA,sBAEA,qBACA,yBAEA,SACA,CAUA,sBACA,oBAEA,oBACA,qBAEA,MACA,CAKA,SACA,gBACA,QAKA,QACA,gBACA,OACA,4DCtHA,SAcA,KAEA,iBAMA,MACA,mBAIA,eACA,OAEA,gBASA,4BASA,mBAeA,uBASA,eAeA,kCAEA,yCACA,KACA,iBACA,OACA,CACA,wCAAiE,2BACjE,qBAGA,mCACA,gBACA,oBACA,4BAIA,cAGA,iBAEA,SAOA,OACA,MACA,YAOA,OACA,MACA,YAaA,YACA,MAEA,iBACA,0BAA2C,UAC3C,cACA,kBACA,GACA,KACA,KACA,KAEA,qBACA,KACG,kBAEH,GAAS,cAA4B,iBAErC,sBAAwB,cACxB,YACA,MAiBA,EACA,wBAkBA,GACA,sBAmDA,GACA,mBACA,UACA,gBACA,4CACA,2BAGA,kBACA,gBACA,oDACA,2BAGA,kBACA,sBACA,4CACA,2BAGA,kBACA,sBACA,oDACA,2BAEA,6EClRA,QAoBA,KACA,mBAIA,eACA,OAQA,mBAQA,wCAQA,wBASA,+BACA,iBACA,wBACA,mCACA,mBAEA,CAGA,sCAIA,8DACA,KACA,iBACA,CAKA,oCAGA,mCACA,yBACA,QAEA,iCACA,4BACA,QACA,EAKA,OAEA,sCAEA,eACA,MAKA,QACA,mBACA,YAUA,oBACA,OACA,0BAIA,iCAEA,yBACA,EACA,YALA,SAMA,uBChIA,aAgBA,IACA,WACA,OAEA,cACA,GAGA,UACA,mBCzBA,aAsBA,IACA,eAEA,cAkCA,qCAEA,qBAEA,kBAGA,MACA,uBAIA,MACA,OAIA,uBAGA,oBACA,OAGA,0BACA,KACA,IAEA,cAGA,eACA,EAEA,mBAnEA,YACA,CAGA,QAGA,uBACA,OAEA,IACA,IAGA,IACA,WACA,QACA,QACA,WAGA,mBACA,WACA,WAGA,EAEA,KAEA,WAsCA,EAGA,IAEA,QAAe,IAAW,EAC1B,WAIA,WAAsB,IAAW,EACjC,WAKA,UAEA,GACA,GAAE,cAIF,qBACA,mBCtHA,aAmBA,IACA,WACA,MAGA,+BACA,yBACA,OAGA,iBACA,mBC9BA,aAeA,IACA,WASA,cACA,iDCtBA,mBAEA,2DCFA,mBAEA,mDCHA,UAEA,gCCIA,iBACA,eACA,SACA,kBACA,SACA,oBACA,0BACA,+BAEA,cACA,EAEA,iBCVA,iBACA,iBACA,QACA,MAEA,cACA,QAEA,UACA,gBAEA,SACA,EAEA,gCCoDA,gCACA,IACA,OACA,8BAEA,KACA,kBAEA,iBACA,UAEA,oBACA,QACA,GAKA,iBACA,kBAEA,cACA,uBAEA,6BACA,aACA,cAEA,qBAA0C,MAC1C,KACA,kCAEA,IAAK,KACL,QACA,cAEA,0BACA,GACA,CAEA,qBA1BA,KACA,sBAEG,eAwBH,oBACA,OACA,SAEA,iBAEA,KACA,mCAGA,0CACA,CACA,QACA,SAEA,wCACA,IACA,GACA,EAEA,qJAvHA,MACA,uBAKA,sBACA,+BAGA,wBAoBA,SA5BA,kBA6BA,GAdA,2BACA,qBAcA,GA7BA,uBACA,iBA6BA,GAdA,4BACA,yBAcA,GAbA,yBACA,uBAaA,GAZA,0BAfA,gBA4BA,GA3BA,yBA4BA,GA1BA,sBACA,gBA0BA,GAzBA,sBACA,mBAyBA,GAfA,0BACA,8BAeA,GAdA,2BAGA,2BAYA,GApCA,wBAoDA,GAzCA,4CC1BA,iBACA,eACA,aACA,cAEA,YACA,eACA,SAGA,UACA,CAEA,wCCnBA,cAGA,cASA,mBACA,aAIA,iBACA,gCACA,kBAEA,iFChBA,YAGA,cAUA,WACA,aACA,sBACA,MAEA,IACA,YACA,eACA,OACA,cACA,cAEA,0BACA,gBACA,gBAEA,GACA,oCAEA,IAEA,wBAEA,GAEA,OACA,EAEA,wCCvCA,QACA,aACA,YACA,MACA,SACA,EAEA,YACA,SACA,YAEA,wBACA,OACA,iBACA,CACA,CACA,OACA,EAEA,iBCrBA,iBACA,aACA,YACA,UAEA,OACA,UAEA,SACA,EAEA,iBCXA,iBACA,eACA,YACA,MACA,WACA,OAEA,WACA,WACA,mBAEA,SACA,EAEA,iBCfA,iBACA,aACA,QACA,MAEA,uBACA,QACA,UAEA,SACA,EAEA,gDCfA,SAiBA,qBACA,OACA,EAHA,MAIA,WAEA,uBACA,GAGA,qBACA,MACA,YAEA,SACA,EACA,SA/BA,KAiCA,wBAGA,UACA,SACA,OAEA,MACA,QACA,cACA,eAEA,iBACA,IACA,EAEA,SACA,KACA,KAEA,IACA,+BACA,WACA,sBACA,iBAEA,EAAW,GACX,CACA,KACA,KACK,UACL,MACA,aACA,IACA,CACA,KACA,KACA,CACA,oBACA,GACA,CAEA,iBChFA,aAUA,aAGA,iBACA,GAGA,CAhBA,aAQA,sBASA,gBACA,CACA,QAGA,iFCVA,SACA,WACA,WACA,8BACA,wCACA,eAEA,QACA,IAEA,iBCfA,iBACA,eACA,aACA,iBAEA,eACA,UACA,OACA,QAGA,UACA,CAEA,wCCbA,QACA,WACA,yBACA,EAEA,iBCNA,iBACA,aACA,mBACA,OAGA,iBACA,4BACA,GACA,CAEA,iBCnBA,aACA,yBAQA,aACA,WACA,YACA,IACA,eACA,EAAK,UACL,IACA,UACA,EAAK,UACL,CACA,OACA,EAEA,wDCjBA,WAuBA,SACA,eACA,sBACA,YAEA,uBAEA,oBACA,SACA,IAEA,mBACA,IACA,cAEA,MACA,0BAEA,SACA,EAEA,iBCnCA,iBACA,WACA,YACA,eACA,IACA,EAEA,WACA,OACA,GACA,WAGA,SACA,EAEA,iECJA,QACA,UACA,qBACA,qBACA,eACA,KAEA,EACA,sBAEA,SACA,mDAEA,MAEA,gECjBA,2BACA,iBACA,2BAEA,WAEA,uFCCA,2BACA,gBACA,mBACA,KAEA,mBACA,4CAEA,MAEA,+ECdA,2BACA,gBACA,mBACA,KAEA,mBACA,0CAEA,KAEA,uDCCA,QACA,aACA,aACA,6BAEA,YAEA,gDCPA,QACA,aACA,aACA,6BAEA,SAEA,iDCdA,QACA,iBACA,kBACA,QAGA,wCACA,OACA,IAEA,kBACA,MAEA,iDCPA,QACA,aACA,aACA,6BACA,KACA,CAEA,iDCPA,QACA,aACA,aACA,6BACA,QACA,CAEA,4EC5CkB,yCCelB,QACA,WACA,kBACA,sBACA,KAEA,wCClBA,QAgBA,WACA,kBACA,oBACA,IAJA,KAMA,gDCFA,QACA,aACA,kBACA,QAGA,4BACA,cACA,MAEA,iBClBA,iBACA,WACA,YACA,eACA,EAEA,WACA,OACA,aAEA,SACA,EAEA,wCCDA,SACA,eACA,iCACA,uBACA,CAEA,iBCjBA,iBACA,WACA,OACA,EAEA,iDCQA,QACA,eACA,kBACA,QACA,eAGA,GACA,qBAEA,iBACA,KALA,CAOA,wCC1BA,SACA,WACA,mBACA,EAEA,kECEA,yBACA,kBACA,+BACA,YAEA,KAEA,yFCCA,yBACA,gBACA,gBAEA,yBACA,GAEA,WAEA,yBACA,uBAEA,MAEA,iFCjBA,yBACA,gBACA,gBAEA,yBACA,GAEA,WAEA,yBACA,qBAEA,KAEA,wEChCA,OAGA,wBAGA,uCAGA,+BAGA,aAGA,wBACA,wBACA,kFAoBA,SACA,WACA,cACA,GAEA,0CACA,yBACA,GAEA,iBCvDA,aACA,YAGA,cAgBA,SACA,aACA,sBACA,EAEA,iDCEA,QACA,eACA,kBACA,MACA,SAEA,QACA,KACA,wBACA,KACA,CACA,iBACA,gBACA,IAEA,OACA,oBAEA,WACA,eACA,QAGA,UACA,CAEA,iDC9BA,QACA,aACA,wCACA,UAEA,iDCFA,cAEA,yDCFA,SACA,eACA,0BACA,6BACA,IACA,CAEA,wCCTA,SACA,eACA,0BACA,2BACA,GACA,CAEA,2FCCA,2BACA,cAEA,oBACA,eAEA,2CACA,yBACA,CAAG,QAEH,MACA,CAEA,uDCdA,SACA,aACA,IACA,gBACA,cAEA,UACA,EACA,SAEA,wBACA,UACA,SACA,SACA,YACA,UAEA,GACA,mBACA,GACA,CAEA,iBCrDA,aACA,YAGA,cAwBA,YACA,WACA,oBACA,CAEA,wDCdA,QACA,eACA,kBACA,QAGA,wCACA,MACA,IAGA,yBACA,2BAEA,iBACA,MAEA,wCCfA,QACA,aACA,mBACA,EAEA,gDCEA,SACA,eACA,8BACA,GAEA,gDCfA,QACA,aACA,kBACA,OACA,kBACA,yBACA,SAEA,EACA,QACA,CAEA,wCCXA,QACA,aACA,mBACA,KAEA,gDCDA,SACA,eACA,8BACA,MAEA,gDCVA,QACA,aACA,kBACA,OACA,wBACA,mBACA,SAEA,EACA,QACA,CAEA,wCCdA,SACA,WACA,aACA,gBAEA,KAEA,gDCLA,SACA,aACA,aACA,2BAEA,MAEA,wCCVA,SACA,WACA,mBACA,EAEA,gDCOA,QACA,eACA,aAGA,mCACA,sBACA,MAEA,gDCTA,QACA,eACA,kBACA,QAGA,+BACA,OACA,qBACA,MAEA,gDCAA,QACA,aACA,aACA,6BAEA,YAEA,gDCPA,QACA,aACA,aACA,6BAEA,MAEA,yDCxCA,QAGA,IAGA,eAGA,uBAGA,eAGA,gBAwBA,aACA,WACA,IACA,yBAEA,eACA,SAEA,kBACA,uCACA,qBACA,CACA,IACA,mCAEA,gBACA,iBACA,oBACA,oBACA,gBACA,CAEA,gEC7CA,yBACA,8BACA,QAEA,uFCKA,yBACA,gBACA,mBACA,KAEA,iDACA,GAEA,+ECZA,yBACA,gBACA,mBACA,KAEA,+CACA,EAEA,+CChBA,QACA,WACA,aACA,gBAEA,KAEA,gDCDA,QACA,aACA,aACA,2BAEA,MAEA,wCCXA,QACA,aACA,aACA,yBAEA,KAEA,wDCLA,2BACA,iBACA,cAEA,KAEA,wECLA,yBACA,4BACA,KAEA,wFCGA,yBACA,gBACA,mBACA,KAEA,4CACA,GAEA,gFCZA,yBACA,gBACA,mBACA,KAEA,0CACA,EAEA,sDCfA,eAEA,yDCHA,SACA,aACA,6BACA,IAEA,iDCNA,SACA,aACA,6BACA,IAEA,+CCAA,2BACA,SACA,iBAEA,iDACA,qBACA,EAEA,wBC9BA,aAiBA,IACA,WACA,YAEA,iBACA,aAGA,UACA,gCCTA,aACA,oGACA,EAUA,CACA,aACA,gDACA,EAUA,CACA,aACA,gDACA,EAQA,CArDA,IAsDA,aACA,qCACA,GAQA,EAhDA,IAiDA,aACA,mBACA,kBCnEA,qBACA,uBACA,qBAEA,kBACA,8CACA,CACA,4BACA,UACA,CAEA,iCACA,CACA,4BACA,UACA,CAEA,sCACA,CAEA,kCACA,CACA,OACA,kCCaA,4CAEA,oCAEA,iBAOA;;;;;EAVA,iBAYA,2BACA,mCACA,qEAnDA,SAMA,KAEA,GACA,8CACA,SACA,CACA,IAEA,KAYE,0HACF,eACA,CACA,cACA,iBACA,MACA,EAAC,SACD,CACA,sFClCA,SAkDA,KACA,mBAIA,sBACA,oBACA,IAKA,wBACA,OACA,uBAKA,OACA,MACA,2BACA,8BACA,uBAWA,sBACA,kCACA,qDACA,eAQA,yBACA,qBAAmD,oBACnD,MAAU,SAAe,SACzB,SAEA,2BAAkC,WAAe,GAAI,CACrD,SACA,EAaA,wBACA,8CACA,gDAIA,6DACA,0DACA,SACA,8CC5HA,OAsBA,IA0FA,IAzFA,KA+BA,mBACA,IAEA,MACA,uBACG,MAEH,QAGA,MAAW,CAAQ,SAGnB,YAJA,EAI8B,CAC9B,SACA,CAEA,iCACA,IACA,YAKA,yCAEA,uBACA,MAGA,iBACA,aAGA,sCACA,EAGA,sBAEA,GAIA,iCAEA,oBAGA,mEAGA,iBAEA,KAAe,SACf,SACA,EACA,EACA,iCCiGA,aACA,2DACA,YAnNA,SAsBA,IA0La,IAzLb,KA8CA,mBACA,aAEA,KACA,GACA,EACA,EAEA,cACA,UAEA,IAGA,EACA,qBAEA,IAIA,aACA,IACA,GACA,KAEA,UAEA,2BAIA,iBACA,CACA,QACA,IACA,IACK,KAGL,sBACA,GAGA,eACA,CACA,MAEA,UACA,cACA,6BAGA,eACA,UAEA,mCAGA,eACA,CACA,SAEA,SAGA,gBACA,aACA,oBAEA,KAEA,iCACA,IACA,aAGA,oCAEA,gDACA,OAGA,uBACA,8BACA,YACA,GAGA,2BACA,2BAIA,eACA,gCACA,OAEA,IAEA,QAGA,iDACA,2BAIA,eACA,gCACA,OAEA,IAEA,iBACA,QAGA,0BAEA,sCACA,iCAGA,YAGA,eACA,YAEA,EACA,EACA,EACA,yDC1MA,mBAoBA,GACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,mBAKA,OACA,cACA,WACA,mBACA,UAGA,+CACA,iBAEA,gBACA,SACA,eACA,EACA,YAGA,qDAGA,qDAEA,SACA,CAGA,sBACA,OACA,8DCnEA,mBAoBA,GACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,qBAKA,OACA,cACA,WACA,mBACA,YAGA,iDACA,iBAEA,gBACA,SACA,iBACA,EACA,YAGA,qDAGA,qDAEA,WACA,CAGA,sBACA,SACA,iFCnEA,kBAyBA,GACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,wBAKA,OACA,cACA,WACA,mBAEA,0DACA,iBAEA,gBACA,SACA,sBACA,EAIA,qDAGA,qDAEA,eACA,CACA,EAKA,YACA,cACA,wBAOA,oEACA,qBACA,yCAEA,6CACA,4BAEA,gBACA,mBAEA,OACA,EACA,sCCiGA,aACA,4CACA,IASa,CACb,aACA,IACA,KACA,OAEA,uBACA,WACA,SAEA,GACA,uBAGA,sBACA,qCACA,OAGA,MACA,GAEA,OACA,iCA/NA,OAmBA,IACA,mBAIA,eACA,OAUA,YAGA,uDACA,MACA,oBACA,cACA,EAKA,eACA,iDAGA,wCACA,GAYA,YAAyB,KACzB,qBACA,sBACA,iCAEA,0CACA,MACA,mCAEA,uBAEA,EACA,EAKA,gBACA,SACA,MAGA,sCACA,iCAEA,oBAEA,yBACA,EAGA,yBACA,MACA,qCAEA,eACA,QACA,6BACA,2BAIA,yBACA,CAYA,kBAEA,6BACA,6BACA,QAMA,6BAJA,6BAKA,kCAEA,QAGA,qBADA,EAKA,OACA,mBAKA,mCAEA,iBACA,EACA,EAQA,iBACA,MAGA,kCACA,WAEA,OACA,cAEA,uBAGA,WACA,EAMA,6BACA,uBACA,2BAEA,IAGA,GACA,CACA,EACA,8DC3LA,QAsBA,IACA,mBAIA,OACA,cACA,oBAEA,2CAEA,mBACA,sBAAiB,0BACjB,kBAAiB,sBAEjB,qCACA,yBACA,wBAEA,0DACA,yBACA,wBACA,aAKA,YACA,8BAIA,iBACA,qBACA,MACA,kBACA,aAGA,8BACA,uEC9DA,SA2FA,KACA,mBAIA,wBACA,OACA,qBAKA,OACA,cACA,WACA,qBAQA,gCAEA,mBAIA,oCACA,WACA,mBAEA,aACA,kCACI,wBACJ,qCAGA,iDAEA,KAEA,yCAAwC,gBACxC,WAAG,EAAG,UAEN,gDACA,uBACA,qBAKA,2BAEA,yCACA,qBACA,UACA,EACA,CAAG,EAAG,UAIN,uBACA,WACA,yDAEA,cAEA,0CAAyC,mCACzC,MAEA,2BAAkD,UAClD,gCAAiD,UAEjD,iDACA,WACA,6EAGA,UACA,sCACA,4CAA6D,CAC7D,UAEA,EAAG,EAAG,UACN,OACA,MAoEA,wCCtPA,QAmBA,KACA,mBACA,eACA,OAEA,QACA,mCAEA,cACA,oBACA,wBAEA,gBACA,MA2DA,iBChFA,aAiCA,IAhCA,KACA,eAOA,cACA,CAUA,WACA,6BACA,EAQA,aACA,wBACA,EACA,kBC5CA,aAcA,IACA,WACA,OACA,uEAGA,OACA,aAGA,IACA,CACA,mBC1BA,aAcA,IACA,WACA,UAEA,eACA,qBAGA,wBACA,yBAEA,mBACA,wBAEA,0BAEA,YAEA,2BAAe,OAMf,QACA,oBCvCA,qBAuBA,IACA,mBAMA,eACA,CAQA,oBACA,CAeA,SACA,uBACA,SAEA,QACA,qBACA,EACA,CAEA,aACA,EAKA,YACA,4CACA,oBAEA,GACA,KAEA,gBACA,EACA,kGC/EA,OAyBA,GACA,OAMA,eACA,wDAQA,6EAEA,qCAQA,6BAQA,oBAMA,yCAQA,4BAQA,mBAQA,4BAcA,SAOA,cACA,gBAkBA,wBACA,yBACA,GAAI,UACJ,UACA,SArBA,YAEA,wBAQA,eACA,uBAEA,6CACA,EAEA,CAbA,aACA,YACA,qBACA,aACA,sBAEA,gBAoBA,UACA,kBACA,gBAEA,wBACA,mBACA,eACA,oBACA,SACA,EAQA,aACA,yBAEA,OAMA,gBAGA,4FACA,EASA,iBACA,yBACA,kBAEA,GACA,IACA,uBACA,QACA,oBACA,QACA,YAEA,GACA,EACA,QAEA,WAiCA,sECrOA,SAmBA,KACA,mBAQA,iBACA,OAQA,gBAGA,4BAQA,kCAaA,4CACA,KAKA,UACA,gBACA,mCACA,iCACA,sBACA,UAOA,WACA,eACA,EAKA,UACA,kBACA,KAKA,sBACA,4BACA,UAKA,4BACA,4BACA,SAUA,mBACA,yBACA,oBAEA,GACA,IACA,uBACA,QACA,oBACA,QACA,YAEA,GACA,EACA,qDC9HA,OAeA,IACA,OAWA,oBAKA,cAQA,4BAMA,sBAEA,mBACA,gCAEA,KACA,oDAGA,EAKA,qBACA,qBACA,SACA,+BAGA,GAQA,OACA,0BACA,EAcA,aACA,cAkCA,mBAKA,oBAIA,YACA,cAOA,kFAAmF,QAEnF,IACA,CACA,EAEA,cACA,yBACA,OAEA,KAEA,KACA,kCACA,WAEA,iBAQA,YAGA,+HAAS,qBAIT,MACA,EAGA,iBACA,YACA,UAEA,GACA,GACA,EAEA,cACA,OACA,qBAGA,0BACA,EAEA,cACA,4BAOA,eACA,KACA,oFAAM,QAGN,GAEA,cAaA,OACA,cACA,kBACA,EACA,SArIA,YACA,aACA,KAEA,SACA,OACA,gBA+GA,MAEA,oBACA,KACA,WAIA,qBACA,IAEA,EAxHA,QAaA,SAGA,gHAAyB,SAEzB,6BAAwD,SACxD,IAEA,0BACA,aAEA,EA8GA,UACA,qBAEA,KACA,2CAEA,EACA,kFCjPA,oBAsBA,GACA,mBAQA,iBACA,SAEA,iBACA,oCACA,uCAQA,kCACA,IASA,UACA,aACA,4CAEA,kBACA,yBACA,UAqBA,mBACA,yBACA,oBAEA,GACA,IACA,8DACA,wBACA,wBACA,4DACA,6BACA,sCACA,QACA,oBACA,QACA,YAEA,GACA,EACA,uDCpGA,QAiBA,KA2EA,IA1EA,KAOA,iBAIA,aAKA,YAKA,gCAKA,wBAGA,gCACA,yCAGA,8DACA,wCAGA,qCACA,wCACA,6CACA,wBACA,iCACA,gBAOA,OACA,cAEA,wBACA,gBACA,sEACA,iBACA,YACA,UACA,kBACA,6BACA,sCACA,6BAEA,SACA,EAOA,UACA,kBACA,SACA,kDC5FA,SAkBA,KACA,mBAMA,eACA,OAQA,wBAQA,yBAEA,qBACA,4BACA,SAKA,sBACA,sBACA,OACA,kJCtDA,SAyCA,KACA,OAOA,iBAOA,YAQA,iBASA,iBAeA,yCACA,aAEA,uDAAsD,UAetD,oCACA,UAQA,+CAA+C,UAC/C,oDAA6D,UAC7D,6DAAsE,UAEtE,gFACA,sEACA,uEACA,8CACA,sBACA,UACA,EASA,cAEA,0CACA,GAYA,aAEA,qBAGA,gCACA,EAYA,UACA,sBAEA,QACA,uCAEA,qCAEA,eAEA,gBACA,CAYA,gBAEA,4BAEA,iCAGA,sBACA,uCAGA,mCACA,mCACA,wCACA,GACA,EAYA,mBAEA,+BAGA,yBACA,EAiBA,qBACA,mCAA2D,UAC3D,IAKA,WAWA,qBACA,2BAA+B,uBAC/B,SAkBA,qBACA,2BAA+B,qBAC/B,WASA,qBACA,6BAAiC,aACjC,WASA,sBACA,SAAmB,CAEnB,mDAEA,KACA,OACA,QAEA,WA+CA,mCC/RA,iBACA,WACA,WAIA,aAOA,eAOA,YAQA,0BACA,sBAEA,KACA,iBAUA,eACA,aAKA,WAQA,sBACA,WAEA,0BAEA,YACA,EAGA,OACA,IAEA,eACA,wBAA0C,qBAC1C,qBAA+C,yBAE/C,cACA,CAOA,CACA,eACA,yBACA,mBAEA,oBACA,+DACA,MAIA,SACA,wCAjKA,GAyBA,IACA,aAAqE,KACrE,OAIA,uBAEA,oBACA,iCAGA,6BACA,eAWA,KACA,aAGA,cAIA,mBACA,iBACA,wBAEA,cACA,EAEA,GACA,SAGA,qFCpEA,SA8BA,GAoIA,IAnIA,KAMA,eAOA,YAQA,eAQA,oBAiBA,yCACA,aACA,+BAUA,yCAGA,0DACA,kCACA,EAAG,EAAG,UAGN,6DACA,oBAEA,4CACA,aACA,QAAG,EAAG,UAGN,gEACA,qDACA,WAEA,8DACA,wDACA,WAGA,gFAGA,uDAAsD,UACtD,mDAA4C,UAG5C,mDAAwD,UACxD,mDAA2D,UAC3D,mDAA8D,UAC9D,mDAAkE,UAClE,OAoBA,uBACA,gCACA,wBAEA,qCAEA,GACA,CAMA,UACA,WACA,yBACA,eACA,iCCtDA,aACA,MAEA,4BAA8B,WAG9B,oCAKA,gBAEA,MACA,gDACA,iDAEA,YACA,EACA,gBACA,gBAEA,iBACA,EAIA,kBACA,WAEA,uBACA,sBAEA,OAEA,gBACA,EACA,CACA,yCAlJA,IA4BA,IACA,WACA,YACA,SAEA,yBACA,kBAGA,mBACA,+BACA,uBAeA,MAEA,yBAEA,OAEA,MACA,6CACA,+BAIA,gCAGA,iCAAiD,CACjD,kBACA,+CAEA,qCAmBA,mBAEA,8DAEA,+BACA,sCAEA,UACA,KACA,EAEA,OACA,EAGA,sEC3GA,IA8BA,IACA,iBACA,CACA,cAGA,WACA,iCACA,CAIA,+BAEA,WAEA,UACA,sBAEA,eAGA,mBAGA,CACA,WAGA,sBAGA,oBACA,eAUA,aAEA,qFAMA,EACA,OACA,mBAMA,qBAOA,aAOA,gBAaA,2CAOA,6BACA,MASA,iBACA,cAEA,aAAkB,MAAkB,WACpC,WAEA,sBACA,kBACA,iCAEA,QACA,CAQA,oBACA,aACA,+BAGA,sEACA,SAUA,iBAIA,wBACA,GAQA,iCANA,kDAQA,SACA,qBAmBA,2BACA,sCAfA,EAqBA,mBAEA,sCACA,gBAIA,+BAEA,EAMA,2BAEA,MACA,4CAIA,+BAEA,EAKA,WAEA,2CAGA,SAQA,gBAPA,MACA,mFAAK,sBAGL,+CAKA,0CAEA,wCACA,KAGA,sEAA2D,oCAC3D,UAEA,EAEA,IAMA,sBACA,gBAIA,mFACA,mFACA,gCACA,qBAEA,QACA,qCAEA,2BAEA,wCACA,KACA,QAEA,MACA,IAGA,yBAIA,cAKA,yIAIA,uDAEA,qCAEA,wCACA,KACA,QAEA,GACA,WACA,SAQA,0BACA,iBAKA,iFACA,uBAEA,sBAEA,GAOA,mCACA,4CAEA,YACA,EAGA,uCAEA,gDACA,MAGA,oCACA,uBACA,sCAIA,KACA,2BAEA,EAAI,uBACJ,oDACI,YACJ,uCAEA,8BAEA,wBAEA,sCACA,UACA,CAEA,CACA,QASA,mBACA,gCACA,IAGA,IACA,8BAGA,QACA,IAQA,qBACA,0BACA,8BACA,2BACA,2BAEA,GAOA,kBACA,wDACA,GAOA,sBACA,aACA,QAGA,UACA,IACA,iCCzWA,eAGA,IACA,mCAIA,2DAEA,gCACA,qDAIA,4BAA2B,uBAC3B,wBAEA,YAEA,KAEA,+BAEA,MAMA,0BAJA,0BAI2B,uBAC3B,wBAEA,YACA,CAGA,CACA,eACA,oBAEA,cACA,WACA,mCAEA,sDACA,MAEA,6BAEA,WAEA,UACA,SAEA,eACA,WACA,8BAEA,SACA,aAEA,aAEA,iCA1IA,KAyCA,IACA,aAAgF,KAChF,iBACA,SACA,wCAEA,gBACA,gBACA,gBACA,GACA,0CAGA,eAAe,+BAEf,eAEA,eACA,MACA,KAGA,qBAEA,UACA,EAIA,uBAFA,EAGA,CAEA,mBCzEA,qBAuFA,IAwNA,IAvNA,KAIA,cAOA,qBAaA,gCACA,IAgBA,SACA,aACA,qCAGA,yBACA,8BAGA,kCACA,KAiBA,aACA,oBACA,qCAGA,kBACA,iCAMA,SAkBA,UACA,aACA,qCAGA,iCAEA,MACA,iBAGA,oBAEA,SACA,YAGA,KACA,CAkBA,YACA,aACA,qCAGA,wBAEA,SACA,oCAGG,UAIH,QACA,IAYA,0BACA,OAEA,2CAEA,kBACA,iBAEA,WACA,cAEA,QAEA,OACA,+DAGA,SACA,CAaA,8BACA,SACA,eAEA,uCAEA,GACA,SACA,mCAGA,YAEA,GACA,SACA,aAGA,YAEA,GACA,CACA,yCC/SA,IA2BA,IACA,aACA,cACA,WACA,kBAEA,KAEA,oBACA,kCAGA,oBAEA,wBACA,iCACA,mBACA,EAEA,EACA,6DC/CA,IA+BA,UACA,kBAEA,iCAAwD,CAAa,UACrE,qCAEA,6BACA,GACA,CACA,CAMA,EAhBA,IAiBA,UACA,kBACA,SACA,MACA,iBAGA,wBACA,gBACA,kCAGA,MACA,yCC5DA,QAkCA,GACA,OAIA,cAUA,sBACA,IA4BA,SACA,IAGA,6BACA,+CAMA,iCACA,2BAMA,SALA,2BAEA,UAIA,GA+BA,UACA,+BAEA,SACA,YAIA,wBACA,oBAIA,SACA,EA8BA,aACA,qBACA,wBAEA,0CAGA,uCAOA,MA8BA,YACA,+BAEA,GACA,gCAEA,0CAGA,eAGA,GAUA,iCACA,SACA,CACA,QACA,aACA,SAGA,cAEA,+BAEA,eAIA,6BAGA,aAEA,4BACA,gBAGA,aAEA,4BACA,gBAGA,SACA,EAaA,uBACA,IACA,SAGA,SACA,qBAEA,GAIA,OACA,6CAGA,SACA,2BAGA,kBACA,+BAGA,SACA,EACA,MAOA,EACA,OAKA,cAOA,sBAQA,uBACA,cACA,cACA,cAEA,KAuBA,OACA,gBACA,YAGA,yBACA,iBACA,kBAGA,GAsBA,QAEA,kBACA,4BAGA,kCACA,uBACA,wBAEA,OACA,aAEA,EAIA,CACA,QAoBA,WACA,gBACA,YAGA,yBACA,iBACA,sBAGA,GAmBA,UACA,gBACA,YAGA,yBACA,iBACA,qBAGA,GAYA,UACA,wBACA,uBAEA,kBACA,mCAMA,2BAGA,4FACA,KACA,CAWA,WACA,wBACA,uBAEA,eACA,kDAEA,+CAEA,YACA,aAEA,EAAI,KACJ,eAEA,MACA,iBAGA,UACA,EAEA,QAGA,CACA,QASA,cACA,wBACA,uBAEA,eACA,kCAEA,sDAEA,eAGA,KASA,aACA,wBACA,uBAEA,eACA,qCAEA,qDACI,aACJ,eAEA,GACA,cAEA,KAEA,CACA,iCC9UA,aACA,YACA,UAGA,eACA,8BACA,GAIA,oCAEA,GACA,gCAKA,uBACA,wBACA,gCAGA,SACA,uCAOA,0CAJA,2BAKA,GAEA,OACA,EA4CA,sEA5UA,QAuGA,IACA,OAQA,aAAgC,KAMhC,wBAAiC,QAIjC,yDACA,oEACA,KAgBA,WAAuC,KACvC,yBAEA,0BACA,2BAGA,sCACA,YAGA,SAGA,cACA,iCAIA,iBAEA,GACA,CAMA,kBAAqD,KACrD,aAAyB,UACzB,OACA,SAGA,mBACA,gDACG,oBACH,kCAEA,qDAGA,iBACA,MAMA,sBAAyD,KACzD,sBACA,kDAGA,yCACA,KAgDA,QAEA,WAM0D,oBC3O1D,aAeA,IAdA,KAOA,WACA,oDACA,sBACA,4BAEA,KACA,SACA,iHC/BA,SAwBA,mCC2EA,eACA,WACA,uBAEA,yDACA,kDAEA,IACA,GAsVA,eACA,aAuCA,YACA,6BACA,2BAGA,iCACA,kBACA,GACA,YA9CA,SAGA,wCAIA,OAEA,iBAEA,qBAAiB,MAAkB,WACnC,oBACA,wBAIA,SAGA,SACA,OAGA,MACA,KAGA,SACA,UAIA,OAEA,KAEA,CAYA,CACA,YACA,UAGA,mCAEA,IACA,oKA5fA,SAoCA,IACA,0BAGA,sBAEA,qCACA,sBAGA,IACA,CAEA,GACA,0BACA,0DAEA,mBAEA,kBAGA,oEACA,YAEA,sBACA,4BACA,eAEA,8DAEA,uBACA,eACA,KACA,qBACA,KACA,SAGA,WAEA,GACA,KAGA,OACA,EAEA,GACA,0BAIA,6BACA,UACA,GACA,gBAIA,sBACA,EAAC,GAYD,oBACA,oBACA,oBACA,oBACA,oBACA,iBAEA,GACA,0BAKA,MACA,qCACA,MAEA,0KAEA,iBACA,EACA,GACA,gBAIA,sBACA,EAEA,GACA,0BAGA,6BACA,WAGA,kBACA,EAEA,GACA,0BAIA,MACA,qCACA,MAEA,0KAEA,iBACA,GAGA,kBACA,EAEA,GACA,0BACA,oBACA,6BAGA,yCACA,kCAEA,cACG,4CAKH,WACA,qEAIA,mCACA,kCACA,+EAEA,yCAGA,UACA,EAKA,WAEA,0CACA,0FACA,sFACA,yEAIA,mCACA,kCACA,+EAEA,yCAGA,UAEA,EAEA,qBACA,EAEA,GACA,0BAGA,OACA,+DAGA,kBACA,EAEA,GACA,0BAIA,SACA,qJAEA,aACA,SACE,wFAIF,WAOA,yCAGA,6BAGA,0BACA,8BAKA,iCAEA,0BACA,wCAKA,kCACA,uBACA,mCAEA,IACA,EAEA,qBACA,EAEA,GACA,wBACA,KAEA,iEAEA,mCAGA,oBACA,oEACA,CACA,uEAKA,6DAHA,UAIA,KAIA,QACA,EAEA,GACA,0BAGA,kEACA,SACA,GACA,gBAIA,uDAMA,KACA,CAEA,qBACA,EAEA,GACA,wBAEA,YAEA,2CACA,sBAGA,IACA,CAEA,GACA,0BAIA,SACA,qJAEA,aACA,QACA,GACA,gBAEE,4FACF,WAGA,2CAGA,0BAGA,2FAEA,MACA,EAEA,qBACA,EAEA,GACA,0BACA,0DAEA,mBAEA,0CAGA,WACA,uEAEA,UACA,EAEA,OACA,EAEA,GACA,wBACA,KAEA,iEAEA,uCAGA,uCACA,6DAIA,UACA,EAEA,GACA,0BACA,sBACA,uBAGA,qBACA,6BACA,yCAEA,mBACA,gBAEA,EAGA,OACA,EAEA,GACA,0BACA,KAEA,kCAEA,mCACA,yCAEA,mBACA,gBAEA,EAEA,qBACA,EAGA,iCC1UA,mBACA,WACA,cAEA,+BAEA,oBACA,kBACA,oBACA,mCA/HA,SAoBA,GACA,mBAIA,WACA,OACA,QAQA,yBACA,OACA,EAKA,uBACA,OACA,gCACA,MAmBA,EACA,kCACA,gCACA,iCAEA,WAMA,gBAGA,0GAEA,WAGA,cAMA,iBAHA,GAIA,IAQA,GACA,mCACA,gCAEA,mCAMA,iBAGA,mHAEA,6BAEA,MACA,IAAC,GAaD,8CC+TA,aACA,WAEA,cACA,WACA,kBAEA,8CACA,EAEA,CACA,QAQA,CACA,eACA,QAEA,UACA,IAEA,OACA,WAEA,SACA,OACA,UACA,QACA,UAGA,OAEA,MACA,WAEA,SACA,OACA,UACA,QACA,UAGA,OACA,CACA,6HAlfA,OA0BwD,KAExD,QAcA,aACA,OAKA,cAUA,cAOA,iBAUA,0BAQA,sBAQA,4BAQA,WASA,iCAGA,0CACA,6BACA,6CAOA,YACA,8GAA8E,CAG9E,SAGA,2BACA,EAQA,gBACA,qBACA,EAUA,kBACA,yBAOA,iBACA,KACA,sGAAK,WAGL,YAEA,gBAEA,kCAEA,OAEA,qDAEA,KAQA,SACA,qBACA,EAWA,+BACA,mBAQA,YACA,KACA,kFAAK,MAIL,2BACA,2BAEA,GACA,CAKA,UACA,gBACA,eACA,eAaA,kBACA,8BAEA,kCACA,2BACA,6BACA,0BAGA,kBACA,cACA,CAQA,kBACA,oBAOA,YACA,KACA,kFAAK,MAIL,0BACA,EAQA,WACA,uBACA,EAOA,eACA,qDACA,EAqBA,qCAEA,sBAA2B,qBAC3B,mBAGA,MACA,GAEA,cACA,2BAAqC,2BAGrC,0BACA,0BAAoC,eAGpC,yBACA,kCACA,mBAEA,mDACA,4BAGA,2BAA4B,uBAC5B,gCAEA,aAEA,OACA,KAOA,SACA,kBAGA,yBAEA,+BACA,CASA,kBACA,yBACA,qBACA,gBAIA,eACA,SASA,mBACA,cAGA,4BACA,uCAGA,qBACA,EAUA,2BACA,wBACA,IA4CA,QAEA,WAGA,sBC/bA,qBAoBA,GA8LA,IA7LA,KAIA,cAOA,MASA,kCACA,IAOA,YACA,mEACA,sBAEA,uBACA,wCACA,EACA,CAWA,2CAEA,IAKA,8CAGA,OAKA,iCACA,sBAEA,uBACA,EAGA,WACA,EACA,EAUA,YACA,+BAEA,MACA,iBAGA,WAEA,UAAc,iBAA6B,WAC3C,sBAEA,qBACA,EAGA,aACA,EAEA,0BACA,CAiBA,eACA,kBACA,KAaA,iBACA,uBAGA,MAMA,sBACA,iBAIA,oDAGA,sBAEA,wCACA,SACA,wDAGA,GAQA,aACA,+BAGA,iBACA,0CACA,gCAEA,kBAGA,SAQA,gBACA,mFAEA,OACA,EACA,iCC6bA,aACA,sCACA,OAGA,gBACA,oEArpBA,QAkBA,IAEA,QAEA,kBAuBA,0HACA,mBAMA,eACA,CAQA,uBAYA,6BAIA,kDACA,OACA,SAEA,qBACA,EAKA,kBACA,sBAEA,6BACA,WAKA,aACA,wDACA,KAKA,YACA,uDACA,KAKA,iBACA,gDACA,CAKA,UACA,WAAkB,iBAAyB,OAC3C,oBAGA,cACA,eAKA,aACA,cACA,mBAEA,iCAEA,kBAKA,gBACA,8CACA,kBAKA,eACA,6CACA,kBAKA,iBACA,kBACA,QACA,mBAKA,kBACA,OACA,uBACA,mBAKA,kBACA,mBACA,QACA,mBAKA,kBAEA,sBACA,0DAGA,2BAEA,8BACmC,gBAAnC,GACA,iBACA,CAKA,mBAEA,sBACA,+DAGA,4BAEA,8BACmC,gBAAnC,GACA,iBACA,CAKA,mBACA,YAEA,qBACA,+DAGA,iCAEA,eAEA,oBACA,gCAAmC,iBACnC,iBACA,CAKA,kBACA,MACA,mBAKA,oBACA,MACA,qBASA,8BACA,oBACA,0BAEA,GACA,CAKA,YACA,oBACA,QAKA,cACA,4BAGA,GACA,qBAEA,EAUA,iBACA,kBAMA,oBAGA,wHAMA,UAKA,qBAHA,6HAKA,+BACA,0CACA,wBACA,yCAGA,4BAA+B,CAC/B,iBAEA,GACA,CASA,qBACA,uBACA,6CAEA,oBAEA,6BACA,oBAGA,8BACA,mBACA,8BACA,kCAKA,0BAGA,WAIA,0BACA,qCACA,UAKA,eACA,qBACA,WAKA,GACA,yCAAmC,iBAEnC,iBASA,gCACA,UACA,CAaA,wBACA,oBAEA,mBAEA,yCAGA,oCAGA,cAIA,sBAGA,iCAGA,MAaA,yBACA,oBAEA,sBAMA,iEAIA,wBAGA,iCAGA,MAYA,yBACA,YAEA,yBAEA,2BAKA,2BACA,UAIA,oBAEA,gCAEA,GACA,SAEA,EAEA,OACA,EAQA,wBACA,iCAEA,4BACA,gCACA,uCACA,oBAEA,+BACA,GAGA,CAQA,0BACA,iCAEA,6DACA,EASA,qBACA,iCAEA,4DACA,EAQA,0BACA,qBACA,wBAEA,iDACA,iCAEA,uBACA,EAEA,kBACA,iCAEA,sBACA,EACA,CAUA,4BACA,cAEA,yBAEA,0BAEA,cAGA,4BAGA,mBACA,mBAGA,gBAAG,KAGH,iCACA,qCAGA,iBAGA,GACA,QAIA,KACA,YAEA,MACA,OACA,oBAKA,OACA,YAEA,MACA,OACA,gBAKA,GACA,WAEA,uBAEA,OACA,EASA,4BACA,iBAEA,qCACA,0BACA,oBAEA,0BACA,iDAGA,GACA,wBAGA,uCACA,0BACA,KAEA,iCACA,EACA,MAUa,sEC9oBb,OAyBA,GACA,OAIA,cAOA,kBACA,IAOA,oBACA,sBACA,QAQA,OACA,0BACA,EASA,OACA,8BACA,IAgBA,SACA,+BACA,sBAEA,QACA,WAEA,wBACA,SAGA,eACA,EAEA,6BACA,aAEA,8BACA,mBAEA,GACA,CAQA,UACA,+BACA,sBAEA,WACA,yBACA,sBAEA,uBAMA,MAQA,yBACA,aACA,oCACA,UAGA,GAKA,UACA,4BACA,6BAGA,iBAEA,UACA,eAeA,oBACA,4BACA,6BACA,YAGA,GAQA,kBACA,GACA,6BACA,sBACA,IAeA,QAEA,WA6BA,KACA,OAOA,iBAOA,WAQA,kBAEA,wCACA,KAOA,WACA,UAMA,yBAGA,2GACA,MAOA,SACA,UAMA,yBAGA,2GACA,IAcA,WACA,UAMA,yBAGA,6FACA,WAeA,EAEA,wHCjVA,SAkBA,KAEA,WACA,qBACA,qBACA,qBACA,qBACA,qBACA,qBACA,qBACA,qBACA,qBACA,iBAMA,IAYA,IAXA,KAQA,qBACA,oCACA,EACA,iCCwgBA,aACA,UACA,QAGA,CACA,eACA,WAAiB,MAAuB,OACxC,yBAGA,QACA,EAEA,CACA,eACA,OACA,8EAIA,CACA,aACA,OACA,cACE,KACF,cAEA,2BAEA,MAEA,+EAxlBA,OA+DA,QA4cA,eACA,IACA,GAEA,cACA,SACE,4BACF,SACE,+BACF,SACE,mCACF,SACE,4BACF,SACE,4BACF,SAEA,gBAGA,EACA,gBACA,SACG,4BACH,SACG,+BACH,SACG,mCACH,SACG,4BACH,SACG,4BACH,SAEA,gBAIA,eAEA,0BACA,EAGA,EAtfA,QACA,iBAGA,uBAEA,WAGA,8FAEA,IACA,EAEA,qBAEA,yBAEA,kBAEA,kBAIA,sBACA,WAGA,4GAEA,WACA,EAGA,sBAEA,qBAEA,+DAGA,6CACA,gDACA,YACA,EAIA,2BACA,kBAIA,+CACA,gDACA,YAGA,qCAEA,aAIA,KACA,iDACM,cACN,6BAIA,KACA,CAEA,UAEA,QAEA,yBAEA,kBAEA,kBAGA,oBAEA,2DAGA,YAKA,0BACA,mFAGA,2BACA,2BACA,sBAMA,sCAGA,8BAEA,SAKA,yEACA,kEAOA,gFAGA,WAIA,2DACA,kEAEA,6BAIA,eACA,gDACA,YACA,EAGA,0BACA,iBAEA,qBAIA,+BACA,mCACA,kDACA,YAKA,oBADA,aAGA,kBAEA,kBAEA,gBAGA,mBAEA,qBAEA,WAGA,mFAEA,eACA,EAEA,qBAEA,yBAIA,wBAEA,WAEA,gCACA,aACA,cAEA,8BAIA,qBACA,EAEA,kBAGA,oBACA,WACA,+BAEA,kHAEA,IACA,EAGA,mBAEA,qBAEA,WAEA,iBACA,gGAGA,MACA,gGAGA,KACA,EAEA,qBAEA,yBAEA,kBAIA,wBAEA,WAEA,qBACA,QACA,eAEA,+BAIA,qBACA,EAGA,oBAEA,WAEA,sBACA,8EACA,yCACA,EAEA,eACA,8EACA,yCACA,EAEA,QACA,EAGA,iBAGA,uBAEA,yDACA,oFAEA,eACA,cACA,2BACA,mBACA,OACA,sFACA,6BAGA,iCAEA,qBACA,+BACA,6CAGA,uBACA,EAEA,qBAEA,yBAEA,kBAEA,kBAIA,sBAIA,gBAGA,YAOA,qDACA,+BACA,2BAEA,eAEA,SACA,8BAEA,KAIA,iCACA,MACI,sCACJ,OAIA,gEACA,6DAGA,YAGA,0BAEA,IACA,yFACA,6FAEA,oBAIA,8BASA,oEAIA,wCACA,sDACA,6CAQA,2BACA,8FAEA,oEAIA,oDACA,kEAGA,4CACA,cAEA,aAIA,IAIA,gCAOA,UACA,kBACA,qBAEA,gBAEA,eAKA,qCACA,wBACA,iBACA,iBACA,SACA,cAIA,iCAEA,aACA,cACA,2BACA,sCACA,4BAGA,iCAEA,qBAGA,oDACA,+BAGA,sBACA,CACA,EAEA,qBCzgBA,qBAcA,GACA,mBAQA,0BACA,OAQA,aAQA,gBACA,CAUA,eACA,aACA,IAKA,QACA,OACA,8CAIA,8BAFA,EASA,SACA,aACA,QACA,sCC0fA,iBAEA,oBACA,aAGA,cACA,WAGA,iBACA,GAGA,wCAEA,mBACA,IACA,IAEA,QAEA,SAEA,CACA,+CA7lBA,SAmCA,GACA,OAIA,cAQA,iBASA,oBAQA,oBAQA,8BAGA,uBACA,2BACA,4BACA,qCAEA,sBAAe,sBACf,qBAAe,uBAMf,gDACA,oBAAe,uBACf,oBAgBA,SACA,+DACA,WAQA,YACA,kEACA,WAgBA,uBACA,oCACA,EAoCA,SACA,oBACA,MAIA,oBACA,YAKA,sCAIA,6BARG,4CAWH,qDACA,sBACA,EAGA,wDACA,YAIA,wBACA,uBACA,sCACA,GAWA,mCACA,IAEA,kBACA,sCACA,CACA,KACA,KAKA,KACA,EAEA,QAEA,CACA,QAQA,WACA,wBACA,EAWA,kBACA,iBAMA,iBAGA,sGAMA,iBAIA,oGAOA,uEACA,+BACA,EASA,iBACA,oCAMA,iBAGA,8GAEA,yBACA,EAUA,YACA,kBAMA,iBAGA,mGACA,EASA,8BACA,IAEA,kBACA,eACA,eACA,cACK,eACL,WAGG,4BACH,aAEA,OACA,mBACA,UAGA,SACA,SAAG,eACH,eAGA,YACA,EACA,MAQA,EACA,OAMA,eAOA,cAQA,OAQA,iBAQA,oBACA,sBAQA,WACA,4BACA,EAQA,cACA,+BACA,EASA,qBACA,+BACA,EAUA,gBACA,KAEA,iBACA,QAGA,gBACA,gBAAyB,QAEzB,aAUA,eACA,wCACA,YAEA,iBACA,iBACA,YAIA,YACA,EAUA,4BACA,IAEA,4CACA,CAEA,iBACA,uBACA,CACA,KACA,KAGA,IACA,EAEA,KAEA,OACA,EAWA,wBACA,0BAEA,iBACA,uBACA,GAIA,SACA,QAOA,SACA,kBAGA,uBAEA,iBACA,CAmC0B,yICnkB1B,OAyCA,IACA,OAIA,cAOA,kBAQA,uBASA,0BAQA,mBAYA,cAQA,6DACA,mDAQA,gCAGA,sBACA,sBACA,sBACA,sBACA,sBAEA,cAIA,2BACA,MACA,iCACA,cACA,iBACA,EAeA,eACA,2BAEA,MACA,QAGA,WAEA,4BAEA,uBACA,qBAGA,YAEA,SACA,CAQA,eACA,4BACA,EAwBA,uBACA,gCAEA,kCACA,qBAEA,sBAGA,qEACA,0EACA,8DAEA,gCACA,yBAGA,GACA,CAaA,0BACA,sBAEA,uBAEA,oCAEA,uCACA,oCAEA,4CACA,qBAEA,EASA,kBACA,uBACA,EAQA,qBACA,0BACA,EAQA,SACA,WACA,SAMA,QACA,oBACA,wBAEA,gBACA,2BACA,QASA,mBAEA,2EACA,CAKA,mBACA,8BACA,WAEA,SAKA,kBACA,8BACA,WAEA,QAKA,UACA,8BACA,WAEA,SACA,QAEA,WAmBA,sBCpVA,qBAmBA,IACA,mBACA,eACA,OAEA,qBACA,OAEA,cACA,kBACA,EACA,MAcA,gCC2EA,aACA,eACA,mBACA,kBACA,gBACA,kCA5HA,QAsBA,KACA,mBAMA,eACA,OASA,oGACA,IAKA,UACA,cAEA,+BACA,WAEA,uCAEA,cAEA,6CAEA,SAAG,EAAG,UACN,UAKA,UACA,OAEA,iDACA,QAeA,wBACA,uBACA,oCACA,KAGA,sCACA,YAIA,6CACA,cAGA,wBACA,cACA,eACA,eAIA,2CAMA,0CACA,EACA,MAMa,mBCtHb,qBAsBA,IACA,mBACA,eACA,OAEA,QACA,mCAEA,+BACA,GAMA,6DACA,EAEA,sBACA,qBAEA,iCACA,YAGA,eAEA,SAQA,EAEA,cACA,kBACA,EAKA,UACA,MACA,oCAGA,wBACA,SACA,MA4BA,wCCrGA,QAkBA,IACA,mBACA,eACA,OAEA,qBACA,SAEA,cACA,uBACA,WAEA,iBACA,4BACA,mBAEA,wBACA,iBACA,KAEA,GACA,MA6BA,mBCpEA,qBAmBA,IACA,mBACA,eACA,OAEA,qBACA,WAEA,cACA,kBACA,EACA,MAaA,yDC3CA,QA2BA,KACA,mBACA,eACA,OAWA,uCAQA,mBAQA,mBAQA,8BASA,gCASA,0GAEA,0DAQA,gDACA,CAKA,WACA,WAGA,kCAIA,2CACA,6BACA,EAEA,uBACA,GAKA,UACA,OAEA,6BACA,mEACA,QAUA,0BACA,kCAKA,iCAIA,8BACA,sDAEA,8BAOA,OASA,2BAKA,qBAHA,yGAIA,mBACA,uBACA,eAIA,wCAMA,0CACA,IAOA,qBACA,uBACA,CACA,MAqCA,gCCjKA,aACA,WAEA,uBACA,oCAEA,0BACA,oBAEA,EAKgD,CAChD,aACA,eAEA,iBACA,OAEA,EAMoB,CACpB,eACA,WAGA,YAIA,aACA,cAGA,kBACA,uBAMA,iCACA,6CAOA,aAEA,gCAEA,mCALA,+DA5GA,IAiBA,eACA,WAEA,aAMA,gBAIA,uFAGA,SACA,gBACA,qCAAmF,UAKnF,4CAGA,kBAGA,OACA,EAMA,EAnDA,WACA,WAEA,KACA,WAUA,uCC6nBA,eACA,sCACA,GAOoD,CACpD,aACA,iCACA,OAEA,eAEA,kBACA,YAGA,qCAEA,YACA,oFAhrBA,QAoCA,GACA,OAOA,iBAMA,sBAQA,uBAQA,2BAQA,4BAQA,yBAQA,oBAQA,qBAQA,UAQA,0CACA,IAcA,gBACA,IACA,mDACA,8BAEG,OAGH,2CACA,GAGA,UACA,2CACI,WACJ,uCAOA,sBAEA,0EACA,CA0BA,SACA,IAKA,6BACA,mCAIA,2BACA,qBAGA,gCACA,mDAGA,6CAGA,2BACA,wFACA,4BAA6B,CAI7B,2CACA,mCAGA,qBACA,sCAAmC,CAGnC,8BACA,wBAEA,gCACA,8BACA,4BAGA,qDACA,EASA,wBACA,KACA,EAKA,+BAHA,kDAMA,sBAMA,sBAGA,uFACA,MAeA,2BACA,wBAEA,sCACA,2DAEA,QAEA,CAUA,6BACA,kDACA,YAYA,gCACA,yDAEA,4DAKA,OAOA,sBACA,cAGA,2BAOA,iBAGA,4EACA,4BAEA,wBAGA,wBACA,IAQA,gCACA,kDACA,YAGA,gCACA,uBACA,WAGA,0DACA,MAGA,kBACA,WAIA,kBACA,kBAGA,mBACA,eAEA,+CAKA,UAWA,iBACA,+CACA,qCAEA,mBACA,aAEA,eAEA,wDACA,cAGA,MACA,WAEA,EAQA,gBACA,+CACA,yCACA,UAGA,+BACA,mCAIA,gBACA,kBACA,sBAGA,EAWA,qBACA,gBA6CA,QACA,EAGA,sCACA,cAGA,kBACA,2BAMA,YACA,cA5DA,qCAEA,MAMA,aAEA,kBAEA,yBACA,gDAAqG,CAErG,6BACA,aAEA,iCACA,gBAEA,0CAEA,KAEA,sBAEA,SAEA,cACA,GACA,6BACA,IACI,KAEJ,mDACA,eAEA,KAIA,IAyBA,mBAEA,IACA,8BAMA,YALA,gCAEA,2FAMA,iCAKA,mBACA,iCAEA,SACA,gDAEA,IAQA,wBACA,WAGA,mBACA,uEACA,mDACA,+CACA,0CACA,oEAIA,uCACA,kCAIA,oEACA,oDAGA,YACA,iBACA,6BACA,iCACA,oCAGA,yEACA,UAQA,uBACA,qCACA,yDAEA,kCAIA,+BACA,SACA,cACA,wBAGA,WAGA,sIADA,EAQA,4DACA,6DAEA,6BACA,4BACA,QAOA,sBACA,gCACA,WAEA,+BACA,WACA,8DAEA,MACA,oBAEA,iBACA,CACA,CAOA,uBACA,cAEA,wBACA,KAEA,QAOA,eACA,mBACA,wBAEA,gBACA,2BAEA,EACA,CACA,QAEA,WAQa,sBCxpBb,qBA8BA,GACA,OAWA,mBAOA,kBAEA,gBAMA,qBAGA,gGAMA,qBAQA,gGAQA,qBACA,CAaA,gBACA,8CACA,MAQA,aACA,sBACA,MAQA,WACA,sBACA,IASA,eACA,sBACA,QAUA,MACA,OACA,cAWA,gBAA0B,gBAAyC,gBACnE,MACA,iDAEA,OACA,4CACA,OAGA,aACA,EACA,qDCnKA,SAiBA,KACA,mBAIA,wBACA,OACA,aAEA,OACA,cACA,mBAEA,mBAEA,oCAGA,mCACA,WACA,WACA,gBAAG,EAAG,UACN,OACA,sCCDA,mBACA,WACA,gBACA,0BACA,eAGA,iDAKA,mBACA,EAOA,YANA,qBAGA,OAIA,UACE,WACF,kCACA,4BAEmD,OAEnD,IAKA,OAPA,UAaA,kBAGA,GACA,GAEA,iBACA,cAIA,WACA,oCAEA,oDACA,EACA,cAGA,uBACA,qBAlGA,QAgBA,GACA,mBAIA,aACA,qBACA,aAEA,6BACA,oCAEA,iCAA+B,CAC/B,SACA,EACA,MAO6C,gDCtC7C,SAiBA,IACA,mBACA,eACA,OAEA,yBACA,gCACA,kCAEA,UACA,EAKA,WACA,MAUA,gCCmHA,eACA,gDACA,+DAhKA,kBAwBA,GACA,mBAIA,sBACA,YACA,IAKA,wBACA,OACA,iBAKA,OACA,cACA,YACA,YACA,uBACA,SACA,MACA,sBAEA,0BACA,0BACA,wBACA,eACA,qBACA,cAGA,gCAGA,eAEA,UACA,EAGA,iBACA,CACA,kBACA,UAGA,wBAEA,UAEA,iCAGA,oBAEA,UAEA,iBACA,0BAGA,0BACA,CAIA,6CACA,oBAEA,gCACA,YACA,CAOA,gEACA,oBACA,4BACA,OAEA,GACA,CACA,EAaA,uBACA,cACA,WACA,IACA,aACA,2BACA,2BACA,2BAGA,8DACA,aAEA,sBAEA,iBAA8B,YAAW,CAGzC,WACA,CACA,EACA,MASa,+DC7Jb,OAmBA,IACA,mBAOA,iBACA,OAEA,sBAUA,YAGA,uDACA,MACA,oBACA,cAyBA,EAUA,YAAyB,KACzB,cACA,WAGA,gBAEA,2BACA,oBAEA,iCAEA,wBACA,YAYA,+BAGA,8CAZA,YACA,6BAGA,0BAAoC,aACpC,SAGA,CAKA,EAKA,eACA,iDAEA,+CACA,aAKA,gBACA,iDAEA,kEACA,WACA,qCAEA,IACA,MASA,iEC7IA,oBAsBA,GACA,mBAIA,sBACA,gBACA,IAKA,wBACA,OACA,aACA,sCCoDA,mBACA,sBACA,kBAEA,uBAIA,qCACA,mBAEA,GACA,4CAEA,8CAEA,8CAzGA,IAwBA,UACA,kBACA,WAIA,kBAA6C,eAK7C,0BAAqC,0CAKrC,4BAEA,iCAAwE,mBAKxE,qBAA0C,eAC1C,sBAAgC,mBAGhC,gCACA,oBAIA,qBAAqC,CACrC,yDAKA,uBACA,iCACA,oBACA,oBACA,aAEA,eACA,GACA,CAOA,EAtDA,IAuDA,aACA,aACA,QAAiC,iBAAgB,SACjD,QAAoC,oBAAgB,SACpD,QAAoC,oBAAgB,SAEpD,EAIA,+CCxFA,oBAiBA,GACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,oBACA,sCC6HA,mBACA,IAIA,8BACA,cACA,MAGA,qCACA,WAEA,oDACA,kCAGA,UACA,2CAEA,WAEA,EACA,EAMY,CACZ,kBACA,kBACA,WAGA,uBAIA,uBACA,sBACA,UAGA,oDACA,sBACA,OACA,UAGA,MACA,uBAGA,4BACA,OACA,CACA,CAQkD,CAClD,mBACA,wBAEA,oBACA,oBACA,EAOA,CACA,aACA,wBAAuC,CACvC,+BAEA,uCACA,uBAGA,EACA,kFArPA,QAgCA,KACA,mBAIA,OACA,cACA,WACA,qBACA,SACA,WACA,SACA,YAgBA,mCAGA,uCACA,mBAAiB,uBACjB,oBAAiB,uBACjB,uBAGA,yBAGA,OACA,aACA,kBACA,eAGA,uDAGA,4DAGA,qFAA+F,UAG/F,8FAAgH,UAGhH,sEAAiF,UACjF,QAQA,2BACA,6BACA,kCACA,cACA,wBAGA,4DACA,+CAIA,4BACA,0BACA,cACA,qBACA,EAGA,YACA,uBAGA,iBACA,kBACA,uCAEA,EASA,yBACA,WACA,yBAEA,YACA,yBAEA,GACA,MACA,yBAEA,wBAGA,aACA,CACA,MAKA,yECrIA,aACA,WACA,iBACA,gCACA,sBACA,iBAEA,YACA,EACA,CAOA,MACA,WACA,6BACA,EAOA,EAjDA,IAkDA,WACA,gBACA,mCACA,wBAIA,SACA,KASA,EAvD2B,IAwD3B,WACA,WAGA,mEACA,SAAU,CAGV,SACA,MA/DA,eAQA,6DCtBA,SAmBA,IACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,kBAKA,OACA,gCAEA,4BACA,sBAIA,kCAEA,wBACA,MACA,eAGA,6BAEA,OAQA,iBACA,cACA,0BAEA,4CACA,iBAEA,gBACA,SACA,aACA,KAGA,sCACA,iCAEA,mDAEA,OACA,CACA,EACA,sCCtBA,mBACA,WACA,UAIA,mBAA4C,SAK5C,sBAKA,qCAEA,6BAAoC,+BAKpC,6BAAyC,SACzC,0CACA,QAMY,CACZ,eACA,aACA,gBACA,QAGA,EAQqB,CACrB,iBACA,kCACA,wCAMA,cAQqB,CACrB,iBACA,+BACA,qCAMA,2BAtIA,IAkBA,WACA,kBACA,2BACA,OAEA,+BAKA,kCACA,2BACA,8BAEA,uBACA,sBAEA,GACA,CAOA,EA1BA,IA2BA,WAEA,uBAEA,iCACA,aACA,WAEA,EACA,CAQkB,wCC7DlB,QAgBA,IACA,mBAOA,iBACA,OAUA,YAQA,uBAGA,6CACA,MACA,oBACA,cACA,EAOA,eACA,qBACA,uBAEA,2BACA,QAMA,mDAEA,kEAEA,iBALA,SAUA,gBACA,wCAEA,qCACA,EAUA,YAAyB,KAEzB,SACA,MAGA,oBACA,WACA,aACA,cAEA,0CACA,oBAEA,iDACA,MACA,EACA,2FC5GA,kBAqBA,GACA,mBAIA,sBACA,QACA,IAKA,OACA,cACA,WACA,MACA,aACA,WACA,SAGA,uCAEA,CAAI,iEAGJ,MAAI,6EAIJ,2CAIA,wBAAiB,6CAGjB,2BACA,oDACA,oDACA,uDACA,uDACA,uDACA,uDAGA,iDAA+E,UAG/E,oBACA,mCAEA,GACA,MAwBA,wHClGA,kBAyBA,GACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,4BAKA,OACA,MAGA,+CAEA,8BACA,OACA,eAGA,YAGA,8DAMA,mBAOA,0BACA,EACA,EAQA,gBACA,cACA,wBACA,4BAEA,wDACA,iBAEA,gBACA,SACA,wCACA,EAGA,sCAEA,gDAEA,qBACA,CACA,EAQA,sBACA,cAEA,iBACA,eAEA,qCACA,kCAA4C,2CAC5C,aACA,mBAGA,yBAEA,WACA,2CACA,GACA,aACA,SAEA,iBACA,SAEA,aAGA,qCAGA,8BACA,SACA,kBACA,4BAIA,+BACA,SACA,kBACA,2BACA,0BAGA,kCACA,eACA,sBACA,cACA,EAOA,oBACA,cACA,wBACA,8DACA,qBACA,gCACA,QAOA,oBACA,cACA,yBACA,wBACA,OACA,8CCrLA,QAgBA,IACA,mBAIA,eACA,OASA,YAGA,uDACA,MACA,oBACA,cACA,EAOA,eACA,qBACA,uBAEA,4DACA,uBAIA,MAKA,gBACA,wCAEA,qCACA,EAWA,cACA,cACA,WACA,uBAEA,0CACA,oBAEA,iCACA,SACA,EACA,8CCrFA,SAiBA,GACA,mBAIA,OACA,8DACA,QACA,6ECzBA,SAoBA,KACA,mBAIA,eACA,OAEA,uBAOA,yBAOA,mEACA,kCAOA,8DAEA,kDACA,YACA,CAMA,oDACA,KAEA,kBACA,CAKA,8CACA,MACA,aACA,KAEA,iBACA,CAKA,uDACA,MACA,oBAMA,+BACA,MAEA,MAUA,mBACA,sBAEA,uBACA,IAEA,YACA,iCAGA,GACA,CAQA,0BACA,qBACA,wBACA,sBAEA,oBACA,CACA,sCC4KA,aACA,sDACA,gHA7SA,kBAgCA,GACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,WAKA,OACA,sCAOA,gCAOA,yCAGA,mBACA,gCACA,4BAQA,2BACA,cACA,wBACA,YAGA,qCAEA,oDACA,iBAEA,YACA,uBACA,iBACA,cACA,WAGA,oCAGA,gDAEA,cACA,CACA,EAQA,6BACA,cACA,WACA,mBAEA,kDACA,iBAEA,YACA,uBACA,mBACA,IAGA,oCAGA,qDAEA,WACA,CACA,EAQA,sBACA,cACA,mBAGA,iBACA,0BAIA,4BAIA,qCACA,WACA,gBAEA,mCACA,SAEA,qDACA,aAEA,uCACA,6BAIA,QAFA,YAIA,+DAEA,WAGA,iCACA,0CACA,0BACA,QAEA,IAGA,iCACA,GACA,iBACA,eAEA,IAGA,YACA,SACA,kBACA,2BACA,0BAGA,kCAEA,GACA,CAQA,cACA,cACA,mBAEA,sEAGA,sCACA,mDACA,YACA,cAGA,gCACA,WACA,eACA,cAGA,iCACA,MACA,eACA,GAGA,qCAEA,kDAEA,GACA,CAUA,yBACA,6BACA,wBAEA,sBAEA,4CAGA,6CAEA,gDACA,CACA,uEAEA,kBAQA,cACA,uBAEA,OACA,4BAEA,OAOA,aACA,MACA,mDACA,QACA,MAOa,uEC1Sb,SAoBA,KACA,mBAKA,eACA,OAQA,YAEA,oFACA,wDACA,WACA,EASA,gBACA,qBAEA,kDACA,OAkBA,cACA,qBACA,aAEA,+BAEA,WAGA,yBACA,WACA,uBAGA,qCAEA,sDAEA,yCAGA,gBACA,GAEA,wBAAsC,6CAA6D,OACnG,mBAAmC,UAEnC,eAGA,6BACA,IACA,CAAI,KAGJ,6CAEA,oBACA,+BAEA,EACA,CACA,EACA,8EClHA,SAsBA,KACA,mBAIA,OACA,cACA,WACA,SAGA,gCAAiC,2BAGjC,4CACA,2BACA,uCAAsD,MAGtD,sBACA,yBACA,uBACA,KACA,gCAIA,yCACA,oCACA,GACA,gHCpDA,SA4BA,IACA,mBAIA,eACA,OAEA,aAQA,uBAQA,wBAOA,4BAOA,2DACA,kCAOA,8DAOA,+DASA,8BASA,+BACA,iBACA,8BACA,mCACA,mBAEA,eAGA,wBAIA,iDACA,YACA,CAMA,oDACA,KAEA,kBACA,CAKA,iCACA,MACA,aACA,KAEA,iBACA,CAKA,0CACA,MACA,oBACA,sBAMA,+BACA,MAGA,eACA,MACA,kBACA,oBACA,sBAGA,iCAEA,sBAGA,2BACA,QACA,EAKA,OAEA,sCAEA,eACA,MAKA,QACA,mBACA,YAQA,kBACA,qBAEA,wBAEA,sBAEA,YACA,CAUA,mBACA,sBAEA,uBACA,IAEA,YACA,iCAGA,GACA,CACA,MAmBA,wCCjPA,QAgBA,KACA,mBAKA,eACA,OAGA,kEACA,eAUA,aACA,qBACA,aAEA,+BAEA,WACA,0EAGA,gBAGA,oBACA,uBAEA,WACA,EAQA,gBACA,oDACA,WACA,sCC8iBA,iBACA,YACA,oBAEA,qCAEA,4DAGA,mCACA,QAEA,mEACA,oBACA,+BAGA,8CAEA,WAAgB,gBAEhB,WACA,WAEA,CACA,kCAEA,kBACA,6CAEA,OAEA,EACA,CAIA,CACA,oBACA,yBAEA,yCAIA,8BAGA,sBAEA,eAGA,GAGA,gCACA,6BAEA,6BACA,wDACA,4DACA,8BAGA,8BAEA,cACA,EAIA,CACA,eACA,iDACA,WAEA,kBACA,+BAEA,qBAEA,IACA,EAYA,CACA,eACA,iCACA,2CACA,oBACA,wBACA,kBACA,oBACA,qBAEA,wDACA,0CAEA,gCACA,CAGA,sBADA,kBAEA,WACA,WACA,GACA,gCACA,UAEA,UAEA,GAEA,QAEA,KACA,SAGA,YACA,EAEA,OACA,KAGA,CACA,eACA,sDACA,yCAGA,IACA,IAKA,CACA,oBACA,YAGA,UAKA,WAAgD,gCAEhD,iFAGA,wBACA,0CACA,IAEA,WAEA,uBAMA,6DAEA,2CAIA,yCACA,yBAEA,IAMA,qCAKA,kBAOA,aACA,EACA,EAAG,+CAGH,UACA,wBAGA,wCAGA,kCAEA,aACA,0BACA,0CACA,mBAEA,sBACA,mBACA,GAGA,SACA,kCACA,GAGA,CACA,uBAKA,cACA,CACA,cACA,iBACA,2BAIA,oCAEA,QAEA,QAiBA,MACE,gBAkBF,+BACA,0BACA,GAAE,KAmBF,0BACA,4BACA,GAIA,qBACA,mCACA,0CAEA,YACA,kCAGA,IAEA,CACA,eACA,wBACA,iCAEA,qBAEA,kEACA,OAEA,8BACA,OAIA,SACA,mFAh6BA,kBACA,kBACA,yBACA,oCAKA,yCACA,2BACA,sCAEA,kCACA,gBAEA,mBACA,QAaA,MACA,kBACA,sBACA,wBAGA,0CAIA,0CACA,wCAIA,eACA,qDACA,sBAGA,YACA,kCACA,GAUA,MACA,kBACA,qBAIA,+CACA,4EAIA,uCACA,wCAGA,iBACA,aACA,gCACA,eAEA,WACA,qBAIA,+EAIA,QACA,mEAEA,MAUA,MACA,kBACA,sBACA,0BAGA,0CAIA,0CACA,wCAGA,iBACA,aACA,gCACA,eAGA,OAEA,WACA,yBAGA,cACA,WAIA,4DAGA,8BACA,GA0BA,MACA,kBACA,4BACA,yCAEA,YAgDA,mCACA,8CAEA,IAMA,iCACA,6BAGA,0BACA,gCACA,aACA,GAEA,uBAIA,uBACA,YAAmB,QAAkB,YACrC,aACA,+BACA,cAGA,SACA,gBAIA,4BACA,OAEA,QACA,CAGA,oBACA,UACA,CACA,CAyBA,MACA,kBACA,2BACA,qCACA,sBACA,iBAKA,eACA,GACA,CAcA,MACA,kBACA,sBAAuC,CAAa,UAEpD,kBAGA,uCAEA,gDACA,kCACA,+BAGA,uBAGA,MAGA,iBAKA,wCAEA,8BAIA,kBACA,yCAIA,kDAEA,GAEA,GACA,mBAEA,eACA,EACA,CAWA,MACA,eACA,mBAAoC,CAAa,UAEjD,6BAEA,4BACA,UACA,UAGA,QACA,CASA,MACA,eACA,mBAAoC,CAAa,UACjD,IACA,uBAGA,4BAEA,kBACA,OAEA,mBACA,4BACA,UAGA,eAEA,SACA,oCAIA,kEACA,wCAEI,0BAEJ,SAGA,OAEA,KACA,CAUA,MACA,aACA,yBAEA,kCACA,iCACA,sDACA,kBACA,+BAGA,kBACA,iDACA,mBAEA,iBACA,KAAI,4CACJ,mBAEA,aACA,KAEA,CACA,CAUA,EApfA,IAqfA,aACA,WACA,kBACA,YAEA,uCAEA,eAGA,8BAEA,4CACA,GAAG,KAKH,8BACA,mCAGA,8DACA,GAEA,GACA,MAAE,yFAGF,4BAIA,WACA,OAEA,wCACA,8BAEA,UAGA,kEAEA,MACA,MACA,CAkBA,EArhBA,IAshBA,WACA,oBACA,IAGA,kCAEA,6BACG,YAGH,gCAEA,6BAIA,uBAEA,0BAIA,qBAEA,wBACG,wEACH,aAGA,6BACA,oDACA,OAEA,+BAIA,gBACA,GAAG,KAGH,iCAEA,0BAIA,qBAEA,wBAEA,IACA,CAGA,gCC/dA,eAEA,WAGA,SACA,EAMA,mDAJA,mBAOA,MACA,0CAEA,QAGA,CACA,eACA,6BAIA,4FACA,6CAEA,gBAGA,uBACA,kBAEA,OACA,cApLA,QAgBA,IACA,mBAQA,iBACA,OASA,kCAEA,6CACA,MACA,cACA,EAKA,aACA,qBACA,aACA,qCAEA,0CACA,oBAGA,eAGA,2EACA,kBAEA,OAOA,YACA,uBAGA,0BACA,uCAIA,UAIA,eAIA,uCAEA,EAIA,CACA,uBAGA,uBACA,OAEA,EACA,EAKA,gBAEA,iDAGA,kCACA,YAGA,6BAGA,wBACA,2BAEA,oBAEA,kEACA,8BAKA,iCAGA,MACA,eAGA,CACA,QAGA,CACA,QACA,MAGA,4FC9IA,QAyBA,IACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,WAKA,OAEA,qBACA,sDACA,uDAIA,yDACA,qBACA,yCAEA,sDACA,8BAEA,iBACA,mBAEA,OAKA,2DACA,IAEA,4BACA,SACI,mCACJ,iBAGA,iBACA,kCAEA,KACA,gCAEA,KACA,mBAEA,OACA,CACA,EAUA,kBACA,cACA,wBAEA,oCACA,iBAEA,gBACA,OACA,OACA,EAIA,qDAGA,qDAEA,IACA,CACA,EACA,sCC+IA,iBAEA,2BAEA,WACA,4CAcA,gCAIA,yDACA,oBACA,6BAIA,qCAEA,yBAGA,2BAGA,+BA3SA,OAiBA,IACA,mBAOA,iBACA,OAQA,sCAQA,oBAGA,uDACA,MACA,oBACA,cACA,EAKA,eAEA,iDAEA,kFACA,IAUA,YAAyB,KACzB,qBACA,kCAGA,iCAGA,2BACA,oBAIA,aAEA,qBACA,YACA,2BAkDA,+DAGA,wBAGA,YAEA,MAKA,aAKA,SAAoB,kBAGpB,QACA,WAEA,KAEA,sBACA,uCAEA,OAmBA,OAGA,IAEA,wCACA,8CACA,qBAKA,qBAGA,SAGA,UACA,EAMA,gBACA,aAGA,8BACK,gBAGL,uEAIA,mCAGA,6EANK,WAOL,EAKA,gBAEA,SACA,MAGA,sCACA,iCAEA,oBAEA,6BAKA,WACA,MACA,WACA,qDAEA,IACA,MASkB,mBCrQlB,aAuCA,YAEA,sDAEA,sDACA,aA3BA,IACA,mBAQA,iBACA,cAKA,wBACA,CACA,MAIyB,gDCtCzB,OAiBA,IACA,mBAMA,eACA,OAUA,YAGA,uDACA,MACA,oBACA,cACA,EAaA,YAAyB,KACzB,qBAEA,8BACA,oBACA,qCAEA,gCACA,QACA,yBAGA,YACA,EAKA,eACA,iDAEA,0CACA,YAKA,gBACA,iDAEA,kEACA,MACA,oCAEA,IACA,+IC1FA,SA+BA,IACA,mBACA,sBACA,OACA,CACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IAEA,IACA,uECjDA,SA4BA,KACA,mBACA,sBACA,oBACA,IACA,qDCjCA,SAiBA,KACA,mBAIA,wBACA,OACA,eAEA,OACA,cACA,mBAEA,mBAEA,8CACA,8CAEA,6CACA,2DAA8E,QAC9E,SACA,gBACA,EACA,8DCxCA,SAmBA,KACA,mBAQA,iBACA,OASA,kBASA,+CACA,mBAUA,YAAyB,KACzB,qBACA,uBAEA,0BACA,cAEA,yCAGA,gBACA,iCAAgD,iCAIhD,SACA,YAGA,aAEA,wDACA,QACA,iBAAuB,yCAEvB,aAEA,wCAAiE,CACjE,8BAEA,yCAEA,yBACA,QACA,EACA,sDC7FA,SAiBA,IACA,mBACA,eACA,OAEA,yBACA,MAEA,wBACA,mBACA,iBACI,mCACJ,sBACA,kBAEA,gBAGA,iCAEA,0CACA,GACA,EAKA,WACA,MAYA,gCCiOA,aAEA,WAIA,sBACA,QAGA,CACA,eACA,sCACA,gBAEA,SAEA,0DA3SA,QAsBA,KACA,mBAIA,wBACA,OACA,cAKA,OACA,cACA,mBACA,kDAIA,2BAEA,oCACA,yBACA,OAAG,EAAG,UAEN,gDACA,yBACA,EACA,EAkBA,oBACA,qBAEA,2BAIA,gBAEA,4BACA,8CACA,MAEA,KACA,SASA,sBACA,6BACA,EACA,MAMA,EACA,OAMA,eAOA,aAQA,2BACA,OASA,YACA,aAEA,8BACA,iCAEA,EAEA,yBACA,IACA,eAYA,2CAEA,mCAEA,kBAGA,SAEA,OAGA,eAAkB,MAAuB,WACzC,WAEA,GACA,yBACA,IAEA,EAGA,OAEA,IAEA,YAA8B,KAAmB,EAEjD,IACA,gBAIA,IACA,gBAKA,UAEA,KACA,yCAIA,yCACA,yCACA,sCACA,gBAEA,+BACA,MACA,QACA,cAEA,GAEA,4BACA,IAKA,oBAKA,2FACA,kBAGA,kBAIA,uBAGA,2BAIA,+BACA,6CACA,iBAEA,iCAKA,0BACA,mBAEA,OACA,EAEA,QACA,UACA,oBACA,uBACA,sBACA,aACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GAGA,KACA,UAAqB,IAAa,OAClC,WAQa,yCCzRb,QAgBA,KACA,mBAQA,iBACA,OASA,mCACA,EAKA,UACA,OAEA,uBACA,uBACA,IAOA,aACA,aACA,OAeA,YAAyB,KACzB,qBACA,mBACA,OACA,8BACA,oBAEA,iCACA,WAEA,yBAEA,OACA,6BAGA,yCAEA,GACA,8CACI,IAEJ,kEAGA,iBAEA,4BACA,EACA,EACA,qDCpGA,SAiBA,KACA,mBACA,sBACA,YACA,IAKA,wBACA,OACA,eACA,8CC7BA,IAoBA,IACA,SAA0C,uBAA+B,YACzE,kCAAgD,CAAU,aAC1D,aACA,KAEA,GACA,qBC3BA,qBAkBA,GA0EA,IAzEA,KAOA,eAOA,aAQA,sBACA,IAWA,SACA,yBAOA,YACA,uFAAwF,CAIxF,gCACA,EAQA,UACA,8BAEA,OAOA,WACA,oFAAqF,CAIrF,8BACA,OACA,0DC5FA,KAoBA,IACA,aACA,iBACA,0EAEA,mBAEA,sBACA,0CC5BA,OAgBA,GACA,mBAIA,eACA,OAEA,gBAQA,sBAQA,mCAEA,yCACA,KAEA,iBACA,OACA,CACA,WACA,sCAIA,8CAEA,UACA,4DCxDA,QAkBA,IACA,mBAIA,mBACA,OAKA,yBACA,YACA,CAYA,iDAQA,iBASA,WAQA,kCAQA,wBAEA,2BACA,KAEA,iBACA,CAKA,gCACA,CACA,EAKA,qDAGA,oCA6BA,SAKA,OAEA,+BAGA,oCAEA,wBACA,MACA,yBACA,aACA,UAEA,IAGA,gDACA,MACA,cACA,UAEA,IAGA,2CACA,MACA,QAEA,GAGA,mCACA,6BAEA,SACA,MAKA,QACA,iBACA,OACA,sCC7FA,aAGA,gCAAuD,CAAuB,YAE9E,kCACA,OAEA,UACA,6BA1FA,KAsBA,IACA,aACA,oBAEA,wBAEA,6CACA,iBAGA,uCAEA,GACA,CAGA,kCAEA,4BAEA,iCACA,CACA,IAEA,mBAEA,SAGA,sBACA,GACA,SAIA,uCACA,GACA,WACA,QAEA,IAIA,qCACA,GACA,WACA,YAEA,IAEA,GACA,CAMgE,wCChFhE,OAgBA,GACA,mBAQA,iBACA,OAEA,gBAEA,aACA,sCAGA,yBACA,KACA,iBACA,OACA,sCACA,cAEA,+DAUA,eAQA,0BAQA,qCAQA,CAQA,OACA,aACA,yCAEA,2CAGA,cACA,MAKA,UACA,aACA,2CAGA,uBACA,SACA,8CCvGA,SAgBA,GACA,mBASA,iBACA,SAEA,gBACA,oBAQA,kBAEA,+BAKA,YACA,MACA,4BACA,YAPA,kCACA,GAEA,SAOA,+BACA,uDCpDA,QAkBA,GACA,mBAMA,eACA,OAEA,gBACA,QAQA,wBAQA,wBASA,oBASA,kCAEA,yCACA,KAEA,iBACA,CAKA,yDACA,kBACA,aACA,uBAAiD,2BAGjD,aACA,CACA,KACA,kBACA,IAAoC,2BACpC,SAEA,4BAEA,GAGA,sBACA,KACA,iBACA,OACA,mCAEA,8BAEA,KACA,KACA,iBACA,OACA,uBAEA,8BAIA,QACA,8CC/GA,OAkBA,GACA,mBAMA,eACA,OASA,kBAQA,kBAKA,OACA,gBACA,wBACA,wCACA,OAKA,UACA,sCAEA,eACA,SAOA,wBACA,+CACA,KACA,iBACA,CAMA,qEACG,OAEH,mCACA,EACA,8CCnFA,OAkBA,GACA,mBAIA,cACA,CAEA,qBAQA,sBAUA,8BAEA,mCACA,KACA,SACA,wCACA,OACA,uBAMA,gDACA,gBACA,sCACA,iBAEA,WACA,6DAEA,GACA,EACA,8CCnEA,OAgBA,GACA,mBAIA,eACA,OAQA,YAQA,iBAEA,oBAEA,mCACA,KACA,mBACA,CAGA,4BAEA,iBACA,CACA,WAIA,WACA,8CCzDA,OAgBA,GACA,mBAIA,cACA,CASA,6BAEA,gBAEA,mCACA,KAEA,gBACA,OACA,CACA,qBACA,yBAEA,oCACA,uBAGA,sBACA,CACA,WAIA,cACA,YAqCA,aAKA,QACA,cACA,OACA,oECpGA,SAmBA,IACA,mBAIA,cACA,CAQA,wBAQA,wCAQA,wBASA,+BACA,iBACA,wBACA,mCACA,mBAEA,eAGA,oBAIA,qCACA,KAEA,gBACA,CAMA,4CAGA,mCACA,yBACA,QAEA,iCACA,4BACA,QACA,EAKA,OAEA,sCAEA,eACA,MAKA,QACA,mBACA,YAKA,YACA,mBACA,WACA,sDCpHA,OAiBA,IACA,OAOA,iBAEA,CACA,iBAIA,GACA,YAEA,EACA,QAEA,+BCtCA,aAqBA,IACA,SACA,CACA,SACA,yBACA,qBACC,WAGD,SAGA,gCACA,8BACA,cACA,QAEA,IAGA,iCACA,gBACA,cACA,QAEA,IACA,yDC/CA,SAYA,KAEA,iBAMA,MACA,mBAIA,eACA,OAEA,gBAUA,sBASA,wBAaA,yCAYA,+BAUA,2BAWA,eAiBA,qDACA,YACA,OAEA,iBACA,kDAEA,yCACA,4BACA,oEACA,IAEA,4CACA,gCACA,IAEA,mBAYA,oDACA,KACA,iBACA,CAGA,wCACA,wCACA,oCACA,sCACA,IAGG,OACH,QAKA,OACA,OAEA,0EAGA,+CACA,MACA,wBAGA,4CACA,MACA,wBACA,EAKA,UACA,iCACA,0BACA,QACA,EAQA,yBACA,+CACA,yDAGA,2CAEA,UAKA,uDAIA,YACA,4DACA,6EAIA,gBACA,0CAEA,KACA,8CCtNA,OAgBA,GACA,mBAIA,eACA,OAEA,yBACA,KACA,kBACA,CAKA,kCACA,8CCjCA,SAsBA,KACA,mBASA,aACA,qBAIA,8CACA,8CACA,gCAMA,2EACA,mCACA,MAEA,oEACA,gBACA,MAEA,QACA,cASA,SACA,qBAGA,aACA,iCAEA,oBACA,UAIA,yBAKA,oCAGA,gBAKA,gDACA,8BACA,8BAKA,wBAEA,iBAGA,mBAGA,kBACA,4BAEA,EACA,CACA,CACA,iFC7GA,kBAgIA,GACA,mBAIA,sBACA,QACA,IAKA,wBACA,OACA,WAKA,OACA,cACA,WAEA,8CACA,+CAEA,6BACA,kCACA,wCACA,OAWA,oBACA,cACA,wBAEA,oCACA,iBAEA,gBACA,OACA,OACA,EACA,YAGA,sCAEA,qDAEA,IACA,CACA,EACA,8CC7LA,SAsBA,KACA,mBAUA,mBAEA,mEAEA,kCAIA,2CACA,sBAEA,wDACA,8EAEA,8BACA,EAEA,QACA,cAUA,gCACA,WAAkB,gBAAwB,OAC1C,yCACA,QAIA,SACA,KASA,SACA,qBAGA,aACA,iCAEA,aACA,mBACA,UAIA,yBAIA,WACA,6BAKA,oBAIA,MACA,SAIA,WACA,aAEA,kBACA,YAIA,oBAKA,kCAIA,6CAKA,aACA,oFAIA,wBAEA,WACA,kBAGA,YACA,mBAGA,0DACA,EAGA,gBAEA,iBAGA,mBAGA,kBACA,4BAEA,EAGA,eAKA,eACA,mBAIA,yBACA,sBAEA,GAEA,OACA,EACA,MAMA,+CC5LA,SAoBA,KACA,mBAIA,eACA,OAwBA,0BACA,QAKA,OAEA,gCACA,uCAGA,6CACA,mDAEA,qEAEA,6BAGA,8DAEA,8BACK,0CAGL,gCACA,qBAKA,sCACA,GAAG,EAAG,UAEN,8DACA,4BACA,EACA,EACA,yBCzFA,qBAaA,IA2MA,IA1MA,KAOA,iBAOA,MAGA,WACA,eAIA,GACA,wCAEA,EAuCA,SACA,kCACA,EAaA,YAGA,kCACA,KAcA,OACA,yCACA,EAYA,yBAEA,aACA,GAMA,wCAJA,mBAOA,SAGA,kBAEA,cACA,QAIA,WAIA,mBAEA,eACA,QAGA,WAGA,oCAMA,YAIA,gCACA,GAUA,oBAEA,iBAGA,SAGA,qBACA,oBACA,GACA,KACA,KAGA,KACA,EAGA,YACA,SAUA,0BACA,6BACA,4BACA,EACA,EACA,kBCxNA,aA+BA,IACA,aACA,aA2CA,CACA,WACA,KAEA,KAEA,cACA,mBACA,CACA,MAnDA,YACA,EAEA,wBACA,CACA,YAEA,IACG,KACH,eACA,0BAEA,KAEA,MACA,MACA,eACA,YAIA,MAEA,OACA,YAEA,WAEA,MACA,MACA,eACA,UAIA,GAEA,GAEA,IAEA,yCC3EA,KAiBA,IACA,aACA,kBACA,cAEA,SAGA,qBACA,IAGA,yBACA,mBC9BA,aAgBA,IACA,WACA,oBACA,uBAGA,QACA,iDCvBA,IAgBA,IACA,WACA,0CACA,IACA,wDAGA,OACA,aAEA,OACA,sBC3BA,aAcA,IACA,WACA,OAEA,SACA,qBACA,gBAGA,UACA,mBCxBA,aAeA,IACA,eACA,mCACA,sBClBA,aAcA,IACA,WACA,OACA,oFC0HA,iBACA,MAAQ,cAAkB,YAE1B,+BACA,GAYmB,CACnB,qBACA,OACA,IACA,EACA,EAGA,YAEA,6BACA,aA+CA,GACA,IACA,IACA,IACA,CAIA,kBAtDA,MACA,GAEA,KACA,OAEA,2BAEA,KAGA,wBAEA,GAEA,CACA,8BAIA,SACA,6BAIA,QACA,IACA,GAIA,QACA,IACA,GAKA,YACA,EACI,YACJ,GAIA,QAUA,CAEA,WACA,IAOoB,CACpB,WAAsC,QAAY,OAClD,MAAQ,WAAmB,eAE3B,aACA,QACA,QAEA,EAkDA,0BAlSA,KA4EA,IACA,SAAqC,0CAAqD,iBAC1F,oBACA,yBACA,aAEA,MACA,GAGA,UACA,iBACE,OACF,oBACA,YAEA,kBACA,gBAGA,aACA,EAEA,IAAM,QAAY,SAElB,QACA,mBACA,kCAMA,QACA,UAOA,SACA,gBAOA,wCACA,iCACA,GAEA,OAAS,cACT,OAQmB,gDC1InB,SAWA,KAEA,KAMA,oDACA,OAqBA,eACA,wBACA,UAGA,kDA2CA,GAOA,QACA,cACA,KASA,YACA,iBACA,oBACA,yBACA,iBAEA,EACA,IASA,YACA,kBACA,cACA,aACA,eAEA,EACA,IAQA,mBACA,SACA,yBACA,iCACA,qCACA,kCAGA,gCACA,yBAEA,eACA,WAEA,WAEA,EAQA,uBACA,8BAEA,SACA,KAEA,UAEA,CAOA,UACA,wBACA,MAOA,yBACA,MAAS,cAA0B,mBAEnC,oBACA,KACA,QACA,SACA,OACA,QACA,SAEA,GACA,uBCtMA,aAaA,IACA,WACA,WAEA,WACA,iBAEA,mBCpBA,aAgBA,IACA,aACA,aACA,+BAGA,eACA,kBCXA,aA4CA,IA3CA,KACA,cAOA,MACA,oBAUA,aACA,6BAAgC,WAEhC,+BAEA,OACA,iCAEA,YAKA,UACA,iCAAqC,WAAsB,gBAC3D,iBAEA,GACA,KAEA,QAEA,QACA,oBACA,kBC/CA,aAEA,4BAOA,gBAOA,KAWA,WACA,QACA,0BAVA,QAOA,mBCnCA,qBAcA,KA+CA,IA9CA,KAKA,iBAOA,aAQA,YAQA,OASA,sBAOA,oBACA,MACA,iDCzDA,mBAEA,gDCOA,aACA,QACA,eAEA,WACA,eACA,SACA,mBACA,GACA,CAEA,6CAZA,KAaA,sBACA,0BACA,oBACA,oBACA,gBAEA,wDC3BA,mBAEA,uDCHA,UAEA,4DCDA,mBAEA,gCCCA,iBACA,aAEA,qBACA,IACA,CAEA,iBCPA,iBACA,aACA,cACA,GACA,CAEA,iBCLA,iBACA,aACA,YACA,MAEA,WACA,mBAIA,YACA,EAEA,iBCZA,iBACA,aACA,YACA,MAEA,WACA,eACA,GAGA,SACA,QAEA,iDCXA,QACA,aACA,kCACA,EAEA,wCCPA,SACA,aACA,YACA,MAEA,eAEA,OACA,QAJA,4BAMA,UACA,EAEA,iBCdA,iBACA,eACA,YACA,IACA,sBAEA,GACA,sBAGA,IACA,CAEA,wCClBA,aASA,WACA,WACA,sBACA,KAEA,gDCLA,SACA,iBACA,SAEA,sBACA,GACA,iBAEA,gCACA,GACA,SAEA,oBACA,KACA,UAEA,QACA,EAEA,gDClBA,QACA,eACA,SACA,qCACA,GAEA,iBCZA,iBACA,aACA,oBACA,EAEA,iBCHA,iBACA,iBACA,aACA,MAEA,WACA,aACA,SAGA,UACA,CAEA,qGCZA,OAIA,uBACA,mBAGA,2BAGA,cAgBA,mBACA,qBACA,gBACA,cACA,KACA,IAEA,EACA,eACA,YAEA,GACA,eACA,YAEA,yBACA,qBACA,QAEA,SACA,kBACA,kBACA,sBACA,wBAEA,UAjDA,GAkDA,mBACA,6BAEA,uBACA,mBACA,gBAEA,kBACA,gBACA,EACA,CACA,SAGA,aACA,yBACA,GAEA,iDC7EA,SAaA,iBACA,SACA,SACA,KAEA,KACA,eAEA,eACA,QACA,SACA,WACA,cACA,YAEA,IAEA,QACA,aACA,KACA,WACA,OACA,OAEA,aACA,IAIA,UACA,QACA,oBAEA,MACA,2BA9CA,EAWA,EAoCA,IAEA,EAEA,QACA,2BAdA,IAEK,QAaL,CACA,QAEA,iBC7DA,aACA,aASA,SACA,WACA,iBACA,GAEA,gCCGA,aACA,oBAEA,MACA,kBACA,UAEA,SACA,EAGA,kBAzBA,cAGA,oBACA,qBASA,2BAY4D,iBAC5D,0BACA,mBACA,GAGA,iECzBA,SACA,WACA,gBACA,4BACA,yBAEA,eACA,4BACA,EACA,CAEA,6FCZA,QAWA,aACA,8BACA,wBAEA,cACA,kBACA,0BACA,aACA,uBAlBA,CAmBA,CAVA,EAWA,CAEA,wCCvBA,QACA,aACA,SACA,UAGA,kBACA,kBACA,SAEA,wCCXA,SACA,WACA,mBACA,mBACA,EACA,CAEA,gFCCA,QACA,iBACA,8BAEA,cACA,MACA,SAGA,oBACA,iBACA,gBACA,OACA,UANA,EAOA,SACA,aACA,UACA,eACA,qBACA,UAEA,EACA,cACA,EACA,KACA,EACA,OACA,EAEA,wCCnCA,QACA,aACA,8BACA,YACA,GACA,EAEA,iDCbA,cAIA,uBASA,oBACA,WAEA,IACA,yBAEA,eACA,sBAEA,WACA,0BApBA,QAqBA,CAEA,iBCxBA,iBACA,WACA,+BACA,IAEA,iBCJA,iBACA,aACA,IACA,WAEA,kCACA,sBACA,GACA,CAEA,wCCRA,SACA,aACA,8BACA,iDACA,WAEA,0DCHA,SACA,eACA,oCACA,+BACA,YAEA,iBClBA,aACA,MAQA,WACA,WACA,yCACA,yBACA,UACA,CAEA,0DCJA,QACA,eACA,oCACA,+BACA,YAEA,wCCfA,eACA,uBAQA,mBACA,WACA,wBACA,MAEA,wCCRA,SACA,aACA,8BACA,iDACA,OAEA,wCCNA,QACA,aACA,UACA,OACA,aACA,eACA,aAEA,KACA,aACA,eACA,aAEA,oBACA,iBACA,SACA,OACA,IACA,QAEA,oBACA,iBACA,SACA,OACA,IACA,SAEA,CACA,OACA,EAEA,iDC9BA,SACA,aACA,+BACA,EAEA,gDCNA,OACA,WACA,8BACA,QACA,MACA,iBACA,kBAEA,4BACA,0BAGA,gCACA,kBACA,IAEA,YACA,UACA,SACA,GACA,WAEA,EACA,OACA,EACA,EAEA,0DC/BA,4CASA,aACA,gBACA,EAEA,6ECZA,SAUA,WACA,mBACA,gBACA,SACA,IAbA,wBAeA,GACA,GARA,wBAUA,gBACA,GACA,CAEA,4ECtBA,cAmBA,uBAmBA,mBACA,uBACA,QACA,GACA,IAxBA,uCAyBA,4BACA,WAEA,aACA,WAEA,OACA,IAnCA,8CAoCA,iCAKA,IACA,IApDA,mBAwDA,IAvDA,2BAyDA,EACA,IAzDA,qDA2DA,QAEA,IA3DA,mCA6DA,QACA,IA7DA,kBAiEA,IA/DA,8BAiEA,GACA,IAtEA,qBAwEA,IACA,IAtEA,qBAuEA,EA9EA,WAgFA,sBACA,EAGA,qBACA,SACA,MAEA,GACA,GA5FA,UA+FA,4BAEA,IACA,IArFA,qBAsFA,2BAGA,IACA,QAEA,iDC7GA,QAgBA,qBACA,OACA,EAHA,aAIA,OACA,kBACA,OAEA,iBACA,EAEA,mBACA,IACA,YACA,2BACA,GAIA,qBACA,MACA,YAEA,KACA,cAEA,aACA,SACA,KACA,WACA,OAEA,MACA,QACA,cACA,eAGA,MACA,8BACA,KACA,EACA,CACA,KACA,KACA,OACA,iBACA,UACA,SACA,gBAGA,eACA,qCACA,wCACA,sCACA,MAEA,KACA,oBACA,GACA,CAEA,0DCxEA,QACA,WACA,uBACA,IAEA,wCCFA,gBAEA,+DCNA,SACA,WACA,oBACA,OAEA,OACA,2BAEA,UACA,EAEA,kGCHA,QACA,eACA,8BAEA,cAEA,MAEA,OAHA,QAIA,iBACA,sBAGA,UAEA,MACA,QAEA,oBACA,qCACA,wCACA,GAEA,wCChCA,QACA,UACA,4BACA,QAEA,iBCJA,iBACA,WACA,0CACA,EAEA,wCCXA,aAMA,cAUA,mBACA,WACA,YACA,gBACA,SACA,cAlBA,mCAmBA,CACA,sBACA,SAEA,wCC1BA,aAGA,cAUA,mBACA,WACA,YACA,2CACA,EAEA,wCCnBA,QAYA,aACA,YACA,qCAHA,4BAIA,EACA,IAEA,iBCrBA,aACA,aAGA,cAQA,mBACA,WACA,SACA,uBAGA,6CACA,qBACA,gBAEA,OACA,CAEA,8FChBA,SAkCA,iBACA,SACA,kBAEA,KA5BA,gCAgCA,OAzCA,wBACA,uBA2CA,OAlCA,+BAuCA,OAtCA,6BACA,6BACA,0BACA,2BACA,2BACA,2BACA,kCACA,4BAcA,kCAoBA,OAlDA,4BAsDA,OArDA,uBAGA,wBAqDA,OAvDA,2BA0DA,OAzDA,4BA4DA,OAzDA,2BA2DA,SAEA,0DCrEA,QACA,WACA,kDACA,wBAEA,GAEA,iDCRA,QACA,WACA,8BACA,EAEA,iBCRA,iBACA,WACA,aACA,gDACA,aACA,gBACA,QAEA,iBCRA,iBACA,WACA,QAGA,MAFA,gBAGA,eAEA,aACA,EAEA,iBCXA,iBACA,UACA,MACA,WAEA,wCCRA,YAGA,cAUA,WACA,WACA,YACA,sBAEA,MACA,IAEA,wBACA,EAMA,UALA,IAEA,iBAEA,KAGA,wCCvBA,QACA,WACA,YACA,sBAEA,0BACA,EAEA,wCCRA,QACA,WACA,QACA,2BAEA,wCCJA,QACA,aACA,YACA,sBAEA,SACA,eAEA,YAEA,EACA,IAEA,yDCdA,SACA,UACA,eACA,SACA,kBACA,eAEA,KAEA,wCCTA,QACA,WACA,mCACA,EAEA,wCCLA,QACA,WACA,6BACA,EAEA,wCCLA,QACA,WACA,6BACA,EAEA,wCCJA,QACA,aACA,+BACA,GACA,IAEA,iDCPA,QACA,aACA,+CACA,GAEA,iBCdA,iBAYA,WACA,0BACA,EAHA,6BAIA,IAEA,iBCVA,iBACA,WACA,0BACA,EAEA,iBCPA,iBACA,WACA,QACA,YAEA,kCACA,WACA,EACA,GACA,CAEA,wCCTA,QACA,UACA,kBACA,IAEA,iBCLA,iBACA,WACA,gCACA,EAEA,iBCLA,iBACA,WACA,0BACA,EAEA,iBCLA,iBACA,WACA,0BACA,EAEA,gDCTA,SAYA,aACA,YACA,6CACA,QAJA,gCAMA,mBACA,GACA,IAEA,iDCrBA,OAGA,wEASA,iCACA,IACA,oDACA,+BACA,EACA,GACA,CAEA,8oBCwCA,SAGA,8DACA,2EACA,+DACA,oEACA,8EACA,sDACA,kEACA,uFACA,0FACA,uEACA,gEACA,2DACA,qEACA,0rBCf6B,mFCzD7B,cAGA,cAGA,0BAAgE,iBAiChE,mCACA,6BACA,GAGA,mCAFA,eAGA,kBAEA,GAEA,+CC5BA,SACA,aACA,yBACA,EAEA,iBClBA,iBACA,WACA,kBACA,OACA,EACA,CAEA,iDCKA,SACA,aACA,8BACA,IAEA,8DC7BA,IAMA,mEACA,SAIA,oCACA,SAIA,0BACA,EAIA,iBAmBA,6BACA,oBACA,EAEA,uFC5BA,QACA,WACA,mDACA,EAEA,wCCKA,SACA,aACA,mBACA,EAEA,gDC/BA,SA4BA,EAXA,2BACA,yBAWA,EAVA,wBACA,uBAUA,EATA,yBACA,uBASA,EARA,gCACA,wBAQA,EALA,2BAMA,EAhCA,wBACA,kBAgCA,EAnBA,0BAZA,oBAgCA,EAnBA,uBAZA,iBAgCA,EA/BA,oBACA,qBA+BA,EA9BA,kBACA,mBA8BA,EA7BA,qBACA,mBA6BA,EA5BA,kBACA,mBA8BA,EA5BA,uBA6BA,aAOA,cAmBA,aACA,WACA,iBACA,mCACA,GAEA,kECzEA,aAGA,cAwBA,mBACA,WACA,YACA,aACA,cACA,OACA,kBACA,KAEA,UAEA,aACA,OACA,KALA,4BAMA,qCACA,YAGA,SACA,EAEA,gCCLA,eACA,6BACA,yCAEA,mBACA,OACA,gCACA,OAEA,eACA,gBAEA,sBACA,0BACA,GACA,CACA,8BACA,KACA,CAEA,SAlEA,OA6CA,sBAsBA,QAEA,yBC1DA,iBACA,UAEA,CAEA,iBCHA,aACA,WAEA,0ECOA,QACA,WACA,mDACA,EAEA,iDC3BA,QA2CA,eACA,IACA,MAEA,QACA,8BAEA,WARA,uCASA,iCACA,gCAEA,gBACA,SACA,UACA,WAEA,GAEA,wCC9DA,SAyBA,MACA,WACA,KACA,iBAEA,gBACA,iBACA,cACA,QACA,yBACA,gBACA,CAEA,iDCrCA,QA6BA,WACA,iCAFA,YAGA,CAEA,iDCVA,eAEA,iDCPA,SACA,WACA,4BACA,EAEA,mBC3BA,qBAaA,KAsDA,IArDA,KAMA,eAOA,cAqBA,+BACA,EAOA,QACA,0BAEA,SACA,mCACA,wBACA,CAGA,IACA,CACA,kBCnEA,aAaA,IACA,aACA,cACA,KAGA,kCACA,wBACA,6BAEA,YACA,EAEA,QAEA,CACA,yBCVA,aACA,QAQA,OACA,OACA,mBAIA,gBAFA,MAIA,EACA,YACA,gBACA,MACA,YAGA,2BC1BA,iBACA,UACA,oBACA,GACA,SACA,CAEA,8BC8BA,eACA,CACA,WACA,WAEA,EASA,CA7DA,IAsCA,aACA,YACA,QAIA,qCADA,GAGA,EA5CA,GAmCA,oCCsNA,aACA,eACA,mBACA,kBACA,gBACA,SAKY,CACZ,aACA,8BACA,SAKa,CACb,aACA,SACA,oCACA,MAGA,aACA,MAEA,CACA,iFA/RA,mBA6BA,GACA,mBAIA,wBACA,OACA,eAKA,OACA,6BAEA,QAIA,6DAEA,eACA,oBAGA,eAGA,kBAEA,iCAIA,kBAAiC,gBACjC,gBACA,OACA,EAAG,EAAG,UAGN,sBACA,8DAGA,4DAAsF,UACtF,QASA,kBACA,cACA,mBACA,aAGA,YACA,GAIA,oBACA,sBAEA,MACA,GAIA,SAGA,mBACA,aAIA,gDAEA,iCACA,+BACA,EACA,EASA,gBACA,WACA,kDAIA,qCACA,gCACA,QACA,mBAEA,OASA,iBACA,qBACA,aAGA,gBACA,YAGA,qDAEA,MACA,EAcA,4BAZA,kBAEA,oBACA,WACA,iBACA,EAEA,+BACA,EAEA,KAUA,oBACA,qBACA,aACA,WACA,cAGA,iDACA,iCACA,8DAEA,YAOA,MANA,yBACA,cACA,GAGA,KAKA,OACA,YAGA,qDAEA,+CACA,MAMA,4BALA,+BACA,EAEA,KAUA,4BACA,wDACA,IAWA,oCACA,qBACA,aACA,WACA,wBAIA,+BACA,uBAA0C,uBAC1C,kDAEA,mDACA,MAGA,EACA,IACA,MAKa,aCjQb,aCAA,aCAA,aCAA,aCAA,aCAA,aCAA,aCAA,aCAA,eCAA,U,u+GCAA,U,4zECAA,UAA07H,06HCA17H,UAA+Y,iYCA/Y,UAA+gB,+fCA/gB,U,24FCAA,U,4rECAA,U,gqFCAA,U,29CCAA,U,o+ECAA,U,0yBCAA,U,oxBCAA,GAGA,aACA,OACA,KAAC,IAED,GAEA,0CACA,OAAC,SAED,CACA,4BACA,OAI4C,CAE5C","file":"app.js","sourcesContent":["/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module module:engine/view/writer\n */\n\nimport Position from './position';\nimport ContainerElement from './containerelement';\nimport AttributeElement from './attributeelement';\nimport EmptyElement from './emptyelement';\nimport UIElement from './uielement';\nimport Text from './text';\nimport Range from './range';\nimport TreeWalker from './treewalker';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport DocumentFragment from './documentfragment';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\n\n/**\n * Contains functions used for composing view tree.\n *\n * @namespace writer\n */\n\nconst writer = {\n\tbreakAttributes,\n\tbreakContainer,\n\tmergeAttributes,\n\tmergeContainers,\n\tinsert,\n\tremove,\n\tclear,\n\tmove,\n\twrap,\n\twrapPosition,\n\tunwrap,\n\trename,\n\tbreakViewRangePerContainer\n};\n\nexport default writer;\n\n/**\n * Breaks attribute nodes at provided position or at boundaries of provided range. It breaks attribute elements inside\n * up to a container element.\n *\n * In following examples `

` is a container, `` and `` are attribute nodes:\n *\n *\t\t

foobar{}

->

foobar[]

\n *\t\t

foo{}bar

->

foo{}bar

\n *\t\t

foob{}ar

->

foob[]ar

\n *\t\t

fo{oba}r

->

foobar

\n *\n * **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.\n *\n * **Note:** Difference between {@link module:engine/view/writer~writer.breakAttributes breakAttributes} and\n * {@link module:engine/view/writer~writer.breakContainer breakContainer} is that `breakAttributes` breaks all\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of given `position`, up to the first\n * encountered {@link module:engine/view/containerelement~ContainerElement container element}. `breakContainer` assumes that given\n * `position`\n * is directly in container element and breaks that container element.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container`\n * when {@link module:engine/view/range~Range#start start}\n * and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element`\n * when trying to break attributes\n * inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element`\n * when trying to break attributes\n * inside {@link module:engine/view/uielement~UIElement UIElement}.\n *\n * @see module:engine/view/attributeelement~AttributeElement\n * @see module:engine/view/containerelement~ContainerElement\n * @see module:engine/view/writer~writer.breakContainer\n * @function module:engine/view/writer~writer.breakAttributes\n * @param {module:engine/view/position~Position|module:engine/view/range~Range} positionOrRange Position where to break attribute elements.\n * @returns {module:engine/view/position~Position|module:engine/view/range~Range} New position or range, after breaking the attribute\n * elements.\n */\nexport function breakAttributes( positionOrRange ) {\n\tif ( positionOrRange instanceof Position ) {\n\t\treturn _breakAttributes( positionOrRange );\n\t} else {\n\t\treturn _breakAttributesRange( positionOrRange );\n\t}\n}\n\n/**\n * Breaks {@link module:engine/view/containerelement~ContainerElement container view element} into two, at the given position. Position\n * has to be directly inside container element and cannot be in root. Does not break if position is at the beginning\n * or at the end of it's parent element.\n *\n *\t\t

foo^bar

->

foo

bar

\n *\t\t

foo

^

bar

->

foo

bar

\n *\t\t

^foobar

-> ^

foobar

\n *\t\t

foobar^

->

foobar

^\n *\n * **Note:** Difference between {@link module:engine/view/writer~writer.breakAttributes breakAttributes} and\n * {@link module:engine/view/writer~writer.breakContainer breakContainer} is that `breakAttributes` breaks all\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of given `position`, up to the first\n * encountered {@link module:engine/view/containerelement~ContainerElement container element}. `breakContainer` assumes that given\n * `position`\n * is directly in container element and breaks that container element.\n *\n * @see module:engine/view/attributeelement~AttributeElement\n * @see module:engine/view/containerelement~ContainerElement\n * @see module:engine/view/writer~writer.breakAttributes\n * @function module:engine/view/writer~writer.breakContainer\n * @param {module:engine/view/position~Position} position Position where to break element.\n * @returns {module:engine/view/position~Position} Position between broken elements. If element has not been broken, the returned position\n * is placed either before it or after it.\n */\nexport function breakContainer( position ) {\n\tconst element = position.parent;\n\n\tif ( !( element.is( 'containerElement' ) ) ) {\n\t\t/**\n\t\t * Trying to break an element which is not a container element.\n\t\t *\n\t\t * @error view-writer-break-non-container-element\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-break-non-container-element: Trying to break an element which is not a container element.' );\n\t}\n\n\tif ( !element.parent ) {\n\t\t/**\n\t\t * Trying to break root element.\n\t\t *\n\t\t * @error view-writer-break-root\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-break-root: Trying to break root element.' );\n\t}\n\n\tif ( position.isAtStart ) {\n\t\treturn Position.createBefore( element );\n\t} else if ( !position.isAtEnd ) {\n\t\tconst newElement = element.clone( false );\n\n\t\tinsert( Position.createAfter( element ), newElement );\n\n\t\tconst sourceRange = new Range( position, Position.createAt( element, 'end' ) );\n\t\tconst targetPosition = new Position( newElement, 0 );\n\n\t\tmove( sourceRange, targetPosition );\n\t}\n\n\treturn Position.createAfter( element );\n}\n\n/**\n * Merges {@link module:engine/view/attributeelement~AttributeElement attribute elements}. It also merges text nodes if needed.\n * Only {@link module:engine/view/attributeelement~AttributeElement#isSimilar similar} attribute elements can be merged.\n *\n * In following examples `

` is a container and `` is an attribute element:\n *\n *\t\t

foo[]bar

->

foo{}bar

\n *\t\t

foo[]bar

->

foo{}bar

\n *\t\t

a[]b

->

a[]b

\n *\n * It will also take care about empty attributes when merging:\n *\n *\t\t

[]

->

[]

\n *\t\t

foo[]bar

->

foo{}bar

\n *\n * **Note:** Difference between {@link module:engine/view/writer~writer.mergeAttributes mergeAttributes} and\n * {@link module:engine/view/writer~writer.mergeContainers mergeContainers} is that `mergeAttributes` merges two\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}\n * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.\n *\n * @see module:engine/view/attributeelement~AttributeElement\n * @see module:engine/view/containerelement~ContainerElement\n * @see module:engine/view/writer~writer.mergeContainers\n * @function module:engine/view/writer~writer.mergeAttributes\n * @param {module:engine/view/position~Position} position Merge position.\n * @returns {module:engine/view/position~Position} Position after merge.\n */\nexport function mergeAttributes( position ) {\n\tconst positionOffset = position.offset;\n\tconst positionParent = position.parent;\n\n\t// When inside text node - nothing to merge.\n\tif ( positionParent.is( 'text' ) ) {\n\t\treturn position;\n\t}\n\n\t// When inside empty attribute - remove it.\n\tif ( positionParent.is( 'attributeElement' ) && positionParent.childCount === 0 ) {\n\t\tconst parent = positionParent.parent;\n\t\tconst offset = positionParent.index;\n\t\tpositionParent.remove();\n\n\t\treturn mergeAttributes( new Position( parent, offset ) );\n\t}\n\n\tconst nodeBefore = positionParent.getChild( positionOffset - 1 );\n\tconst nodeAfter = positionParent.getChild( positionOffset );\n\n\t// Position should be placed between two nodes.\n\tif ( !nodeBefore || !nodeAfter ) {\n\t\treturn position;\n\t}\n\n\t// When position is between two text nodes.\n\tif ( nodeBefore.is( 'text' ) && nodeAfter.is( 'text' ) ) {\n\t\treturn mergeTextNodes( nodeBefore, nodeAfter );\n\t}\n\t// When selection is between two same attribute elements.\n\telse if ( nodeBefore.is( 'attributeElement' ) && nodeAfter.is( 'attributeElement' ) && nodeBefore.isSimilar( nodeAfter ) ) {\n\t\t// Move all children nodes from node placed after selection and remove that node.\n\t\tconst count = nodeBefore.childCount;\n\t\tnodeBefore.appendChildren( nodeAfter.getChildren() );\n\t\tnodeAfter.remove();\n\n\t\t// New position is located inside the first node, before new nodes.\n\t\t// Call this method recursively to merge again if needed.\n\t\treturn mergeAttributes( new Position( nodeBefore, count ) );\n\t}\n\n\treturn position;\n}\n\n/**\n * Merges two {@link module:engine/view/containerelement~ContainerElement container elements} that are before and after given position.\n * Precisely, the element after the position is removed and it's contents are moved to element before the position.\n *\n *\t\t

foo

^

bar

->

foo^bar

\n *\t\t
foo
^

bar

->
foo^bar
\n *\n * **Note:** Difference between {@link module:engine/view/writer~writer.mergeAttributes mergeAttributes} and\n * {@link module:engine/view/writer~writer.mergeContainers mergeContainers} is that `mergeAttributes` merges two\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}\n * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.\n *\n * @see module:engine/view/attributeelement~AttributeElement\n * @see module:engine/view/containerelement~ContainerElement\n * @see module:engine/view/writer~writer.mergeAttributes\n * @function module:engine/view/writer~writer.mergeContainers\n * @param {module:engine/view/position~Position} position Merge position.\n * @returns {module:engine/view/position~Position} Position after merge.\n */\nexport function mergeContainers( position ) {\n\tconst prev = position.nodeBefore;\n\tconst next = position.nodeAfter;\n\n\tif ( !prev || !next || !prev.is( 'containerElement' ) || !next.is( 'containerElement' ) ) {\n\t\t/**\n\t\t * Element before and after given position cannot be merged.\n\t\t *\n\t\t * @error view-writer-merge-containers-invalid-position\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-merge-containers-invalid-position: ' +\n\t\t\t'Element before and after given position cannot be merged.' );\n\t}\n\n\tconst lastChild = prev.getChild( prev.childCount - 1 );\n\tconst newPosition = lastChild instanceof Text ? Position.createAt( lastChild, 'end' ) : Position.createAt( prev, 'end' );\n\n\tmove( Range.createIn( next ), Position.createAt( prev, 'end' ) );\n\tremove( Range.createOn( next ) );\n\n\treturn newPosition;\n}\n\n/**\n * Breaks given `range` on a set of {@link module:engine/view/range~Range ranges}, that each are contained within a\n * {@link module:engine/view/containerelement~ContainerElement container element}. After `range` is broken, it's \"pieces\" can\n * be used by other {@link module:engine/view/writer~writer} methods (which expect that passed ranges are contained within\n * one container element).\n *\n * @function module:engine/view/writer~writer.breakViewRangePerContainer\n * @param {module:engine/view/range~Range} range Range to break.\n * @returns {Array.} Ranges that combine into passed `viewRange`.\n */\nexport function breakViewRangePerContainer( range ) {\n\tconst ranges = [];\n\tconst walker = new TreeWalker( { boundaries: range } );\n\n\tlet start = range.start;\n\n\tfor ( let value of walker ) {\n\t\tif ( value.item.is( 'containerElement' ) ) {\n\t\t\tif ( !start.isEqual( value.previousPosition ) ) {\n\t\t\t\tranges.push( new Range( start, value.previousPosition ) );\n\t\t\t}\n\n\t\t\tstart = value.nextPosition;\n\t\t}\n\t}\n\n\tranges.push( new Range( start, range.end ) );\n\n\treturn ranges;\n}\n\n/**\n * Insert node or nodes at specified position. Takes care about breaking attributes before insertion\n * and merging them afterwards.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert\n * contains instances that are not {@link module:engine/view/text~Text Texts},\n * {@link module:engine/view/attributeelement~AttributeElement AttributeElements},\n * {@link module:engine/view/containerelement~ContainerElement ContainerElements},\n * {@link module:engine/view/emptyelement~EmptyElement EmptyElements} or\n * {@link module:engine/view/uielement~UIElement UIElements}.\n *\n * @function insert\n * @param {module:engine/view/position~Position} position Insertion position.\n * @param {module:engine/view/text~Text|module:engine/view/attributeelement~AttributeElement|\n * module:engine/view/containerelement~ContainerElement|module:engine/view/emptyelement~EmptyElement|\n * module:engine/view/uielement~UIElement|Iterable.} nodes Node or nodes to insert.\n * @returns {module:engine/view/range~Range} Range around inserted nodes.\n */\nexport function insert( position, nodes ) {\n\tnodes = isIterable( nodes ) ? [ ...nodes ] : [ nodes ];\n\n\t// Check if nodes to insert are instances of AttributeElements, ContainerElements, EmptyElements, UIElements or Text.\n\tvalidateNodesToInsert( nodes );\n\n\tconst container = getParentContainer( position );\n\n\tif ( !container ) {\n\t\t/**\n\t\t * Position's parent container cannot be found.\n\t\t *\n\t\t * @error view-writer-invalid-position-container\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-invalid-position-container' );\n\t}\n\n\tconst insertionPosition = _breakAttributes( position, true );\n\n\tconst length = container.insertChildren( insertionPosition.offset, nodes );\n\tconst endPosition = insertionPosition.getShiftedBy( length );\n\tconst start = mergeAttributes( insertionPosition );\n\n\t// When no nodes were inserted - return collapsed range.\n\tif ( length === 0 ) {\n\t\treturn new Range( start, start );\n\t} else {\n\t\t// If start position was merged - move end position.\n\t\tif ( !start.isEqual( insertionPosition ) ) {\n\t\t\tendPosition.offset--;\n\t\t}\n\n\t\tconst end = mergeAttributes( endPosition );\n\n\t\treturn new Range( start, end );\n\t}\n}\n\n/**\n * Removes provided range from the container.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside\n * same parent container.\n *\n * @function module:engine/view/writer~writer.remove\n * @param {module:engine/view/range~Range} range Range to remove from container. After removing, it will be updated\n * to a collapsed range showing the new position.\n * @returns {module:engine/view/documentfragment~DocumentFragment} Document fragment containing removed nodes.\n */\nexport function remove( range ) {\n\tvalidateRangeContainer( range );\n\n\t// If range is collapsed - nothing to remove.\n\tif ( range.isCollapsed ) {\n\t\treturn new DocumentFragment();\n\t}\n\n\t// Break attributes at range start and end.\n\tconst { start: breakStart, end: breakEnd } = _breakAttributesRange( range, true );\n\tconst parentContainer = breakStart.parent;\n\n\tconst count = breakEnd.offset - breakStart.offset;\n\n\t// Remove nodes in range.\n\tconst removed = parentContainer.removeChildren( breakStart.offset, count );\n\n\t// Merge after removing.\n\tconst mergePosition = mergeAttributes( breakStart );\n\trange.start = mergePosition;\n\trange.end = Position.createFromPosition( mergePosition );\n\n\t// Return removed nodes.\n\treturn new DocumentFragment( removed );\n}\n\n/**\n * Removes matching elements from given range.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside\n * same parent container.\n *\n * @function module:engine/view/writer~writer.clear\n * @param {module:engine/view/range~Range} range Range to clear.\n * @param {module:engine/view/element~Element} element Element to remove.\n */\nexport function clear( range, element ) {\n\tvalidateRangeContainer( range );\n\n\t// Create walker on given range.\n\t// We walk backward because when we remove element during walk it modifies range end position.\n\tconst walker = range.getWalker( {\n\t\tdirection: 'backward',\n\t\tignoreElementEnd: true\n\t} );\n\n\t// Let's walk.\n\tfor ( const current of walker ) {\n\t\tconst item = current.item;\n\t\tlet rangeToRemove;\n\n\t\t// When current item matches to the given element.\n\t\tif ( item.is( 'element' ) && element.isSimilar( item ) ) {\n\t\t\t// Create range on this element.\n\t\t\trangeToRemove = Range.createOn( item );\n\t\t// When range starts inside Text or TextProxy element.\n\t\t} else if ( !current.nextPosition.isAfter( range.start ) && ( item.is( 'text' ) || item.is( 'textProxy' ) ) ) {\n\t\t\t// We need to check if parent of this text matches to given element.\n\t\t\tconst parentElement = item.getAncestors().find( ( ancestor ) => {\n\t\t\t\treturn ancestor.is( 'element' ) && element.isSimilar( ancestor );\n\t\t\t} );\n\n\t\t\t// If it is then create range inside this element.\n\t\t\tif ( parentElement ) {\n\t\t\t\trangeToRemove = Range.createIn( parentElement );\n\t\t\t}\n\t\t}\n\n\t\t// If we have found element to remove.\n\t\tif ( rangeToRemove ) {\n\t\t\t// We need to check if element range stick out of the given range and truncate if it is.\n\t\t\tif ( rangeToRemove.end.isAfter( range.end ) ) {\n\t\t\t\trangeToRemove.end = range.end;\n\t\t\t}\n\n\t\t\tif ( rangeToRemove.start.isBefore( range.start ) ) {\n\t\t\t\trangeToRemove.start = range.start;\n\t\t\t}\n\n\t\t\t// At the end we remove range with found element.\n\t\t\tremove( rangeToRemove );\n\t\t}\n\t}\n}\n\n/**\n * Moves nodes from provided range to target position.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside\n * same parent container.\n *\n * @function module:engine/view/writer~writer.move\n * @param {module:engine/view/range~Range} sourceRange Range containing nodes to move.\n * @param {module:engine/view/position~Position} targetPosition Position to insert.\n * @returns {module:engine/view/range~Range} Range in target container. Inserted nodes are placed between\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions.\n */\nexport function move( sourceRange, targetPosition ) {\n\tlet nodes;\n\n\tif ( targetPosition.isAfter( sourceRange.end ) ) {\n\t\ttargetPosition = _breakAttributes( targetPosition, true );\n\n\t\tconst parent = targetPosition.parent;\n\t\tconst countBefore = parent.childCount;\n\n\t\tsourceRange = _breakAttributesRange( sourceRange, true );\n\n\t\tnodes = remove( sourceRange );\n\n\t\ttargetPosition.offset += ( parent.childCount - countBefore );\n\t} else {\n\t\tnodes = remove( sourceRange );\n\t}\n\n\treturn insert( targetPosition, nodes );\n}\n\n/**\n * Wraps elements within range with provided {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-invalid-range-container`\n * when {@link module:engine/view/range~Range#start}\n * and {@link module:engine/view/range~Range#end} positions are not placed inside same parent container.\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not\n * an instance of {module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * @function module:engine/view/writer~writer.wrap\n * @param {module:engine/view/range~Range} range Range to wrap.\n * @param {module:engine/view/attributeelement~AttributeElement} attribute Attribute element to use as wrapper.\n */\nexport function wrap( range, attribute ) {\n\tif ( !( attribute instanceof AttributeElement ) ) {\n\t\t/**\n\t\t * Attribute element need to be instance of attribute element.\n\t\t *\n\t\t * @error view-writer-wrap-invalid-attribute\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-wrap-invalid-attribute' );\n\t}\n\n\tvalidateRangeContainer( range );\n\n\t// If range is collapsed - nothing to wrap.\n\tif ( range.isCollapsed ) {\n\t\treturn range;\n\t}\n\n\t// Range around one element.\n\tif ( range.end.isEqual( range.start.getShiftedBy( 1 ) ) ) {\n\t\tconst node = range.start.nodeAfter;\n\n\t\tif ( node instanceof AttributeElement && wrapAttributeElement( attribute, node ) ) {\n\t\t\treturn range;\n\t\t}\n\t}\n\n\t// Range is inside single attribute and spans on all children.\n\tif ( rangeSpansOnAllChildren( range ) && wrapAttributeElement( attribute, range.start.parent ) ) {\n\t\tconst parent = range.start.parent.parent;\n\t\tconst index = range.start.parent.index;\n\n\t\treturn Range.createFromParentsAndOffsets( parent, index, parent, index + 1 ) ;\n\t}\n\n\t// Break attributes at range start and end.\n\tconst { start: breakStart, end: breakEnd } = _breakAttributesRange( range, true );\n\tconst parentContainer = breakStart.parent;\n\n\t// Unwrap children located between break points.\n\tconst unwrappedRange = unwrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );\n\n\t// Wrap all children with attribute.\n\tconst newRange = wrapChildren( parentContainer, unwrappedRange.start.offset, unwrappedRange.end.offset, attribute );\n\n\t// Merge attributes at the both ends and return a new range.\n\tconst start = mergeAttributes( newRange.start );\n\n\t// If start position was merged - move end position back.\n\tif ( !start.isEqual( newRange.start ) ) {\n\t\tnewRange.end.offset--;\n\t}\n\tconst end = mergeAttributes( newRange.end );\n\n\treturn new Range( start, end );\n}\n\n/**\n * Wraps position with provided attribute. Returns new position after wrapping. This method will also merge newly\n * added attribute with its siblings whenever possible.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not\n * an instance of {module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * @param {module:engine/view/position~Position} position\n * @param {module:engine/view/attributeelement~AttributeElement} attribute\n * @returns {module:engine/view/position~Position} New position after wrapping.\n */\nexport function wrapPosition( position, attribute ) {\n\tif ( !( attribute instanceof AttributeElement ) ) {\n\t\t/**\n\t\t * Attribute element need to be instance of attribute element.\n\t\t *\n\t\t * @error view-writer-wrap-invalid-attribute\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-wrap-invalid-attribute' );\n\t}\n\n\t// Return same position when trying to wrap with attribute similar to position parent.\n\tif ( attribute.isSimilar( position.parent ) ) {\n\t\treturn movePositionToTextNode( Position.createFromPosition( position ) );\n\t}\n\n\t// When position is inside text node - break it and place new position between two text nodes.\n\tif ( position.parent.is( 'text' ) ) {\n\t\tposition = breakTextNode( position );\n\t}\n\n\t// Create fake element that will represent position, and will not be merged with other attributes.\n\tconst fakePosition = new AttributeElement();\n\tfakePosition.priority = Number.POSITIVE_INFINITY;\n\tfakePosition.isSimilar = () => false;\n\n\t// Insert fake element in position location.\n\tposition.parent.insertChildren( position.offset, fakePosition );\n\n\t// Range around inserted fake attribute element.\n\tconst wrapRange = new Range( position, position.getShiftedBy( 1 ) );\n\n\t// Wrap fake element with attribute (it will also merge if possible).\n\twrap( wrapRange, attribute );\n\n\t// Remove fake element and place new position there.\n\tconst newPosition = new Position( fakePosition.parent, fakePosition.index );\n\tfakePosition.remove();\n\n\t// If position is placed between text nodes - merge them and return position inside.\n\tconst nodeBefore = newPosition.nodeBefore;\n\tconst nodeAfter = newPosition.nodeAfter;\n\n\tif ( nodeBefore instanceof Text && nodeAfter instanceof Text ) {\n\t\treturn mergeTextNodes( nodeBefore, nodeAfter );\n\t}\n\n\t// If position is next to text node - move position inside.\n\treturn movePositionToTextNode( newPosition );\n}\n\n/**\n * Unwraps nodes within provided range from attribute element.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside\n * same parent container.\n *\n * @param {module:engine/view/range~Range} range\n * @param {module:engine/view/attributeelement~AttributeElement} element\n */\nexport function unwrap( range, attribute ) {\n\tif ( !( attribute instanceof AttributeElement ) ) {\n\t\t/**\n\t\t * Attribute element need to be instance of attribute element.\n\t\t *\n\t\t * @error view-writer-unwrap-invalid-attribute\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-unwrap-invalid-attribute' );\n\t}\n\n\tvalidateRangeContainer( range );\n\n\t// If range is collapsed - nothing to unwrap.\n\tif ( range.isCollapsed ) {\n\t\treturn range;\n\t}\n\n\t// Range around one element - check if AttributeElement can be unwrapped partially when it's not similar.\n\t// For example:\n\t// unwrap with:\t

result: \n\tif ( range.end.isEqual( range.start.getShiftedBy( 1 ) ) ) {\n\t\tconst node = range.start.nodeAfter;\n\n\t\t// Unwrap single attribute element.\n\t\tif ( !attribute.isSimilar( node ) && node instanceof AttributeElement && unwrapAttributeElement( attribute, node ) ) {\n\t\t\treturn range;\n\t\t}\n\t}\n\n\t// Break attributes at range start and end.\n\tconst { start: breakStart, end: breakEnd } = _breakAttributesRange( range, true );\n\tconst parentContainer = breakStart.parent;\n\n\t// Unwrap children located between break points.\n\tconst newRange = unwrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );\n\n\t// Merge attributes at the both ends and return a new range.\n\tconst start = mergeAttributes( newRange.start );\n\n\t// If start position was merged - move end position back.\n\tif ( !start.isEqual( newRange.start ) ) {\n\t\tnewRange.end.offset--;\n\t}\n\tconst end = mergeAttributes( newRange.end );\n\n\treturn new Range( start, end );\n}\n\n/**\n * Renames element by creating a copy of renamed element but with changed name and then moving contents of the\n * old element to the new one. Keep in mind that this will invalidate all {@link module:engine/view/position~Position positions} which\n * has renamed element as {@link module:engine/view/position~Position#parent a parent}.\n *\n * New element has to be created because `Element#tagName` property in DOM is readonly.\n *\n * Since this function creates a new element and removes the given one, the new element is returned to keep reference.\n *\n * @param {module:engine/view/containerelement~ContainerElement} viewElement Element to be renamed.\n * @param {String} newName New name for element.\n */\nexport function rename( viewElement, newName ) {\n\tconst newElement = new ContainerElement( newName, viewElement.getAttributes() );\n\n\tinsert( Position.createAfter( viewElement ), newElement );\n\tmove( Range.createIn( viewElement ), Position.createAt( newElement ) );\n\tremove( Range.createOn( viewElement ) );\n\n\treturn newElement;\n}\n\n// Returns first parent container of specified {@link module:engine/view/position~Position Position}.\n// Position's parent node is checked as first, then next parents are checked.\n// Note that {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.\n//\n// @param {module:engine/view/position~Position} position Position used as a start point to locate parent container.\n// @returns {module:engine/view/containerelement~ContainerElement|module:engine/view/documentfragment~DocumentFragment|undefined}\n// Parent container element or `undefined` if container is not found.\nfunction getParentContainer( position ) {\n\tlet parent = position.parent;\n\n\twhile ( !isContainerOrFragment( parent ) ) {\n\t\tif ( !parent ) {\n\t\t\treturn undefined;\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\n\treturn parent;\n}\n\n// Function used by both public breakAttributes (without splitting text nodes) and by other methods (with\n// splitting text nodes).\n//\n// @param {module:engine/view/range~Range} range Range which `start` and `end` positions will be used to break attributes.\n// @param {Boolean} [forceSplitText = false] If set to `true`, will break text nodes even if they are directly in\n// container element. This behavior will result in incorrect view state, but is needed by other view writing methods\n// which then fixes view state. Defaults to `false`.\n// @returns {module:engine/view/range~Range} New range with located at break positions.\nfunction _breakAttributesRange( range, forceSplitText = false ) {\n\tconst rangeStart = range.start;\n\tconst rangeEnd = range.end;\n\n\tvalidateRangeContainer( range );\n\n\t// Break at the collapsed position. Return new collapsed range.\n\tif ( range.isCollapsed ) {\n\t\tconst position = _breakAttributes( range.start, forceSplitText );\n\n\t\treturn new Range( position, position );\n\t}\n\n\tconst breakEnd = _breakAttributes( rangeEnd, forceSplitText );\n\tconst count = breakEnd.parent.childCount;\n\tconst breakStart = _breakAttributes( rangeStart, forceSplitText );\n\n\t// Calculate new break end offset.\n\tbreakEnd.offset += breakEnd.parent.childCount - count;\n\n\treturn new Range( breakStart, breakEnd );\n}\n\n// Function used by public breakAttributes (without splitting text nodes) and by other methods (with\n// splitting text nodes).\n//\n// Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element` when break position\n// is placed inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.\n//\n// Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element` when break position\n// is placed inside {@link module:engine/view/uielement~UIElement UIElement}.\n//\n// @param {module:engine/view/position~Position} position Position where to break attributes.\n// @param {Boolean} [forceSplitText = false] If set to `true`, will break text nodes even if they are directly in\n// container element. This behavior will result in incorrect view state, but is needed by other view writing methods\n// which then fixes view state. Defaults to `false`.\n// @returns {module:engine/view/position~Position} New position after breaking the attributes.\nfunction _breakAttributes( position, forceSplitText = false ) {\n\tconst positionOffset = position.offset;\n\tconst positionParent = position.parent;\n\n\t// If position is placed inside EmptyElement - throw an exception as we cannot break inside.\n\tif ( position.parent.is( 'emptyElement' ) ) {\n\t\t/**\n\t\t * Cannot break inside EmptyElement instance.\n\t\t *\n\t\t * @error view-writer-cannot-break-empty-element\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-cannot-break-empty-element' );\n\t}\n\n\t// If position is placed inside UIElement - throw an exception as we cannot break inside.\n\tif ( position.parent.is( 'uiElement' ) ) {\n\t\t/**\n\t\t * Cannot break inside UIElement instance.\n\t\t *\n\t\t * @error view-writer-cannot-break-ui-element\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-cannot-break-ui-element' );\n\t}\n\n\t// There are no attributes to break and text nodes breaking is not forced.\n\tif ( !forceSplitText && positionParent.is( 'text' ) && isContainerOrFragment( positionParent.parent ) ) {\n\t\treturn Position.createFromPosition( position );\n\t}\n\n\t// Position's parent is container, so no attributes to break.\n\tif ( isContainerOrFragment( positionParent ) ) {\n\t\treturn Position.createFromPosition( position );\n\t}\n\n\t// Break text and start again in new position.\n\tif ( positionParent.is( 'text' ) ) {\n\t\treturn _breakAttributes( breakTextNode( position ), forceSplitText );\n\t}\n\n\tconst length = positionParent.childCount;\n\n\t//

foobar{}

\n\t//

foobar[]

\n\t//

foobar[]

\n\tif ( positionOffset == length ) {\n\t\tconst newPosition = new Position( positionParent.parent, positionParent.index + 1 );\n\n\t\treturn _breakAttributes( newPosition, forceSplitText );\n\t} else\n\t//

foo{}bar

\n\t//

foo[]bar

\n\t//

foo{}bar

\n\tif ( positionOffset === 0 ) {\n\t\tconst newPosition = new Position( positionParent.parent, positionParent.index );\n\n\t\treturn _breakAttributes( newPosition, forceSplitText );\n\t}\n\t//

foob{}ar

\n\t//

foob[]ar

\n\t//

foob[]ar

\n\t//

foob[]ar

\n\telse {\n\t\tconst offsetAfter = positionParent.index + 1;\n\n\t\t// Break element.\n\t\tconst clonedNode = positionParent.clone();\n\n\t\t// Insert cloned node to position's parent node.\n\t\tpositionParent.parent.insertChildren( offsetAfter, clonedNode );\n\n\t\t// Get nodes to move.\n\t\tconst count = positionParent.childCount - positionOffset;\n\t\tconst nodesToMove = positionParent.removeChildren( positionOffset, count );\n\n\t\t// Move nodes to cloned node.\n\t\tclonedNode.appendChildren( nodesToMove );\n\n\t\t// Create new position to work on.\n\t\tconst newPosition = new Position( positionParent.parent, offsetAfter );\n\n\t\treturn _breakAttributes( newPosition, forceSplitText );\n\t}\n}\n\n// Unwraps children from provided `attribute`. Only children contained in `parent` element between\n// `startOffset` and `endOffset` will be unwrapped.\n//\n// @param {module:engine/view/element~Element} parent\n// @param {Number} startOffset\n// @param {Number} endOffset\n// @param {module:engine/view/element~Element} attribute\nfunction unwrapChildren( parent, startOffset, endOffset, attribute ) {\n\tlet i = startOffset;\n\tconst unwrapPositions = [];\n\n\t// Iterate over each element between provided offsets inside parent.\n\twhile ( i < endOffset ) {\n\t\tconst child = parent.getChild( i );\n\n\t\t// If attributes are the similar, then unwrap.\n\t\tif ( child.isSimilar( attribute ) ) {\n\t\t\tconst unwrapped = child.getChildren();\n\t\t\tconst count = child.childCount;\n\n\t\t\t// Replace wrapper element with its children\n\t\t\tchild.remove();\n\t\t\tparent.insertChildren( i, unwrapped );\n\n\t\t\t// Save start and end position of moved items.\n\t\t\tunwrapPositions.push(\n\t\t\t\tnew Position( parent, i ),\n\t\t\t\tnew Position( parent, i + count )\n\t\t\t);\n\n\t\t\t// Skip elements that were unwrapped. Assuming that there won't be another element to unwrap in child\n\t\t\t// elements.\n\t\t\ti += count;\n\t\t\tendOffset += count - 1;\n\t\t} else {\n\t\t\t// If other nested attribute is found start unwrapping there.\n\t\t\tif ( child.is( 'attributeElement' ) ) {\n\t\t\t\tunwrapChildren( child, 0, child.childCount, attribute );\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\t}\n\n\t// Merge at each unwrap.\n\tlet offsetChange = 0;\n\n\tfor ( let position of unwrapPositions ) {\n\t\tposition.offset -= offsetChange;\n\n\t\t// Do not merge with elements outside selected children.\n\t\tif ( position.offset == startOffset || position.offset == endOffset ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst newPosition = mergeAttributes( position );\n\n\t\t// If nodes were merged - other merge offsets will change.\n\t\tif ( !newPosition.isEqual( position ) ) {\n\t\t\toffsetChange++;\n\t\t\tendOffset--;\n\t\t}\n\t}\n\n\treturn Range.createFromParentsAndOffsets( parent, startOffset, parent, endOffset );\n}\n\n// Wraps children with provided `attribute`. Only children contained in `parent` element between\n// `startOffset` and `endOffset` will be wrapped.\n//\n// @param {module:engine/view/element~Element} parent\n// @param {Number} startOffset\n// @param {Number} endOffset\n// @param {module:engine/view/element~Element} attribute\nfunction wrapChildren( parent, startOffset, endOffset, attribute ) {\n\tlet i = startOffset;\n\tconst wrapPositions = [];\n\n\twhile ( i < endOffset ) {\n\t\tconst child = parent.getChild( i );\n\t\tconst isText = child.is( 'text' );\n\t\tconst isAttribute = child.is( 'attributeElement' );\n\t\tconst isEmpty = child.is( 'emptyElement' );\n\t\tconst isUI = child.is( 'uiElement' );\n\n\t\t// Wrap text, empty elements, ui elements or attributes with higher or equal priority.\n\t\tif ( isText || isEmpty || isUI || ( isAttribute && attribute.priority <= child.priority ) ) {\n\t\t\t// Clone attribute.\n\t\t\tconst newAttribute = attribute.clone();\n\n\t\t\t// Wrap current node with new attribute;\n\t\t\tchild.remove();\n\t\t\tnewAttribute.appendChildren( child );\n\t\t\tparent.insertChildren( i, newAttribute );\n\n\t\t\twrapPositions.push(\tnew Position( parent, i ) );\n\t\t}\n\t\t// If other nested attribute is found start wrapping there.\n\t\telse if ( isAttribute ) {\n\t\t\twrapChildren( child, 0, child.childCount, attribute );\n\t\t}\n\n\t\ti++;\n\t}\n\n\t// Merge at each wrap.\n\tlet offsetChange = 0;\n\n\tfor ( let position of wrapPositions ) {\n\t\tposition.offset -= offsetChange;\n\n\t\t// Do not merge with elements outside selected children.\n\t\tif ( position.offset == startOffset ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst newPosition = mergeAttributes( position );\n\n\t\t// If nodes were merged - other merge offsets will change.\n\t\tif ( !newPosition.isEqual( position ) ) {\n\t\t\toffsetChange++;\n\t\t\tendOffset--;\n\t\t}\n\t}\n\n\treturn Range.createFromParentsAndOffsets( parent, startOffset, parent, endOffset );\n}\n\n// Returns new position that is moved to near text node. Returns same position if there is no text node before of after\n// specified position.\n//\n//\t\t

foo[]

->

foo{}

\n//\t\t

[]foo

->

{}foo

\n//\n// @param {module:engine/view/position~Position} position\n// @returns {module:engine/view/position~Position} Position located inside text node or same position if there is no text nodes\n// before or after position location.\nfunction movePositionToTextNode( position ) {\n\tconst nodeBefore = position.nodeBefore;\n\n\tif ( nodeBefore && nodeBefore.is( 'text' ) ) {\n\t\treturn new Position( nodeBefore, nodeBefore.data.length );\n\t}\n\n\tconst nodeAfter = position.nodeAfter;\n\n\tif ( nodeAfter && nodeAfter.is( 'text' ) ) {\n\t\treturn new Position( nodeAfter, 0 );\n\t}\n\n\treturn position;\n}\n\n// Breaks text node into two text nodes when possible.\n//\n//\t\t

foo{}bar

->

foo[]bar

\n//\t\t

{}foobar

->

[]foobar

\n//\t\t

foobar{}

->

foobar[]

\n//\n// @param {module:engine/view/position~Position} position Position that need to be placed inside text node.\n// @returns {module:engine/view/position~Position} New position after breaking text node.\nfunction breakTextNode( position ) {\n\tif ( position.offset == position.parent.data.length ) {\n\t\treturn new Position( position.parent.parent, position.parent.index + 1 );\n\t}\n\n\tif ( position.offset === 0 ) {\n\t\treturn new Position( position.parent.parent, position.parent.index );\n\t}\n\n\t// Get part of the text that need to be moved.\n\tconst textToMove = position.parent.data.slice( position.offset );\n\n\t// Leave rest of the text in position's parent.\n\tposition.parent.data = position.parent.data.slice( 0, position.offset );\n\n\t// Insert new text node after position's parent text node.\n\tposition.parent.parent.insertChildren( position.parent.index + 1, new Text( textToMove ) );\n\n\t// Return new position between two newly created text nodes.\n\treturn new Position( position.parent.parent, position.parent.index + 1 );\n}\n\n// Merges two text nodes into first node. Removes second node and returns merge position.\n//\n// @param {module:engine/view/text~Text} t1 First text node to merge. Data from second text node will be moved at the end of\n// this text node.\n// @param {module:engine/view/text~Text} t2 Second text node to merge. This node will be removed after merging.\n// @returns {module:engine/view/position~Position} Position after merging text nodes.\nfunction mergeTextNodes( t1, t2 ) {\n\t// Merge text data into first text node and remove second one.\n\tconst nodeBeforeLength = t1.data.length;\n\tt1.data += t2.data;\n\tt2.remove();\n\n\treturn new Position( t1, nodeBeforeLength );\n}\n\n// Wraps one {@link module:engine/view/attributeelement~AttributeElement AttributeElement} into another by merging them if possible.\n// Two AttributeElements can be merged when there is no attribute or style conflicts between them.\n// When merging is possible - all attributes, styles and classes are moved from wrapper element to element being\n// wrapped.\n//\n// @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.\n// @param {module:engine/view/attributeelement~AttributeElement} toWrap AttributeElement to wrap using wrapper element.\n// @returns {Boolean} Returns `true` if elements are merged.\nfunction wrapAttributeElement( wrapper, toWrap ) {\n\t// Can't merge if name or priority differs.\n\tif ( wrapper.name !== toWrap.name || wrapper.priority !== toWrap.priority ) {\n\t\treturn false;\n\t}\n\n\t// Check if attributes can be merged.\n\tfor ( let key of wrapper.getAttributeKeys() ) {\n\t\t// Classes and styles should be checked separately.\n\t\tif ( key === 'class' || key === 'style' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If some attributes are different we cannot wrap.\n\t\tif ( toWrap.hasAttribute( key ) && toWrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check if styles can be merged.\n\tfor ( let key of wrapper.getStyleNames() ) {\n\t\tif ( toWrap.hasStyle( key ) && toWrap.getStyle( key ) !== wrapper.getStyle( key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Move all attributes/classes/styles from wrapper to wrapped AttributeElement.\n\tfor ( let key of wrapper.getAttributeKeys() ) {\n\t\t// Classes and styles should be checked separately.\n\t\tif ( key === 'class' || key === 'style' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Move only these attributes that are not present - other are similar.\n\t\tif ( !toWrap.hasAttribute( key ) ) {\n\t\t\ttoWrap.setAttribute( key, wrapper.getAttribute( key ) );\n\t\t}\n\t}\n\n\tfor ( let key of wrapper.getStyleNames() ) {\n\t\tif ( !toWrap.hasStyle( key ) ) {\n\t\t\ttoWrap.setStyle( key, wrapper.getStyle( key ) );\n\t\t}\n\t}\n\n\tfor ( let key of wrapper.getClassNames() ) {\n\t\tif ( !toWrap.hasClass( key ) ) {\n\t\t\ttoWrap.addClass( key );\n\t\t}\n\t}\n\n\treturn true;\n}\n\n// Unwraps {@link module:engine/view/attributeelement~AttributeElement AttributeElement} from another by removing corresponding attributes,\n// classes and styles. All attributes, classes and styles from wrapper should be present inside element being unwrapped.\n//\n// @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.\n// @param {module:engine/view/attributeelement~AttributeElement} toUnwrap AttributeElement to unwrap using wrapper element.\n// @returns {Boolean} Returns `true` if elements are unwrapped.\nfunction unwrapAttributeElement( wrapper, toUnwrap ) {\n\t// Can't unwrap if name or priority differs.\n\tif ( wrapper.name !== toUnwrap.name || wrapper.priority !== toUnwrap.priority ) {\n\t\treturn false;\n\t}\n\n\t// Check if AttributeElement has all wrapper attributes.\n\tfor ( let key of wrapper.getAttributeKeys() ) {\n\t\t// Classes and styles should be checked separately.\n\t\tif ( key === 'class' || key === 'style' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If some attributes are missing or different we cannot unwrap.\n\t\tif ( !toUnwrap.hasAttribute( key ) || toUnwrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check if AttributeElement has all wrapper classes.\n\tif ( !toUnwrap.hasClass( ...wrapper.getClassNames() ) ) {\n\t\treturn false;\n\t}\n\n\t// Check if AttributeElement has all wrapper styles.\n\tfor ( let key of wrapper.getStyleNames() ) {\n\t\t// If some styles are missing or different we cannot unwrap.\n\t\tif ( !toUnwrap.hasStyle( key ) || toUnwrap.getStyle( key ) !== wrapper.getStyle( key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Remove all wrapper's attributes from unwrapped element.\n\tfor ( let key of wrapper.getAttributeKeys() ) {\n\t\t// Classes and styles should be checked separately.\n\t\tif ( key === 'class' || key === 'style' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttoUnwrap.removeAttribute( key );\n\t}\n\n\t// Remove all wrapper's classes from unwrapped element.\n\ttoUnwrap.removeClass( ...wrapper.getClassNames() );\n\n\t// Remove all wrapper's styles from unwrapped element.\n\ttoUnwrap.removeStyle( ...wrapper.getStyleNames() );\n\n\treturn true;\n}\n\n// Returns `true` if range is located in same {@link module:engine/view/attributeelement~AttributeElement AttributeElement}\n// (`start` and `end` positions are located inside same {@link module:engine/view/attributeelement~AttributeElement AttributeElement}),\n// starts on 0 offset and ends after last child node.\n//\n// @param {module:engine/view/range~Range} Range\n// @returns {Boolean}\nfunction rangeSpansOnAllChildren( range ) {\n\treturn range.start.parent == range.end.parent && range.start.parent.is( 'attributeElement' ) &&\n\t\trange.start.offset === 0 && range.end.offset === range.start.parent.childCount;\n}\n\n// Checks if provided nodes are valid to insert. Checks if each node is an instance of\n// {@link module:engine/view/text~Text Text} or {@link module:engine/view/attributeelement~AttributeElement AttributeElement},\n// {@link module:engine/view/containerelement~ContainerElement ContainerElement},\n// {@link module:engine/view/emptyelement~EmptyElement EmptyElement} or\n// {@link module:engine/view/uielement~UIElement UIElement}.\n//\n// Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert\n// contains instances that are not {@link module:engine/view/text~Text Texts},\n// {@link module:engine/view/emptyelement~EmptyElement EmptyElements},\n// {@link module:engine/view/uielement~UIElement UIElements},\n// {@link module:engine/view/attributeelement~AttributeElement AttributeElements} or\n// {@link module:engine/view/containerelement~ContainerElement ContainerElements}.\n//\n// @param Iterable. nodes\nfunction validateNodesToInsert( nodes ) {\n\tfor ( let node of nodes ) {\n\t\tif ( !validNodesToInsert.some( ( validNode => node instanceof validNode ) ) ) {\n\t\t\t/**\n\t\t\t * Inserted nodes should be valid to insert. of {@link module:engine/view/attributeelement~AttributeElement AttributeElement},\n\t\t\t * {@link module:engine/view/containerelement~ContainerElement ContainerElement},\n\t\t\t * {@link module:engine/view/emptyelement~EmptyElement EmptyElement},\n\t\t\t * {@link module:engine/view/uielement~UIElement UIElement}, {@link module:engine/view/text~Text Text}.\n\t\t\t *\n\t\t\t * @error view-writer-insert-invalid-node\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-writer-insert-invalid-node' );\n\t\t}\n\n\t\tif ( !node.is( 'text' ) ) {\n\t\t\tvalidateNodesToInsert( node.getChildren() );\n\t\t}\n\t}\n}\n\nconst validNodesToInsert = [ Text, AttributeElement, ContainerElement, EmptyElement, UIElement ];\n\n// Checks if node is ContainerElement or DocumentFragment, because in most cases they should be treated the same way.\n//\n// @param {module:engine/view/node~Node} node\n// @returns {Boolean} Returns `true` if node is instance of ContainerElement or DocumentFragment.\nfunction isContainerOrFragment( node ) {\n\treturn node && ( node.is( 'containerElement' ) || node.is( 'documentFragment' ) );\n}\n\n// Checks if {@link module:engine/view/range~Range#start range start} and {@link module:engine/view/range~Range#end range end} are placed\n// inside same {@link module:engine/view/containerelement~ContainerElement container element}.\n// Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when validation fails.\n//\n// @param {module:engine/view/range~Range} range\nfunction validateRangeContainer( range ) {\n\tconst startContainer = getParentContainer( range.start );\n\tconst endContainer = getParentContainer( range.end );\n\n\tif ( !startContainer || !endContainer || startContainer !== endContainer ) {\n\t\t/**\n\t\t * Range container is invalid. This can happen if {@link module:engine/view/range~Range#start range start} and\n\t\t * {@link module:engine/view/range~Range#end range end} positions are not placed inside same container or\n\t\t * parent container for these positions cannot be found.\n\t\t *\n\t\t * @error view-writer-invalid-range-container\n\t\t */\n\t\tthrow new CKEditorError( 'view-writer-invalid-range-container' );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/writer.js\n// module id = 76\n// module chunks = 0","import apply from './_apply';\nimport toInteger from './toInteger';\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, array);\n case 1: return func.call(this, args[0], array);\n case 2: return func.call(this, args[0], args[1], array);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\nexport default rest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/rest.js\n// module id = 8\n// module chunks = 0"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 527);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 7897e2108f2124e1315c","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/ckeditorerror\n */\n\n/**\n * The CKEditor error class.\n *\n * All errors will be shortened during the minification process in order to reduce the code size.\n * Therefore, all error messages should be documented in the same way as those in {@link module:utils/log}.\n *\n * Read more in the {@link module:utils/log} module.\n *\n * @extends Error\n */\nexport default class CKEditorError extends Error {\n\t/**\n\t * Creates an instance of the CKEditorError class.\n\t *\n\t * Read more about error logging in the {@link module:utils/log} module.\n\t *\n\t * @param {String} message The error message in an `error-name: Error message.` format.\n\t * During the minification process the \"Error message\" part will be removed to limit the code size\n\t * and a link to this error documentation will be added to the `message`.\n\t * @param {Object} [data] Additional data describing the error. A stringified version of this object\n\t * will be appended to the error message, so the data are quickly visible in the console. The original\n\t * data object will also be later available under the {@link #data} property.\n\t */\n\tconstructor( message, data ) {\n\t\tif ( data ) {\n\t\t\tmessage += ' ' + JSON.stringify( data );\n\t\t}\n\n\t\tsuper( message );\n\n\t\t/**\n\t\t * @member {String}\n\t\t */\n\t\tthis.name = 'CKEditorError';\n\n\t\t/**\n\t\t * The additional error data passed to the constructor.\n\t\t *\n\t\t * @member {Object}\n\t\t */\n\t\tthis.data = data;\n\t}\n\n\t/**\n\t * Checks if error is an instance of CKEditorError class.\n\t *\n\t * @param {Object} error Object to check.\n\t * @returns {Boolean}\n\t */\n\tstatic isCKEditorError( error ) {\n\t\treturn error instanceof CKEditorError;\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/ckeditorerror.js\n// module id = 0\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/position\n */\n\nimport TreeWalker from './treewalker';\nimport last from '@ckeditor/ckeditor5-utils/src/lib/lodash/last';\nimport compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport Text from './text';\n\n/**\n * Represents a position in the model tree.\n *\n * **Note:** Position is based on offsets, not indexes. This means that position in element containing two text nodes\n * with data `foo` and `bar`, position between them has offset `3`, not `1`.\n * See {@link module:engine/model/position~Position#path} for more.\n *\n * Since position in a model is represented by a {@link module:engine/model/position~Position#root position root} and\n * {@link module:engine/model/position~Position#path position path} it is possible to create positions placed in non-existing elements.\n * This requirement is important for {@link module:engine/model/operation/transform~transform operational transformation}.\n *\n * Also, {@link module:engine/model/operation/operation~Operation operations}\n * kept in {@link module:engine/model/document~Document#history document history}\n * are storing positions (and ranges) which were correct when those operations were applied, but may not be correct\n * after document got changed.\n *\n * When changes are applied to model, it may also happen that {@link module:engine/model/position~Position#parent position parent}\n * will change even if position path has not changed. Keep in mind, that if a position leads to non-existing element,\n * {@link module:engine/model/position~Position#parent} and some other properties and methods will throw errors.\n *\n * In most cases, position with wrong path is caused by an error in code, but it is sometimes needed, as described above.\n */\nexport default class Position {\n\t/**\n\t * Creates a position.\n\t *\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.\n\t * @param {Array.} path Position path. See {@link module:engine/model/position~Position#path}.\n\t */\n\tconstructor( root, path ) {\n\t\tif ( !root.is( 'element' ) && !root.is( 'documentFragment' ) ) {\n\t\t\t/**\n\t\t\t * Position root invalid.\n\t\t\t *\n\t\t\t * @error position-root-invalid.\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-position-root-invalid: Position root invalid.' );\n\t\t}\n\n\t\tif ( !( path instanceof Array ) || path.length === 0 ) {\n\t\t\t/**\n\t\t\t * Position path must be an Array with at least one item.\n\t\t\t *\n\t\t\t * @error position-path-incorrect\n\t\t\t * @param path\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-position-path-incorrect: Position path must be an Array with at least one item.', { path: path } );\n\t\t}\n\n\t\t// Normalize the root and path (if element was passed).\n\t\tpath = root.getPath().concat( path );\n\t\troot = root.root;\n\n\t\t/**\n\t\t * Root of the position path.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}\n\t\t * module:engine/model/position~Position#root\n\t\t */\n\t\tthis.root = root;\n\n\t\t/**\n\t\t * Position of the node it the tree. Path is described through offsets, not indexes.\n\t\t *\n\t\t * Position can be placed before, after or in a {@link module:engine/model/node~Node node} if that node has\n\t\t * {@link module:engine/model/node~Node#offsetSize} greater than `1`. Items in position path are\n\t\t * {@link module:engine/model/node~Node#startOffset starting offsets} of position ancestors, starting from direct root children,\n\t\t * down to the position offset in it's parent.\n\t\t *\n\t\t *\t\t ROOT\n\t\t *\t\t |- P before: [ 0 ] after: [ 1 ]\n\t\t *\t\t |- UL before: [ 1 ] after: [ 2 ]\n\t\t *\t\t |- LI before: [ 1, 0 ] after: [ 1, 1 ]\n\t\t *\t\t | |- foo before: [ 1, 0, 0 ] after: [ 1, 0, 3 ]\n\t\t *\t\t |- LI before: [ 1, 1 ] after: [ 1, 2 ]\n\t\t *\t\t |- bar before: [ 1, 1, 0 ] after: [ 1, 1, 3 ]\n\t\t *\n\t\t * `foo` and `bar` are representing {@link module:engine/model/text~Text text nodes}. Since text nodes has offset size\n\t\t * greater than `1` you can place position offset between their start and end:\n\t\t *\n\t\t *\t\t ROOT\n\t\t *\t\t |- P\n\t\t *\t\t |- UL\n\t\t *\t\t |- LI\n\t\t *\t\t | |- f^o|o ^ has path: [ 1, 0, 1 ] | has path: [ 1, 0, 2 ]\n\t\t *\t\t |- LI\n\t\t *\t\t |- b^a|r ^ has path: [ 1, 1, 1 ] | has path: [ 1, 1, 2 ]\n\t\t *\n\t\t * @member {Array.} module:engine/model/position~Position#path\n\t\t */\n\t\tthis.path = path;\n\t}\n\n\t/**\n\t * Offset at which this position is located in its {@link module:engine/model/position~Position#parent parent}. It is equal\n\t * to the last item in position {@link module:engine/model/position~Position#path path}.\n\t *\n\t * @type {Number}\n\t */\n\tget offset() {\n\t\treturn last( this.path );\n\t}\n\n\t/**\n\t * @param {Number} newOffset\n\t */\n\tset offset( newOffset ) {\n\t\tthis.path[ this.path.length - 1 ] = newOffset;\n\t}\n\n\t/**\n\t * Parent element of this position.\n\t *\n\t * Keep in mind that `parent` value is calculated when the property is accessed.\n\t * If {@link module:engine/model/position~Position#path position path}\n\t * leads to a non-existing element, `parent` property will throw error.\n\t *\n\t * Also it is a good idea to cache `parent` property if it is used frequently in an algorithm (i.e. in a long loop).\n\t *\n\t * @readonly\n\t * @type {module:engine/model/element~Element}\n\t */\n\tget parent() {\n\t\tlet parent = this.root;\n\n\t\tfor ( let i = 0; i < this.path.length - 1; i++ ) {\n\t\t\tparent = parent.getChild( parent.offsetToIndex( this.path[ i ] ) );\n\t\t}\n\n\t\treturn parent;\n\t}\n\n\t/**\n\t * Position {@link module:engine/model/position~Position#offset offset} converted to an index in position's parent node. It is\n\t * equal to the {@link module:engine/model/node~Node#index index} of a node after this position. If position is placed\n\t * in text node, position index is equal to the index of that text node.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget index() {\n\t\treturn this.parent.offsetToIndex( this.offset );\n\t}\n\n\t/**\n\t * Returns {@link module:engine/model/text~Text text node} instance in which this position is placed or `null` if this\n\t * position is not in a text node.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/text~Text|null}\n\t */\n\tget textNode() {\n\t\tlet node = this.parent.getChild( this.index );\n\n\t\treturn ( node instanceof Text && node.startOffset < this.offset ) ? node : null;\n\t}\n\n\t/**\n\t * Node directly after this position or `null` if this position is in text node.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/node~Node|null}\n\t */\n\tget nodeAfter() {\n\t\treturn this.textNode === null ? this.parent.getChild( this.index ) : null;\n\t}\n\n\t/**\n\t * Node directly before this position or `null` if this position is in text node.\n\t *\n\t * @readonly\n\t * @type {Node}\n\t */\n\tget nodeBefore() {\n\t\treturn this.textNode === null ? this.parent.getChild( this.index - 1 ) : null;\n\t}\n\n\t/**\n\t * Is `true` if position is at the beginning of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isAtStart() {\n\t\treturn this.offset === 0;\n\t}\n\n\t/**\n\t * Is `true` if position is at the end of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isAtEnd() {\n\t\treturn this.offset == this.parent.maxOffset;\n\t}\n\n\t/**\n\t * Checks whether this position is before or after given position.\n\t *\n\t * @param {module:engine/model/position~Position} otherPosition Position to compare with.\n\t * @returns {module:engine/model/position~PositionRelation}\n\t */\n\tcompareWith( otherPosition ) {\n\t\tif ( this.root != otherPosition.root ) {\n\t\t\treturn 'different';\n\t\t}\n\n\t\tconst result = compareArrays( this.path, otherPosition.path );\n\n\t\tswitch ( result ) {\n\t\t\tcase 'same':\n\t\t\t\treturn 'same';\n\n\t\t\tcase 'prefix':\n\t\t\t\treturn 'before';\n\n\t\t\tcase 'extension':\n\t\t\t\treturn 'after';\n\n\t\t\tdefault:\n\t\t\t\tif ( this.path[ result ] < otherPosition.path[ result ] ) {\n\t\t\t\t\treturn 'before';\n\t\t\t\t} else {\n\t\t\t\t\treturn 'after';\n\t\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Gets the farthest position which matches the callback using\n\t * {@link module:engine/model/treewalker~TreeWalker TreeWalker}.\n\t *\n\t * For example:\n\t *\n\t * \t\tgetLastMatchingPosition( value => value.type == 'text' );\n\t * \t\t// []foo -> foo[]\n\t *\n\t * \t\tgetLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } );\n\t * \t\t// foo[] -> []foo\n\t *\n\t * \t\tgetLastMatchingPosition( value => false );\n\t * \t\t// Do not move the position.\n\t *\n\t * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should\n\t * return `true` if the value should be skipped or `false` if not.\n\t * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n\t *\n\t * @returns {module:engine/model/position~Position} The position after the last item which matches the `skip` callback test.\n\t */\n\tgetLastMatchingPosition( skip, options = {} ) {\n\t\toptions.startPosition = this;\n\n\t\tconst treeWalker = new TreeWalker( options );\n\t\ttreeWalker.skip( skip );\n\n\t\treturn treeWalker.position;\n\t}\n\n\t/**\n\t * Returns a path to this position's parent. Parent path is equal to position {@link module:engine/model/position~Position#path path}\n\t * but without the last item.\n\t *\n\t * This method returns the parent path even if the parent does not exists.\n\t *\n\t * @returns {Array.} Path to the parent.\n\t */\n\tgetParentPath() {\n\t\treturn this.path.slice( 0, -1 );\n\t}\n\n\t/**\n\t * Returns ancestors array of this position, that is this position's parent and its ancestors.\n\t *\n\t * @returns {Array.} Array with ancestors.\n\t */\n\tgetAncestors() {\n\t\tif ( this.parent.is( 'documentFragment' ) ) {\n\t\t\treturn [ this.parent ];\n\t\t} else {\n\t\t\treturn this.parent.getAncestors( { includeNode: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Returns the slice of two position {@link #path paths} which is identical. The {@link #root roots}\n\t * of these two paths must be identical.\n\t *\n\t * @param {module:engine/model/position~Position} position The second position.\n\t * @returns {Array.} The common path.\n\t */\n\tgetCommonPath( position ) {\n\t\tif ( this.root != position.root ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// We find on which tree-level start and end have the lowest common ancestor\n\t\tlet cmp = compareArrays( this.path, position.path );\n\t\t// If comparison returned string it means that arrays are same.\n\t\tlet diffAt = ( typeof cmp == 'string' ) ? Math.min( this.path.length, position.path.length ) : cmp;\n\n\t\treturn this.path.slice( 0, diffAt );\n\t}\n\n\t/**\n\t * Returns a new instance of `Position`, that has same {@link #parent parent} but it's offset\n\t * is shifted by `shift` value (can be a negative value).\n\t *\n\t * @param {Number} shift Offset shift. Can be a negative value.\n\t * @returns {module:engine/model/position~Position} Shifted position.\n\t */\n\tgetShiftedBy( shift ) {\n\t\tlet shifted = Position.createFromPosition( this );\n\n\t\tlet offset = shifted.offset + shift;\n\t\tshifted.offset = offset < 0 ? 0 : offset;\n\n\t\treturn shifted;\n\t}\n\n\t/**\n\t * Checks whether this position is after given position.\n\t *\n\t * @see module:engine/model/position~Position#isBefore\n\t *\n\t * @param {module:engine/model/position~Position} otherPosition Position to compare with.\n\t * @returns {Boolean} True if this position is after given position.\n\t */\n\tisAfter( otherPosition ) {\n\t\treturn this.compareWith( otherPosition ) == 'after';\n\t}\n\n\t/**\n\t * Checks whether this position is before given position.\n\t *\n\t * **Note:** watch out when using negation of the value returned by this method, because the negation will also\n\t * be `true` if positions are in different roots and you might not expect this. You should probably use\n\t * `a.isAfter( b ) || a.isEqual( b )` or `!a.isBefore( p ) && a.root == b.root` in most scenarios. If your\n\t * condition uses multiple `isAfter` and `isBefore` checks, build them so they do not use negated values, i.e.:\n\t *\n\t *\t\tif ( a.isBefore( b ) && c.isAfter( d ) ) {\n\t *\t\t\t// do A.\n\t *\t\t} else {\n\t *\t\t\t// do B.\n\t *\t\t}\n\t *\n\t * or, if you have only one if-branch:\n\t *\n\t *\t\tif ( !( a.isBefore( b ) && c.isAfter( d ) ) {\n\t *\t\t\t// do B.\n\t *\t\t}\n\t *\n\t * rather than:\n\t *\n\t *\t\tif ( !a.isBefore( b ) || && !c.isAfter( d ) ) {\n\t *\t\t\t// do B.\n\t *\t\t} else {\n\t *\t\t\t// do A.\n\t *\t\t}\n\t *\n\t * @param {module:engine/model/position~Position} otherPosition Position to compare with.\n\t * @returns {Boolean} True if this position is before given position.\n\t */\n\tisBefore( otherPosition ) {\n\t\treturn this.compareWith( otherPosition ) == 'before';\n\t}\n\n\t/**\n\t * Checks whether this position is equal to given position.\n\t *\n\t * @param {module:engine/model/position~Position} otherPosition Position to compare with.\n\t * @returns {Boolean} True if positions are same.\n\t */\n\tisEqual( otherPosition ) {\n\t\treturn this.compareWith( otherPosition ) == 'same';\n\t}\n\n\t/**\n\t * Checks whether this position is touching given position. Positions touch when there are no text nodes\n\t * or empty nodes in a range between them. Technically, those positions are not equal but in many cases\n\t * they are very similar or even indistinguishable.\n\t *\n\t * **Note:** this method traverses model document so it can be only used when range is up-to-date with model document.\n\t *\n\t * @param {module:engine/model/position~Position} otherPosition Position to compare with.\n\t * @returns {Boolean} True if positions touch.\n\t */\n\tisTouching( otherPosition ) {\n\t\tlet left = null;\n\t\tlet right = null;\n\t\tlet compare = this.compareWith( otherPosition );\n\n\t\tswitch ( compare ) {\n\t\t\tcase 'same':\n\t\t\t\treturn true;\n\n\t\t\tcase 'before':\n\t\t\t\tleft = Position.createFromPosition( this );\n\t\t\t\tright = Position.createFromPosition( otherPosition );\n\t\t\t\tbreak;\n\n\t\t\tcase 'after':\n\t\t\t\tleft = Position.createFromPosition( otherPosition );\n\t\t\t\tright = Position.createFromPosition( this );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\n\t\t// Cached for optimization purposes.\n\t\tlet leftParent = left.parent;\n\n\t\twhile ( left.path.length + right.path.length ) {\n\t\t\tif ( left.isEqual( right ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ( left.path.length > right.path.length ) {\n\t\t\t\tif ( left.offset !== leftParent.maxOffset ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tleft.path = left.path.slice( 0, -1 );\n\t\t\t\tleftParent = leftParent.parent;\n\t\t\t\tleft.offset++;\n\t\t\t} else {\n\t\t\t\tif ( right.offset !== 0 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tright.path = right.path.slice( 0, -1 );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns a copy of this position that is updated by removing `howMany` nodes starting from `deletePosition`.\n\t * It may happen that this position is in a removed node. If that is the case, `null` is returned instead.\n\t *\n\t * @protected\n\t * @param {module:engine/model/position~Position} deletePosition Position before the first removed node.\n\t * @param {Number} howMany How many nodes are removed.\n\t * @returns {module:engine/model/position~Position|null} Transformed position or `null`.\n\t */\n\t_getTransformedByDeletion( deletePosition, howMany ) {\n\t\tlet transformed = Position.createFromPosition( this );\n\n\t\t// This position can't be affected if deletion was in a different root.\n\t\tif ( this.root != deletePosition.root ) {\n\t\t\treturn transformed;\n\t\t}\n\n\t\tif ( compareArrays( deletePosition.getParentPath(), this.getParentPath() ) == 'same' ) {\n\t\t\t// If nodes are removed from the node that is pointed by this position...\n\t\t\tif ( deletePosition.offset < this.offset ) {\n\t\t\t\t// And are removed from before an offset of that position...\n\t\t\t\tif ( deletePosition.offset + howMany > this.offset ) {\n\t\t\t\t\t// Position is in removed range, it's no longer in the tree.\n\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\t// Decrement the offset accordingly.\n\t\t\t\t\ttransformed.offset -= howMany;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( compareArrays( deletePosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {\n\t\t\t// If nodes are removed from a node that is on a path to this position...\n\t\t\tconst i = deletePosition.path.length - 1;\n\n\t\t\tif ( deletePosition.offset <= this.path[ i ] ) {\n\t\t\t\t// And are removed from before next node of that path...\n\t\t\t\tif ( deletePosition.offset + howMany > this.path[ i ] ) {\n\t\t\t\t\t// If the next node of that path is removed return null\n\t\t\t\t\t// because the node containing this position got removed.\n\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, decrement index on that path.\n\t\t\t\t\ttransformed.path[ i ] -= howMany;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn transformed;\n\t}\n\n\t/**\n\t * Returns a copy of this position that is updated by inserting `howMany` nodes at `insertPosition`.\n\t *\n\t * @protected\n\t * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.\n\t * @param {Number} howMany How many nodes are inserted.\n\t * @param {Boolean} insertBefore Flag indicating whether nodes are inserted before or after `insertPosition`.\n\t * This is important only when `insertPosition` and this position are same. If that is the case and the flag is\n\t * set to `true`, this position will get transformed. If the flag is set to `false`, it won't.\n\t * @returns {module:engine/model/position~Position} Transformed position.\n\t */\n\t_getTransformedByInsertion( insertPosition, howMany, insertBefore ) {\n\t\tlet transformed = Position.createFromPosition( this );\n\n\t\t// This position can't be affected if insertion was in a different root.\n\t\tif ( this.root != insertPosition.root ) {\n\t\t\treturn transformed;\n\t\t}\n\n\t\tif ( compareArrays( insertPosition.getParentPath(), this.getParentPath() ) == 'same' ) {\n\t\t\t// If nodes are inserted in the node that is pointed by this position...\n\t\t\tif ( insertPosition.offset < this.offset || ( insertPosition.offset == this.offset && insertBefore ) ) {\n\t\t\t\t// And are inserted before an offset of that position...\n\t\t\t\t// \"Push\" this positions offset.\n\t\t\t\ttransformed.offset += howMany;\n\t\t\t}\n\t\t} else if ( compareArrays( insertPosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {\n\t\t\t// If nodes are inserted in a node that is on a path to this position...\n\t\t\tconst i = insertPosition.path.length - 1;\n\n\t\t\tif ( insertPosition.offset <= this.path[ i ] ) {\n\t\t\t\t// And are inserted before next node of that path...\n\t\t\t\t// \"Push\" the index on that path.\n\t\t\t\ttransformed.path[ i ] += howMany;\n\t\t\t}\n\t\t}\n\n\t\treturn transformed;\n\t}\n\n\t/**\n\t * Returns a copy of this position that is updated by moving `howMany` nodes from `sourcePosition` to `targetPosition`.\n\t *\n\t * @protected\n\t * @param {module:engine/model/position~Position} sourcePosition Position before the first element to move.\n\t * @param {module:engine/model/position~Position} targetPosition Position where moved elements will be inserted.\n\t * @param {Number} howMany How many consecutive nodes to move, starting from `sourcePosition`.\n\t * @param {Boolean} insertBefore Flag indicating whether moved nodes are pasted before or after `insertPosition`.\n\t * This is important only when `targetPosition` and this position are same. If that is the case and the flag is\n\t * set to `true`, this position will get transformed by range insertion. If the flag is set to `false`, it won't.\n\t * @param {Boolean} [sticky] Flag indicating whether this position \"sticks\" to range, that is if it should be moved\n\t * with the moved range if it is equal to one of range's boundaries.\n\t * @returns {module:engine/model/position~Position} Transformed position.\n\t */\n\t_getTransformedByMove( sourcePosition, targetPosition, howMany, insertBefore, sticky ) {\n\t\t// Moving a range removes nodes from their original position. We acknowledge this by proper transformation.\n\t\tlet transformed = this._getTransformedByDeletion( sourcePosition, howMany );\n\n\t\t// Then we update target position, as it could be affected by nodes removal too.\n\t\ttargetPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );\n\n\t\tif ( transformed === null || ( sticky && transformed.isEqual( sourcePosition ) ) ) {\n\t\t\t// This position is inside moved range (or sticks to it).\n\t\t\t// In this case, we calculate a combination of this position, move source position and target position.\n\t\t\ttransformed = this._getCombined( sourcePosition, targetPosition );\n\t\t} else {\n\t\t\t// This position is not inside a removed range.\n\t\t\t// In next step, we simply reflect inserting `howMany` nodes, which might further affect the position.\n\t\t\ttransformed = transformed._getTransformedByInsertion( targetPosition, howMany, insertBefore );\n\t\t}\n\n\t\treturn transformed;\n\t}\n\n\t/**\n\t * Returns a new position that is a combination of this position and given positions.\n\t *\n\t * The combined position is a copy of this position transformed by moving a range starting at `source` position\n\t * to the `target` position. It is expected that this position is inside the moved range.\n\t *\n\t * Example:\n\t *\n\t *\t\tlet original = new Position( root, [ 2, 3, 1 ] );\n\t *\t\tlet source = new Position( root, [ 2, 2 ] );\n\t *\t\tlet target = new Position( otherRoot, [ 1, 1, 3 ] );\n\t *\t\toriginal._getCombined( source, target ); // path is [ 1, 1, 4, 1 ], root is `otherRoot`\n\t *\n\t * Explanation:\n\t *\n\t * We have a position `[ 2, 3, 1 ]` and move some nodes from `[ 2, 2 ]` to `[ 1, 1, 3 ]`. The original position\n\t * was inside moved nodes and now should point to the new place. The moved nodes will be after\n\t * positions `[ 1, 1, 3 ]`, `[ 1, 1, 4 ]`, `[ 1, 1, 5 ]`. Since our position was in the second moved node,\n\t * the transformed position will be in a sub-tree of a node at `[ 1, 1, 4 ]`. Looking at original path, we\n\t * took care of `[ 2, 3 ]` part of it. Now we have to add the rest of the original path to the transformed path.\n\t * Finally, the transformed position will point to `[ 1, 1, 4, 1 ]`.\n\t *\n\t * @protected\n\t * @param {module:engine/model/position~Position} source Beginning of the moved range.\n\t * @param {module:engine/model/position~Position} target Position where the range is moved.\n\t * @returns {module:engine/model/position~Position} Combined position.\n\t */\n\t_getCombined( source, target ) {\n\t\tconst i = source.path.length - 1;\n\n\t\t// The first part of a path to combined position is a path to the place where nodes were moved.\n\t\tlet combined = Position.createFromPosition( target );\n\n\t\t// Then we have to update the rest of the path.\n\n\t\t// Fix the offset because this position might be after `from` position and we have to reflect that.\n\t\tcombined.offset = combined.offset + this.path[ i ] - source.offset;\n\n\t\t// Then, add the rest of the path.\n\t\t// If this position is at the same level as `from` position nothing will get added.\n\t\tcombined.path = combined.path.concat( this.path.slice( i + 1 ) );\n\n\t\treturn combined;\n\t}\n\n\t/**\n\t * Creates position at the given location. The location can be specified as:\n\t *\n\t * * a {@link module:engine/model/position~Position position},\n\t * * parent element and offset (offset defaults to `0`),\n\t * * parent element and `'end'` (sets position at the end of that element),\n\t * * {@link module:engine/model/item~Item model item} and `'before'` or `'after'` (sets position before or after given model item).\n\t *\n\t * This method is a shortcut to other constructors such as:\n\t *\n\t * * {@link module:engine/model/position~Position.createBefore},\n\t * * {@link module:engine/model/position~Position.createAfter},\n\t * * {@link module:engine/model/position~Position.createFromParentAndOffset},\n\t * * {@link module:engine/model/position~Position.createFromPosition}.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tstatic createAt( itemOrPosition, offset ) {\n\t\tif ( itemOrPosition instanceof Position ) {\n\t\t\treturn this.createFromPosition( itemOrPosition );\n\t\t} else {\n\t\t\tconst node = itemOrPosition;\n\n\t\t\tif ( offset == 'end' ) {\n\t\t\t\toffset = node.maxOffset;\n\t\t\t} else if ( offset == 'before' ) {\n\t\t\t\treturn this.createBefore( node );\n\t\t\t} else if ( offset == 'after' ) {\n\t\t\t\treturn this.createAfter( node );\n\t\t\t} else if ( !offset ) {\n\t\t\t\toffset = 0;\n\t\t\t}\n\n\t\t\treturn this.createFromParentAndOffset( node, offset );\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new position, after given {@link module:engine/model/item~Item model item}.\n\t *\n\t * @param {module:engine/model/item~Item} item Item after which the position should be placed.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tstatic createAfter( item ) {\n\t\tif ( !item.parent ) {\n\t\t\t/**\n\t\t\t * You can not make position after root.\n\t\t\t *\n\t\t\t * @error position-after-root\n\t\t\t * @param {module:engine/model/item~Item} root\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-position-after-root: You can not make position after root.', { root: item } );\n\t\t}\n\n\t\treturn this.createFromParentAndOffset( item.parent, item.endOffset );\n\t}\n\n\t/**\n\t * Creates a new position, before the given {@link module:engine/model/item~Item model item}.\n\t *\n\t * @param {module:engine/model/item~Item} item Item before which the position should be placed.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tstatic createBefore( item ) {\n\t\tif ( !item.parent ) {\n\t\t\t/**\n\t\t\t * You can not make position before root.\n\t\t\t *\n\t\t\t * @error position-before-root\n\t\t\t * @param {module:engine/model/item~Item} root\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-position-before-root: You can not make position before root.', { root: item } );\n\t\t}\n\n\t\treturn this.createFromParentAndOffset( item.parent, item.startOffset );\n\t}\n\n\t/**\n\t * Creates a new position from the parent element and an offset in that element.\n\t *\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent Position's parent.\n\t * @param {Number} offset Position's offset.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tstatic createFromParentAndOffset( parent, offset ) {\n\t\tif ( !parent.is( 'element' ) && !parent.is( 'documentFragment' ) ) {\n\t\t\t/**\n\t\t\t * Position parent have to be a model element or model document fragment.\n\t\t\t *\n\t\t\t * @error position-parent-incorrect\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-position-parent-incorrect: Position parent have to be a element or document fragment.' );\n\t\t}\n\n\t\tconst path = parent.getPath();\n\n\t\tpath.push( offset );\n\n\t\treturn new this( parent.root, path );\n\t}\n\n\t/**\n\t * Creates a new position, which is equal to passed position.\n\t *\n\t * @param {module:engine/model/position~Position} position Position to be cloned.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tstatic createFromPosition( position ) {\n\t\treturn new this( position.root, position.path.slice() );\n\t}\n\n\t/**\n\t * Creates a `Position` instance from given plain object (i.e. parsed JSON string).\n\t *\n\t * @param {Object} json Plain object to be converted to `Position`.\n\t * @returns {module:engine/model/position~Position} `Position` instance created using given plain object.\n\t */\n\tstatic fromJSON( json, doc ) {\n\t\tif ( json.root === '$graveyard' ) {\n\t\t\treturn new Position( doc.graveyard, json.path );\n\t\t}\n\n\t\tif ( !doc.hasRoot( json.root ) ) {\n\t\t\t/**\n\t\t\t * Cannot create position for document. Root with specified name does not exist.\n\t\t\t *\n\t\t\t * @error position-fromjson-no-root\n\t\t\t * @param {String} rootName\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'model-position-fromjson-no-root: Cannot create position for document. Root with specified name does not exist.',\n\t\t\t\t{ rootName: json.root }\n\t\t\t);\n\t\t}\n\n\t\treturn new Position( doc.getRoot( json.root ), json.path );\n\t}\n}\n\n/**\n * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.\n * If positions are in different roots `'different'` flag is returned.\n *\n * @typedef {String} module:engine/model/position~PositionRelation\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/position.js\n// module id = 1\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/plugin\n */\n\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * The base class for CKEditor plugin classes.\n *\n * @mixes module:utils/observablemixin~ObservaleMixin\n */\nexport default class Plugin {\n\t/**\n\t * Creates a new Plugin instance. This is the first step of a plugin initialization.\n\t * See also {@link #init} and {@link #afterInit}.\n\t *\n\t * A plugin is always instantiated after its {@link module:core/plugin~Plugin.requires dependencies} and the\n\t * {@link #init} and {@link #afterInit} methods are called in the same order.\n\t *\n\t * Usually, you'll want to put your plugin's initialization code in the {@link #init} method.\n\t * The constructor can be understood as \"before init\" and used in special cases, just like\n\t * {@link #afterInit} servers for the special \"after init\" scenarios (e.g. code which depends on other\n\t * plugins, but which doesn't {@link module:core/plugin~Plugin.requires explicitly require} them).\n\t *\n\t * @param {module:core/editor/editor~Editor} editor\n\t */\n\tconstructor( editor ) {\n\t\t/**\n\t\t * The editor instance.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:core/editor/editor~Editor} module:core/plugin~Plugin#editor\n\t\t */\n\t\tthis.editor = editor;\n\t}\n\n\t/**\n\t * An array of plugins required by this plugin.\n\t *\n\t * To keep a plugin class definition tight it's recommended to define this property as a static getter:\n\t *\n\t *\t\timport Image from './image.js';\n\t *\n\t *\t\texport default class ImageCaption extends Plugin {\n *\t\t\tstatic get requires() {\n *\t\t\t\treturn [ Image ];\n *\t\t\t}\n\t *\t\t}\n\t *\n\t * @static\n\t * @member {Array.|undefined} module:core/plugin~Plugin.requires\n\t */\n\n\t/**\n\t * Optional name of the plugin. If set, the plugin will be available in\n\t * {@link module:core/plugincollection~PluginCollection#get} by its\n\t * name and its constructor. If not, then only by its constructor.\n\t *\n\t * The name should reflect the package name + path to that module. E.g. `ckeditor5-image/src/image.js` plugin\n\t * should be named `image/image` (the `ckeditor5-` prefix is stripped during compilation).\n\t *\n\t * To keep a plugin class definition tight it's recommended to define this property as a static getter:\n\t *\n\t *\t\texport default class ImageCaption {\n *\t\t\tstatic get pluginName() {\n *\t\t\t\treturn 'image/imagecaption';\n *\t\t\t}\n\t *\t\t}\n\t *\n\t * @static\n\t * @member {String|undefined} module:core/plugin~Plugin.pluginName\n\t */\n\n\t/**\n\t * The second stage (after plugin {@link #constructor}) of plugin initialization.\n\t * Unlike the plugin constructor this method can perform asynchronous.\n\t *\n\t * A plugin's `init()` method is called after its {@link module:core/plugin~Plugin.requires dependencies} are initialized,\n\t * so in the same order as constructors of these plugins.\n\t *\n\t * @returns {null|Promise}\n\t */\n\tinit() {}\n\n\t/**\n\t * The third (and last) stage of plugin initialization. See also {@link #constructor} and {@link #init}.\n\t *\n\t * @returns {null|Promise}\n\t */\n\tafterInit() {}\n\n\t/**\n\t * Destroys the plugin.\n\t *\n\t * @returns {null|Promise}\n\t */\n\tdestroy() {}\n}\n\nmix( Plugin, ObservableMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-core/src/plugin.js\n// module id = 2\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/range\n */\n\nimport Position from './position';\nimport TreeWalker from './treewalker';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Range class. Range is iterable.\n */\nexport default class Range {\n\t/**\n\t * Creates a range spanning from `start` position to `end` position.\n\t *\n\t * **Note:** Constructor creates it's own {@link module:engine/model/position~Position Position} instances basing on passed values.\n\t *\n\t * @param {module:engine/model/position~Position} start Start position.\n\t * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.\n\t */\n\tconstructor( start, end = null ) {\n\t\t/**\n\t\t * Start position.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/position~Position}\n\t\t */\n\t\tthis.start = Position.createFromPosition( start );\n\n\t\t/**\n\t\t * End position.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/position~Position}\n\t\t */\n\t\tthis.end = end ? Position.createFromPosition( end ) : Position.createFromPosition( start );\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns\n\t * them together with additional information like length or {@link module:engine/model/position~Position positions},\n\t * grouped as {@link module:engine/model/treewalker~TreeWalkerValue}.\n\t * It iterates over all {@link module:engine/model/textproxy~TextProxy text contents} that are inside the range\n\t * and all the {@link module:engine/model/element~Element}s that are entered into when iterating over this range.\n\t *\n\t * This iterator uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range\n\t * and `ignoreElementEnd` option set to `true`.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t*[ Symbol.iterator ]() {\n\t\tyield* new TreeWalker( { boundaries: this, ignoreElementEnd: true } );\n\t}\n\n\t/**\n\t * Returns whether the range is collapsed, that is if {@link #start start} and\n\t * {@link #end end} positions are equal.\n\t *\n\t * @type {Boolean}\n\t */\n\tget isCollapsed() {\n\t\treturn this.start.isEqual( this.end );\n\t}\n\n\t/**\n\t * Returns whether this range is flat, that is if {@link #start start} position and\n\t * {@link #end end} position are in the same {@link module:engine/model/position~Position#parent parent}.\n\t *\n\t * @type {Boolean}\n\t */\n\tget isFlat() {\n\t\treturn this.start.parent === this.end.parent;\n\t}\n\n\t/**\n\t * Range root element.\n\t *\n\t * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\treturn this.start.root;\n\t}\n\n\t/**\n\t * Checks whether this range contains given {@link module:engine/model/position~Position position}.\n\t *\n\t * @param {module:engine/model/position~Position} position Position to check.\n\t * @returns {Boolean} `true` if given {@link module:engine/model/position~Position position} is contained in this range, `false` otherwise.\n\t */\n\tcontainsPosition( position ) {\n\t\treturn position.isAfter( this.start ) && position.isBefore( this.end );\n\t}\n\n\t/**\n\t * Checks whether this range contains given {@link ~Range range}.\n\t *\n\t * @param {module:engine/model/range~Range} otherRange Range to check.\n\t * @returns {Boolean} `true` if given {@link ~Range range} boundaries are contained by this range, `false` otherwise.\n\t */\n\tcontainsRange( otherRange ) {\n\t\treturn this.containsPosition( otherRange.start ) && this.containsPosition( otherRange.end );\n\t}\n\n\t/**\n\t * Two ranges are equal if their {@link #start start} and\n\t * {@link #end end} positions are equal.\n\t *\n\t * @param {module:engine/model/range~Range} otherRange Range to compare with.\n\t * @returns {Boolean} `true` if ranges are equal, `false` otherwise.\n\t */\n\tisEqual( otherRange ) {\n\t\treturn this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end );\n\t}\n\n\t/**\n\t * Checks and returns whether this range intersects with given range.\n\t *\n\t * @param {module:engine/model/range~Range} otherRange Range to compare with.\n\t * @returns {Boolean} `true` if ranges intersect, `false` otherwise.\n\t */\n\tisIntersecting( otherRange ) {\n\t\treturn this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );\n\t}\n\n\t/**\n\t * Computes which part(s) of this {@link ~Range range} is not a part of given {@link ~Range range}.\n\t * Returned array contains zero, one or two {@link ~Range ranges}.\n\t *\n\t * Examples:\n\t *\n\t *\t\tlet range = new Range( new Position( root, [ 2, 7 ] ), new Position( root, [ 4, 0, 1 ] ) );\n\t *\t\tlet otherRange = new Range( new Position( root, [ 1 ] ), new Position( root, [ 5 ] ) );\n\t *\t\tlet transformed = range.getDifference( otherRange );\n\t *\t\t// transformed array has no ranges because `otherRange` contains `range`\n\t *\n\t *\t\totherRange = new Range( new Position( root, [ 1 ] ), new Position( root, [ 3 ] ) );\n\t *\t\ttransformed = range.getDifference( otherRange );\n\t *\t\t// transformed array has one range: from [ 3 ] to [ 4, 0, 1 ]\n\t *\n\t *\t\totherRange = new Range( new Position( root, [ 3 ] ), new Position( root, [ 4 ] ) );\n\t *\t\ttransformed = range.getDifference( otherRange );\n\t *\t\t// transformed array has two ranges: from [ 2, 7 ] to [ 3 ] and from [ 4 ] to [ 4, 0, 1 ]\n\t *\n\t * @param {module:engine/model/range~Range} otherRange Range to differentiate against.\n\t * @returns {Array.} The difference between ranges.\n\t */\n\tgetDifference( otherRange ) {\n\t\tconst ranges = [];\n\n\t\tif ( this.isIntersecting( otherRange ) ) {\n\t\t\t// Ranges intersect.\n\n\t\t\tif ( this.containsPosition( otherRange.start ) ) {\n\t\t\t\t// Given range start is inside this range. This means that we have to\n\t\t\t\t// add shrunken range - from the start to the middle of this range.\n\t\t\t\tranges.push( new Range( this.start, otherRange.start ) );\n\t\t\t}\n\n\t\t\tif ( this.containsPosition( otherRange.end ) ) {\n\t\t\t\t// Given range end is inside this range. This means that we have to\n\t\t\t\t// add shrunken range - from the middle of this range to the end.\n\t\t\t\tranges.push( new Range( otherRange.end, this.end ) );\n\t\t\t}\n\t\t} else {\n\t\t\t// Ranges do not intersect, return the original range.\n\t\t\tranges.push( Range.createFromRange( this ) );\n\t\t}\n\n\t\treturn ranges;\n\t}\n\n\t/**\n\t * Returns an intersection of this {@link ~Range range} and given {@link ~Range range}.\n\t * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.\n\t *\n\t * Examples:\n\t *\n\t *\t\tlet range = new Range( new Position( root, [ 2, 7 ] ), new Position( root, [ 4, 0, 1 ] ) );\n\t *\t\tlet otherRange = new Range( new Position( root, [ 1 ] ), new Position( root, [ 2 ] ) );\n\t *\t\tlet transformed = range.getIntersection( otherRange ); // null - ranges have no common part\n\t *\n\t *\t\totherRange = new Range( new Position( root, [ 3 ] ), new Position( root, [ 5 ] ) );\n\t *\t\ttransformed = range.getIntersection( otherRange ); // range from [ 3 ] to [ 4, 0, 1 ]\n\t *\n\t * @param {module:engine/model/range~Range} otherRange Range to check for intersection.\n\t * @returns {module:engine/model/range~Range|null} A common part of given ranges or `null` if ranges have no common part.\n\t */\n\tgetIntersection( otherRange ) {\n\t\tif ( this.isIntersecting( otherRange ) ) {\n\t\t\t// Ranges intersect, so a common range will be returned.\n\t\t\t// At most, it will be same as this range.\n\t\t\tlet commonRangeStart = this.start;\n\t\t\tlet commonRangeEnd = this.end;\n\n\t\t\tif ( this.containsPosition( otherRange.start ) ) {\n\t\t\t\t// Given range start is inside this range. This means thaNt we have to\n\t\t\t\t// shrink common range to the given range start.\n\t\t\t\tcommonRangeStart = otherRange.start;\n\t\t\t}\n\n\t\t\tif ( this.containsPosition( otherRange.end ) ) {\n\t\t\t\t// Given range end is inside this range. This means that we have to\n\t\t\t\t// shrink common range to the given range end.\n\t\t\t\tcommonRangeEnd = otherRange.end;\n\t\t\t}\n\n\t\t\treturn new Range( commonRangeStart, commonRangeEnd );\n\t\t}\n\n\t\t// Ranges do not intersect, so they do not have common part.\n\t\treturn null;\n\t}\n\n\t/**\n\t * Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.\n\t *\n\t * See an example of a model structure (`[` and `]` are range boundaries):\n\t *\n\t *\t\troot root\n\t *\t\t |- element DIV DIV P2 P3 DIV\n\t *\t\t | |- element H H P1 f o o b a r H P4\n\t *\t\t | | |- \"fir[st\" fir[st lorem se]cond ipsum\n\t *\t\t | |- element P1\n\t *\t\t | | |- \"lorem\" ||\n\t *\t\t |- element P2 ||\n\t *\t\t | |- \"foo\" VV\n\t *\t\t |- element P3\n\t *\t\t | |- \"bar\" root\n\t *\t\t |- element DIV DIV [P2 P3] DIV\n\t *\t\t | |- element H H [P1] f o o b a r H P4\n\t *\t\t | | |- \"se]cond\" fir[st] lorem [se]cond ipsum\n\t *\t\t | |- element P4\n\t *\t\t | | |- \"ipsum\"\n\t *\n\t * As it can be seen, letters contained in the range are: `stloremfoobarse`, spread across different parents.\n\t * We are looking for minimal set of flat ranges that contains the same nodes.\n\t *\n\t * Minimal flat ranges for above range `( [ 0, 0, 3 ], [ 3, 0, 2 ] )` will be:\n\t *\n\t *\t\t( [ 0, 0, 3 ], [ 0, 0, 5 ] ) = \"st\"\n\t *\t\t( [ 0, 1 ], [ 0, 2 ] ) = element P1 (\"lorem\")\n\t *\t\t( [ 1 ], [ 3 ] ) = element P2, element P3 (\"foobar\")\n\t *\t\t( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = \"se\"\n\t *\n\t * **Note:** if an {@link module:engine/model/element~Element element} is not wholly contained in this range, it won't be returned\n\t * in any of the returned flat ranges. See in the example how `H` elements at the beginning and at the end of the range\n\t * were omitted. Only their parts that were wholly in the range were returned.\n\t *\n\t * **Note:** this method is not returning flat ranges that contain no nodes.\n\t *\n\t * @returns {Array.} Array of flat ranges covering this range.\n\t */\n\tgetMinimalFlatRanges() {\n\t\tconst ranges = [];\n\t\tconst diffAt = this.start.getCommonPath( this.end ).length;\n\n\t\tlet pos = Position.createFromPosition( this.start );\n\t\tlet posParent = pos.parent;\n\n\t\t// Go up.\n\t\twhile ( pos.path.length > diffAt + 1 ) {\n\t\t\tlet howMany = posParent.maxOffset - pos.offset;\n\n\t\t\tif ( howMany !== 0 ) {\n\t\t\t\tranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );\n\t\t\t}\n\n\t\t\tpos.path = pos.path.slice( 0, -1 );\n\t\t\tpos.offset++;\n\t\t\tposParent = posParent.parent;\n\t\t}\n\n\t\t// Go down.\n\t\twhile ( pos.path.length <= this.end.path.length ) {\n\t\t\tlet offset = this.end.path[ pos.path.length - 1 ];\n\t\t\tlet howMany = offset - pos.offset;\n\n\t\t\tif ( howMany !== 0 ) {\n\t\t\t\tranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );\n\t\t\t}\n\n\t\t\tpos.offset = offset;\n\t\t\tpos.path.push( 0 );\n\t\t}\n\n\t\treturn ranges;\n\t}\n\n\t/**\n\t * Creates a {@link module:engine/model/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.\n\t *\n\t * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n\t * @param {module:engine/model/position~Position} [options.startPosition]\n\t * @param {Boolean} [options.singleCharacters=false]\n\t * @param {Boolean} [options.shallow=false]\n\t * @param {Boolean} [options.ignoreElementEnd=false]\n\t */\n\tgetWalker( options = {} ) {\n\t\toptions.boundaries = this;\n\n\t\treturn new TreeWalker( options );\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns\n\t * them.\n\t *\n\t * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option\n\t * set to `true`. However it returns only {@link module:engine/model/item~Item model items},\n\t * not {@link module:engine/model/treewalker~TreeWalkerValue}.\n\t *\n\t * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for\n\t * a full list of available options.\n\t *\n\t * @method getItems\n\t * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n\t * @returns {Iterable.}\n\t */\n\t*getItems( options = {} ) {\n\t\toptions.boundaries = this;\n\t\toptions.ignoreElementEnd = true;\n\n\t\tconst treeWalker = new TreeWalker( options );\n\n\t\tfor ( let value of treeWalker ) {\n\t\t\tyield value.item;\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all {@link module:engine/model/position~Position positions} that are boundaries or\n\t * contained in this range.\n\t *\n\t * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only\n\t * {@link module:engine/model/position~Position positions}, not {@link module:engine/model/treewalker~TreeWalkerValue}.\n\t *\n\t * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for\n\t * a full list of available options.\n\t *\n\t * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n\t * @returns {Iterable.}\n\t */\n\t*getPositions( options = {} ) {\n\t\toptions.boundaries = this;\n\n\t\tconst treeWalker = new TreeWalker( options );\n\n\t\tyield treeWalker.position;\n\n\t\tfor ( let value of treeWalker ) {\n\t\t\tyield value.nextPosition;\n\t\t}\n\t}\n\n\t/**\n\t * Returns a range that is a result of transforming this range by given `delta`.\n\t *\n\t * **Note:** transformation may break one range into multiple ranges (e.g. when a part of the range is\n\t * moved to a different part of document tree). For this reason, an array is returned by this method and it\n\t * may contain one or more `Range` instances.\n\t *\n\t * @param {module:engine/model/delta/delta~Delta} delta Delta to transform range by.\n\t * @returns {Array.} Range which is the result of transformation.\n\t */\n\tgetTransformedByDelta( delta ) {\n\t\tlet ranges = [ Range.createFromRange( this ) ];\n\n\t\t// Operation types that a range can be transformed by.\n\t\tconst supportedTypes = new Set( [ 'insert', 'move', 'remove', 'reinsert' ] );\n\n\t\tfor ( let operation of delta.operations ) {\n\t\t\tif ( supportedTypes.has( operation.type ) ) {\n\t\t\t\tfor ( let i = 0; i < ranges.length; i++ ) {\n\t\t\t\t\tconst result = ranges[ i ]._getTransformedByDocumentChange(\n\t\t\t\t\t\toperation.type,\n\t\t\t\t\t\tdelta.type,\n\t\t\t\t\t\toperation.targetPosition || operation.position,\n\t\t\t\t\t\toperation.howMany || operation.nodes.maxOffset,\n\t\t\t\t\t\toperation.sourcePosition\n\t\t\t\t\t);\n\n\t\t\t\t\tranges.splice( i, 1, ...result );\n\n\t\t\t\t\ti += result.length - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn ranges;\n\t}\n\n\t/**\n\t * Returns a range that is a result of transforming this range by multiple `deltas`.\n\t *\n\t * **Note:** transformation may break one range into multiple ranges (e.g. when a part of the range is\n\t * moved to a different part of document tree). For this reason, an array is returned by this method and it\n\t * may contain one or more `Range` instances.\n\t *\n\t * @param {Iterable.} deltas Deltas to transform the range by.\n\t * @returns {Array.} Range which is the result of transformation.\n\t */\n\tgetTransformedByDeltas( deltas ) {\n\t\tlet ranges = [ Range.createFromRange( this ) ];\n\n\t\tfor ( let delta of deltas ) {\n\t\t\tfor ( let i = 0; i < ranges.length; i++ ) {\n\t\t\t\tlet result = ranges[ i ].getTransformedByDelta( delta );\n\n\t\t\t\tranges.splice( i, 1, ...result );\n\t\t\t\ti += result.length - 1;\n\t\t\t}\n\t\t}\n\n\t\t// It may happen that a range is split into two, and then the part of second \"piece\" is moved into first\n\t\t// \"piece\". In this case we will have incorrect third rage, which should not be included in the result --\n\t\t// because it is already included in first \"piece\". In this loop we are looking for all such ranges that\n\t\t// are inside other ranges and we simply remove them.\n\t\tfor ( let i = 0; i < ranges.length; i++ ) {\n\t\t\tconst range = ranges[ i ];\n\n\t\t\tfor ( let j = i + 1; j < ranges.length; j++ ) {\n\t\t\t\tconst next = ranges[ j ];\n\n\t\t\t\tif ( range.containsRange( next ) || next.containsRange( range ) || range.isEqual( next ) ) {\n\t\t\t\t\tranges.splice( j, 1 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn ranges;\n\t}\n\n\t/**\n\t * Returns a range that is a result of transforming this range by a change in the model document.\n\t *\n\t * @protected\n\t * @param {'insert'|'move'|'remove'|'reinsert'} type Change type.\n\t * @param {String} deltaType Type of delta that introduced the change.\n\t * @param {module:engine/model/position~Position} targetPosition Position before the first changed node.\n\t * @param {Number} howMany How many nodes has been changed.\n\t * @param {module:engine/model/position~Position} sourcePosition Source position of changes.\n\t * @returns {Array.}\n\t */\n\t_getTransformedByDocumentChange( type, deltaType, targetPosition, howMany, sourcePosition ) {\n\t\tif ( type == 'insert' ) {\n\t\t\treturn this._getTransformedByInsertion( targetPosition, howMany, false, false );\n\t\t} else {\n\t\t\tconst sourceRange = Range.createFromPositionAndShift( sourcePosition, howMany );\n\n\t\t\tif ( deltaType == 'merge' && this.isCollapsed && ( this.start.isEqual( sourceRange.start ) || this.start.isEqual( sourceRange.end ) ) ) {\n\t\t\t\t// Collapsed range is in merged element.\n\t\t\t\t// Without fix, the range would end up in the graveyard, together with removed element.\n\t\t\t\t//

foo

[]bar

->

foobar

[]

->

foobar

->

foo[]bar

\n\t\t\t\treturn [ new Range( targetPosition.getShiftedBy( this.start.offset ) ) ];\n\t\t\t} else if ( type == 'move' ) {\n\t\t\t\t// In all examples `[]` is `this` and `{}` is `sourceRange`, while `^` is move target position.\n\t\t\t\t//\n\t\t\t\t// Example:\n\t\t\t\t//

xx

^{

a[b

}

c]d

-->

xx

a[b

c]d

\n\t\t\t\t// ^

xx

{

a[b

}

c]d

-->

a[b

xx

c]d

// Note

xx

inclusion.\n\t\t\t\t// {

a[b

}
^

c]d

-->

a[b

c]d

\n\t\t\t\tif ( sourceRange.containsPosition( this.start ) && this.containsPosition( sourceRange.end ) && this.end.isAfter( targetPosition ) ) {\n\t\t\t\t\tlet start = this.start._getCombined( sourcePosition, targetPosition._getTransformedByDeletion( sourcePosition, howMany ) );\n\t\t\t\t\tconst end = this.end._getTransformedByMove( sourcePosition, targetPosition, howMany, false, false );\n\n\t\t\t\t\treturn [ new Range( start, end ) ];\n\t\t\t\t}\n\n\t\t\t\t// Example:\n\t\t\t\t//

c[d

{

a]b

}
^

xx

-->

c[d

a]b

xx

\n\t\t\t\t//

c[d

{

a]b

}

xx

^ -->

c[d

xx

a]b

// Note

xx

inclusion.\n\t\t\t\t//

c[d

^{

a]b

}
-->

c[d

a]b

\n\t\t\t\tif ( sourceRange.containsPosition( this.end ) && this.containsPosition( sourceRange.start ) && this.start.isBefore( targetPosition ) ) {\n\t\t\t\t\tconst start = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany, true, false );\n\t\t\t\t\tlet end = this.end._getCombined( sourcePosition, targetPosition._getTransformedByDeletion( sourcePosition, howMany ) );\n\n\t\t\t\t\treturn [ new Range( start, end ) ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this._getTransformedByMove( sourcePosition, targetPosition, howMany );\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this\n\t * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are\n\t * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.\n\t *\n\t * Examples:\n\t *\n\t *\t\tlet range = new Range( new Position( root, [ 2, 7 ] ), new Position( root, [ 4, 0, 1 ] ) );\n\t *\t\tlet transformed = range._getTransformedByInsertion( new Position( root, [ 1 ] ), 2 );\n\t *\t\t// transformed array has one range from [ 4, 7 ] to [ 6, 0, 1 ]\n\t *\n\t *\t\ttransformed = range._getTransformedByInsertion( new Position( root, [ 4, 0, 0 ] ), 4 );\n\t *\t\t// transformed array has one range from [ 2, 7 ] to [ 4, 0, 5 ]\n\t *\n\t *\t\ttransformed = range._getTransformedByInsertion( new Position( root, [ 3, 2 ] ), 4 );\n\t *\t\t// transformed array has one range, which is equal to original range\n\t *\n\t *\t\ttransformed = range._getTransformedByInsertion( new Position( root, [ 3, 2 ] ), 4, true );\n\t *\t\t// transformed array has two ranges: from [ 2, 7 ] to [ 3, 2 ] and from [ 3, 6 ] to [ 4, 0, 1 ]\n\t *\n\t *\t\ttransformed = range._getTransformedByInsertion( new Position( root, [ 4, 0, 1 ] ), 4, false, false );\n\t *\t\t// transformed array has one range which is equal to original range because insertion is after the range boundary\n\t *\n\t *\t\ttransformed = range._getTransformedByInsertion( new Position( root, [ 4, 0, 1 ] ), 4, false, true );\n\t *\t\t// transformed array has one range: from [ 2, 7 ] to [ 4, 0, 5 ] because range was expanded\n\t *\n\t * @protected\n\t * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.\n\t * @param {Number} howMany How many nodes are inserted.\n\t * @param {Boolean} [spread] Flag indicating whether this {~Range range} should be spread if insertion\n\t * was inside the range. Defaults to `false`.\n\t * @param {Boolean} [isSticky] Flag indicating whether insertion should expand a range if it is in a place of\n\t * range boundary. Defaults to `false`.\n\t * @returns {Array.} Result of the transformation.\n\t */\n\t_getTransformedByInsertion( insertPosition, howMany, spread = false, isSticky = false ) {\n\t\tif ( spread && this.containsPosition( insertPosition ) ) {\n\t\t\t// Range has to be spread. The first part is from original start to the spread point.\n\t\t\t// The other part is from spread point to the original end, but transformed by\n\t\t\t// insertion to reflect insertion changes.\n\n\t\t\treturn [\n\t\t\t\tnew Range( this.start, insertPosition ),\n\t\t\t\tnew Range(\n\t\t\t\t\tinsertPosition._getTransformedByInsertion( insertPosition, howMany, true ),\n\t\t\t\t\tthis.end._getTransformedByInsertion( insertPosition, howMany, this.isCollapsed )\n\t\t\t\t)\n\t\t\t];\n\t\t} else {\n\t\t\tconst range = Range.createFromRange( this );\n\n\t\t\tlet insertBeforeStart = range.isCollapsed ? true : !isSticky;\n\t\t\tlet insertBeforeEnd = range.isCollapsed ? true : isSticky;\n\n\t\t\trange.start = range.start._getTransformedByInsertion( insertPosition, howMany, insertBeforeStart );\n\t\t\trange.end = range.end._getTransformedByInsertion( insertPosition, howMany, insertBeforeEnd );\n\n\t\t\treturn [ range ];\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array containing {@link ~Range ranges} that are a result of transforming this\n\t * {@link ~Range range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.\n\t *\n\t * @protected\n\t * @param {module:engine/model/position~Position} sourcePosition Position from which nodes are moved.\n\t * @param {module:engine/model/position~Position} targetPosition Position to where nodes are moved.\n\t * @param {Number} howMany How many nodes are moved.\n\t * @returns {Array.} Result of the transformation.\n\t */\n\t_getTransformedByMove( sourcePosition, targetPosition, howMany ) {\n\t\tif ( this.isCollapsed ) {\n\t\t\tconst newPos = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany, true, false );\n\n\t\t\treturn [ new Range( newPos ) ];\n\t\t}\n\n\t\tlet result;\n\n\t\tconst moveRange = new Range( sourcePosition, sourcePosition.getShiftedBy( howMany ) );\n\n\t\tconst differenceSet = this.getDifference( moveRange );\n\t\tlet difference = null;\n\n\t\tconst common = this.getIntersection( moveRange );\n\n\t\tif ( differenceSet.length == 1 ) {\n\t\t\t// `moveRange` and this range may intersect.\n\t\t\tdifference = new Range(\n\t\t\t\tdifferenceSet[ 0 ].start._getTransformedByDeletion( sourcePosition, howMany ),\n\t\t\t\tdifferenceSet[ 0 ].end._getTransformedByDeletion( sourcePosition, howMany )\n\t\t\t);\n\t\t} else if ( differenceSet.length == 2 ) {\n\t\t\t// `moveRange` is inside this range.\n\t\t\tdifference = new Range(\n\t\t\t\tthis.start,\n\t\t\t\tthis.end._getTransformedByDeletion( sourcePosition, howMany )\n\t\t\t);\n\t\t} // else, `moveRange` contains this range.\n\n\t\tconst insertPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );\n\n\t\tif ( difference ) {\n\t\t\tresult = difference._getTransformedByInsertion( insertPosition, howMany, common !== null );\n\t\t} else {\n\t\t\tresult = [];\n\t\t}\n\n\t\tif ( common ) {\n\t\t\tresult.push( new Range(\n\t\t\t\tcommon.start._getCombined( moveRange.start, insertPosition ),\n\t\t\t\tcommon.end._getCombined( moveRange.start, insertPosition )\n\t\t\t) );\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by\n\t * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.\n\t *\n\t * @param {module:engine/model/position~Position} position Beginning of the range.\n\t * @param {Number} shift How long the range should be.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tstatic createFromPositionAndShift( position, shift ) {\n\t\tconst start = position;\n\t\tconst end = position.getShiftedBy( shift );\n\n\t\treturn shift > 0 ? new this( start, end ) : new this( end, start );\n\t}\n\n\t/**\n\t * Creates a range from given parents and offsets.\n\t *\n\t * @param {module:engine/model/element~Element} startElement Start position parent element.\n\t * @param {Number} startOffset Start position offset.\n\t * @param {module:engine/model/element~Element} endElement End position parent element.\n\t * @param {Number} endOffset End position offset.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tstatic createFromParentsAndOffsets( startElement, startOffset, endElement, endOffset ) {\n\t\treturn new this(\n\t\t\tPosition.createFromParentAndOffset( startElement, startOffset ),\n\t\t\tPosition.createFromParentAndOffset( endElement, endOffset )\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of `Range` which is equal to passed range.\n\t *\n\t * @param {module:engine/model/range~Range} range Range to clone.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tstatic createFromRange( range ) {\n\t\treturn new this( range.start, range.end );\n\t}\n\n\t/**\n\t * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n\t * that element and ends after the last child of that element.\n\t *\n\t * @param {module:engine/model/element~Element} element Element which is a parent for the range.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tstatic createIn( element ) {\n\t\treturn this.createFromParentsAndOffsets( element, 0, element, element.maxOffset );\n\t}\n\n\t/**\n\t * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.\n\t *\n\t * @param {module:engine/model/item~Item} item\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tstatic createOn( item ) {\n\t\treturn this.createFromPositionAndShift( Position.createBefore( item ), item.offsetSize );\n\t}\n\n\t/**\n\t * Combines all ranges from the passed array into a one range. At least one range has to be passed.\n\t * Passed ranges must not have common parts.\n\t *\n\t * The first range from the array is a reference range. If other ranges start or end on the exactly same position where\n\t * the reference range, they get combined into one range.\n\t *\n\t *\t\t[ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted\n\t *\t\t[ ] // The result of the function if the first range was a reference range.\n\t *\t [ ] // The result of the function if the third-to-seventh range was a reference range.\n\t *\t [ ] // The result of the function if the last range was a reference range.\n\t *\n\t * @param {Array.} ranges Ranges to combine.\n\t * @returns {module:engine/model/range~Range} Combined range.\n\t */\n\tstatic createFromRanges( ranges ) {\n\t\tif ( ranges.length === 0 ) {\n\t\t\t/**\n\t\t\t * At least one range has to be passed.\n\t\t\t *\n\t\t\t * @error range-create-from-ranges-empty-array\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'range-create-from-ranges-empty-array: At least one range has to be passed.' );\n\t\t} else if ( ranges.length == 1 ) {\n\t\t\treturn this.createFromRange( ranges[ 0 ] );\n\t\t}\n\n\t\t// 1. Set the first range in `ranges` array as a reference range.\n\t\t// If we are going to return just a one range, one of the ranges need to be the reference one.\n\t\t// Other ranges will be stuck to that range, if possible.\n\t\tconst ref = ranges[ 0 ];\n\n\t\t// 2. Sort all the ranges so it's easier to process them.\n\t\tranges.sort( ( a, b ) => a.start.isAfter( b.start ) );\n\n\t\t// 3. Check at which index the reference range is now.\n\t\tconst refIndex = ranges.indexOf( ref );\n\n\t\t// 4. At this moment we don't need the original range.\n\t\t// We are going to modify the result and we need to return a new instance of Range.\n\t\t// We have to create a copy of the reference range.\n\t\tconst result = new this( ref.start, ref.end );\n\n\t\t// 5. Ranges should be checked and glued starting from the range that is closest to the reference range.\n\t\t// Since ranges are sorted, start with the range with index that is closest to reference range index.\n\t\tfor ( let i = refIndex - 1; i >= 0; i++ ) {\n\t\t\tif ( ranges[ i ].end.isEqual( result.start ) ) {\n\t\t\t\tresult.start = Position.createFromPosition( ranges[ i ].start );\n\t\t\t} else {\n\t\t\t\t// If ranges are not starting/ending at the same position there is no point in looking further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// 6. Ranges should be checked and glued starting from the range that is closest to the reference range.\n\t\t// Since ranges are sorted, start with the range with index that is closest to reference range index.\n\t\tfor ( let i = refIndex + 1; i < ranges.length; i++ ) {\n\t\t\tif ( ranges[ i ].start.isEqual( result.end ) ) {\n\t\t\t\tresult.end = Position.createFromPosition( ranges[ i ].end );\n\t\t\t} else {\n\t\t\t\t// If ranges are not starting/ending at the same position there is no point in looking further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Creates a `Range` instance from given plain object (i.e. parsed JSON string).\n\t *\n\t * @param {Object} json Plain object to be converted to `Range`.\n\t * @param {module:engine/model/document~Document} doc Document object that will be range owner.\n\t * @returns {module:engine/model/element~Element} `Range` instance created using given plain object.\n\t */\n\tstatic fromJSON( json, doc ) {\n\t\treturn new this( Position.fromJSON( json.start, doc ), Position.fromJSON( json.end, doc ) );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/range.js\n// module id = 3\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/mix\n */\n\n/**\n * Copies enumerable properties and symbols from the objects given as 2nd+ parameters to the\n * prototype of first object (a constructor).\n *\n *\t\tclass Editor {\n *\t\t\t...\n *\t\t}\n *\n *\t\tconst SomeMixin = {\n *\t\t\ta() {\n *\t\t\t\treturn 'a';\n *\t\t\t}\n *\t\t};\n *\n *\t\tmix( Editor, SomeMixin, ... );\n *\n *\t\tnew Editor().a(); // -> 'a'\n *\n * Note: Properties which already exist in the base class will not be overriden.\n *\n * @param {Function} [baseClass] Class which prototype will be extended.\n * @param {Object} [...mixins] Objects from which to get properties.\n */\nexport default function mix( baseClass, ...mixins ) {\n\tmixins.forEach( ( mixin ) => {\n\t\tObject.getOwnPropertyNames( mixin ).concat( Object.getOwnPropertySymbols( mixin ) )\n\t\t\t.forEach( ( key ) => {\n\t\t\t\tif ( key in baseClass.prototype ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst sourceDescriptor = Object.getOwnPropertyDescriptor( mixin, key );\n\t\t\t\tsourceDescriptor.enumerable = false;\n\n\t\t\t\tObject.defineProperty( baseClass.prototype, key, sourceDescriptor );\n\t\t\t} );\n\t} );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/mix.js\n// module id = 4\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/element\n */\n\nimport Node from './node';\nimport NodeList from './nodelist';\nimport Text from './text';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\n\n/**\n * Model element. Type of {@link module:engine/model/node~Node node} that has a {@link module:engine/model/element~Element#name name} and\n * {@link module:engine/model/element~Element#getChildren child nodes}.\n *\n * **Important**: see {@link module:engine/model/node~Node} to read about restrictions using `Element` and `Node` API.\n */\nexport default class Element extends Node {\n\t/**\n\t * Creates a model element.\n\t *\n\t * @param {String} name Element's name.\n\t * @param {Object} [attrs] Element's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n\t * @param {module:engine/model/node~Node|Iterable.} [children]\n\t * One or more nodes to be inserted as children of created element.\n\t */\n\tconstructor( name, attrs, children ) {\n\t\tsuper( attrs );\n\n\t\t/**\n\t\t * Element name.\n\t\t *\n\t\t * @member {String} module:engine/model/element~Element#name\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t * List of children nodes.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/nodelist~NodeList} module:engine/model/element~Element#_children\n\t\t */\n\t\tthis._children = new NodeList();\n\n\t\tif ( children ) {\n\t\t\tthis.insertChildren( 0, children );\n\t\t}\n\t}\n\n\t/**\n\t * Number of this element's children.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget childCount() {\n\t\treturn this._children.length;\n\t}\n\n\t/**\n\t * Sum of {module:engine/model/node~Node#offsetSize offset sizes} of all of this element's children.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget maxOffset() {\n\t\treturn this._children.maxOffset;\n\t}\n\n\t/**\n\t * Is `true` if there are no nodes inside this element, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isEmpty() {\n\t\treturn this.childCount === 0;\n\t}\n\n\t/**\n\t * Checks whether given model tree object is of given type.\n\t *\n\t *\t\tobj.name; // 'listItem'\n\t *\t\tobj instanceof Element; // true\n\t *\n\t *\t\tobj.is( 'element' ); // true\n\t *\t\tobj.is( 'listItem' ); // true\n\t *\t\tobj.is( 'element', 'listItem' ); // true\n\t *\t\tobj.is( 'text' ); // false\n\t *\t\tobj.is( 'element', 'image' ); // false\n\t *\n\t * Read more in {@link module:engine/model/node~Node#is}.\n\t *\n\t * @param {String} type Type to check when `name` parameter is present.\n\t * Otherwise, it acts like the `name` parameter.\n\t * @param {String} [name] Element name.\n\t * @returns {Boolean}\n\t */\n\tis( type, name = null ) {\n\t\tif ( !name ) {\n\t\t\treturn type == 'element' || type == this.name;\n\t\t} else {\n\t\t\treturn type == 'element' && name == this.name;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the child at the given index.\n\t *\n\t * @param {Number} index Index of child.\n\t * @returns {module:engine/model/node~Node} Child node.\n\t */\n\tgetChild( index ) {\n\t\treturn this._children.getNode( index );\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all of this element's children.\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetChildren() {\n\t\treturn this._children[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Returns an index of the given child node. Returns `null` if given node is not a child of this element.\n\t *\n\t * @param {module:engine/model/node~Node} node Child node to look for.\n\t * @returns {Number} Child node's index in this element.\n\t */\n\tgetChildIndex( node ) {\n\t\treturn this._children.getNodeIndex( node );\n\t}\n\n\t/**\n\t * Returns the starting offset of given child. Starting offset is equal to the sum of\n\t * {module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if\n\t * given node is not a child of this element.\n\t *\n\t * @param {module:engine/model/node~Node} node Child node to look for.\n\t * @returns {Number} Child node's starting offset.\n\t */\n\tgetChildStartOffset( node ) {\n\t\treturn this._children.getNodeStartOffset( node );\n\t}\n\n\t/**\n\t * Creates a copy of this element and returns it. Created element has same name and attributes as original element.\n\t * If clone is not deep, children of copied element are references to the same nodes as in original element.\n\t * If clone is deep, original element's children are also cloned.\n\t *\n\t * @param {Boolean} [deep=false] Decides whether children of this element should also be cloned (`true`) or not (`false`).\n\t */\n\tclone( deep = false ) {\n\t\tconst children = deep ?\n\t\t\tArray.from( this._children ).map( ( node ) => node.clone() ) :\n\t\t\tArray.from( this._children );\n\n\t\treturn new Element( this.name, this.getAttributes(), children );\n\t}\n\n\t/**\n\t * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is\n\t * too high, returns {@link module:engine/model/element~Element#getChildIndex index after last child}.\n\t *\n\t *\t\tconst textNode = new Text( 'foo' );\n\t *\t\tconst pElement = new Element( 'p' );\n\t *\t\tconst divElement = new Element( [ textNode, pElement ] );\n\t *\t\tdivElement.offsetToIndex( -1 ); // Returns 0, because offset is too low.\n\t *\t\tdivElement.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.\n\t *\t\tdivElement.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.\n\t *\t\tdivElement.offsetToIndex( 2 ); // Returns 0.\n\t *\t\tdivElement.offsetToIndex( 3 ); // Returns 1.\n\t *\t\tdivElement.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.\n\t *\n\t * @param {Number} offset Offset to look for.\n\t * @returns {Number}\n\t */\n\toffsetToIndex( offset ) {\n\t\treturn this._children.offsetToIndex( offset );\n\t}\n\n\t/**\n\t * {@link module:engine/model/element~Element#insertChildren Inserts} one or more nodes at the end of this element.\n\t *\n\t * @param {module:engine/model/node~Node|Iterable.} nodes Nodes to be inserted.\n\t */\n\tappendChildren( nodes ) {\n\t\tthis.insertChildren( this.childCount, nodes );\n\t}\n\n\t/**\n\t * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes\n\t * to this element.\n\t *\n\t * @param {Number} index Index at which nodes should be inserted.\n\t * @param {module:engine/model/node~Node|Iterable.} nodes Nodes to be inserted.\n\t */\n\tinsertChildren( index, nodes ) {\n\t\tnodes = normalize( nodes );\n\n\t\tfor ( let node of nodes ) {\n\t\t\tnode.parent = this;\n\t\t}\n\n\t\tthis._children.insertNodes( index, nodes );\n\t}\n\n\t/**\n\t * Removes one or more nodes starting at the given index and sets\n\t * {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.\n\t *\n\t * @param {Number} index Index of the first node to remove.\n\t * @param {Number} [howMany=1] Number of nodes to remove.\n\t * @returns {Array.} Array containing removed nodes.\n\t */\n\tremoveChildren( index, howMany = 1 ) {\n\t\tconst nodes = this._children.removeNodes( index, howMany );\n\n\t\tfor ( let node of nodes ) {\n\t\t\tnode.parent = null;\n\t\t}\n\n\t\treturn nodes;\n\t}\n\n\t/**\n\t * Returns a descendant node by its path relative to this element.\n\t *\n\t *\t\t// ac\n\t *\t\tthis.getNodeByPath( [ 0 ] ); // -> \"a\"\n\t *\t\tthis.getNodeByPath( [ 1 ] ); // -> \n\t *\t\tthis.getNodeByPath( [ 1, 0 ] ); // -> \"c\"\n\t *\n\t * @param {Array.} relativePath Path of the node to find, relative to this element.\n\t * @returns {module:engine/model/node~Node}\n\t */\n\tgetNodeByPath( relativePath ) {\n\t\tlet node = this;\n\n\t\tfor ( const index of relativePath ) {\n\t\t\tnode = node.getChild( index );\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Converts `Element` instance to plain object and returns it. Takes care of converting all of this element's children.\n\t *\n\t * @returns {Object} `Element` instance converted to plain object.\n\t */\n\ttoJSON() {\n\t\tlet json = super.toJSON();\n\n\t\tjson.name = this.name;\n\n\t\tif ( this._children.length > 0 ) {\n\t\t\tjson.children = [];\n\n\t\t\tfor ( let node of this._children ) {\n\t\t\t\tjson.children.push( node.toJSON() );\n\t\t\t}\n\t\t}\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Creates an `Element` instance from given plain object (i.e. parsed JSON string).\n\t * Converts `Element` children to proper nodes.\n\t *\n\t * @param {Object} json Plain object to be converted to `Element`.\n\t * @returns {module:engine/model/element~Element} `Element` instance created using given plain object.\n\t */\n\tstatic fromJSON( json ) {\n\t\tlet children = null;\n\n\t\tif ( json.children ) {\n\t\t\tchildren = [];\n\n\t\t\tfor ( let child of json.children ) {\n\t\t\t\tif ( child.name ) {\n\t\t\t\t\t// If child has name property, it is an Element.\n\t\t\t\t\tchildren.push( Element.fromJSON( child ) );\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, it is a Text node.\n\t\t\t\t\tchildren.push( Text.fromJSON( child ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new Element( json.name, json.attributes, children );\n\t}\n}\n\n// Converts strings to Text and non-iterables to arrays.\n//\n// @param {String|module:engine/model/node~Node|Iterable.}\n// @return {Iterable.}\nfunction normalize( nodes ) {\n\t// Separate condition because string is iterable.\n\tif ( typeof nodes == 'string' ) {\n\t\treturn [ new Text( nodes ) ];\n\t}\n\n\tif ( !isIterable( nodes ) ) {\n\t\tnodes = [ nodes ];\n\t}\n\n\t// Array.from to enable .map() on non-arrays.\n\treturn Array.from( nodes ).map( ( node ) => typeof node == 'string' ? new Text( node ) : node );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/element.js\n// module id = 5\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/template\n */\n\n/* global document */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport Collection from '@ckeditor/ckeditor5-utils/src/collection';\nimport View from './view';\nimport ViewCollection from './viewcollection';\nimport cloneDeepWith from '@ckeditor/ckeditor5-utils/src/lib/lodash/cloneDeepWith';\nimport isObject from '@ckeditor/ckeditor5-utils/src/lib/lodash/isObject';\nimport log from '@ckeditor/ckeditor5-utils/src/log';\n\nconst xhtmlNs = 'http://www.w3.org/1999/xhtml';\n\n/**\n * A basic Template class. It renders DOM HTMLElement or Text from {@link module:ui/template~TemplateDefinition} and supports\n * element attributes, children, bindings to {@link module:utils/observablemixin~ObservableMixin} instances and DOM events\n * propagation. For example:\n *\n *\t\tnew Template( {\n *\t\t\ttag: 'p',\n *\t\t\tattributes: {\n *\t\t\t\tclass: 'foo',\n *\t\t\t\tstyle: {\n *\t\t\t\t\tbackgroundColor: 'yellow'\n *\t\t\t\t}\n *\t\t\t},\n *\t\t\tchildren: [\n *\t\t\t\t'A paragraph.'\n *\t\t\t]\n *\t\t} ).render();\n *\n * will render the following HTMLElement:\n *\n *\t\t

A paragraph.

\n *\n * See {@link module:ui/template~TemplateDefinition} to know more about templates and complex template definitions.\n *\n* @mixes module:utils/emittermixin~EmitterMixin\n */\nexport default class Template {\n\t/**\n\t * Creates an instance of the {@link ~Template} class.\n\t *\n\t * @param {module:ui/template~TemplateDefinition} def The definition of the template.\n\t */\n\tconstructor( def ) {\n\t\tObject.assign( this, normalize( clone( def ) ) );\n\n\t\t/**\n\t\t * Indicates whether this particular Template instance has been\n\t\t * {@link #render rendered}.\n\t\t *\n\t\t * @readonly\n\t\t * @protected\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis._isRendered = false;\n\n\t\t/**\n\t\t * Tag of this template, i.e. `div`, indicating that the instance will render\n\t\t * to an HTMLElement.\n\t\t *\n\t\t * @member {String} #tag\n\t\t */\n\n\t\t/**\n\t\t * Text of this template, indicating that the instance will render to a DOM Text.\n\t\t *\n\t\t * @member {Array.} #text\n\t\t */\n\n\t\t/**\n\t\t * Attributes of this template, i.e. `{ id: [ 'ck-id' ] }`, corresponding with\n\t\t * HTML attributes on HTMLElement.\n\t\t *\n\t\t * Note: Only when {@link #tag} is defined.\n\t\t *\n\t\t * @member {Object} #attributes\n\t\t */\n\n\t\t/**\n\t\t * Children of this template; sub–templates. Each one is an independent\n\t\t * instance of {@link ~Template}.\n\t\t *\n\t\t * Note: Only when {@link #tag} is defined.\n\t\t *\n\t\t * @member {module:utils/collection~Collection.} #children\n\t\t */\n\n\t\t/**\n\t\t * DOM event listeners of this template.\n\t\t *\n\t\t * @member {Object} #eventListeners\n\t\t */\n\n\t\t/**\n\t\t * Data used by {@link #revert} method to restore a node\n\t\t * to its original state.\n\t\t *\n\t\t * See: {@link #apply}.\n\t\t *\n\t\t * @readonly\n\t\t * @protected\n\t\t * @member {module:ui/template~RenderData}\n\t\t */\n\t\tthis._revertData = null;\n\t}\n\n\t/**\n\t * Renders a DOM Node (`HTMLElement` or `Text`) out of the template.\n\t *\n\t * @see #apply\n\t *\n\t * @returns {HTMLElement|Text}\n\t */\n\trender() {\n\t\tconst node = this._renderNode( {\n\t\t\tintoFragment: true\n\t\t} );\n\n\t\tthis._isRendered = true;\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Applies the template to an existing DOM Node, either `HTMLElement` or `Text`.\n\t *\n\t * **Note:** No new DOM nodes (HTMLElement or Text) will be created. Applying extends attributes\n\t * ({@link module:ui/template~TemplateDefinition attributes}) and listeners ({@link module:ui/template~TemplateDefinition on}) only.\n\t *\n\t * **Note:** Existing \"class\" and \"style\" attributes are extended when a template\n\t * is applied to a Node, while other attributes and `textContent` are overridden.\n\t *\n\t * **Note:** The process of applying a template can be easily reverted using\n\t * {@link module:ui/template~Template#revert} method.\n\t *\n\t *\t\tconst element = document.createElement( 'div' );\n\t *\t\tconst bind = Template.bind( observableInstance, emitterInstance );\n\t *\n\t *\t\tnew Template( {\n\t *\t\t\tattrs: {\n\t *\t\t\t\tid: 'first-div',\n\t *\t\t\t\tclass: bind.to( 'divClass' )\n\t *\t\t\t},\n\t *\t\t\ton: {\n\t *\t\t\t\tclick: bind( 'elementClicked' ) // Will be fired by the observableInstance.\n\t *\t\t\t}\n\t *\t\t\tchildren: [\n\t *\t\t\t\t'Div text.'\n\t *\t\t\t]\n\t *\t\t} ).apply( element );\n\t *\n\t *\t\telement.outerHTML == \"
Div text.
\"\n\t *\n\t * @see module:ui/template~Template#render\n\t * @see module:ui/template~Template#revert\n\t * @param {Node} node Root node for the template to apply.\n\t */\n\tapply( node ) {\n\t\tthis._revertData = getEmptyRevertData();\n\n\t\tthis._renderNode( {\n\t\t\tnode: node,\n\t\t\tisApplying: true,\n\t\t\trevertData: this._revertData\n\t\t} );\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Reverts a template {@link module:ui/template~Template#apply applied} to a DOM Node.\n\t *\n\t * @param {Node} node Root node for the template to revert. In most cases, it's the same node\n\t * that {@link module:ui/template~Template#apply} has used.\n\t */\n\trevert( node ) {\n\t\tif ( !this._revertData ) {\n\t\t\t/**\n\t\t\t * Attempting reverting a template which has not been applied yet.\n\t\t\t *\n\t\t\t * @error ui-template-revert-not-applied\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'ui-template-revert-not-applied: Attempting reverting a template which has not been applied yet.' );\n\t\t}\n\n\t\tthis._revertTemplateFromNode( node, this._revertData );\n\t}\n\n\t/**\n\t * An entry point to the interface which allows binding DOM nodes to {@link module:utils/observablemixin~ObservableMixin}.\n\t * There are two types of bindings:\n\t *\n\t * * `HTMLElement` attributes or Text Node `textContent` can be synchronized with {@link module:utils/observablemixin~ObservableMixin}\n\t * instance attributes. See {@link module:ui/template~BindChain#to} and {@link module:ui/template~BindChain#if}.\n\t *\n\t * * DOM events fired on `HTMLElement` can be propagated through {@link module:utils/observablemixin~ObservableMixin}.\n\t * See {@link module:ui/template~BindChain#to}.\n\t *\n\t * @param {module:utils/observablemixin~ObservableMixin} observable An instance of ObservableMixin class.\n\t * @param {module:utils/emittermixin~EmitterMixin} emitter An instance of `Emitter` class. It listens\n\t * to `observable` attribute changes and DOM Events, depending on the binding. Usually {@link module:ui/view~View} instance.\n\t * @returns {module:ui/template~BindChain}\n\t */\n\tstatic bind( observable, emitter ) {\n\t\treturn {\n\t\t\tto( eventNameOrFunctionOrAttribute, callback ) {\n\t\t\t\treturn new TemplateToBinding( {\n\t\t\t\t\teventNameOrFunction: eventNameOrFunctionOrAttribute,\n\t\t\t\t\tattribute: eventNameOrFunctionOrAttribute,\n\t\t\t\t\tobservable, emitter, callback\n\t\t\t\t} );\n\t\t\t},\n\n\t\t\tif( attribute, valueIfTrue, callback ) {\n\t\t\t\treturn new TemplateIfBinding( {\n\t\t\t\t\tobservable, emitter, attribute, valueIfTrue, callback\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Extends {@link module:ui/template~Template} instance with additional content from {@link module:ui/template~TemplateDefinition}.\n\t *\n\t *\t\tconst bind = Template.bind( observable, emitterInstance );\n\t *\t\tconst instance = new Template( {\n\t *\t\t\ttag: 'p',\n\t *\t\t\tattributes: {\n\t *\t\t\t\tclass: 'a',\n\t *\t\t\t\tdata-x: bind.to( 'foo' )\n\t *\t\t\t},\n\t *\t\t\tchildren: [\n\t *\t\t\t\t{\n\t *\t\t\t\t\ttag: 'span',\n\t *\t\t\t\t\tattributes: {\n\t *\t\t\t\t\t\tclass: 'b'\n\t *\t\t\t\t\t},\n\t *\t\t\t\t\tchildren: [\n\t *\t\t\t\t\t\t'Span'\n\t *\t\t\t\t\t]\n\t *\t\t\t\t}\n\t *\t\t\t]\n\t *\t\t } );\n\t *\n\t *\t\t// Instance-level extension.\n\t *\t\tTemplate.extend( instance, {\n\t *\t\t\tattributes: {\n\t *\t\t\t\tclass: 'b',\n\t *\t\t\t\tdata-x: bind.to( 'bar' )\n\t *\t\t\t},\n\t *\t\t\tchildren: [\n\t *\t\t\t\t{\n\t *\t\t\t\t\tattributes: {\n\t *\t\t\t\t\t\tclass: 'c'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t]\n\t *\t\t} );\n\t *\n\t *\t\t// Child extension.\n\t *\t\tTemplate.extend( instance.children.get( 0 ), {\n\t *\t\t\tattributes: {\n\t *\t\t\t\tclass: 'd'\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * the `instance.render().outerHTML` is\n\t *\n\t *\t\t

\n\t *\t\t\tSpan\n\t *\t\t

\n\t *\n\t * @param {module:ui/template~Template} template Existing Template instance to be extended.\n\t * @param {module:ui/template~TemplateDefinition} def An extension to existing an template instance.\n\t */\n\tstatic extend( template, def ) {\n\t\tif ( template._isRendered ) {\n\t\t\t/**\n\t\t\t * Extending a template after rendering may not work as expected. To make sure\n\t\t\t * the {@link #extend extending} works for the rendered element, perform it\n\t\t\t * before {@link #render} is called.\n\t\t\t *\n\t\t\t * @error template-extend-render\n\t\t\t */\n\t\t\tlog.warn( 'template-extend-render: Attempting to extend a template which has already been rendered.' );\n\t\t}\n\n\t\textendTemplate( template, normalize( clone( def ) ) );\n\t}\n\n\t/**\n\t * Renders a DOM Node (either `HTMLElement` or `Text`) out of the template.\n\t *\n\t * @protected\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t */\n\t_renderNode( data ) {\n\t\tlet isInvalid;\n\n\t\tif ( data.node ) {\n\t\t\t// When applying, a definition cannot have \"tag\" and \"text\" at the same time.\n\t\t\tisInvalid = this.tag && this.text;\n\t\t} else {\n\t\t\t// When rendering, a definition must have either \"tag\" or \"text\": XOR( this.tag, this.text ).\n\t\t\tisInvalid = this.tag ? this.text : !this.text;\n\t\t}\n\n\t\tif ( isInvalid ) {\n\t\t\t/**\n\t\t\t * Node definition cannot have \"tag\" and \"text\" properties at the same time.\n\t\t\t * Node definition must have either \"tag\" or \"text\" when rendering new Node.\n\t\t\t *\n\t\t\t * @error ui-template-wrong-syntax\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'ui-template-wrong-syntax: Node definition must have either \"tag\" or \"text\" when rendering new Node.' );\n\t\t}\n\n\t\tif ( this.text ) {\n\t\t\treturn this._renderText( data );\n\t\t} else {\n\t\t\treturn this._renderElement( data );\n\t\t}\n\t}\n\n\t/**\n\t * Renders an `HTMLElement` out of the template.\n\t *\n\t * @protected\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t */\n\t_renderElement( data ) {\n\t\tlet node = data.node;\n\n\t\tif ( !node ) {\n\t\t\tnode = data.node = document.createElementNS( this.ns || xhtmlNs, this.tag );\n\t\t}\n\n\t\tthis._renderAttributes( data );\n\t\tthis._renderElementChildren( data );\n\t\tthis._setUpListeners( data );\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Renders a `Text` node out of {@link module:ui/template~Template#text}.\n\t *\n\t * @protected\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t */\n\t_renderText( data ) {\n\t\tlet node = data.node;\n\n\t\t// Save the original textContent to revert it in #revert().\n\t\tif ( node ) {\n\t\t\tdata.revertData.text = node.textContent;\n\t\t} else {\n\t\t\tnode = data.node = document.createTextNode( '' );\n\t\t}\n\n\t\t// Check if this Text Node is bound to Observable. Cases:\n\t\t//\n\t\t//\t\ttext: [ Template.bind( ... ).to( ... ) ]\n\t\t//\n\t\t//\t\ttext: [\n\t\t//\t\t\t'foo',\n\t\t//\t\t\tTemplate.bind( ... ).to( ... ),\n\t\t//\t\t\t...\n\t\t//\t\t]\n\t\t//\n\t\tif ( hasTemplateBinding( this.text ) ) {\n\t\t\tthis._bindToObservable( {\n\t\t\t\tschema: this.text,\n\t\t\t\tupdater: getTextUpdater( node ),\n\t\t\t\tdata\n\t\t\t} );\n\t\t}\n\t\t// Simply set text. Cases:\n\t\t//\n\t\t//\t\ttext: [ 'all', 'are', 'static' ]\n\t\t//\n\t\t//\t\ttext: [ 'foo' ]\n\t\t//\n\t\telse {\n\t\t\tnode.textContent = this.text.join( '' );\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Renders an `HTMLElement` attributes out of {@link module:ui/template~Template#attributes}.\n\t *\n\t * @protected\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t */\n\t_renderAttributes( data ) {\n\t\tlet attrName, attrValue, domAttrValue, attrNs;\n\n\t\tif ( !this.attributes ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst node = data.node;\n\t\tconst revertData = data.revertData;\n\n\t\tfor ( attrName in this.attributes ) {\n\t\t\t// Current attribute value in DOM.\n\t\t\tdomAttrValue = node.getAttribute( attrName );\n\n\t\t\t// The value to be set.\n\t\t\tattrValue = this.attributes[ attrName ];\n\n\t\t\t// Save revert data.\n\t\t\tif ( revertData ) {\n\t\t\t\trevertData.attributes[ attrName ] = domAttrValue;\n\t\t\t}\n\n\t\t\t// Detect custom namespace:\n\t\t\t//\n\t\t\t//\t\tclass: {\n\t\t\t//\t\t\tns: 'abc',\n\t\t\t//\t\t\tvalue: Template.bind( ... ).to( ... )\n\t\t\t//\t\t}\n\t\t\t//\n\t\t\tattrNs = ( isObject( attrValue[ 0 ] ) && attrValue[ 0 ].ns ) ? attrValue[ 0 ].ns : null;\n\n\t\t\t// Activate binding if one is found. Cases:\n\t\t\t//\n\t\t\t//\t\tclass: [\n\t\t\t//\t\t\tTemplate.bind( ... ).to( ... )\n\t\t\t//\t\t]\n\t\t\t//\n\t\t\t//\t\tclass: [\n\t\t\t//\t\t\t'bar',\n\t\t\t//\t\t\tTemplate.bind( ... ).to( ... ),\n\t\t\t//\t\t\t'baz'\n\t\t\t//\t\t]\n\t\t\t//\n\t\t\t//\t\tclass: {\n\t\t\t//\t\t\tns: 'abc',\n\t\t\t//\t\t\tvalue: Template.bind( ... ).to( ... )\n\t\t\t//\t\t}\n\t\t\t//\n\t\t\tif ( hasTemplateBinding( attrValue ) ) {\n\t\t\t\t// Normalize attributes with additional data like namespace:\n\t\t\t\t//\n\t\t\t\t//\t\tclass: {\n\t\t\t\t//\t\t\tns: 'abc',\n\t\t\t\t//\t\t\tvalue: [ ... ]\n\t\t\t\t//\t\t}\n\t\t\t\t//\n\t\t\t\tconst valueToBind = attrNs ? attrValue[ 0 ].value : attrValue;\n\n\t\t\t\t// Extend the original value of attributes like \"style\" and \"class\",\n\t\t\t\t// don't override them.\n\t\t\t\tif ( revertData && shouldExtend( attrName ) ) {\n\t\t\t\t\tvalueToBind.unshift( domAttrValue );\n\t\t\t\t}\n\n\t\t\t\tthis._bindToObservable( {\n\t\t\t\t\tschema: valueToBind,\n\t\t\t\t\tupdater: getAttributeUpdater( node, attrName, attrNs ),\n\t\t\t\t\tdata\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Style attribute could be an Object so it needs to be parsed in a specific way.\n\t\t\t//\n\t\t\t//\t\tstyle: {\n\t\t\t//\t\t\twidth: '100px',\n\t\t\t//\t\t\theight: Template.bind( ... ).to( ... )\n\t\t\t//\t\t}\n\t\t\t//\n\t\t\telse if ( attrName == 'style' && typeof attrValue[ 0 ] !== 'string' ) {\n\t\t\t\tthis._renderStyleAttribute( attrValue[ 0 ], data );\n\t\t\t}\n\n\t\t\t// Otherwise simply set the static attribute:\n\t\t\t//\n\t\t\t//\t\tclass: [ 'foo' ]\n\t\t\t//\n\t\t\t//\t\tclass: [ 'all', 'are', 'static' ]\n\t\t\t//\n\t\t\t//\t\tclass: [\n\t\t\t//\t\t\t{\n\t\t\t//\t\t\t\tns: 'abc',\n\t\t\t//\t\t\t\tvalue: [ 'foo' ]\n\t\t\t//\t\t\t}\n\t\t\t//\t\t]\n\t\t\t//\n\t\t\telse {\n\t\t\t\t// Extend the original value of attributes like \"style\" and \"class\",\n\t\t\t\t// don't override them.\n\t\t\t\tif ( revertData && domAttrValue && shouldExtend( attrName ) ) {\n\t\t\t\t\tattrValue.unshift( domAttrValue );\n\t\t\t\t}\n\n\t\t\t\tattrValue = attrValue\n\t\t\t\t\t// Retrieve \"values\" from:\n\t\t\t\t\t//\n\t\t\t\t\t//\t\tclass: [\n\t\t\t\t\t//\t\t\t{\n\t\t\t\t\t//\t\t\t\tns: 'abc',\n\t\t\t\t\t//\t\t\t\tvalue: [ ... ]\n\t\t\t\t\t//\t\t\t}\n\t\t\t\t\t//\t\t]\n\t\t\t\t\t//\n\t\t\t\t\t.map( val => val ? ( val.value || val ) : val )\n\t\t\t\t\t// Flatten the array.\n\t\t\t\t\t.reduce( ( prev, next ) => prev.concat( next ), [] )\n\t\t\t\t\t// Convert into string.\n\t\t\t\t\t.reduce( arrayValueReducer, '' );\n\n\t\t\t\tif ( !isFalsy( attrValue ) ) {\n\t\t\t\t\tnode.setAttributeNS( attrNs, attrName, attrValue );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Renders `style` attribute of an `HTMLElement` based on {@link module:ui/template~Template#attributes}.\n\t *\n\t * Style attribute is an {Object} with static values:\n\t *\n\t *\t\tattributes: {\n\t *\t\t\tstyle: {\n\t *\t\t\t\tcolor: 'red'\n\t *\t\t\t}\n\t *\t\t}\n\t *\n\t * or values bound to {@link module:ui/model~Model} properties:\n\t *\n\t *\t\tattributes: {\n\t *\t\t\tstyle: {\n\t *\t\t\t\tcolor: bind.to( ... )\n\t *\t\t\t}\n\t *\t\t}\n\t *\n\t * Note: `style` attribute is rendered without setting the namespace. It does not seem to be\n\t * needed.\n\t *\n\t * @private\n\t * @param {Object} styles Styles located in `attributes.style` of {@link module:ui/template~TemplateDefinition}.\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t */\n\t_renderStyleAttribute( styles, data ) {\n\t\tconst node = data.node;\n\n\t\tfor ( let styleName in styles ) {\n\t\t\tconst styleValue = styles[ styleName ];\n\n\t\t\t// Cases:\n\t\t\t//\n\t\t\t//\t\tstyle: {\n\t\t\t//\t\t\tcolor: bind.to( 'attribute' )\n\t\t\t//\t\t}\n\t\t\t//\n\t\t\tif ( hasTemplateBinding( styleValue ) ) {\n\t\t\t\tthis._bindToObservable( {\n\t\t\t\t\tschema: [ styleValue ],\n\t\t\t\t\tupdater: getStyleUpdater( node, styleName ),\n\t\t\t\t\tdata\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Cases:\n\t\t\t//\n\t\t\t//\t\tstyle: {\n\t\t\t//\t\t\tcolor: 'red'\n\t\t\t//\t\t}\n\t\t\t//\n\t\t\telse {\n\t\t\t\tnode.style[ styleName ] = styleValue;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Recursively renders `HTMLElement` children from {@link module:ui/template~Template#children}.\n\t *\n\t * @protected\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t */\n\t_renderElementChildren( data ) {\n\t\tconst node = data.node;\n\t\tconst container = data.intoFragment ? document.createDocumentFragment() : node;\n\t\tconst isApplying = data.isApplying;\n\t\tlet childIndex = 0;\n\n\t\tfor ( let child of this.children ) {\n\t\t\tif ( isViewCollection( child ) ) {\n\t\t\t\tif ( !isApplying ) {\n\t\t\t\t\tchild.setParent( node );\n\n\t\t\t\t\tfor ( let view of child ) {\n\t\t\t\t\t\tcontainer.appendChild( view.element );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( isView( child ) ) {\n\t\t\t\tif ( !isApplying ) {\n\t\t\t\t\tcontainer.appendChild( child.element );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isApplying ) {\n\t\t\t\t\tconst revertData = data.revertData;\n\t\t\t\t\tconst childRevertData = getEmptyRevertData();\n\n\t\t\t\t\trevertData.children.push( childRevertData );\n\n\t\t\t\t\tchild._renderNode( {\n\t\t\t\t\t\tnode: container.childNodes[ childIndex++ ],\n\t\t\t\t\t\tisApplying: true,\n\t\t\t\t\t\trevertData: childRevertData\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tcontainer.appendChild( child.render() );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( data.intoFragment ) {\n\t\t\tnode.appendChild( container );\n\t\t}\n\t}\n\n\t/**\n\t * Activates `on` listeners in the {@link module:ui/template~TemplateDefinition}\n\t * on a passed `HTMLElement`.\n\t *\n\t * @protected\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t */\n\t_setUpListeners( data ) {\n\t\tif ( !this.eventListeners ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( let key in this.eventListeners ) {\n\t\t\tconst revertBindings = this.eventListeners[ key ].map( schemaItem => {\n\t\t\t\tconst [ domEvtName, domSelector ] = key.split( '@' );\n\n\t\t\t\treturn schemaItem.activateDomEventListener( domEvtName, domSelector, data );\n\t\t\t} );\n\n\t\t\tif ( data.revertData ) {\n\t\t\t\tdata.revertData.bindings.push( revertBindings );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * For given {@link module:ui/template~TemplateValueSchema} containing {@link module:ui/template~TemplateBinding} it activates the\n\t * binding and sets its initial value.\n\t *\n\t * Note: {@link module:ui/template~TemplateValueSchema} can be for HTMLElement attributes or Text Node `textContent`.\n\t *\n\t * @protected\n\t * @param {Object} options Binding options.\n\t * @param {module:ui/template~TemplateValueSchema} options.schema\n\t * @param {Function} options.updater A function which updates DOM (like attribute or text).\n\t * @param {module:ui/template~RenderData} options.data Rendering data.\n\t */\n\t_bindToObservable( { schema, updater, data } ) {\n\t\tconst revertData = data.revertData;\n\n\t\t// Set initial values.\n\t\tsyncValueSchemaValue( schema, updater, data );\n\n\t\tconst revertBindings = schema\n\t\t\t// Filter \"falsy\" (false, undefined, null, '') value schema components out.\n\t\t\t.filter( item => !isFalsy( item ) )\n\t\t\t// Filter inactive bindings from schema, like static strings ('foo'), numbers (42), etc.\n\t\t\t.filter( item => item.observable )\n\t\t\t// Once only the actual binding are left, let the emitter listen to observable change:attribute event.\n\t\t\t// TODO: Reduce the number of listeners attached as many bindings may listen\n\t\t\t// to the same observable attribute.\n\t\t\t.map( templateBinding => templateBinding.activateAttributeListener( schema, updater, data ) );\n\n\t\tif ( revertData ) {\n\t\t\trevertData.bindings.push( revertBindings );\n\t\t}\n\t}\n\n\t/**\n\t * Reverts {@link module:ui/template~RenderData#revertData template data} from a node to\n\t * return it to the the original state.\n\t *\n\t * @protected\n\t * @param {HTMLElement|Text} node A node to be reverted.\n\t * @param {module:ui/template~RenderData#revertData} revertData Stores information about\n\t * what changes have been made by {@link #apply} to the node.\n\t */\n\t_revertTemplateFromNode( node, revertData ) {\n\t\tfor ( let binding of revertData.bindings ) {\n\t\t\t// Each binding may consist of several observable+observable#attribute.\n\t\t\t// like the following has 2:\n\t\t\t//\n\t\t\t//\t\tclass: [\n\t\t\t//\t\t\t'x',\n\t\t\t//\t\t\tbind.to( 'foo' ),\n\t\t\t//\t\t\t'y',\n\t\t\t//\t\t\tbind.to( 'bar' )\n\t\t\t//\t\t]\n\t\t\t//\n\t\t\tfor ( let revertBinding of binding ) {\n\t\t\t\trevertBinding();\n\t\t\t}\n\t\t}\n\n\t\tif ( revertData.text ) {\n\t\t\tnode.textContent = revertData.text;\n\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( let attrName in revertData.attributes ) {\n\t\t\tconst attrValue = revertData.attributes[ attrName ];\n\n\t\t\t// When the attribute has **not** been set before #apply().\n\t\t\tif ( attrValue === null ) {\n\t\t\t\tnode.removeAttribute( attrName );\n\t\t\t} else {\n\t\t\t\tnode.setAttribute( attrName, attrValue );\n\t\t\t}\n\t\t}\n\n\t\tfor ( let i = 0; i < revertData.children.length; ++i ) {\n\t\t\tthis._revertTemplateFromNode( node.childNodes[ i ], revertData.children[ i ] );\n\t\t}\n\t}\n}\n\nmix( Template, EmitterMixin );\n\n/**\n * Describes a binding created by {@link module:ui/template~Template.bind} interface.\n *\n * @protected\n */\nexport class TemplateBinding {\n\t/**\n\t * Creates an instance of the {@link module:ui/template~TemplateBinding} class.\n\t *\n\t * @param {module:ui/template~TemplateDefinition} def The definition of the binding.\n\t */\n\tconstructor( def ) {\n\t\tObject.assign( this, def );\n\n\t\t/**\n\t\t * An observable instance of the binding. It provides the attribute\n\t\t * with the value or passes the event when a corresponding DOM event is fired.\n\t\t *\n\t\t * @member {module:utils/observablemixin~ObservableMixin} module:ui/template~TemplateBinding#observable\n\t\t */\n\n\t\t/**\n\t\t * An {@link module:utils/emittermixin~EmitterMixin} instance used by the binding\n\t\t * to (either):\n\t\t *\n\t\t * * listen to the attribute change in the {@link module:ui/template~TemplateBinding#observable},\n\t\t * * listen to the event in the DOM.\n\t\t *\n\t\t * @member {module:utils/emittermixin~EmitterMixin} module:ui/template~TemplateBinding#emitter\n\t\t */\n\n\t\t/**\n\t\t * The name of the attribute of {@link module:ui/template~TemplateBinding#observable} which is observed.\n\t\t *\n\t\t * @member {String} module:ui/template~TemplateBinding#attribute\n\t\t */\n\n\t\t/**\n\t\t * A custom function to process the value of {@link module:ui/template~TemplateBinding#attribute}.\n\t\t *\n\t\t * @member {Function} [module:ui/template~TemplateBinding#callback]\n\t\t */\n\t}\n\n\t/**\n\t * Returns the value of the binding, which is the value of {@link module:ui/template~TemplateBinding#attribute} in\n\t * {@link module:ui/template~TemplateBinding#observable}.\n\t *\n\t * @param {Node} [node] A native DOM node, passed to the custom {@link module:ui/template~TemplateBinding#callback}.\n\t * @returns {*} The value of {@link module:ui/template~TemplateBinding#attribute} in {@link module:ui/template~TemplateBinding#observable}.\n\t */\n\tgetValue( node ) {\n\t\tconst value = this.observable[ this.attribute ];\n\n\t\treturn this.callback ? this.callback( value, node ) : value;\n\t}\n\n\t/**\n\t * Activates the listener for the changes of {@link module:ui/template~TemplateBinding#attribute} in\n\t * {@link module:ui/template~TemplateBinding#observable}, which then updates the DOM with the aggregated\n\t * value of {@link module:ui/template~TemplateValueSchema}.\n\t *\n\t * For instance, the `class` attribute of the `Template` element can be be bound to\n\t * the observable `foo` attribute in `ObservableMixin` instance.\n\t *\n\t * @param {module:ui/template~TemplateValueSchema} schema A full schema to generate an attribute or text in DOM.\n\t * @param {Function} updater A DOM updater function used to update native DOM attribute or text.\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t * @returns {Function} A function to sever the listener binding.\n\t */\n\tactivateAttributeListener( schema, updater, data ) {\n\t\tconst callback = () => syncValueSchemaValue( schema, updater, data );\n\n\t\tthis.emitter.listenTo( this.observable, 'change:' + this.attribute, callback );\n\n\t\t// Allows revert of the listener.\n\t\treturn () => {\n\t\t\tthis.emitter.stopListening( this.observable, 'change:' + this.attribute, callback );\n\t\t};\n\t}\n}\n\n/**\n * Describes either:\n *\n * * a binding to {@link module:utils/observablemixin~ObservableMixin}\n * * or a native DOM event binding\n *\n * created by {@link module:ui/template~BindChain#to} method.\n *\n * @protected\n */\nexport class TemplateToBinding extends TemplateBinding {\n\t/**\n\t * Activates the listener for the native DOM event, which when fired, is propagated by\n\t * the {@link module:ui/template~TemplateBinding#emitter}.\n\t *\n\t * @param {String} domEvtName A name of the native DOM event.\n\t * @param {String} domSelector A selector in DOM to filter delegated events.\n\t * @param {module:ui/template~RenderData} data Rendering data.\n\t * @returns {Function} A function to sever the listener binding.\n\t */\n\tactivateDomEventListener( domEvtName, domSelector, data ) {\n\t\tconst callback = ( evt, domEvt ) => {\n\t\t\tif ( !domSelector || domEvt.target.matches( domSelector ) ) {\n\t\t\t\tif ( typeof this.eventNameOrFunction == 'function' ) {\n\t\t\t\t\tthis.eventNameOrFunction( domEvt );\n\t\t\t\t} else {\n\t\t\t\t\tthis.observable.fire( this.eventNameOrFunction, domEvt );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.emitter.listenTo( data.node, domEvtName, callback );\n\n\t\t// Allows revert of the listener.\n\t\treturn () => {\n\t\t\tthis.emitter.stopListening( data.node, domEvtName, callback );\n\t\t};\n\t}\n}\n\n/**\n * Describes a binding to {@link module:utils/observablemixin~ObservableMixin} created by {@link module:ui/template~BindChain#if}\n * method.\n *\n * @protected\n */\nexport class TemplateIfBinding extends TemplateBinding {\n\t/**\n\t * @inheritDoc\n\t */\n\tgetValue( node ) {\n\t\tconst value = super.getValue( node );\n\n\t\treturn isFalsy( value ) ? false : ( this.valueIfTrue || true );\n\t}\n\n\t/**\n\t * The value of the DOM attribute/text to be set if the {@link module:ui/template~TemplateBinding#attribute} in\n\t * {@link module:ui/template~TemplateBinding#observable} is `true`.\n\t *\n\t * @member {String} [module:ui/template~TemplateIfBinding#valueIfTrue]\n\t */\n}\n\n// Checks whether given {@link module:ui/template~TemplateValueSchema} contains a\n// {@link module:ui/template~TemplateBinding}.\n//\n// @param {module:ui/template~TemplateValueSchema} schema\n// @returns {Boolean}\nfunction hasTemplateBinding( schema ) {\n\tif ( !schema ) {\n\t\treturn false;\n\t}\n\n\t// Normalize attributes with additional data like namespace:\n\t//\n\t//\t\tclass: {\n\t//\t\t\tns: 'abc',\n\t//\t\t\tvalue: [ ... ]\n\t//\t\t}\n\t//\n\tif ( schema.value ) {\n\t\tschema = schema.value;\n\t}\n\n\tif ( Array.isArray( schema ) ) {\n\t\treturn schema.some( hasTemplateBinding );\n\t} else if ( schema instanceof TemplateBinding ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n// Assembles the value using {@link module:ui/template~TemplateValueSchema} and stores it in a form of\n// an Array. Each entry of an Array corresponds to one of {@link module:ui/template~TemplateValueSchema}\n// items.\n//\n// @param {module:ui/template~TemplateValueSchema} schema\n// @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.\n// @return {Array}\nfunction getValueSchemaValue( schema, node ) {\n\treturn schema.map( schemaItem => {\n\t\t// Process {@link module:ui/template~TemplateBinding} bindings.\n\t\tif ( schemaItem instanceof TemplateBinding ) {\n\t\t\treturn schemaItem.getValue( node );\n\t\t}\n\n\t\t// All static values like strings, numbers, and \"falsy\" values (false, null, undefined, '', etc.) just pass.\n\t\treturn schemaItem;\n\t} );\n}\n\n// A function executed each time bound Observable attribute changes, which updates DOM with a value\n// constructed from {@link module:ui/template~TemplateValueSchema}.\n//\n// @param {module:ui/template~TemplateValueSchema} schema\n// @param {Function} updater A function which updates DOM (like attribute or text).\n// @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.\nfunction syncValueSchemaValue( schema, updater, { node } ) {\n\tlet value = getValueSchemaValue( schema, node );\n\n\t// Check if schema is a single Template.bind.if, like:\n\t//\n\t//\t\tclass: Template.bind.if( 'foo' )\n\t//\n\tif ( schema.length == 1 && schema[ 0 ] instanceof TemplateIfBinding ) {\n\t\tvalue = value[ 0 ];\n\t} else {\n\t\tvalue = value.reduce( arrayValueReducer, '' );\n\t}\n\n\tif ( isFalsy( value ) ) {\n\t\tupdater.remove();\n\t} else {\n\t\tupdater.set( value );\n\t}\n}\n\n// Returns an object consisting of `set` and `remove` functions, which\n// can be used in the context of DOM Node to set or reset `textContent`.\n// @see module:ui/view~View#_bindToObservable\n//\n// @param {Node} node DOM Node to be modified.\n// @returns {Object}\nfunction getTextUpdater( node ) {\n\treturn {\n\t\tset( value ) {\n\t\t\tnode.textContent = value;\n\t\t},\n\n\t\tremove() {\n\t\t\tnode.textContent = '';\n\t\t}\n\t};\n}\n\n// Returns an object consisting of `set` and `remove` functions, which\n// can be used in the context of DOM Node to set or reset an attribute.\n// @see module:ui/view~View#_bindToObservable\n//\n// @param {Node} node DOM Node to be modified.\n// @param {String} attrName Name of the attribute to be modified.\n// @param {String} [ns=null] Namespace to use.\n// @returns {Object}\nfunction getAttributeUpdater( el, attrName, ns ) {\n\treturn {\n\t\tset( value ) {\n\t\t\tel.setAttributeNS( ns, attrName, value );\n\t\t},\n\n\t\tremove() {\n\t\t\tel.removeAttributeNS( ns, attrName );\n\t\t}\n\t};\n}\n\n// Returns an object consisting of `set` and `remove` functions, which\n// can be used in the context of CSSStyleDeclaration to set or remove a style.\n// @see module:ui/view~View#_bindToObservable\n//\n// @param {Node} node DOM Node to be modified.\n// @param {String} styleName Name of the style to be modified.\n// @returns {Object}\nfunction getStyleUpdater( el, styleName ) {\n\treturn {\n\t\tset( value ) {\n\t\t\tel.style[ styleName ] = value;\n\t\t},\n\n\t\tremove() {\n\t\t\tel.style[ styleName ] = null;\n\t\t}\n\t};\n}\n\n// Clones definition of the template.\n//\n// @param {module:ui/template~TemplateDefinition} def\n// @returns {module:ui/template~TemplateDefinition}\nfunction clone( def ) {\n\tconst clone = cloneDeepWith( def, value => {\n\t\t// Don't clone the `Template.bind`* bindings because of the references to Observable\n\t\t// and DomEmitterMixin instances inside, which would also be traversed and cloned by greedy\n\t\t// cloneDeepWith algorithm. There's no point in cloning Observable/DomEmitterMixins\n\t\t// along with the definition.\n\t\t//\n\t\t// Don't clone Template instances if provided as a child. They're simply #render()ed\n\t\t// and nothing should interfere.\n\t\t//\n\t\t// Also don't clone View instances if provided as a child of the Template. The template\n\t\t// instance will be extracted from the View during the normalization and there's no need\n\t\t// to clone it.\n\t\tif ( value && ( value instanceof TemplateBinding || isTemplate( value ) || isView( value ) || isViewCollection( value ) ) ) {\n\t\t\treturn value;\n\t\t}\n\t} );\n\n\treturn clone;\n}\n\n// Normalizes given {@link module:ui/template~TemplateDefinition}.\n//\n// See:\n// * {@link normalizeAttributes}\n// * {@link normalizeListeners}\n// * {@link normalizePlainTextDefinition}\n// * {@link normalizeTextDefinition}\n//\n// @param {module:ui/template~TemplateDefinition} def\n// @returns {module:ui/template~TemplateDefinition} Normalized definition.\nfunction normalize( def ) {\n\tif ( typeof def == 'string' ) {\n\t\tdef = normalizePlainTextDefinition( def );\n\t} else if ( def.text ) {\n\t\tnormalizeTextDefinition( def );\n\t}\n\n\tif ( def.on ) {\n\t\tdef.eventListeners = normalizeListeners( def.on );\n\n\t\t// Template mixes EmitterMixin, so delete #on to avoid collision.\n\t\tdelete def.on;\n\t}\n\n\tif ( !def.text ) {\n\t\tif ( def.attributes ) {\n\t\t\tnormalizeAttributes( def.attributes );\n\t\t}\n\n\t\tconst children = new Collection();\n\n\t\tif ( def.children ) {\n\t\t\tif ( isViewCollection( def.children ) ) {\n\t\t\t\tchildren.add( def.children );\n\t\t\t} else {\n\t\t\t\tfor ( let child of def.children ) {\n\t\t\t\t\tif ( isTemplate( child ) || isView( child ) ) {\n\t\t\t\t\t\tchildren.add( child );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchildren.add( new Template( child ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdef.children = children;\n\t}\n\n\treturn def;\n}\n\n// Normalizes \"attributes\" section of {@link module:ui/template~TemplateDefinition}.\n//\n//\t\tattributes: {\n//\t\t\ta: 'bar',\n//\t\t\tb: {@link module:ui/template~TemplateBinding},\n//\t\t\tc: {\n//\t\t\t\tvalue: 'bar'\n//\t\t\t}\n//\t\t}\n//\n// becomes\n//\n//\t\tattributes: {\n//\t\t\ta: [ 'bar' ],\n//\t\t\tb: [ {@link module:ui/template~TemplateBinding} ],\n//\t\t\tc: {\n//\t\t\t\tvalue: [ 'bar' ]\n//\t\t\t}\n//\t\t}\n//\n// @param {Object} attrs\nfunction normalizeAttributes( attrs ) {\n\tfor ( let a in attrs ) {\n\t\tif ( attrs[ a ].value ) {\n\t\t\tattrs[ a ].value = [].concat( attrs[ a ].value );\n\t\t}\n\n\t\tarrayify( attrs, a );\n\t}\n}\n\n// Normalizes \"on\" section of {@link module:ui/template~TemplateDefinition}.\n//\n//\t\ton: {\n//\t\t\ta: 'bar',\n//\t\t\tb: {@link module:ui/template~TemplateBinding},\n//\t\t\tc: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]\n//\t\t}\n//\n// becomes\n//\n//\t\ton: {\n//\t\t\ta: [ 'bar' ],\n//\t\t\tb: [ {@link module:ui/template~TemplateBinding} ],\n//\t\t\tc: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]\n//\t\t}\n//\n// @param {Object} listeners\n// @returns {Object} Object containing normalized listeners.\nfunction normalizeListeners( listeners ) {\n\tfor ( let l in listeners ) {\n\t\tarrayify( listeners, l );\n\t}\n\n\treturn listeners;\n}\n\n// Normalizes \"string\" {@link module:ui/template~TemplateDefinition}.\n//\n//\t\t\"foo\"\n//\n// becomes\n//\n//\t\t{ text: [ 'foo' ] },\n//\n// @param {String} def\n// @returns {module:ui/template~TemplateDefinition} Normalized template definition.\nfunction normalizePlainTextDefinition( def ) {\n\treturn {\n\t\ttext: [ def ]\n\t};\n}\n\n// Normalizes text {@link module:ui/template~TemplateDefinition}.\n//\n//\t\tchildren: [\n//\t\t\t{ text: 'def' },\n//\t\t\t{ text: {@link module:ui/template~TemplateBinding} }\n//\t\t]\n//\n// becomes\n//\n//\t\tchildren: [\n//\t\t\t{ text: [ 'def' ] },\n//\t\t\t{ text: [ {@link module:ui/template~TemplateBinding} ] }\n//\t\t]\n//\n// @param {module:ui/template~TemplateDefinition} def\nfunction normalizeTextDefinition( def ) {\n\tif ( !Array.isArray( def.text ) ) {\n\t\tdef.text = [ def.text ];\n\t}\n}\n\n// Wraps an entry in Object in an Array, if not already one.\n//\n//\t\t{\n//\t\t\tx: 'y',\n//\t\t\ta: [ 'b' ]\n//\t\t}\n//\n// becomes\n//\n//\t\t{\n//\t\t\tx: [ 'y' ],\n//\t\t\ta: [ 'b' ]\n//\t\t}\n//\n// @param {Object} obj\n// @param {String} key\nfunction arrayify( obj, key ) {\n\tif ( !Array.isArray( obj[ key ] ) ) {\n\t\tobj[ key ] = [ obj[ key ] ];\n\t}\n}\n\n// A helper which concatenates the value avoiding unwanted\n// leading white spaces.\n//\n// @param {String} prev\n// @param {String} cur\n// @returns {String}\nfunction arrayValueReducer( prev, cur ) {\n\tif ( isFalsy( cur ) ) {\n\t\treturn prev;\n\t} else if ( isFalsy( prev ) ) {\n\t\treturn cur;\n\t} else {\n\t\treturn `${prev} ${cur}`;\n\t}\n}\n\n// Extends one object defined in the following format:\n//\n//\t\t{\n//\t\t\tkey1: [Array1],\n//\t\t\tkey2: [Array2],\n//\t\t\t...\n//\t\t\tkeyN: [ArrayN]\n//\t\t}\n//\n// with another object of the same data format.\n//\n// @param {Object} obj Base object.\n// @param {Object} ext Object extending base.\n// @returns {String}\nfunction extendObjectValueArray( obj, ext ) {\n\tfor ( let a in ext ) {\n\t\tif ( obj[ a ] ) {\n\t\t\tobj[ a ].push( ...ext[ a ] );\n\t\t} else {\n\t\t\tobj[ a ] = ext[ a ];\n\t\t}\n\t}\n}\n\n// A helper for {@link module:ui/template~Template#extend}. Recursively extends {@link module:ui/template~Template} instance\n// with content from {module:ui/template~TemplateDefinition}. See {@link module:ui/template~Template#extend} to learn more.\n//\n// @param {module:ui/template~Template} def A template instance to be extended.\n// @param {module:ui/template~TemplateDefinition} def A definition which is to extend the template instance.\nfunction extendTemplate( template, def ) {\n\tif ( def.attributes ) {\n\t\tif ( !template.attributes ) {\n\t\t\ttemplate.attributes = {};\n\t\t}\n\n\t\textendObjectValueArray( template.attributes, def.attributes );\n\t}\n\n\tif ( def.eventListeners ) {\n\t\tif ( !template.eventListeners ) {\n\t\t\ttemplate.eventListeners = {};\n\t\t}\n\n\t\textendObjectValueArray( template.eventListeners, def.eventListeners );\n\t}\n\n\tif ( def.text ) {\n\t\ttemplate.text.push( ...def.text );\n\t}\n\n\tif ( def.children && def.children.length ) {\n\t\tif ( template.children.length != def.children.length ) {\n\t\t\t/**\n\t\t\t * The number of children in extended definition does not match.\n\t\t\t *\n\t\t\t * @error ui-template-extend-children-mismatch\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'ui-template-extend-children-mismatch: The number of children in extended definition does not match.' );\n\t\t}\n\n\t\tlet childIndex = 0;\n\n\t\tfor ( let childDef of def.children ) {\n\t\t\textendTemplate( template.children.get( childIndex++ ), childDef );\n\t\t}\n\t}\n}\n\n// Checks if value is \"falsy\".\n// Note: 0 (Number) is not \"falsy\" in this context.\n//\n// @private\n// @param {*} value Value to be checked.\nfunction isFalsy( value ) {\n\treturn !value && value !== 0;\n}\n\n// Checks if the item is an instance of {@link module:ui/view~View}\n//\n// @private\n// @param {*} value Value to be checked.\nfunction isView( item ) {\n\treturn item instanceof View;\n}\n\n// Checks if the item is an instance of {@link module:ui/template~Template}\n//\n// @private\n// @param {*} value Value to be checked.\nfunction isTemplate( item ) {\n\treturn item instanceof Template;\n}\n\n// Checks if the item is an instance of {@link module:ui/viewcollection~ViewCollection}\n//\n// @private\n// @param {*} value Value to be checked.\nfunction isViewCollection( item ) {\n\treturn item instanceof ViewCollection;\n}\n\n// Creates an empty skeleton for {@link module:ui/template~Template#revert}\n// data.\n//\n// @private\nfunction getEmptyRevertData() {\n\treturn {\n\t\tchildren: [],\n\t\tbindings: [],\n\t\tattributes: {}\n\t};\n}\n\n// Checks whether an attribute should be extended when\n// {@link module:ui/template~Template#apply} is called.\n//\n// @private\n// @param {String} attrName Attribute name to check.\nfunction shouldExtend( attrName ) {\n\treturn attrName == 'class' || attrName == 'style';\n}\n\n/**\n * A definition of {@link module:ui/template~Template}.\n * See: {@link module:ui/template~TemplateValueSchema}.\n *\n *\t\tnew Template( {\n *\t\t\ttag: 'p',\n *\t\t\tchildren: [\n *\t\t\t\t{\n *\t\t\t\t\ttag: 'span',\n *\t\t\t\t\tattributes: { ... },\n *\t\t\t\t\tchildren: [ ... ],\n *\t\t\t\t\t...\n *\t\t\t\t},\n *\t\t\t\t{\n *\t\t\t\t\ttext: 'static–text'\n *\t\t\t\t},\n *\t\t\t\t'also-static–text',\n *\t\t\t\t<{@link module:ui/view~View} instance>\n *\t\t\t\t<{@link module:ui/template~Template} instance>\n *\t\t\t\t...\n *\t\t\t],\n *\t\t\tattributes: {\n *\t\t\t\tclass: {@link module:ui/template~TemplateValueSchema},\n *\t\t\t\tid: {@link module:ui/template~TemplateValueSchema},\n *\t\t\t\tstyle: {@link module:ui/template~TemplateValueSchema}\n *\t\t\t\t...\n *\t\t\t},\n *\t\t\ton: {\n *\t\t\t\t'click': {@link module:ui/template~TemplateListenerSchema}\n *\t\t\t\t'keyup@.some-class': {@link module:ui/template~TemplateListenerSchema},\n *\t\t\t\t...\n *\t\t\t}\n *\t\t} );\n *\n *\t\t// An entire view collection can be used as a child in the definition.\n *\t\tnew Template( {\n *\t\t\ttag: 'p',\n *\t\t\tchildren: <{@link module:ui/viewcollection~ViewCollection} instance>\n *\t\t} );\n *\n * @typedef module:ui/template~TemplateDefinition\n * @type Object\n * @property {String} tag\n * @property {Array.} [children]\n * @property {Object.} [attributes]\n * @property {String|module:ui/template~TemplateValueSchema|Array.} [text]\n * @property {Object.} [on]\n */\n\n/**\n * Describes a value of HTMLElement attribute or `textContent`. See:\n * * {@link module:ui/template~TemplateDefinition},\n * * {@link module:ui/template~Template.bind},\n *\n *\t\tconst bind = Template.bind( observableInstance, emitterInstance );\n *\n *\t\tnew Template( {\n *\t\t\ttag: 'p',\n *\t\t\tattributes: {\n *\t\t\t\t// Plain String schema.\n *\t\t\t\tclass: 'static-text'\n *\n *\t\t\t\t// Object schema, an `ObservableMixin` binding.\n *\t\t\t\tclass: bind.to( 'foo' )\n *\n *\t\t\t\t// Array schema, combines the above.\n *\t\t\t\tclass: [\n *\t\t\t\t\t'static-text',\n *\t\t\t\t\tbind.to( 'bar', () => { ... } )\n *\t\t\t\t],\n *\n *\t\t\t\t// Array schema, with custom namespace.\n *\t\t\t\tclass: {\n *\t\t\t\t\tns: 'http://ns.url',\n *\t\t\t\t\tvalue: [\n *\t\t\t\t\t\tbind.if( 'baz', 'value-when-true' )\n *\t\t\t\t\t\t'static-text'\n *\t\t\t\t\t]\n *\t\t\t\t},\n *\n *\t\t\t\t// Object literal schema, specific for styles.\n *\t\t\t\tstyle: {\n *\t\t\t\t\tcolor: 'red',\n *\t\t\t\t\tbackgroundColor: bind.to( 'qux', () => { ... } )\n *\t\t\t\t}\n *\t\t\t}\n *\t\t} );\n *\n * @typedef module:ui/template~TemplateValueSchema\n * @type {Object|String|Array}\n */\n\n/**\n * Describes a listener attached to HTMLElement. See: {@link module:ui/template~TemplateDefinition}.\n *\n *\t\tnew Template( {\n *\t\t\ttag: 'p',\n *\t\t\ton: {\n *\t\t\t\t// Plain String schema.\n *\t\t\t\tclick: 'clicked'\n *\n *\t\t\t\t// Object schema, an `ObservableMixin` binding.\n *\t\t\t\tclick: {@link module:ui/template~TemplateBinding}\n *\n *\t\t\t\t// Array schema, combines the above.\n *\t\t\t\tclick: [\n *\t\t\t\t\t'clicked',\n *\t\t\t\t\t{@link module:ui/template~TemplateBinding}\n *\t\t\t\t],\n *\n *\t\t\t\t// Array schema, with custom callback.\n *\t\t\t\t// Note: It will work for \"click\" event on class=\".foo\" children only.\n *\t\t\t\t'click@.foo': {\n *\t\t\t\t\t'clicked',\n *\t\t\t\t\t{@link module:ui/template~TemplateBinding},\n *\t\t\t\t\t() => { ... }\n *\t\t\t\t}\n *\t\t\t}\n *\t\t} );\n *\n * @typedef module:ui/template~TemplateListenerSchema\n * @type {Object|String|Array}\n */\n\n/**\n * The type of {@link ~Template.bind}'s return value.\n *\n * @interface module:ui/template~BindChain\n */\n\n/**\n * Binds {@link module:utils/observablemixin~ObservableMixin} instance to:\n *\n * * HTMLElement attribute or Text Node `textContent` so remains in sync with the Observable when it changes:\n * * HTMLElement DOM event, so the DOM events are propagated through Observable.\n *\n *\t\tconst bind = Template.bind( observableInstance, emitterInstance );\n *\n *\t\tnew Template( {\n *\t\t\ttag: 'p',\n *\t\t\tattributes: {\n *\t\t\t\t// class=\"...\" attribute gets bound to `observableInstance#a`\n *\t\t\t\t'class': bind.to( 'a' )\n *\t\t\t},\n *\t\t\tchildren: [\n *\t\t\t\t//

...

gets bound to `observableInstance#b`; always `toUpperCase()`.\n *\t\t\t\t{ text: bind.to( 'b', ( value, node ) => value.toUpperCase() ) }\n *\t\t\t],\n *\t\t\ton: {\n *\t\t\t\tclick: [\n *\t\t\t\t\t// \"clicked\" event will be fired on `observableInstance` when \"click\" fires in DOM.\n *\t\t\t\t\tbind.to( 'clicked' ),\n *\n *\t\t\t\t\t// A custom callback function will be executed when \"click\" fires in DOM.\n *\t\t\t\t\tbind.to( () => {\n *\t\t\t\t\t\t...\n *\t\t\t\t\t} )\n *\t\t\t\t]\n *\t\t\t}\n *\t\t} ).render();\n *\n *\t\tconst bind = Template.bind( observableInstance, emitterInstance );\n *\n *\t\tnew Template( {\n *\t\t\ttag: 'p',\n *\t\t} ).render();\n *\n * @method #to\n * @param {String|Function} eventNameOrFunctionOrAttribute An attribute name of\n * {@link module:utils/observablemixin~ObservableMixin} or a DOM event name or an event callback.\n * @param {Function} [callback] Allows processing of the value. Accepts `Node` and `value` as arguments.\n * @return {module:ui/template~TemplateBinding}\n */\n\n/**\n * Binds {@link module:utils/observablemixin~ObservableMixin} to HTMLElement attribute or Text Node `textContent`\n * so remains in sync with the Model when it changes. Unlike {@link module:ui/template~BindChain#to},\n * it controls the presence of the attribute/`textContent` depending on the \"falseness\" of\n * {@link module:utils/observablemixin~ObservableMixin} attribute.\n *\n *\t\tconst bind = Template.bind( observableInstance, emitterInstance );\n *\n *\t\tnew Template( {\n *\t\t\ttag: 'input',\n *\t\t\tattributes: {\n *\t\t\t\t// when `observableInstance#a` is not undefined/null/false/''\n *\t\t\t\t// when `observableInstance#a` is undefined/null/false\n *\t\t\t\tchecked: bind.if( 'a' )\n *\t\t\t},\n *\t\t\tchildren: [\n *\t\t\t\t{\n *\t\t\t\t\t// \"b-is-not-set\" when `observableInstance#b` is undefined/null/false/''\n *\t\t\t\t\t// when `observableInstance#b` is not \"falsy\"\n *\t\t\t\t\ttext: bind.if( 'b', 'b-is-not-set', ( value, node ) => !value )\n *\t\t\t\t}\n *\t\t\t]\n *\t\t} ).render();\n *\n * @method #if\n * @param {String} attribute An attribute name of {@link module:utils/observablemixin~ObservableMixin} used in the binding.\n * @param {String} [valueIfTrue] Value set when {@link module:utils/observablemixin~ObservableMixin} attribute is not\n * undefined/null/false/''.\n * @param {Function} [callback] Allows processing of the value. Accepts `Node` and `value` as arguments.\n * @return {module:ui/template~TemplateBinding}\n */\n\n/**\n * The {@link module:ui/template~Template#_renderNode} configuration.\n *\n * @private\n * @interface module:ui/template~RenderData\n */\n\n/**\n * Tells {@link module:ui/template~Template#_renderNode} to render\n * children into `DocumentFragment` first and then append the fragment\n * to the parent element. It's a speed optimization.\n *\n * @member {Boolean} #intoFragment\n */\n\n/**\n * A node which is being rendered.\n *\n * @member {HTMLElement|Text} #node\n */\n\n/**\n * Indicates whether the {@module:ui/template~RenderNodeOptions#node} has\n * been provided by {@module:ui/template~Template#apply}.\n *\n * @member {Boolean} #isApplying\n */\n\n/**\n * An object storing the data that helps {@module:ui/template~Template#revert}\n * bringing back an element to its initial state, i.e. before\n * {@module:ui/template~Template#apply} was called.\n *\n * @member {Object} #revertData\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-ui/src/template.js\n// module id = 6\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/emittermixin\n */\n\nimport EventInfo from './eventinfo';\nimport uid from './uid';\nimport priorities from './priorities';\n\nconst _listeningTo = Symbol( 'listeningTo' );\nconst _emitterId = Symbol( 'emitterId' );\n\n/**\n * Mixin that injects the events API into its host.\n *\n * @mixin EmitterMixin\n * @implements module:utils/emittermixin~Emitter\n */\nconst EmitterMixin = {\n\t/**\n\t * Registers a callback function to be executed when an event is fired. Events can be grouped in namespaces using `:`.\n\t * When namespaced event is fired, it additionaly fires all callbacks for that namespace.\n\t *\n\t *\t\tmyEmitter.on( 'myGroup', genericCallback );\n\t *\t\tmyEmitter.on( 'myGroup:myEvent', specificCallback );\n\t *\t\tmyEmitter.fire( 'myGroup' ); // genericCallback is fired.\n\t *\t\tmyEmitter.fire( 'myGroup:myEvent' ); // both genericCallback and specificCallback are fired.\n\t *\t\tmyEmitter.fire( 'myGroup:foo' ); // genericCallback is fired even though there are no callbacks for \"foo\".\n\t *\n\t * @method #on\n\t * @param {String} event The name of the event.\n\t * @param {Function} callback The function to be called on event.\n\t * @param {Object} [options={}] Additional options.\n\t * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher\n\t * the priority value the sooner the callback will be fired. Events having the same priority are called in the\n\t * order they were added.\n\t * @param {Object} [options.context] The object that represents `this` in the callback. Defaults to the object firing the event.\n\t */\n\ton( event, callback, options = {} ) {\n\t\tcreateEventNamespace( this, event );\n\t\tconst lists = getCallbacksListsForNamespace( this, event );\n\t\tconst priority = priorities.get( options.priority );\n\n\t\tcallback = {\n\t\t\tcallback: callback,\n\t\t\tcontext: options.context || this,\n\t\t\tpriority: priority\n\t\t};\n\n\t\t// Add the callback to all callbacks list.\n\t\tfor ( let callbacks of lists ) {\n\t\t\t// Add the callback to the list in the right priority position.\n\t\t\tlet added = false;\n\n\t\t\tfor ( let i = 0; i < callbacks.length; i++ ) {\n\t\t\t\tif ( callbacks[ i ].priority < priority ) {\n\t\t\t\t\tcallbacks.splice( i, 0, callback );\n\t\t\t\t\tadded = true;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add at the end, if right place was not found.\n\t\t\tif ( !added ) {\n\t\t\t\tcallbacks.push( callback );\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Registers a callback function to be executed on the next time the event is fired only. This is similar to\n\t * calling {@link #on} followed by {@link #off} in the callback.\n\t *\n\t * @method #once\n\t * @param {String} event The name of the event.\n\t * @param {Function} callback The function to be called on event.\n\t * @param {Object} [options={}] Additional options.\n\t * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher\n\t * the priority value the sooner the callback will be fired. Events having the same priority are called in the\n\t * order they were added.\n\t * @param {Object} [options.context] The object that represents `this` in the callback. Defaults to the object firing the event.\n\t */\n\tonce( event, callback, options ) {\n\t\tconst onceCallback = function( event ) {\n\t\t\t// Go off() at the first call.\n\t\t\tevent.off();\n\n\t\t\t// Go with the original callback.\n\t\t\tcallback.apply( this, arguments );\n\t\t};\n\n\t\t// Make a similar on() call, simply replacing the callback.\n\t\tthis.on( event, onceCallback, options );\n\t},\n\n\t/**\n\t * Stops executing the callback on the given event.\n\t *\n\t * @method #off\n\t * @param {String} event The name of the event.\n\t * @param {Function} callback The function to stop being called.\n\t * @param {Object} [context] The context object to be removed, pared with the given callback. To handle cases where\n\t * the same callback is used several times with different contexts.\n\t */\n\toff( event, callback, context ) {\n\t\tconst lists = getCallbacksListsForNamespace( this, event );\n\n\t\tfor ( let callbacks of lists ) {\n\t\t\tfor ( let i = 0; i < callbacks.length; i++ ) {\n\t\t\t\tif ( callbacks[ i ].callback == callback ) {\n\t\t\t\t\tif ( !context || context == callbacks[ i ].context ) {\n\t\t\t\t\t\t// Remove the callback from the list (fixing the next index).\n\t\t\t\t\t\tcallbacks.splice( i, 1 );\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Registers a callback function to be executed when an event is fired in a specific (emitter) object.\n\t *\n\t * @method #listenTo\n\t * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.\n\t * @param {String} event The name of the event.\n\t * @param {Function} callback The function to be called on event.\n\t * @param {Object} [options={}] Additional options.\n\t * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher\n\t * the priority value the sooner the callback will be fired. Events having the same priority are called in the\n\t * order they were added.\n\t * @param {Object} [options.context] The object that represents `this` in the callback. Defaults to the object firing the event.\n\t */\n\tlistenTo( emitter, event, callback, options ) {\n\t\tlet emitters, emitterId, emitterInfo, eventCallbacks;\n\n\t\t// _listeningTo contains a list of emitters that this object is listening to.\n\t\t// This list has the following format:\n\t\t//\n\t\t// _listeningTo: {\n\t\t// emitterId: {\n\t\t// emitter: emitter,\n\t\t// callbacks: {\n\t\t// event1: [ callback1, callback2, ... ]\n\t\t// ....\n\t\t// }\n\t\t// },\n\t\t// ...\n\t\t// }\n\n\t\tif ( !this[ _listeningTo ] ) {\n\t\t\tthis[ _listeningTo ] = {};\n\t\t}\n\n\t\temitters = this[ _listeningTo ];\n\n\t\tif ( !_getEmitterId( emitter ) ) {\n\t\t\t_setEmitterId( emitter );\n\t\t}\n\n\t\temitterId = _getEmitterId( emitter );\n\n\t\tif ( !( emitterInfo = emitters[ emitterId ] ) ) {\n\t\t\temitterInfo = emitters[ emitterId ] = {\n\t\t\t\temitter: emitter,\n\t\t\t\tcallbacks: {}\n\t\t\t};\n\t\t}\n\n\t\tif ( !( eventCallbacks = emitterInfo.callbacks[ event ] ) ) {\n\t\t\teventCallbacks = emitterInfo.callbacks[ event ] = [];\n\t\t}\n\n\t\teventCallbacks.push( callback );\n\n\t\t// Finally register the callback to the event.\n\t\temitter.on( event, callback, options );\n\t},\n\n\t/**\n\t * Stops listening for events. It can be used at different levels:\n\t *\n\t * * To stop listening to a specific callback.\n\t * * To stop listening to a specific event.\n\t * * To stop listening to all events fired by a specific object.\n\t * * To stop listening to all events fired by all object.\n\t *\n\t * @method #stopListening\n\t * @param {module:utils/emittermixin~Emitter} [emitter] The object to stop listening to. If omitted, stops it for all objects.\n\t * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it\n\t * for all events from `emitter`.\n\t * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given\n\t * `event`.\n\t */\n\tstopListening( emitter, event, callback ) {\n\t\tlet emitters = this[ _listeningTo ];\n\t\tlet emitterId = emitter && _getEmitterId( emitter );\n\t\tlet emitterInfo = emitters && emitterId && emitters[ emitterId ];\n\t\tlet eventCallbacks = emitterInfo && event && emitterInfo.callbacks[ event ];\n\n\t\t// Stop if nothing has been listened.\n\t\tif ( !emitters || ( emitter && !emitterInfo ) || ( event && !eventCallbacks ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// All params provided. off() that single callback.\n\t\tif ( callback ) {\n\t\t\temitter.off( event, callback );\n\t\t}\n\t\t// Only `emitter` and `event` provided. off() all callbacks for that event.\n\t\telse if ( eventCallbacks ) {\n\t\t\twhile ( ( callback = eventCallbacks.pop() ) ) {\n\t\t\t\temitter.off( event, callback );\n\t\t\t}\n\t\t\tdelete emitterInfo.callbacks[ event ];\n\t\t}\n\t\t// Only `emitter` provided. off() all events for that emitter.\n\t\telse if ( emitterInfo ) {\n\t\t\tfor ( event in emitterInfo.callbacks ) {\n\t\t\t\tthis.stopListening( emitter, event );\n\t\t\t}\n\t\t\tdelete emitters[ emitterId ];\n\t\t}\n\t\t// No params provided. off() all emitters.\n\t\telse {\n\t\t\tfor ( emitterId in emitters ) {\n\t\t\t\tthis.stopListening( emitters[ emitterId ].emitter );\n\t\t\t}\n\t\t\tdelete this[ _listeningTo ];\n\t\t}\n\t},\n\n\t/**\n\t * Fires an event, executing all callbacks registered for it.\n\t *\n\t * The first parameter passed to callbacks is an {@link module:utils/eventinfo~EventInfo} object,\n\t * followed by the optional `args` provided in the `fire()` method call.\n\t *\n\t * @method #fire\n\t * @param {String|module:utils/eventinfo~EventInfo} eventOrInfo The name of the event or `EventInfo` object if event is delegated.\n\t * @param {...*} [args] Additional arguments to be passed to the callbacks.\n\t */\n\tfire( eventOrInfo, ...args ) {\n\t\tconst eventInfo = eventOrInfo instanceof EventInfo ? eventOrInfo : new EventInfo( this, eventOrInfo );\n\t\tconst event = eventInfo.name;\n\t\tlet callbacks = getCallbacksForEvent( this, event );\n\n\t\t// Record that the event passed this emitter on its path.\n\t\teventInfo.path.push( this );\n\n\t\t// Handle event listener callbacks first.\n\t\tif ( callbacks ) {\n\t\t\t// Arguments passed to each callback.\n\t\t\tconst callbackArgs = [ eventInfo, ...args ];\n\n\t\t\t// Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks\n\t\t\t// are added while processing other callbacks. Previous solution involved adding counters (unique ids) but\n\t\t\t// failed if callbacks were added to the queue before currently processed callback.\n\t\t\t// If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same\n\t\t\t// event is currently processed. Then, `.fire()` at the end, would have to add all stored events.\n\t\t\tcallbacks = Array.from( callbacks );\n\n\t\t\tfor ( let i = 0; i < callbacks.length; i++ ) {\n\t\t\t\tcallbacks[ i ].callback.apply( callbacks[ i ].context, callbackArgs );\n\n\t\t\t\t// Remove the callback from future requests if off() has been called.\n\t\t\t\tif ( eventInfo.off.called ) {\n\t\t\t\t\t// Remove the called mark for the next calls.\n\t\t\t\t\tdelete eventInfo.off.called;\n\n\t\t\t\t\tthis.off( event, callbacks[ i ].callback, callbacks[ i ].context );\n\t\t\t\t}\n\n\t\t\t\t// Do not execute next callbacks if stop() was called.\n\t\t\t\tif ( eventInfo.stop.called ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Delegate event to other emitters if needed.\n\t\tif ( this._delegations ) {\n\t\t\tconst destinations = this._delegations.get( event );\n\t\t\tconst passAllDestinations = this._delegations.get( '*' );\n\n\t\t\tif ( destinations ) {\n\t\t\t\tfireDelegatedEvents( destinations, eventInfo, args );\n\t\t\t}\n\n\t\t\tif ( passAllDestinations ) {\n\t\t\t\tfireDelegatedEvents( passAllDestinations, eventInfo, args );\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Delegates selected events to another {@link module:utils/emittermixin~Emitter}. For instance:\n\t *\n\t *\t\temitterA.delegate( 'eventX' ).to( emitterB );\n\t *\t\temitterA.delegate( 'eventX', 'eventY' ).to( emitterC );\n\t *\n\t * then `eventX` is delegated (fired by) `emitterB` and `emitterC` along with `data`:\n\t *\n\t *\t\temitterA.fire( 'eventX', data );\n\t *\n\t * and `eventY` is delegated (fired by) `emitterC` along with `data`:\n\t *\n\t *\t\temitterA.fire( 'eventY', data );\n\t *\n\t * @method #delegate\n\t * @param {...String} events Event names that will be delegated to another emitter.\n\t * @returns {module:utils/emittermixin~EmitterMixinDelegateChain}\n\t */\n\tdelegate( ...events ) {\n\t\treturn {\n\t\t\tto: ( emitter, nameOrFunction ) => {\n\t\t\t\tif ( !this._delegations ) {\n\t\t\t\t\tthis._delegations = new Map();\n\t\t\t\t}\n\n\t\t\t\tfor ( let eventName of events ) {\n\t\t\t\t\tlet destinations = this._delegations.get( eventName );\n\n\t\t\t\t\tif ( !destinations ) {\n\t\t\t\t\t\tthis._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdestinations.set( emitter, nameOrFunction );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t},\n\n\t/**\n\t * Stops delegating events. It can be used at different levels:\n\t *\n\t * * To stop delegating all events.\n\t * * To stop delegating a specific event to all emitters.\n\t * * To stop delegating a specific event to a specific emitter.\n\t *\n\t * @method #stopDelegating\n\t * @param {String} [event] The name of the event to stop delegating. If omitted, stops it all delegations.\n\t * @param {module:utils/emittermixin~Emitter} [emitter] (requires `event`) The object to stop delegating a particular event to.\n\t * If omitted, stops delegation of `event` to all emitters.\n\t */\n\tstopDelegating( event, emitter ) {\n\t\tif ( !this._delegations ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !event ) {\n\t\t\tthis._delegations.clear();\n\t\t} else if ( !emitter ) {\n\t\t\tthis._delegations.delete( event );\n\t\t} else {\n\t\t\tconst destinations = this._delegations.get( event );\n\n\t\t\tif ( destinations ) {\n\t\t\t\tdestinations.delete( emitter );\n\t\t\t}\n\t\t}\n\t}\n};\n\nexport default EmitterMixin;\n\n/**\n * Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.\n * If not, returns `null`.\n *\n * @protected\n * @param {module:utils/emittermixin~EmitterMixin} listeningEmitter Emitter that listens.\n * @param {String} listenedToEmitterId Unique emitter id of emitter listened to.\n * @returns {module:utils/emittermixin~EmitterMixin|null}\n */\nexport function _getEmitterListenedTo( listeningEmitter, listenedToEmitterId ) {\n\tif ( listeningEmitter[ _listeningTo ] && listeningEmitter[ _listeningTo ][ listenedToEmitterId ] ) {\n\t\treturn listeningEmitter[ _listeningTo ][ listenedToEmitterId ].emitter;\n\t}\n\n\treturn null;\n}\n\n/**\n * Sets emitter's unique id.\n *\n * **Note:** `_emitterId` can be set only once.\n *\n * @protected\n * @param {module:utils/emittermixin~EmitterMixin} emitter Emitter for which id will be set.\n * @param {String} [id] Unique id to set. If not passed, random unique id will be set.\n */\nexport function _setEmitterId( emitter, id ) {\n\tif ( !emitter[ _emitterId ] ) {\n\t\temitter[ _emitterId ] = id || uid();\n\t}\n}\n\n/**\n * Returns emitter's unique id.\n *\n * @protected\n * @param {module:utils/emittermixin~EmitterMixin} emitter Emitter which id will be returned.\n */\nexport function _getEmitterId( emitter ) {\n\treturn emitter[ _emitterId ];\n}\n\n// Gets the internal `_events` property of the given object.\n// `_events` property store all lists with callbacks for registered event names.\n// If there were no events registered on the object, empty `_events` object is created.\nfunction getEvents( source ) {\n\tif ( !source._events ) {\n\t\tObject.defineProperty( source, '_events', {\n\t\t\tvalue: {}\n\t\t} );\n\t}\n\n\treturn source._events;\n}\n\n// Creates event node for generic-specific events relation architecture.\nfunction makeEventNode() {\n\treturn {\n\t\tcallbacks: [],\n\t\tchildEvents: []\n\t};\n}\n\n// Creates an architecture for generic-specific events relation.\n// If needed, creates all events for given eventName, i.e. if the first registered event\n// is foo:bar:abc, it will create foo:bar:abc, foo:bar and foo event and tie them together.\n// It also copies callbacks from more generic events to more specific events when\n// specific events are created.\nfunction createEventNamespace( source, eventName ) {\n\tconst events = getEvents( source );\n\n\t// First, check if the event we want to add to the structure already exists.\n\tif ( events[ eventName ] ) {\n\t\t// If it exists, we don't have to do anything.\n\t\treturn;\n\t}\n\n\t// In other case, we have to create the structure for the event.\n\t// Note, that we might need to create intermediate events too.\n\t// I.e. if foo:bar:abc is being registered and we only have foo in the structure,\n\t// we need to also register foo:bar.\n\n\t// Currently processed event name.\n\tlet name = eventName;\n\t// Name of the event that is a child event for currently processed event.\n\tlet childEventName = null;\n\n\t// Array containing all newly created specific events.\n\tconst newEventNodes = [];\n\n\t// While loop can't check for ':' index because we have to handle generic events too.\n\t// In each loop, we truncate event name, going from the most specific name to the generic one.\n\t// I.e. foo:bar:abc -> foo:bar -> foo.\n\twhile ( name !== '' ) {\n\t\tif ( events[ name ] ) {\n\t\t\t// If the currently processed event name is already registered, we can be sure\n\t\t\t// that it already has all the structure created, so we can break the loop here\n\t\t\t// as no more events need to be registered.\n\t\t\tbreak;\n\t\t}\n\n\t\t// If this event is not yet registered, create a new object for it.\n\t\tevents[ name ] = makeEventNode();\n\t\t// Add it to the array with newly created events.\n\t\tnewEventNodes.push( events[ name ] );\n\n\t\t// Add previously processed event name as a child of this event.\n\t\tif ( childEventName ) {\n\t\t\tevents[ name ].childEvents.push( childEventName );\n\t\t}\n\n\t\tchildEventName = name;\n\t\t// If `.lastIndexOf()` returns -1, `.substr()` will return '' which will break the loop.\n\t\tname = name.substr( 0, name.lastIndexOf( ':' ) );\n\t}\n\n\tif ( name !== '' ) {\n\t\t// If name is not empty, we found an already registered event that was a parent of the\n\t\t// event we wanted to register.\n\n\t\t// Copy that event's callbacks to newly registered events.\n\t\tfor ( let node of newEventNodes ) {\n\t\t\tnode.callbacks = events[ name ].callbacks.slice();\n\t\t}\n\n\t\t// Add last newly created event to the already registered event.\n\t\tevents[ name ].childEvents.push( childEventName );\n\t}\n}\n\n// Gets an array containing callbacks list for a given event and it's more specific events.\n// I.e. if given event is foo:bar and there is also foo:bar:abc event registered, this will\n// return callback list of foo:bar and foo:bar:abc (but not foo).\n// Returns empty array if given event has not been yet registered.\nfunction getCallbacksListsForNamespace( source, eventName ) {\n\tconst eventNode = getEvents( source )[ eventName ];\n\n\tif ( !eventNode ) {\n\t\treturn [];\n\t}\n\n\tlet callbacksLists = [ eventNode.callbacks ];\n\n\tfor ( let i = 0; i < eventNode.childEvents.length; i++ ) {\n\t\tlet childCallbacksLists = getCallbacksListsForNamespace( source, eventNode.childEvents[ i ] );\n\n\t\tcallbacksLists = callbacksLists.concat( childCallbacksLists );\n\t}\n\n\treturn callbacksLists;\n}\n\n// Get the list of callbacks for a given event, but only if there any callbacks have been registered.\n// If there are no callbacks registered for given event, it checks if this is a specific event and looks\n// for callbacks for it's more generic version.\nfunction getCallbacksForEvent( source, eventName ) {\n\tlet event;\n\n\tif ( !source._events || !( event = source._events[ eventName ] ) || !event.callbacks.length ) {\n\t\t// There are no callbacks registered for specified eventName.\n\t\t// But this could be a specific-type event that is in a namespace.\n\t\tif ( eventName.indexOf( ':' ) > -1 ) {\n\t\t\t// If the eventName is specific, try to find callback lists for more generic event.\n\t\t\treturn getCallbacksForEvent( source, eventName.substr( 0, eventName.lastIndexOf( ':' ) ) );\n\t\t} else {\n\t\t\t// If this is a top-level generic event, return null;\n\t\t\treturn null;\n\t\t}\n\t}\n\n\treturn event.callbacks;\n}\n\n// Fires delegated events for given map of destinations.\n//\n// @private\n// * @param {Map.} destinations A map containing `[ {@link utils.Emitter}, \"event name\" ]` pair destinations.\n// * @param {utils.EventInfo} eventInfo The original event info object.\n// * @param {Array.<*>} fireArgs Arguments the original event was fired with.\nfunction fireDelegatedEvents( destinations, eventInfo, fireArgs ) {\n\tfor ( let [ emitter, name ] of destinations ) {\n\t\tif ( !name ) {\n\t\t\tname = eventInfo.name;\n\t\t} else if ( typeof name == 'function' ) {\n\t\t\tname = name( eventInfo.name );\n\t\t}\n\n\t\tconst delegatedInfo = new EventInfo( eventInfo.source, name );\n\n\t\tdelegatedInfo.path = [ ...eventInfo.path ];\n\n\t\temitter.fire( delegatedInfo, ...fireArgs );\n\t}\n}\n\n/**\n * Interface representing classes which mix in {@link module:utils/emittermixin~EmitterMixin}.\n *\n * @interface Emitter\n */\n\n/**\n * The return value of {@link ~EmitterMixin#delegate}.\n *\n * @interface module:utils/emittermixin~EmitterMixinDelegateChain\n */\n\n/**\n * Selects destination for {@link module:utils/emittermixin~EmitterMixin#delegate} events.\n *\n * @method #to\n * @param {module:utils/emittermixin~Emitter} emitter An `EmitterMixin` instance which is the destination for delegated events.\n * @param {String|Function} nameOrFunction A custom event name or function which converts the original name string.\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/emittermixin.js\n// module id = 7\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/view\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport ViewCollection from './viewcollection';\nimport Template from './template';\nimport DomEmmiterMixin from '@ckeditor/ckeditor5-utils/src/dom/emittermixin';\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport Collection from '@ckeditor/ckeditor5-utils/src/collection';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\n\n/**\n * Basic View class.\n *\n *\t\tclass SampleView extends View {\n *\t\t\tconstructor( locale ) {\n *\t\t\t\tsuper( locale );\n *\n *\t\t\t\tthis.template = new Template( {\n *\t\t\t\t\ttag: 'p',\n *\t\t\t\t\tchildren: [\n *\t\t\t\t\t\t'Hello',\n *\t\t\t\t\t\t{\n *\t\t\t\t\t\t\ttag: 'b',\n *\t\t\t\t\t\t\tchildren: [\n *\t\t\t\t\t\t\t\t'world!'\n *\t\t\t\t\t\t\t]\n *\t\t\t\t\t\t}\n *\t\t\t\t\t],\n *\t\t\t\t\tattributes: {\n *\t\t\t\t\t\tclass: 'foo'\n *\t\t\t\t\t}\n *\t\t\t\t} );\n *\t\t\t}\n *\t\t}\n *\n *\t\tconst view = new SampleView( locale );\n *\n *\t\tview.init().then( () => {\n *\t\t\t// Will append

Helloworld

\n *\t\t\tdocument.body.appendChild( view.element );\n *\t\t} );\n *\n * @mixes module:utils/dom/emittermixin~EmmiterMixin\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class View {\n\t/**\n\t * Creates an instance of the {@link module:ui/view~View} class.\n\t *\n\t * @param {module:utils/locale~Locale} [locale] The {@link module:core/editor/editor~Editor editor's locale} instance.\n\t */\n\tconstructor( locale ) {\n\t\t/**\n\t\t * A set of tools to localize the user interface. See {@link module:core/editor/editor~Editor}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:utils/locale~Locale}\n\t\t */\n\t\tthis.locale = locale;\n\n\t\t/**\n\t\t * Shorthand for {@link module:utils/locale~Locale#t}.\n\t\t *\n\t\t * Note: If locale instance hasn't been passed to the view this method may not be available.\n\t\t *\n\t\t * @see module:utils/locale~Locale#t\n\t\t * @method\n\t\t */\n\t\tthis.t = locale && locale.t;\n\n\t\t/**\n\t\t * Set `true` after {@link #init}, which can be asynchronous.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Boolean} #ready\n\t\t */\n\t\tthis.set( 'ready', false );\n\n\t\t/**\n\t\t * Collections registered with {@link #createCollection}.\n\t\t *\n\t\t * @protected\n\t\t * @member {Set.}\n\t\t */\n\t\tthis._viewCollections = new Collection();\n\n\t\t/**\n\t\t * A collection of view instances, which have been added directly\n\t\t * into the {@link module:ui/template~Template#children}.\n\t\t *\n\t\t * @protected\n\t\t * @member {module:ui/viewcollection~ViewCollection}\n\t\t */\n\t\tthis._unboundChildren = this.createCollection();\n\n\t\t// Pass parent locale to its children.\n\t\tthis._viewCollections.on( 'add', ( evt, collection ) => {\n\t\t\tcollection.locale = locale;\n\t\t} );\n\n\t\t/**\n\t\t * Template of this view.\n\t\t *\n\t\t * @member {module:ui/template~Template} #template\n\t\t */\n\n\t\t/**\n\t\t * Element of this view.\n\t\t *\n\t\t * @private\n\t\t * @member {HTMLElement} #_element\n\t\t */\n\n\t\t/**\n\t\t * Cached {@link module:ui/template~Template} binder object specific for this instance.\n\t\t * See {@link #bindTemplate}.\n\t\t *\n\t\t * @private\n\t\t * @member {Object} #_bindTemplate\n\t\t */\n\t}\n\n\t/**\n\t * Element of this view. The element is rendered on first reference\n\t * using {@link #template} definition.\n\t *\n\t * @type {HTMLElement}\n\t */\n\tget element() {\n\t\tif ( this._element ) {\n\t\t\treturn this._element;\n\t\t}\n\n\t\t// No template means no element (a virtual view).\n\t\tif ( !this.template ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tthis._addTemplateChildren();\n\n\t\treturn ( this._element = this.template.render() );\n\t}\n\n\t/**\n\t * @type {HTMLElement}\n\t */\n\tset element( el ) {\n\t\tthis._element = el;\n\t}\n\n\t/**\n\t * Shorthand for {@link module:ui/template~Template.bind}, bound to {@link ~View} on the first access.\n\t *\n\t * Cached {@link module:ui/template~Template.bind} object is stored in {@link #_bindTemplate}.\n\t *\n\t * @method #bindTemplate\n\t */\n\tget bindTemplate() {\n\t\tif ( this._bindTemplate ) {\n\t\t\treturn this._bindTemplate;\n\t\t}\n\n\t\treturn ( this._bindTemplate = Template.bind( this, this ) );\n\t}\n\n\t/**\n\t * Creates a new collection of views, which can be used in this view instance,\n\t * e.g. as a member of {@link module:ui/template~TemplateDefinition TemplateDefinition} children.\n\t *\n\t *\t\tclass SampleView extends View {\n\t *\t\t\tconstructor( locale ) {\n\t *\t\t\t\tsuper( locale );\n\t *\n\t *\t\t\t\tthis.items = this.createCollection();\n \t *\n\t *\t\t\t\tthis.template = new Template( {\n\t *\t\t\t\t\ttag: 'p',\n\t *\n\t *\t\t\t\t\t// `items` collection will render here.\n\t *\t\t\t\t\tchildren: this.items\n\t *\t\t\t\t} );\n\t *\t\t\t}\n\t *\t\t}\n\t *\n\t *\t\tconst view = new SampleView( locale );\n\t *\t\tconst anotherView = new AnotherSampleView( locale );\n\t *\n\t *\t\tview.init().then( () => {\n\t *\t\t\t// Will append

\n\t *\t\t\tdocument.body.appendChild( view.element );\n\t *\n\t *\t\t\t// `anotherView` becomes a child of the view, which is reflected in DOM\n\t *\t\t\t//

\n\t *\t\t\tview.items.add( anotherView );\n\t *\t\t} );\n\t *\n\t * @returns {module:ui/viewcollection~ViewCollection} A new collection of view instances.\n\t */\n\tcreateCollection() {\n\t\tconst collection = new ViewCollection();\n\n\t\tthis._viewCollections.add( collection );\n\n\t\treturn collection;\n\t}\n\n\t/**\n\t * Registers a new child view under this view instance. Once registered, a child\n\t * view is managed by its parent, including initialization ({@link #init})\n\t * and destruction ({@link #destroy}).\n\t *\n\t *\t\tclass SampleView extends View {\n\t *\t\t\tconstructor( locale ) {\n\t *\t\t\t\tsuper( locale );\n\t *\n\t *\t\t\t\tthis.childA = new SomeChildView( locale );\n\t *\t\t\t\tthis.childB = new SomeChildView( locale );\n\t *\n\t *\t\t\t\tthis.template = new Template( { tag: 'p' } );\n\t *\n\t *\t\t\t\t// Register children.\n\t *\t\t\t\tthis.addChildren( [ this.childA, this.childB ] );\n\t *\t\t\t}\n\t *\n\t *\t\t\tinit() {\n\t *\t\t\t\tthis.element.appendChild( this.childA.element );\n\t *\t\t\t\tthis.element.appendChild( this.childB.element );\n\t *\n\t *\t\t\t\treturn super.init();\n\t *\t\t\t}\n\t *\t\t}\n\t *\n\t *\t\tconst view = new SampleView( locale );\n\t *\n\t *\t\tview.init().then( () => {\n\t *\t\t\t// Will append

\n\t *\t\t\tdocument.body.appendChild( view.element );\n\t *\t\t} );\n\t *\n\t * **Note**: There's no need to add child views if they're used in the\n\t * {@link #template} explicitly:\n\t *\n\t *\t\tclass SampleView extends View {\n\t *\t\t\tconstructor( locale ) {\n\t *\t\t\t\tsuper( locale );\n\t *\n\t *\t\t\t\tthis.childA = new SomeChildView( locale );\n\t *\t\t\t\tthis.childB = new SomeChildView( locale );\n\t *\n\t *\t\t\t\tthis.template = new Template( {\n\t *\t\t\t\t\ttag: 'p',\n\t *\n \t *\t\t\t\t\t// These children will be added automatically. There's no\n \t *\t\t\t\t\t// need to call {@link #addChildren} for any of them.\n\t *\t\t\t\t\tchildren: [ this.childA, this.childB ]\n\t *\t\t\t\t} );\n\t *\t\t\t}\n\t *\n\t *\t\t\t...\n\t *\t\t}\n\t *\n\t * @param {module:ui/view~View|Iterable.} children Children views to be registered.\n\t */\n\taddChildren( children ) {\n\t\tif ( !isIterable( children ) ) {\n\t\t\tchildren = [ children ];\n\t\t}\n\n\t\tfor ( let child of children ) {\n\t\t\tthis._unboundChildren.add( child );\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the view and child views located in {@link #_viewCollections}.\n\t *\n\t * @returns {Promise} A Promise resolved when the initialization process is finished.\n\t */\n\tinit() {\n\t\tif ( this.ready ) {\n\t\t\t/**\n\t\t\t * This View has already been initialized.\n\t\t\t *\n\t\t\t * @error ui-view-init-reinit\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'ui-view-init-reinit: This View has already been initialized.' );\n\t\t}\n\n\t\treturn Promise.resolve()\n\t\t\t// Initialize collections in #_viewCollections.\n\t\t\t.then( () => {\n\t\t\t\treturn Promise.all( this._viewCollections.map( c => c.init() ) );\n\t\t\t} )\n\t\t\t// Spread the word that this view is ready!\n\t\t\t.then( () => {\n\t\t\t\tthis.ready = true;\n\t\t\t} );\n\t}\n\n\t/**\n\t * Destroys the view instance and child views located in {@link #_viewCollections}.\n\t *\n\t * @returns {Promise} A Promise resolved when the destruction process is finished.\n\t */\n\tdestroy() {\n\t\tthis.stopListening();\n\n\t\tconst promises = this._viewCollections.map( c => c.destroy() );\n\n\t\tthis._unboundChildren.clear();\n\t\tthis._viewCollections.clear();\n\n\t\tthis.element = this.template = this.locale = this.t =\n\t\t\tthis._viewCollections = this._unboundChildren = null;\n\n\t\treturn Promise.all( promises );\n\t}\n\n\t/**\n\t * Recursively traverses {@link #template} in search of {@link module:ui/view~View}\n\t * instances and automatically registers them using {@link #addChildren} method.\n\t *\n\t * @protected\n\t */\n\t_addTemplateChildren() {\n\t\tconst search = ( def ) => {\n\t\t\tif ( def.children ) {\n\t\t\t\tfor ( let defOrView of def.children ) {\n\t\t\t\t\tif ( defOrView instanceof View ) {\n\t\t\t\t\t\tthis.addChildren( defOrView );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsearch( defOrView );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tsearch( this.template );\n\t}\n}\n\nmix( View, DomEmmiterMixin );\nmix( View, ObservableMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-ui/src/view.js\n// module id = 9\n// module chunks = 0","import baseMatches from './_baseMatches';\nimport baseMatchesProperty from './_baseMatchesProperty';\nimport identity from './identity';\nimport isArray from './isArray';\nimport property from './property';\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nexport default baseIteratee;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIteratee.js\n// module id = 10\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/command/command\n */\n\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * The base class for CKEditor commands.\n *\n * Commands are main way to manipulate editor contents and state. They are mostly used by UI elements (or by other\n * commands) to make changes in Tree Model. Commands are available in every part of code that has access to\n * {@link module:core/editor/editor~Editor} instance, since they are registered in it and executed through\n * {@link module:core/editor/editor~Editor#execute}.\n * Commands instances are available through {@link module:core/editor/editor~Editor#commands}.\n *\n * This is an abstract base class for all commands.\n *\n * @mixes module:utils/observablemixin~ObservaleMixin\n */\nexport default class Command {\n\t/**\n\t * Creates a new Command instance.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor Editor on which this command will be used.\n\t */\n\tconstructor( editor ) {\n\t\t/**\n\t\t * Editor on which this command will be used.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:core/editor/editor~Editor} #editor\n\t\t */\n\t\tthis.editor = editor;\n\n\t\t/**\n\t\t * Flag indicating whether a command is enabled or disabled.\n\t\t * A disabled command should do nothing upon it's execution.\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #isEnabled\n\t\t */\n\t\tthis.set( 'isEnabled', true );\n\n\t\t// If schema checking function is specified, add it to the `refreshState` listeners.\n\t\t// Feature will be disabled if it does not apply to schema requirements.\n\t\tif ( this._checkEnabled ) {\n\t\t\tthis.on( 'refreshState', ( evt, data ) => {\n\t\t\t\tdata.isEnabled = this._checkEnabled();\n\t\t\t} );\n\t\t}\n\t}\n\n\tdestroy() {\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Fires `refreshState` event and checks it's resolve value to decide whether command should be enabled or not.\n\t * Other parts of code might listen to `refreshState` event on this command and add their callbacks. This\n\t * way the responsibility of deciding whether a command should be enabled is shared.\n\t *\n\t * @fires refreshState\n\t */\n\trefreshState() {\n\t\tconst data = { isEnabled: true };\n\t\tthis.fire( 'refreshState', data );\n\n\t\tthis.isEnabled = data.isEnabled;\n\t}\n\n\t/**\n\t * Executes the command if it is enabled.\n\t *\n\t * @protected\n\t * @param {*} param Parameter passed to {@link module:core/editor/editor~Editor#execute execute} method of this command.\n\t */\n\t_execute( param ) {\n\t\tif ( this.isEnabled ) {\n\t\t\tthis._doExecute( param );\n\t\t}\n\t}\n\n\t/**\n\t * Disables the command. This should be used only by the command itself. Other parts of code should add\n\t * listeners to `refreshState` event.\n\t *\n\t * @protected\n\t */\n\t_disable() {\n\t\tthis.on( 'refreshState', disableCallback );\n\t\tthis.refreshState();\n\t}\n\n\t/**\n\t * Enables the command (internally). This should be used only by the command itself. Command will be enabled if\n\t * other listeners does not return false on `refreshState` event callbacks. Firing {@link #_enable}\n\t * does not guarantee that {@link #isEnabled} will be set to true, as it depends on other listeners.\n\t *\n\t * @protected\n\t */\n\t_enable() {\n\t\tthis.off( 'refreshState', disableCallback );\n\t\tthis.refreshState();\n\t}\n\n\t/**\n\t * Executes command.\n\t * This is an abstract method that should be overwritten in child classes.\n\t *\n\t * @protected\n\t */\n\t_doExecute() {}\n\n\t/**\n\t * Checks if a command should be enabled according to its own rules. Mostly it will check schema to see if the command\n\t * is allowed to be executed in given position. This method can be defined in child class (but is not obligatory).\n\t * If it is defined, it will be added as a callback to `refreshState` event.\n\t *\n\t * @protected\n\t * @method #_checkEnabled\n\t * @returns {Boolean} `true` if command should be enabled according to\n\t * {@link module:engine/model/document~Document#schema}. `false` otherwise.\n\t */\n}\n\nfunction disableCallback( evt, data ) {\n\tdata.isEnabled = false;\n}\n\nmix( Command, ObservableMixin );\n\n/**\n * Fired whenever command has to have its {@link #isEnabled} property refreshed. Every feature,\n * command or other class which needs to disable command (set `isEnabled` to `false`) should listen to this\n * event.\n *\n * @event refreshState\n * @param {Object} data\n * @param {Boolean} [data.isEnabled=true]\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-core/src/command/command.js\n// module id = 11\n// module chunks = 0","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @type {Function}\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified,\n * else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isArray.js\n// module id = 12\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/writer\n */\n\nimport Node from './node';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport Range from './range';\nimport DocumentFragment from './documentfragment';\nimport NodeList from './nodelist';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Contains functions used for composing model tree, grouped together under \"model writer\" name. Those functions\n * are built on top of {@link module:engine/model/node~Node node}, and it's child classes', APIs.\n *\n * Model writer API has multiple advantages and it is highly recommended to use it when changing model tree and nodes:\n * * model writer API {@link module:engine/model/writer~writer.normalizeNodes normalizes inserted nodes}, which means that you can insert\n * not only {@link module:engine/model/node~Node nodes}, but also `String`s, {@link module:engine/model/textproxy~TextProxy text proxies}\n * and\n * {@link module:engine/model/documentfragment~DocumentFragment document fragments},\n * * model writer API operates on {@link module:engine/model/position~Position positions}, which means that you have\n * better control over manipulating model tree as positions operate on offsets rather than indexes,\n * * model writer API automatically merges {@link module:engine/model/text~Text text nodes} with same attributes, which means\n * lower memory usage and better efficiency.\n *\n * @namespace writer\n */\nconst writer = {\n\tinsert,\n\tremove,\n\tmove,\n\tsetAttribute,\n\tremoveAttribute,\n\tnormalizeNodes\n};\n\nexport default writer;\n\n/**\n * Inserts given nodes at given position.\n *\n * @function module:engine/model/writer~writer.insert\n * @param {module:engine/model/position~Position} position Position at which nodes should be inserted.\n * @param {module:engine/model/node~NodeSet} nodes Nodes to insert.\n * @returns {module:engine/model/range~Range} Range spanning over inserted elements.\n */\nexport function insert( position, nodes ) {\n\tnodes = normalizeNodes( nodes );\n\n\t// We have to count offset before inserting nodes because they can get merged and we would get wrong offsets.\n\tconst offset = nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );\n\tconst parent = position.parent;\n\n\t// Insertion might be in a text node, we should split it if that's the case.\n\t_splitNodeAtPosition( position );\n\tconst index = position.index;\n\n\t// Insert nodes at given index. After splitting we have a proper index and insertion is between nodes,\n\t// using basic `Element` API.\n\tparent.insertChildren( index, nodes );\n\n\t// Merge text nodes, if possible. Merging is needed only at points where inserted nodes \"touch\" \"old\" nodes.\n\t_mergeNodesAtIndex( parent, index + nodes.length );\n\t_mergeNodesAtIndex( parent, index );\n\n\treturn new Range( position, position.getShiftedBy( offset ) );\n}\n\n/**\n * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.\n *\n * @function module:engine/model/writer~writer.remove\n * @param {module:engine/model/range~Range} range Range containing nodes to remove.\n * @returns {Array.}\n */\nexport function remove( range ) {\n\tif ( !range.isFlat ) {\n\t\t/**\n\t\t * Trying to remove a range that starts and ends in different element.\n\t\t *\n\t\t * @error model-writer-remove-range-not-flat\n\t\t */\n\t\tthrow new CKEditorError( 'model-writer-remove-range-not-flat: ' +\n\t\t\t'Trying to remove a range that starts and ends in different element.' );\n\t}\n\n\tconst parent = range.start.parent;\n\n\t// Range may be inside text nodes, we have to split them if that's the case.\n\t_splitNodeAtPosition( range.start );\n\t_splitNodeAtPosition( range.end );\n\n\t// Remove the text nodes using basic `Element` API.\n\tconst removed = parent.removeChildren( range.start.index, range.end.index - range.start.index );\n\n\t// Merge text nodes, if possible. After some nodes were removed, node before and after removed range will be\n\t// touching at the position equal to the removed range beginning. We check merging possibility there.\n\t_mergeNodesAtIndex( parent, range.start.index );\n\n\treturn removed;\n}\n\n/**\n * Moves nodes in given range to given target position. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.\n *\n * @param {module:engine/model/range~Range} sourceRange Range containing nodes to move.\n * @param {module:engine/model/position~Position} targetPosition Position to which nodes should be moved.\n * @returns {module:engine/model/range~Range} Range containing moved nodes.\n */\nexport function move( sourceRange, targetPosition ) {\n\t/* jshint validthis:true */\n\tif ( !sourceRange.isFlat ) {\n\t\t/**\n\t\t * Trying to move a range that starts and ends in different element.\n\t\t *\n\t\t * @error model-writer-move-range-not-flat\n\t\t */\n\t\tthrow new CKEditorError( 'model-writer-move-range-not-flat: ' +\n\t\t\t'Trying to move a range that starts and ends in different element.' );\n\t}\n\n\tconst nodes = this.remove( sourceRange );\n\n\t// We have to fix `targetPosition` because model changed after nodes from `sourceRange` got removed and\n\t// that change might have an impact on `targetPosition`.\n\ttargetPosition = targetPosition._getTransformedByDeletion( sourceRange.start, sourceRange.end.offset - sourceRange.start.offset );\n\n\treturn this.insert( targetPosition, nodes );\n}\n\n/**\n * Sets given attribute on nodes in given range.\n *\n * @param {module:engine/model/range~Range} range Range containing nodes that should have the attribute set.\n * @param {String} key Key of attribute to set.\n * @param {*} value Attribute value.\n */\nexport function setAttribute( range, key, value ) {\n\t// Range might start or end in text nodes, so we have to split them.\n\t_splitNodeAtPosition( range.start );\n\t_splitNodeAtPosition( range.end );\n\n\t// Iterate over all items in the range.\n\tfor ( let item of range.getItems() ) {\n\t\t// Iterator will return `TextProxy` instances but we know that those text proxies will\n\t\t// always represent full text nodes (this is guaranteed thanks to splitting we did before).\n\t\t// So, we can operate on those text proxies' text nodes.\n\t\tlet node = item.is( 'textProxy' ) ? item.textNode : item;\n\n\t\tif ( value !== null ) {\n\t\t\tnode.setAttribute( key, value );\n\t\t} else {\n\t\t\tnode.removeAttribute( key );\n\t\t}\n\n\t\t// After attributes changing it may happen that some text nodes can be merged. Try to merge with previous node.\n\t\t_mergeNodesAtIndex( node.parent, node.index );\n\t}\n\n\t// Try to merge last changed node with it's previous sibling (not covered by the loop above).\n\t_mergeNodesAtIndex( range.end.parent, range.end.index );\n}\n\n/**\n * Removes given attribute from nodes in given range.\n *\n * @param {module:engine/model/range~Range} range Range containing nodes that should have the attribute removed.\n * @param {String} key Key of attribute to remove.\n */\nexport function removeAttribute( range, key ) {\n\t/* jshint validthis:true */\n\tthis.setAttribute( range, key, null );\n}\n\n/**\n * Normalizes given object or an array of objects to an array of {@link module:engine/model/node~Node nodes}. See\n * {@link module:engine/model/node~NodeSet NodeSet} for details on how normalization is performed.\n *\n * @param {module:engine/model/node~NodeSet} nodes Objects to normalize.\n * @returns {Array.} Normalized nodes.\n */\nexport function normalizeNodes( nodes ) {\n\tconst normalized = [];\n\n\tif ( !( nodes instanceof Array ) ) {\n\t\tnodes = [ nodes ];\n\t}\n\n\t// Convert instances of classes other than Node.\n\tfor ( let i = 0; i < nodes.length; i++ ) {\n\t\tif ( typeof nodes[ i ] == 'string' ) {\n\t\t\tnormalized.push( new Text( nodes[ i ] ) );\n\t\t} else if ( nodes[ i ] instanceof TextProxy ) {\n\t\t\tnormalized.push( new Text( nodes[ i ].data, nodes[ i ].getAttributes() ) );\n\t\t} else if ( nodes[ i ] instanceof DocumentFragment || nodes[ i ] instanceof NodeList ) {\n\t\t\tfor ( let child of nodes[ i ] ) {\n\t\t\t\tnormalized.push( child );\n\t\t\t}\n\t\t} else if ( nodes[ i ] instanceof Node ) {\n\t\t\tnormalized.push( nodes[ i ] );\n\t\t}\n\t\t// Skip unrecognized type.\n\t}\n\n\t// Merge text nodes.\n\tfor ( let i = 1; i < normalized.length; i++ ) {\n\t\tconst node = normalized[ i ];\n\t\tconst prev = normalized[ i - 1 ];\n\n\t\tif ( node instanceof Text && prev instanceof Text && _haveSameAttributes( node, prev ) ) {\n\t\t\t// Doing this instead changing prev.data because .data is readonly.\n\t\t\tnormalized.splice( i - 1, 2, new Text( prev.data + node.data, prev.getAttributes() ) );\n\t\t\ti--;\n\t\t}\n\t}\n\n\treturn normalized;\n}\n\n/**\n * Checks if nodes before and after given index in given element are {@link module:engine/model/text~Text text nodes} and\n * merges them into one node if they have same attributes.\n *\n * Merging is done by removing two text nodes and inserting a new text node containing data from both merged text nodes.\n *\n * @ignore\n * @private\n * @param {module:engine/model/element~Element} element Parent element of nodes to merge.\n * @param {Number} index Index between nodes to merge.\n */\nfunction _mergeNodesAtIndex( element, index ) {\n\tconst nodeBefore = element.getChild( index - 1 );\n\tconst nodeAfter = element.getChild( index );\n\n\t// Check if both of those nodes are text objects with same attributes.\n\tif ( nodeBefore && nodeAfter && nodeBefore.is( 'text' ) && nodeAfter.is( 'text' ) && _haveSameAttributes( nodeBefore, nodeAfter ) ) {\n\t\t// Append text of text node after index to the before one.\n\t\tconst mergedNode = new Text( nodeBefore.data + nodeAfter.data, nodeBefore.getAttributes() );\n\n\t\t// Remove separate text nodes.\n\t\telement.removeChildren( index - 1, 2 );\n\n\t\t// Insert merged text node.\n\t\telement.insertChildren( index - 1, mergedNode );\n\t}\n}\n\n/**\n * Checks if given position is in a text node, and if so, splits the text node in two text nodes, each of them\n * containing a part of original text node.\n *\n * @ignore\n * @private\n * @param {module:engine/model/position~Position} position Position at which node should be split.\n */\nfunction _splitNodeAtPosition( position ) {\n\tconst textNode = position.textNode;\n\tconst element = position.parent;\n\n\tif ( textNode ) {\n\t\tconst offsetDiff = position.offset - textNode.startOffset;\n\t\tconst index = textNode.index;\n\n\t\telement.removeChildren( index, 1 );\n\n\t\tconst firstPart = new Text( textNode.data.substr( 0, offsetDiff ), textNode.getAttributes() );\n\t\tconst secondPart = new Text( textNode.data.substr( offsetDiff ), textNode.getAttributes() );\n\n\t\telement.insertChildren( index, [ firstPart, secondPart ] );\n\t}\n}\n\n/**\n * Checks whether two given nodes have same attributes.\n *\n * @ignore\n * @private\n * @param {module:engine/model/node~Node} nodeA Node to check.\n * @param {module:engine/model/node~Node} nodeB Node to check.\n * @returns {Boolean} `true` if nodes have same attributes, `false` otherwise.\n */\nfunction _haveSameAttributes( nodeA, nodeB ) {\n\tconst iteratorA = nodeA.getAttributes();\n\tconst iteratorB = nodeB.getAttributes();\n\n\tfor ( let attr of iteratorA ) {\n\t\tif ( attr[ 1 ] !== nodeB.getAttribute( attr[ 0 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\titeratorB.next();\n\t}\n\n\treturn iteratorB.next().done;\n}\n\n/**\n * Value that can be normalized to an array of {@link module:engine/model/node~Node nodes}.\n *\n * Non-arrays are normalized as follows:\n * * {@link module:engine/model/node~Node Node} is left as is,\n * * {@link module:engine/model/textproxy~TextProxy TextProxy} and `String` are normalized to {@link module:engine/model/text~Text Text},\n * * {@link module:engine/model/nodelist~NodeList NodeList} is normalized to an array containing all nodes that are in that node list,\n * * {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment} is normalized to an array containing all of it's\n * * children.\n *\n * Arrays are processed item by item like non-array values and flattened to one array. Normalization always results in\n * a flat array of {@link module:engine/model/node~Node nodes}. Consecutive text nodes (or items normalized to text nodes) will be\n * merged if they have same attributes.\n *\n * @typedef {module:engine/model/node~Node|module:engine/model/textproxy~TextProxy|String|\n * module:engine/model/nodelist~NodeList|module:engine/model/documentfragment~DocumentFragment|Iterable}\n * module:engine/model/node~NodeSet\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/writer.js\n// module id = 13\n// module chunks = 0","import isArrayLike from './isArrayLike';\nimport isObjectLike from './isObjectLike';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isArrayLikeObject.js\n// module id = 14\n// module chunks = 0","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isObject.js\n// module id = 15\n// module chunks = 0","import toFinite from './toFinite';\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This function is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nexport default toInteger;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/toInteger.js\n// module id = 16\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/batch\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * `Batch` instance groups document changes ({@link module:engine/model/delta/delta~Delta deltas}). All deltas grouped in a single `Batch`\n * can be reverted together, so you can think about `Batch` as of a single undo step. If you want to extend given undo step you\n * can call another method on the same `Batch` object. If you want to create a separate undo step you can create a new `Batch`.\n *\n * For example to create two separate undo steps you can call:\n *\n *\t\tdoc.batch().insert( firstPosition, 'foo' );\n *\t\tdoc.batch().insert( secondPosition, 'bar' );\n *\n * To create a single undo step:\n *\n *\t\tconst batch = doc.batch();\n *\t\tbatch.insert( firstPosition, 'foo' );\n *\t\tbatch.insert( secondPosition, 'bar' );\n *\n * Note that all document modification methods (insert, remove, split, etc.) are chainable so you can shorten code to:\n *\n *\t\tdoc.batch().insert( firstPosition, 'foo' ).insert( secondPosition, 'bar' );\n */\nexport default class Batch {\n\t/**\n\t * Creates `Batch` instance. Not recommended to use directly, use {@link module:engine/model/document~Document#batch} instead.\n\t *\n\t * @param {module:engine/model/document~Document} document Document which this Batch changes.\n\t * @param {'transparent'|'default'} [type='default'] Type of the batch.\n\t */\n\tconstructor( document, type = 'default' ) {\n\t\t/**\n\t\t * Document which this batch changes.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/document~Document} module:engine/model/batch~Batch#document\n\t\t */\n\t\tthis.document = document;\n\n\t\t/**\n\t\t * Array of deltas which compose this batch.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Array.} module:engine/model/batch~Batch#deltas\n\t\t */\n\t\tthis.deltas = [];\n\n\t\t/**\n\t\t * Type of the batch.\n\t\t *\n\t\t * Can be one of the following values:\n\t\t * * `'default'` - all \"normal\" batches, most commonly used type.\n\t\t * * `'transparent'` - batch that should be ignored by other features, i.e. initial batch or collaborative editing changes.\n\t\t *\n\t\t * @readonly\n\t\t * @member {'transparent'|'default'} module:engine/model/batch~Batch#type\n\t\t */\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Returns this batch base version, which is equal to the base version of first delta in the batch.\n\t * If there are no deltas in the batch, it returns `null`.\n\t *\n\t * @readonly\n\t * @type {Number|null}\n\t */\n\tget baseVersion() {\n\t\treturn this.deltas.length > 0 ? this.deltas[ 0 ].baseVersion : null;\n\t}\n\n\t/**\n\t * Adds delta to the batch instance. All modification methods (insert, remove, split, etc.) use this method\n\t * to add created deltas.\n\t *\n\t * @param {module:engine/model/delta/delta~Delta} delta Delta to add.\n\t * @return {module:engine/model/delta/delta~Delta} Added delta.\n\t */\n\taddDelta( delta ) {\n\t\tdelta.batch = this;\n\t\tthis.deltas.push( delta );\n\n\t\treturn delta;\n\t}\n\n\t/**\n\t * Gets an iterable collection of operations.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t*getOperations() {\n\t\tfor ( let delta of this.deltas ) {\n\t\t\tyield* delta.operations;\n\t\t}\n\t}\n}\n\n/**\n * Function to register batch methods. To make code scalable `Batch` do not have modification\n * methods built in. They can be registered using this method.\n *\n * This method checks if there is no naming collision and throws `batch-register-taken` if the method name\n * is already taken.\n *\n * Besides that no magic happens here, the method is added to the `Batch` class prototype.\n *\n * For example:\n *\n *\t\tBatch.register( 'insert', function( position, nodes ) {\n *\t\t\t// You can use a class inheriting from `Delta` if that class should handle OT in a special way.\n *\t\t\tconst delta = new Delta();\n *\n *\t\t\t// Add delta to the Batch instance. It is important to add a delta to the batch before applying any operation.\n *\t\t\tthis.addDelta( delta );\n *\n *\t\t\t// Create operations which should be components of this delta.\n *\t\t\tconst operation = new InsertOperation( position, nodes, this.document.version );\n *\n *\t\t\t// Add operation to the delta. It is important to add operation before applying it.\n *\t\t\tdelta.addOperation( operation );\n *\n *\t\t\t// Remember to apply every operation, no magic, you need to do it manually.\n *\t\t\tthis.document.applyOperation( operation );\n *\n *\t\t\t// Make this method chainable.\n *\t\t\treturn this;\n *\t\t} );\n *\n * @method module:engine/model/batch~Batch.register\n * @param {String} name Method name.\n * @param {Function} creator Method body.\n */\nexport function register( name, creator ) {\n\tif ( Batch.prototype[ name ] ) {\n\t\t/**\n\t\t * This batch method name is already taken.\n\t\t *\n\t\t * @error batch-register-taken\n\t\t * @param {String} name\n\t\t */\n\t\tthrow new CKEditorError(\n\t\t\t'model-batch-register-taken: This batch method name is already taken.',\n\t\t\t{ name: name } );\n\t}\n\n\tBatch.prototype[ name ] = creator;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/batch.js\n// module id = 17\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/deltafactory\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\nimport OperationFactory from '../operation/operationfactory';\n\nconst deserializers = new Map();\n\n/**\n * A factory class for creating operations.\n *\n * Delta is a single, from the user action point of view, change in the editable document, like insert, split or\n * rename element. Delta is composed of operations, which are unit changes needed to be done to execute user action.\n *\n * Multiple deltas are grouped into a single {@link module:engine/model/batch~Batch}.\n */\nexport default class DeltaFactory {\n\t/**\n\t * Creates InsertDelta from deserialized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json\n\t * @param {module:engine/model/document~Document} doc Document on which this delta will be applied.\n\t * @returns {module:engine/model/delta/insertdelta~InsertDelta}\n\t */\n\tstatic fromJSON( json, doc ) {\n\t\tif ( !deserializers.has( json.__className ) ) {\n\t\t\t/**\n\t\t\t * This delta has no defined deserializer.\n\t\t\t *\n\t\t\t * @error delta-fromjson-no-deserializer\n\t\t\t * @param {String} name\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'delta-fromjson-no-deserializer: This delta has no defined deserializer',\n\t\t\t\t{ name: json.__className }\n\t\t\t);\n\t\t}\n\n\t\tlet Delta = deserializers.get( json.__className );\n\n\t\tlet delta = new Delta();\n\n\t\tfor ( let operation of json.operations ) {\n\t\t\tdelta.addOperation( OperationFactory.fromJSON( operation, doc ) );\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\t/**\n\t * Registers a class for delta factory.\n\t *\n\t * @param {Function} Delta A delta class to register.\n\t */\n\tstatic register( Delta ) {\n\t\tdeserializers.set( Delta.className, Delta );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/deltafactory.js\n// module id = 18\n// module chunks = 0","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n}\n\nexport default last;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/last.js\n// module id = 19\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/delta\n */\n\nimport clone from '@ckeditor/ckeditor5-utils/src/lib/lodash/clone';\nimport DeltaFactory from './deltafactory';\n\n/**\n * Base class for all deltas.\n *\n * Delta is a single, from the user action point of view, change in the editable document, like insert, split or\n * rename element. Delta is composed of operations, which are unit changes needed to be done to execute user action.\n *\n * Multiple deltas are grouped into a single {@link module:engine/model/batch~Batch}.\n */\nexport default class Delta {\n\t/**\n\t * Creates a delta instance.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * {@link module:engine/model/batch~Batch} which delta is a part of. This property is null by default and set by the\n\t\t * {@link module:engine/model/batch~Batch#addDelta} method.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/batch~Batch} module:engine/model/delta/delta~Delta#batch\n\t\t */\n\t\tthis.batch = null;\n\n\t\t/**\n\t\t * Array of operations which compose delta.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/operation/operation~Operation[]} module:engine/model/delta/delta~Delta#operations\n\t\t */\n\t\tthis.operations = [];\n\t}\n\n\t/**\n\t * Returns delta base version which is equal to the base version of the first operation in delta. If there\n\t * are no operations in delta, returns `null`.\n\t *\n\t * @see module:engine/model/document~Document\n\t * @type {Number|null}\n\t */\n\tget baseVersion() {\n\t\tif ( this.operations.length > 0 ) {\n\t\t\treturn this.operations[ 0 ].baseVersion;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * @param {Number} baseVersion\n\t */\n\tset baseVersion( baseVersion ) {\n\t\tfor ( let operation of this.operations ) {\n\t\t\toperation.baseVersion = baseVersion++;\n\t\t}\n\t}\n\n\t/**\n\t * A class that will be used when creating reversed delta.\n\t *\n\t * @private\n\t * @type {Function}\n\t */\n\tget _reverseDeltaClass() {\n\t\treturn Delta;\n\t}\n\n\t/**\n\t * Delta type.\n\t *\n\t * @readonly\n\t * @member {String} #type\n\t */\n\n\t/**\n\t * Add operation to the delta.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} operation Operation instance.\n\t */\n\taddOperation( operation ) {\n\t\toperation.delta = this;\n\t\tthis.operations.push( operation );\n\n\t\treturn operation;\n\t}\n\n\t/**\n\t * Creates and returns a delta that has the same parameters as this delta.\n\t *\n\t * @returns {module:engine/model/delta/delta~Delta} Clone of this delta.\n\t */\n\tclone() {\n\t\tlet delta = new this.constructor();\n\n\t\tfor ( let op of this.operations ) {\n\t\t\tdelta.addOperation( op.clone() );\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\t/**\n\t * Creates and returns a reverse delta. Reverse delta when executed right after the original delta will bring back\n\t * tree model state to the point before the original delta execution. In other words, it reverses changes done\n\t * by the original delta.\n\t *\n\t * Keep in mind that tree model state may change since executing the original delta, so reverse delta may be \"outdated\".\n\t * In that case you will need to {@link module:engine/model/delta/transform~transform} it by all deltas that were executed after\n\t * the original delta.\n\t *\n\t * @returns {module:engine/model/delta/delta~Delta} Reversed delta.\n\t */\n\tgetReversed() {\n\t\tlet delta = new this._reverseDeltaClass();\n\n\t\tfor ( let op of this.operations ) {\n\t\t\tdelta.addOperation( op.getReversed() );\n\t\t}\n\n\t\tdelta.operations.reverse();\n\n\t\tfor ( let i = 0; i < delta.operations.length; i++ ) {\n\t\t\tdelta.operations[ i ].baseVersion = this.operations[ this.operations.length - 1 ].baseVersion + i + 1;\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\t/**\n\t * Custom toJSON method to make deltas serializable.\n\t *\n\t * @returns {Object} Clone of this delta with added class name.\n\t */\n\ttoJSON() {\n\t\tlet json = clone( this );\n\n\t\tjson.__className = this.constructor.className;\n\n\t\t// Remove parent batch to avoid circular dependencies.\n\t\tdelete json.batch;\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Delta class name. Used by {@link #toJSON} method for serialization and\n\t * {@link module:engine/model/delta/deltafactory~DeltaFactory.fromJSON} during deserialization.\n\t *\n\t * @type {String}\n\t * @readonly\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.Delta';\n\t}\n\n\t/**\n\t * Delta priority. Used in {@link module:engine/model/delta/transform~transform delta transformations}. Delta with the higher\n\t * priority will be treated as more important when resolving transformation conflicts. If deltas have same\n\t * priority, other factors will be used to determine which delta is more important.\n\t *\n\t * @private\n\t * @type {Number}\n\t */\n\tstatic get _priority() {\n\t\treturn 0;\n\t}\n}\n\nDeltaFactory.register( Delta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/delta.js\n// module id = 20\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/element\n */\n\nimport Node from './node';\nimport Text from './text';\nimport objectToMap from '@ckeditor/ckeditor5-utils/src/objecttomap';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\nimport isPlainObject from '@ckeditor/ckeditor5-utils/src/lib/lodash/isPlainObject';\nimport Matcher from './matcher';\n\n/**\n * View element.\n *\n * Editing engine does not define fixed HTML DTD. This is why the type of the {@link module:engine/view/element~Element} need to\n * be defined by the feature developer. Creating an element you should use {@link module:engine/view/containerelement~ContainerElement}\n * class, {@link module:engine/view/attributeelement~AttributeElement} class or {@link module:engine/view/emptyelement~EmptyElement} class.\n *\n * Note that for view elements which are not created from model, like elements from mutations, paste or\n * {@link module:engine/controller/datacontroller~DataController#set data.set} it is not possible to define the type of the element, so\n * these will be instances of the {@link module:engine/view/element~Element}.\n *\n * @extends module:engine/view/node~Node\n */\nexport default class Element extends Node {\n\t/**\n\t * Creates a view element.\n\t *\n\t * Attributes can be passed in various formats:\n\t *\n\t *\t\tnew Element( 'div', { 'class': 'editor', 'contentEditable': 'true' } ); // object\n\t *\t\tnew Element( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator\n\t *\t\tnew Element( 'div', mapOfAttributes ); // map\n\t *\n\t * @param {String} name Node name.\n\t * @param {Object|Iterable} [attrs] Collection of attributes.\n\t * @param {module:engine/view/node~Node|Iterable.} [children]\n\t * List of nodes to be inserted into created element.\n\t */\n\tconstructor( name, attrs, children ) {\n\t\tsuper();\n\n\t\t/**\n\t\t * Name of the element.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t * Map of attributes, where attributes names are keys and attributes values are values.\n\t\t *\n\t\t * @protected\n\t\t * @member {Map} #_attrs\n\t\t */\n\t\tif ( isPlainObject( attrs ) ) {\n\t\t\tthis._attrs = objectToMap( attrs );\n\t\t} else {\n\t\t\tthis._attrs = new Map( attrs );\n\t\t}\n\n\t\t/**\n\t\t * Array of child nodes.\n\t\t *\n\t\t * @protected\n\t\t * @member {Array.}\n\t\t */\n\t\tthis._children = [];\n\n\t\tif ( children ) {\n\t\t\tthis.insertChildren( 0, children );\n\t\t}\n\n\t\t/**\n\t\t * Set of classes associated with element instance.\n\t\t *\n\t\t * @protected\n\t\t * @member {Set}\n\t\t */\n\t\tthis._classes = new Set();\n\n\t\tif ( this._attrs.has( 'class' ) ) {\n\t\t\t// Remove class attribute and handle it by class set.\n\t\t\tconst classString = this._attrs.get( 'class' );\n\t\t\tparseClasses( this._classes, classString );\n\t\t\tthis._attrs.delete( 'class' );\n\t\t}\n\n\t\t/**\n\t\t * Map of styles.\n\t\t *\n\t\t * @protected\n\t\t * @member {Set} module:engine/view/element~Element#_styles\n\t\t */\n\t\tthis._styles = new Map();\n\n\t\tif ( this._attrs.has( 'style' ) ) {\n\t\t\t// Remove style attribute and handle it by styles map.\n\t\t\tparseInlineStyles( this._styles, this._attrs.get( 'style' ) );\n\t\t\tthis._attrs.delete( 'style' );\n\t\t}\n\n\t\t/**\n\t\t * Map of custom properties.\n\t\t * Custom properties can be added to element instance, will be cloned but not rendered into DOM.\n\t\t *\n\t\t * @protected\n\t\t * @memeber {Map}\n\t\t */\n\t\tthis._customProperties = new Map();\n\t}\n\n\t/**\n\t * Number of element's children.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget childCount() {\n\t\treturn this._children.length;\n\t}\n\n\t/**\n\t * Is `true` if there are no nodes inside this element, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isEmpty() {\n\t\treturn this._children.length === 0;\n\t}\n\n\t/**\n\t * Checks whether given view tree object is of given type.\n\t *\n\t * Read more in {@link module:engine/view/node~Node#is}.\n\t *\n\t * @param {String} type\n\t * @param {String} [name] Element name.\n\t * @returns {Boolean}\n\t */\n\tis( type, name = null ) {\n\t\tif ( !name ) {\n\t\t\treturn type == 'element' || type == this.name;\n\t\t} else {\n\t\t\treturn type == 'element' && name == this.name;\n\t\t}\n\t}\n\n\t/**\n\t * Clones provided element.\n\t *\n\t * @param {Boolean} deep If set to `true` clones element and all its children recursively. When set to `false`,\n\t * element will be cloned without any children.\n\t * @returns {module:engine/view/element~Element} Clone of this element.\n\t */\n\tclone( deep ) {\n\t\tconst childrenClone = [];\n\n\t\tif ( deep ) {\n\t\t\tfor ( let child of this.getChildren() ) {\n\t\t\t\tchildrenClone.push( child.clone( deep ) );\n\t\t\t}\n\t\t}\n\n\t\t// ContainerElement and AttributeElement should be also cloned properly.\n\t\tconst cloned = new this.constructor( this.name, this._attrs, childrenClone );\n\n\t\t// Classes and styles are cloned separately - this solution is faster than adding them back to attributes and\n\t\t// parse once again in constructor.\n\t\tcloned._classes = new Set( this._classes );\n\t\tcloned._styles = new Map( this._styles );\n\n\t\t// Clone custom properties.\n\t\tcloned._customProperties = new Map( this._customProperties );\n\n\t\t// Clone filler offset method.\n\t\tcloned.getFillerOffset = this.getFillerOffset;\n\n\t\treturn cloned;\n\t}\n\n\t/**\n\t * {@link module:engine/view/element~Element#insertChildren Insert} a child node or a list of child nodes at the end of this node and sets\n\t * the parent of these nodes to this element.\n\t *\n\t * @fires module:engine/view/node~Node#change\n\t * @param {module:engine/view/node~Node|Iterable.} nodes Node or the list of nodes to be inserted.\n\t * @returns {Number} Number of appended nodes.\n\t */\n\tappendChildren( nodes ) {\n\t\treturn this.insertChildren( this.childCount, nodes );\n\t}\n\n\t/**\n\t * Gets child at the given index.\n\t *\n\t * @param {Number} index Index of child.\n\t * @returns {module:engine/view/node~Node} Child node.\n\t */\n\tgetChild( index ) {\n\t\treturn this._children[ index ];\n\t}\n\n\t/**\n\t * Gets index of the given child node. Returns `-1` if child node is not found.\n\t *\n\t * @param {module:engine/view/node~Node} node Child node.\n\t * @returns {Number} Index of the child node.\n\t */\n\tgetChildIndex( node ) {\n\t\treturn this._children.indexOf( node );\n\t}\n\n\t/**\n\t * Gets child nodes iterator.\n\t *\n\t * @returns {Iterable.} Child nodes iterator.\n\t */\n\tgetChildren() {\n\t\treturn this._children[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Returns an iterator that contains the keys for attributes. Order of inserting attributes is not preserved.\n\t *\n\t * @returns {Iterator.} Keys for attributes.\n\t */\n\t*getAttributeKeys() {\n\t\tif ( this._classes.size > 0 ) {\n\t\t\tyield 'class';\n\t\t}\n\n\t\tif ( this._styles.size > 0 ) {\n\t\t\tyield 'style';\n\t\t}\n\n\t\t// This is not an optimal solution because of https://github.com/ckeditor/ckeditor5-engine/issues/454.\n\t\t// It can be simplified to `yield* this._attrs.keys();`.\n\t\tfor ( let key of this._attrs.keys() ) {\n\t\t\tyield key;\n\t\t}\n\t}\n\n\t/**\n\t * Returns iterator that iterates over this element's attributes.\n\t *\n\t * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n\t * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n\t *\n\t * @returns {Iterable.<*>}\n\t */\n\t*getAttributes() {\n\t\tyield* this._attrs.entries();\n\n\t\tif ( this._classes.size > 0 ) {\n\t\t\tyield [ 'class', this.getAttribute( 'class' ) ];\n\t\t}\n\n\t\tif ( this._styles.size > 0 ) {\n\t\t\tyield [ 'style', this.getAttribute( 'style' ) ];\n\t\t}\n\t}\n\n\t/**\n\t * Gets attribute by key. If attribute is not present - returns undefined.\n\t *\n\t * @param {String} key Attribute key.\n\t * @returns {String|undefined} Attribute value.\n\t */\n\tgetAttribute( key ) {\n\t\tif ( key == 'class' ) {\n\t\t\tif ( this._classes.size > 0 ) {\n\t\t\t\treturn [ ...this._classes ].join( ' ' );\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ( key == 'style' ) {\n\t\t\tif ( this._styles.size > 0 ) {\n\t\t\t\tlet styleString = '';\n\n\t\t\t\tfor ( let [ property, value ] of this._styles ) {\n\t\t\t\t\tstyleString += `${ property }:${ value };`;\n\t\t\t\t}\n\n\t\t\t\treturn styleString;\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn this._attrs.get( key );\n\t}\n\n\t/**\n\t * Returns a boolean indicating whether an attribute with the specified key exists in the element.\n\t *\n\t * @param {String} key Attribute key.\n\t * @returns {Boolean} `true` if attribute with the specified key exists in the element, false otherwise.\n\t */\n\thasAttribute( key ) {\n\t\tif ( key == 'class' ) {\n\t\t\treturn this._classes.size > 0;\n\t\t}\n\n\t\tif ( key == 'style' ) {\n\t\t\treturn this._styles.size > 0;\n\t\t}\n\n\t\treturn this._attrs.has( key );\n\t}\n\n\t/**\n\t * Adds or overwrite attribute with a specified key and value.\n\t *\n\t * @param {String} key Attribute key.\n\t * @param {String} value Attribute value.\n\t * @fires module:engine/view/node~Node#change\n\t */\n\tsetAttribute( key, value ) {\n\t\tthis._fireChange( 'attributes', this );\n\n\t\tif ( key == 'class' ) {\n\t\t\tparseClasses( this._classes, value );\n\t\t} else if ( key == 'style' ) {\n\t\t\tparseInlineStyles( this._styles, value );\n\t\t} else {\n\t\t\tthis._attrs.set( key, value );\n\t\t}\n\t}\n\n\t/**\n\t * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to\n\t * this element.\n\t *\n\t * @param {Number} index Position where nodes should be inserted.\n\t * @param {module:engine/view/node~Node|Iterable.} nodes Node or the list of nodes to be inserted.\n\t * @fires module:engine/view/node~Node#change\n\t * @returns {Number} Number of inserted nodes.\n\t */\n\tinsertChildren( index, nodes ) {\n\t\tthis._fireChange( 'children', this );\n\t\tlet count = 0;\n\n\t\tnodes = normalize( nodes );\n\n\t\tfor ( let node of nodes ) {\n\t\t\tnode.parent = this;\n\n\t\t\tthis._children.splice( index, 0, node );\n\t\t\tindex++;\n\t\t\tcount++;\n\t\t}\n\n\t\treturn count;\n\t}\n\n\t/**\n\t * Removes attribute from the element.\n\t *\n\t * @param {String} key Attribute key.\n\t * @returns {Boolean} Returns true if an attribute existed and has been removed.\n\t * @fires module:engine/view/node~Node#change\n\t */\n\tremoveAttribute( key ) {\n\t\tthis._fireChange( 'attributes', this );\n\n\t\t// Remove class attribute.\n\t\tif ( key == 'class' ) {\n\t\t\tif ( this._classes.size > 0 ) {\n\t\t\t\tthis._classes.clear();\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Remove style attribute.\n\t\tif ( key == 'style' ) {\n\t\t\tif ( this._styles.size > 0 ) {\n\t\t\t\tthis._styles.clear();\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Remove other attributes.\n\t\treturn this._attrs.delete( key );\n\t}\n\n\t/**\n\t * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.\n\t *\n\t * @param {Number} index Number of the first node to remove.\n\t * @param {Number} [howMany=1] Number of nodes to remove.\n\t * @returns {Array.} The array of removed nodes.\n\t * @fires module:engine/view/node~Node#change\n\t */\n\tremoveChildren( index, howMany = 1 ) {\n\t\tthis._fireChange( 'children', this );\n\n\t\tfor ( let i = index; i < index + howMany; i++ ) {\n\t\t\tthis._children[ i ].parent = null;\n\t\t}\n\n\t\treturn this._children.splice( index, howMany );\n\t}\n\n\t/**\n\t * Checks if this element is similar to other element.\n\t * Both elements should have the same name and attributes to be considered as similar. Two similar elements\n\t * can contain different set of children nodes.\n\t *\n\t * @param {module:engine/view/element~Element} otherElement\n\t * @returns {Boolean}\n\t */\n\tisSimilar( otherElement ) {\n\t\tif ( !( otherElement instanceof Element ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If exactly the same Element is provided - return true immediately.\n\t\tif ( this === otherElement ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Check element name.\n\t\tif ( this.name != otherElement.name ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check number of attributes, classes and styles.\n\t\tif ( this._attrs.size !== otherElement._attrs.size || this._classes.size !== otherElement._classes.size ||\n\t\t\tthis._styles.size !== otherElement._styles.size ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if attributes are the same.\n\t\tfor ( let [ key, value ] of this._attrs ) {\n\t\t\tif ( !otherElement._attrs.has( key ) || otherElement._attrs.get( key ) !== value ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if classes are the same.\n\t\tfor ( let className of this._classes ) {\n\t\t\tif ( !otherElement._classes.has( className ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if styles are the same.\n\t\tfor ( let [ property, value ] of this._styles ) {\n\t\t\tif ( !otherElement._styles.has( property ) || otherElement._styles.get( property ) !== value ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Adds specified class.\n\t *\n\t *\t\telement.addClass( 'foo' ); // Adds 'foo' class.\n\t *\t\telement.addClass( 'foo', 'bar' ); // Adds 'foo' and 'bar' classes.\n\t *\n\t * @param {...String} className\n\t * @fires module:engine/view/node~Node#change\n\t */\n\taddClass( ...className ) {\n\t\tthis._fireChange( 'attributes', this );\n\t\tclassName.forEach( name => this._classes.add( name ) );\n\t}\n\n\t/**\n\t * Removes specified class.\n\t *\n \t *\t\telement.removeClass( 'foo' ); // Removes 'foo' class.\n\t *\t\telement.removeClass( 'foo', 'bar' ); // Removes both 'foo' and 'bar' classes.\n\t *\n\t * @param {...String} className\n\t * @fires module:engine/view/node~Node#change\n\t */\n\tremoveClass( ...className ) {\n\t\tthis._fireChange( 'attributes', this );\n\t\tclassName.forEach( name => this._classes.delete( name ) );\n\t}\n\n\t/**\n\t * Returns true if class is present.\n\t * If more then one class is provided - returns true only when all classes are present.\n\t *\n\t *\t\telement.hasClass( 'foo' ); // Returns true if 'foo' class is present.\n\t *\t\telement.hasClass( 'foo', 'bar' ); // Returns true if 'foo' and 'bar' classes are both present.\n\t *\n\t * @param {...String} className\n\t */\n\thasClass( ...className ) {\n\t\tfor ( let name of className ) {\n\t\t\tif ( !this._classes.has( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns iterator that contains all class names.\n\t *\n\t * @returns {Iterator.}\n\t */\n\tgetClassNames() {\n\t\treturn this._classes.keys();\n\t}\n\n\t/**\n\t * Adds style to the element.\n\t *\n\t *\t\telement.setStyle( 'color', 'red' );\n\t *\t\telement.setStyle( {\n\t *\t\t\tcolor: 'red',\n\t *\t\t\tposition: 'fixed'\n\t *\t\t} );\n\t *\n\t * @param {String|Object} property Property name or object with key - value pairs.\n\t * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.\n\t * @fires module:engine/view/node~Node#change\n\t */\n\tsetStyle( property, value ) {\n\t\tthis._fireChange( 'attributes', this );\n\n\t\tif ( isPlainObject( property ) ) {\n\t\t\tconst keys = Object.keys( property );\n\n\t\t\tfor ( let key of keys ) {\n\t\t\t\tthis._styles.set( key, property[ key ] );\n\t\t\t}\n\t\t} else {\n\t\t\tthis._styles.set( property, value );\n\t\t}\n\t}\n\n\t/**\n\t * Returns style value for given property.\n\t * Undefined is returned if style does not exist.\n\t *\n\t * @param {String} property\n\t * @returns {String|undefined}\n\t */\n\tgetStyle( property ) {\n\t\treturn this._styles.get( property );\n\t}\n\n\t/**\n\t * Returns iterator that contains all style names.\n\t *\n\t * @returns {Iterator.}\n\t */\n\tgetStyleNames() {\n\t\treturn this._styles.keys();\n\t}\n\n\t/**\n\t * Returns true if style keys are present.\n\t * If more then one style property is provided - returns true only when all properties are present.\n\t *\n\t *\t\telement.hasStyle( 'color' ); // Returns true if 'border-top' style is present.\n\t *\t\telement.hasStyle( 'color', 'border-top' ); // Returns true if 'color' and 'border-top' styles are both present.\n\t *\n\t * @param {...String} property\n\t */\n\thasStyle( ...property ) {\n\t\tfor ( let name of property ) {\n\t\t\tif ( !this._styles.has( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Removes specified style.\n\t *\n\t *\t\telement.removeStyle( 'color' ); // Removes 'color' style.\n\t *\t\telement.removeStyle( 'color', 'border-top' ); // Removes both 'color' and 'border-top' styles.\n\t *\n\t * @param {...String} property\n\t * @fires module:engine/view/node~Node#change\n\t */\n\tremoveStyle( ...property ) {\n\t\tthis._fireChange( 'attributes', this );\n\t\tproperty.forEach( name => this._styles.delete( name ) );\n\t}\n\n\t/**\n\t * Returns ancestor element that match specified pattern.\n\t * Provided patterns should be compatible with {@link module:engine/view/matcher~Matcher Matcher} as it is used internally.\n\t *\n\t * @see module:engine/view/matcher~Matcher\n\t * @param {Object|String|RegExp|Function} patterns Patterns used to match correct ancestor.\n\t * See {@link module:engine/view/matcher~Matcher}.\n\t * @returns {module:engine/view/element~Element|null} Found element or `null` if no matching ancestor was found.\n\t */\n\tfindAncestor( ...patterns ) {\n\t\tconst matcher = new Matcher( ...patterns );\n\t\tlet parent = this.parent;\n\n\t\twhile ( parent ) {\n\t\t\tif ( matcher.match( parent ) ) {\n\t\t\t\treturn parent;\n\t\t\t}\n\n\t\t\tparent = parent.parent;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Sets a custom property. Unlike attributes, custom properties are not rendered to the DOM,\n\t * so they can be used to add special data to elements.\n\t *\n\t * @param {String|Symbol} key\n\t * @param {*} value\n\t */\n\tsetCustomProperty( key, value ) {\n\t\tthis._customProperties.set( key, value );\n\t}\n\n\t/**\n\t * Returns the custom property value for the given key.\n\t *\n\t * @param {String|Symbol} key\n\t * @returns {*}\n\t */\n\tgetCustomProperty( key ) {\n\t\treturn this._customProperties.get( key );\n\t}\n\n\t/**\n\t * Removes the custom property stored under the given key.\n\t *\n\t * @param {String|Symbol} key\n\t * @returns {Boolean} Returns true if property was removed.\n\t */\n\tremoveCustomProperty( key ) {\n\t\treturn this._customProperties.delete( key );\n\t}\n\n\t/**\n\t * Returns an iterator which iterates over this element's custom properties.\n\t * Iterator provides [key, value] pair for each stored property.\n\t *\n\t * @returns {Iterable.<*>}\n\t */\n\t*getCustomProperties() {\n\t\tyield* this._customProperties.entries();\n\t}\n\n\t/**\n\t * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.\n\t *\n\t * @abstract\n\t * @method module:engine/view/element~Element#getFillerOffset\n\t */\n}\n\n// Parses inline styles and puts property - value pairs into styles map.\n// Styles map is cleared before insertion.\n//\n// @param {Map.} stylesMap Map to insert parsed properties and values.\n// @param {String} stylesString Styles to parse.\nfunction parseInlineStyles( stylesMap, stylesString ) {\n\tconst regex = /\\s*([^:;\\s]+)\\s*:\\s*([^;]+)\\s*(?=;|$)/g;\n\tlet matchStyle;\n\tstylesMap.clear();\n\n\twhile ( ( matchStyle = regex.exec( stylesString ) ) !== null ) {\n\t\tstylesMap.set( matchStyle[ 1 ], matchStyle[ 2 ].trim() );\n\t}\n}\n\n// Parses class attribute and puts all classes into classes set.\n// Classes set s cleared before insertion.\n//\n// @param {Set.} classesSet Set to insert parsed classes.\n// @param {String} classesString String with classes to parse.\nfunction parseClasses( classesSet, classesString ) {\n\tconst classArray = classesString.split( /\\s+/ );\n\tclassesSet.clear();\n\tclassArray.forEach( name => classesSet.add( name ) );\n}\n\n// Converts strings to Text and non-iterables to arrays.\n//\n// @param {String|module:engine/view/node~Node|Iterable.}\n// @return {Iterable.}\nfunction normalize( nodes ) {\n\t// Separate condition because string is iterable.\n\tif ( typeof nodes == 'string' ) {\n\t\treturn [ new Text( nodes ) ];\n\t}\n\n\tif ( !isIterable( nodes ) ) {\n\t\tnodes = [ nodes ];\n\t}\n\n\t// Array.from to enable .map() on non-arrays.\n\treturn Array.from( nodes ).map( ( node ) => typeof node == 'string' ? new Text( node ) : node );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/element.js\n// module id = 21\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/button/buttonview\n */\n\nimport View from '../view';\nimport Template from '../template';\nimport IconView from '../icon/iconview';\n\nimport { getEnvKeystrokeText } from '@ckeditor/ckeditor5-utils/src/keyboard';\n\n/**\n * The button view class.\n *\n * @extends module:ui/view~View\n */\nexport default class ButtonView extends View {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( locale ) {\n\t\tsuper( locale );\n\n\t\t/**\n\t\t * The label of the button view visible to the user.\n\t\t *\n\t\t * @observable\n\t\t * @member {String} #label\n\t\t */\n\t\tthis.set( 'label' );\n\n\t\t/**\n\t\t * (Optional) The keystroke associated with the button, i.e. CTRL+B,\n\t\t * in the string format compatible with {@link module:utils/keyboard}.\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #keystroke\n\t\t */\n\t\tthis.set( 'keystroke' );\n\n\t\t/**\n\t\t * (Optional) Tooltip of the button, i.e. displayed when hovering the button with the mouse cursor.\n\t\t *\n\t\t * * If defined as a `Boolean` (e.g. `true`), then combination of `label` and `keystroke` will be set as a tooltip.\n\t\t * * If defined as a `String`, tooltip will equal the exact text of that `String`.\n\t\t * * If defined as a `Function`, `label` and `keystroke` will be passed to that function, which is to return\n\t\t * a string with the tooltip text.\n\t\t *\n\t\t *\t\tconst view = new ButtonView( locale );\n\t\t *\t\tview.tooltip = ( label, keystroke ) => `A tooltip for ${ label } and ${ keystroke }.`\n\t\t *\n\t\t * @observable\n\t\t * @default false\n\t\t * @member {Boolean|String|Function} #tooltip\n\t\t */\n\t\tthis.set( 'tooltip' );\n\n\t\t/**\n\t\t * The HTML type of the button. Default `button`.\n\t\t *\n\t\t * @observable\n\t\t * @member {'button'|'submit'|'reset'|'menu'} #type\n\t\t */\n\t\tthis.set( 'type', 'button' );\n\n\t\t/**\n\t\t * Controls whether the button view is \"on\", e.g. some feature which it represents\n\t\t * is currently enabled.\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #isOn\n\t\t */\n\t\tthis.set( 'isOn', false );\n\n\t\t/**\n\t\t * Controls whether the button view is enabled (can be clicked).\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #isEnabled\n\t\t */\n\t\tthis.set( 'isEnabled', true );\n\n\t\t/**\n\t\t * (Optional) Whether the label of the button is hidden (e.g. button with icon only).\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #withText\n\t\t */\n\t\tthis.set( 'withText', false );\n\n\t\t/**\n\t\t * (Optional) Source of the icon. See {@link module:ui/icon/iconview~IconView#content}.\n\t\t *\n\t\t * @observable\n\t\t * @member {String} #icon\n\t\t */\n\t\tthis.set( 'icon' );\n\n\t\t/**\n\t\t * Controls the `tabindex` attribute of the button.\n\t\t *\n\t\t * @observable\n\t\t * @default -1\n\t\t * @member {String} #tabindex\n\t\t */\n\t\tthis.set( 'tabindex', -1 );\n\n\t\t/**\n\t\t * Tooltip of the button bound to the template.\n\t\t *\n\t\t * @see #tooltip\n\t\t * @see #_getTooltipString\n\t\t * @private\n\t\t * @observable\n\t\t * @member {Boolean} #_tooltipString\n\t\t */\n\t\tthis.bind( '_tooltipString' ).to(\n\t\t\tthis, 'tooltip',\n\t\t\tthis, 'label',\n\t\t\tthis, 'keystroke',\n\t\t\tthis._getTooltipString.bind( this )\n\t\t);\n\n\t\t/**\n\t\t * Icon of the button view.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:ui/icon/iconview~IconView} #iconView\n\t\t */\n\n\t\tconst bind = this.bindTemplate;\n\n\t\tthis.template = new Template( {\n\t\t\ttag: 'button',\n\n\t\t\tattributes: {\n\t\t\t\tclass: [\n\t\t\t\t\t'ck-button',\n\t\t\t\t\tbind.if( '_tooltipString', 'ck-tooltip_s' ),\n\t\t\t\t\tbind.to( 'isEnabled', value => value ? 'ck-enabled' : 'ck-disabled' ),\n\t\t\t\t\tbind.to( 'isOn', value => value ? 'ck-on' : 'ck-off' ),\n\t\t\t\t\tbind.if( 'withText', 'ck-button_with-text' )\n\t\t\t\t],\n\t\t\t\ttype: bind.to( 'type', value => value ? value : 'button' ),\n\t\t\t\t'data-ck-tooltip': [\n\t\t\t\t\tbind.to( '_tooltipString' )\n\t\t\t\t],\n\t\t\t\ttabindex: bind.to( 'tabindex' )\n\t\t\t},\n\n\t\t\tchildren: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'span',\n\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tclass: [ 'ck-button__label' ]\n\t\t\t\t\t},\n\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: bind.to( 'label' )\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\n\t\t\ton: {\n\t\t\t\tmousedown: bind.to( evt => {\n\t\t\t\t\tevt.preventDefault();\n\t\t\t\t} ),\n\n\t\t\t\tclick: bind.to( evt => {\n\t\t\t\t\t// We can't make the button disabled using the disabled attribute, because it won't be focusable.\n\t\t\t\t\t// Though, shouldn't this condition be moved to the button controller?\n\t\t\t\t\tif ( this.isEnabled ) {\n\t\t\t\t\t\tthis.fire( 'execute' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Prevent the default when button is disabled, to block e.g.\n\t\t\t\t\t\t// automatic form submitting. See ckeditor/ckeditor5-link#74.\n\t\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * Fired when the button view is clicked. It won't be fired when the button is disabled.\n\t\t *\n\t\t * @event #execute\n\t\t */\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tlet promise = Promise.resolve();\n\n\t\tif ( this.icon && !this.iconView ) {\n\t\t\tconst iconView = this.iconView = new IconView();\n\n\t\t\ticonView.bind( 'content' ).to( this, 'icon' );\n\n\t\t\tthis.element.insertBefore( iconView.element, this.element.firstChild );\n\n\t\t\t// Make sure the icon view will be destroyed along with button.\n\t\t\tpromise = promise.then( () => this.addChildren( iconView ) );\n\t\t}\n\n\t\treturn promise.then( () => super.init() );\n\t}\n\n\t/**\n\t * Focuses the button.\n\t */\n\tfocus() {\n\t\tthis.element.focus();\n\t}\n\n\t/**\n\t * Gets value for the `data-ck-tooltip` attribute from the combination of\n\t * {@link #tooltip}, {@link #label} and {@link #keystroke} attributes.\n\t *\n\t * @private\n\t * @see #tooltip\n\t * @see #_tooltipString\n\t * @param {Boolean|String|Function} tooltip Button tooltip.\n\t * @param {String} label Button label.\n\t * @param {String} keystroke Button keystroke.\n\t * @returns {String}\n\t */\n\t_getTooltipString( tooltip, label, keystroke ) {\n\t\tif ( tooltip ) {\n\t\t\tif ( typeof tooltip == 'string' ) {\n\t\t\t\treturn tooltip;\n\t\t\t} else {\n\t\t\t\tif ( keystroke ) {\n\t\t\t\t\tkeystroke = getEnvKeystrokeText( keystroke );\n\t\t\t\t}\n\n\t\t\t\tif ( tooltip instanceof Function ) {\n\t\t\t\t\treturn tooltip( label, keystroke );\n\t\t\t\t} else if ( tooltip === true ) {\n\t\t\t\t\treturn `${ label }${ keystroke ? ` (${ keystroke })` : '' }`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-ui/src/button/buttonview.js\n// module id = 22\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * Set of utils related to keyboard support.\n *\n * @module utils/keyboard\n */\n\nimport CKEditorError from './ckeditorerror';\nimport env from './env';\n\n/**\n * Object with `keyName => keyCode` pairs for a set of known keys.\n *\n * Contains:\n *\n * * `a-z`,\n * * `0-9`,\n * * `f1-f12`,\n * * `arrow(left|up|right|bottom)`,\n * * `backspace`, `delete`, `enter`, `esc`, `tab`,\n * * `ctrl`, `cmd`, `shift`, `alt`.\n */\nexport const keyCodes = generateKnownKeyCodes();\n\n/**\n * Converts a key name or a {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.\n *\n * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.\n *\n * @param {String|module:utils/keyboard~KeystrokeInfo} Key name (see {@link module:utils/keyboard~keyCodes})\n * or a keystroke data object.\n * @returns {Number} Key or keystroke code.\n */\nexport function getCode( key ) {\n\tlet keyCode;\n\n\tif ( typeof key == 'string' ) {\n\t\tkeyCode = keyCodes[ key.toLowerCase() ];\n\n\t\tif ( !keyCode ) {\n\t\t\t/**\n\t\t\t * Unknown key name. Only key names contained by the {@link module:utils/keyboard~keyCodes} can be used.\n\t\t\t *\n\t\t\t * @errror keyboard-unknown-key\n\t\t\t * @param {String} key\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'keyboard-unknown-key: Unknown key name.', { key } );\n\t\t}\n\t} else {\n\t\tkeyCode = key.keyCode +\n\t\t\t( key.altKey ? keyCodes.alt : 0 ) +\n\t\t\t( key.ctrlKey ? keyCodes.ctrl : 0 ) +\n\t\t\t( key.shiftKey ? keyCodes.shift : 0 );\n\t}\n\n\treturn keyCode;\n}\n\n/**\n * Parses keystroke and returns a keystroke code that will match the code returned by\n * link {@link module:utils/keyboard.getCode} for a corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.\n *\n * The keystroke can be passed in two formats:\n *\n * * as a single string – e.g. `ctrl + A`,\n * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:\n * * `[ 'ctrl', 32 ]` (ctrl + space),\n * * `[ 'ctrl', 'a' ]` (ctrl + A).\n *\n * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.\n *\n * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).\n *\n * @param {String|Array.} keystroke Keystroke definition.\n * @returns {Number} Keystroke code.\n */\nexport function parseKeystroke( keystroke ) {\n\tif ( typeof keystroke == 'string' ) {\n\t\tkeystroke = splitKeystrokeText( keystroke );\n\t}\n\n\treturn keystroke\n\t\t.map( key => ( typeof key == 'string' ) ? getCode( key ) : key )\n\t\t.reduce( ( key, sum ) => sum + key, 0 );\n}\n\n/**\n * It translates any keystroke string text like `\"CTRL+A\"` to an\n * environment–specific keystroke, i.e. `\"⌘A\"` on Mac OSX.\n *\n * @param {String} keystroke Keystroke text.\n * @returns {String} Keystroke text specific for the environment.\n */\nexport function getEnvKeystrokeText( keystroke ) {\n\tconst split = splitKeystrokeText( keystroke );\n\n\tif ( env.mac ) {\n\t\tif ( split[ 0 ].toLowerCase() == 'ctrl' ) {\n\t\t\treturn '⌘' + ( split[ 1 ] || '' );\n\t\t}\n\t}\n\n\treturn keystroke;\n}\n\nfunction generateKnownKeyCodes() {\n\tconst keyCodes = {\n\t\tarrowleft: 37,\n\t\tarrowup: 38,\n\t\tarrowright: 39,\n\t\tarrowdown: 40,\n\t\tbackspace: 8,\n\t\tdelete: 46,\n\t\tenter: 13,\n\t\tesc: 27,\n\t\ttab: 9,\n\n\t\t// The idea about these numbers is that they do not collide with any real key codes, so we can use them\n\t\t// like bit masks.\n\t\tctrl: 0x110000,\n\t\t// Has the same code as ctrl, because their behaviour should be unified across the editor.\n\t\t// See http://ckeditor.github.io/editor-recommendations/general-policies#ctrl-vs-cmd\n\t\tcmd: 0x110000,\n\t\tshift: 0x220000,\n\t\talt: 0x440000\n\t};\n\n\t// a-z\n\tfor ( let code = 65; code <= 90; code++ ) {\n\t\tconst letter = String.fromCharCode( code );\n\n\t\tkeyCodes[ letter.toLowerCase() ] = code;\n\t}\n\n\t// 0-9\n\tfor ( let code = 48; code <= 57; code++ ) {\n\t\tkeyCodes[ code - 48 ] = code;\n\t}\n\n\t// F1-F12\n\tfor ( let code = 112; code <= 123; code++ ) {\n\t\tkeyCodes[ 'f' + ( code - 111 ) ] = code;\n\t}\n\n\treturn keyCodes;\n}\n\nfunction splitKeystrokeText( keystroke ) {\n\treturn keystroke.split( /\\s*\\+\\s*/ );\n}\n\n/**\n * Information about a keystroke.\n *\n * @interface module:utils/keyboard~KeystrokeInfo\n */\n\n/**\n * The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).\n *\n * @member {Number} module:utils/keyboard~KeystrokeInfo#keyCode\n */\n\n/**\n * Whether the Alt modifier was pressed.\n *\n * @member {Bolean} module:utils/keyboard~KeystrokeInfo#altKey\n */\n\n/**\n * Whether the Ctrl or Cmd modifier was pressed.\n *\n * @member {Bolean} module:utils/keyboard~KeystrokeInfo#ctrlKey\n */\n\n/**\n * Whether the Shift modifier was pressed.\n *\n * @member {Bolean} module:utils/keyboard~KeystrokeInfo#shiftKey\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/keyboard.js\n// module id = 23\n// module chunks = 0","import arrayPush from './_arrayPush';\nimport isFlattenable from './_isFlattenable';\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nexport default baseFlatten;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseFlatten.js\n// module id = 24\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/text\n */\n\nimport Node from './node';\n\n/**\n * Model text node. Type of {@link module:engine/model/node~Node node} that contains {@link module:engine/model/text~Text#data text data}.\n *\n * **Important:** see {@link module:engine/model/node~Node} to read about restrictions using `Text` and `Node` API.\n *\n * **Note:** keep in mind that `Text` instances might indirectly got removed from model tree when model is changed.\n * This happens when {@link module:engine/model/writer~writer model writer} is used to change model and the text node is merged with\n * another text node. Then, both text nodes are removed and a new text node is inserted into the model. Because of\n * this behavior, keeping references to `Text` is not recommended. Instead, consider creating\n * {@link module:engine/model/liveposition~LivePosition live position} placed before the text node.\n */\nexport default class Text extends Node {\n\t/**\n\t * Creates a text node.\n\t *\n\t * @param {String} data Node's text.\n\t * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n\t */\n\tconstructor( data, attrs ) {\n\t\tsuper( attrs );\n\n\t\t/**\n\t\t * Text data contained in this text node.\n\t\t *\n\t\t * @type {String}\n\t\t */\n\t\tthis.data = data || '';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget offsetSize() {\n\t\treturn this.data.length;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tis( type ) {\n\t\treturn type == 'text';\n\t}\n\n\t/**\n\t * Creates a copy of this text node and returns it. Created text node has same text data and attributes as original text node.\n\t */\n\tclone() {\n\t\treturn new Text( this.data, this.getAttributes() );\n\t}\n\n\t/**\n\t * Converts `Text` instance to plain object and returns it.\n\t *\n\t * @returns {Object} `Text` instance converted to plain object.\n\t */\n\ttoJSON() {\n\t\tlet json = super.toJSON();\n\n\t\tjson.data = this.data;\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Creates a `Text` instance from given plain object (i.e. parsed JSON string).\n\t *\n\t * @param {Object} json Plain object to be converted to `Text`.\n\t * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.\n\t */\n\tstatic fromJSON( json ) {\n\t\treturn new Text( json.data, json.attributes );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/text.js\n// module id = 25\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/position\n */\n\nimport TreeWalker from './treewalker';\n\nimport compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport EditableElement from './editableelement';\n\n/**\n * Position in the tree. Position is always located before or after a node.\n */\nexport default class Position {\n\t/**\n\t * Creates a position.\n\t *\n\t * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} parent Position parent.\n\t * @param {Number} offset Position offset.\n\t */\n\tconstructor( parent, offset ) {\n\t\t/**\n\t\t * Position parent.\n\t\t *\n\t\t * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}\n\t\t * module:engine/view/position~Position#parent\n\t\t */\n\t\tthis.parent = parent;\n\n\t\t/**\n\t\t * Position offset.\n\t\t *\n\t\t * @member {Number} module:engine/view/position~Position#offset\n\t\t */\n\t\tthis.offset = offset;\n\t}\n\n\t/**\n\t * Node directly after the position. Equals `null` when there is no node after position or position is located\n\t * inside text node.\n\t *\n\t * @readonly\n\t * @type {module:engine/view/node~Node|null}\n\t */\n\tget nodeAfter() {\n\t\tif ( this.parent.is( 'text' ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.parent.getChild( this.offset ) || null;\n\t}\n\n\t/**\n\t * Node directly before the position. Equals `null` when there is no node before position or position is located\n\t * inside text node.\n\t *\n\t * @readonly\n\t * @type {module:engine/view/node~Node|null}\n\t */\n\tget nodeBefore() {\n\t\tif ( this.parent.is( 'text' ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.parent.getChild( this.offset - 1 ) || null;\n\t}\n\n\t/**\n\t * Is `true` if position is at the beginning of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isAtStart() {\n\t\treturn this.offset === 0;\n\t}\n\n\t/**\n\t * Is `true` if position is at the end of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isAtEnd() {\n\t\tconst endOffset = this.parent.is( 'text' ) ? this.parent.data.length : this.parent.childCount;\n\n\t\treturn this.offset === endOffset;\n\t}\n\n\t/**\n\t * Position's root, that is the root of the position's parent element.\n\t *\n\t * @readonly\n\t * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\treturn this.parent.root;\n\t}\n\n\t/**\n\t * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this position, or `null` if\n\t * position is not inside an editable element.\n\t *\n\t * @type {module:engine/view/editableelement~EditableElement|null}\n\t */\n\tget editableElement() {\n\t\tlet editable = this.parent;\n\n\t\twhile ( !( editable instanceof EditableElement ) ) {\n\t\t\tif ( editable.parent ) {\n\t\t\t\teditable = editable.parent;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn editable;\n\t}\n\n\t/**\n\t * Returns a new instance of Position with offset incremented by `shift` value.\n\t *\n\t * @param {Number} shift How position offset should get changed. Accepts negative values.\n\t * @returns {module:engine/view/position~Position} Shifted position.\n\t */\n\tgetShiftedBy( shift ) {\n\t\tlet shifted = Position.createFromPosition( this );\n\n\t\tlet offset = shifted.offset + shift;\n\t\tshifted.offset = offset < 0 ? 0 : offset;\n\n\t\treturn shifted;\n\t}\n\n\t/**\n\t * Gets the farthest position which matches the callback using\n\t * {@link module:engine/view/treewalker~TreeWalker TreeWalker}.\n\t *\n\t * For example:\n\t *\n\t * \t\tgetLastMatchingPosition( value => value.type == 'text' ); //

{}foo

->

foo[]

\n\t * \t\tgetLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } ); //

foo[]

->

{}foo

\n\t * \t\tgetLastMatchingPosition( value => false ); // Do not move the position.\n\t *\n\t * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should\n\t * return `true` if the value should be skipped or `false` if not.\n\t * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n\t *\n\t * @returns {module:engine/view/position~Position} The position after the last item which matches the `skip` callback test.\n\t */\n\tgetLastMatchingPosition( skip, options = {} ) {\n\t\toptions.startPosition = this;\n\n\t\tconst treeWalker = new TreeWalker( options );\n\t\ttreeWalker.skip( skip );\n\n\t\treturn treeWalker.position;\n\t}\n\n\t/**\n\t * Returns ancestors array of this position, that is this position's parent and it's ancestors.\n\t *\n\t * @returns {Array} Array with ancestors.\n\t */\n\tgetAncestors() {\n\t\tif ( this.parent.is( 'documentFragment' ) ) {\n\t\t\treturn [ this.parent ];\n\t\t} else {\n\t\t\treturn this.parent.getAncestors( { includeNode: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether this position equals given position.\n\t *\n\t * @param {module:engine/view/position~Position} otherPosition Position to compare with.\n\t * @returns {Boolean} True if positions are same.\n\t */\n\tisEqual( otherPosition ) {\n\t\treturn ( this.parent == otherPosition.parent && this.offset == otherPosition.offset );\n\t}\n\n\t/**\n\t * Checks whether this position is located before given position. When method returns `false` it does not mean that\n\t * this position is after give one. Two positions may be located inside separate roots and in that situation this\n\t * method will still return `false`.\n\t *\n\t * @see module:engine/view/position~Position#isAfter\n\t * @see module:engine/view/position~Position#compareWith\n\t * @param {module:engine/view/position~Position} otherPosition Position to compare with.\n\t * @returns {Boolean} Returns `true` if this position is before given position.\n\t */\n\tisBefore( otherPosition ) {\n\t\treturn this.compareWith( otherPosition ) == 'before';\n\t}\n\n\t/**\n\t * Checks whether this position is located after given position. When method returns `false` it does not mean that\n\t * this position is before give one. Two positions may be located inside separate roots and in that situation this\n\t * method will still return `false`.\n\t *\n\t * @see module:engine/view/position~Position#isBefore\n\t * @see module:engine/view/position~Position#compareWith\n\t * @param {module:engine/view/position~Position} otherPosition Position to compare with.\n\t * @returns {Boolean} Returns `true` if this position is after given position.\n\t */\n\tisAfter( otherPosition ) {\n\t\treturn this.compareWith( otherPosition ) == 'after';\n\t}\n\n\t/**\n\t * Checks whether this position is before, after or in same position that other position. Two positions may be also\n\t * different when they are located in separate roots.\n\t *\n\t * @param {module:engine/view/position~Position} otherPosition Position to compare with.\n\t * @returns {module:engine/view/position~PositionRelation}\n\t */\n\tcompareWith( otherPosition ) {\n\t\tif ( this.isEqual( otherPosition ) ) {\n\t\t\treturn 'same';\n\t\t}\n\n\t\t// If positions have same parent.\n\t\tif ( this.parent === otherPosition.parent ) {\n\t\t\treturn this.offset - otherPosition.offset < 0 ? 'before' : 'after';\n\t\t}\n\n\t\t// Get path from root to position's parent element.\n\t\tconst path = this.getAncestors();\n\t\tconst otherPath = otherPosition.getAncestors();\n\n\t\t// Compare both path arrays to find common ancestor.\n\t\tconst result = compareArrays( path, otherPath );\n\n\t\tlet commonAncestorIndex;\n\n\t\tswitch ( result ) {\n\t\t\tcase 0:\n\t\t\t\t// No common ancestors found.\n\t\t\t\treturn 'different';\n\n\t\t\tcase 'prefix':\n\t\t\t\tcommonAncestorIndex = path.length - 1;\n\t\t\t\tbreak;\n\n\t\t\tcase 'extension':\n\t\t\t\tcommonAncestorIndex = otherPath.length - 1;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tcommonAncestorIndex = result - 1;\n\t\t}\n\n\t\t// Common ancestor of two positions.\n\t\tconst commonAncestor = path[ commonAncestorIndex ];\n\t\tconst nextAncestor1 = path[ commonAncestorIndex + 1 ];\n\t\tconst nextAncestor2 = otherPath[ commonAncestorIndex + 1 ];\n\n\t\t// Check if common ancestor is not one of the parents.\n\t\tif ( commonAncestor === this.parent ) {\n\t\t\tconst index = this.offset - nextAncestor2.index;\n\n\t\t\treturn index <= 0 ? 'before' : 'after';\n\t\t} else if ( commonAncestor === otherPosition.parent ) {\n\t\t\tconst index = nextAncestor1.index - otherPosition.offset;\n\n\t\t\treturn index < 0 ? 'before' : 'after';\n\t\t}\n\n\t\tconst index = nextAncestor1.index - nextAncestor2.index;\n\n\t\t// Compare indexes of next ancestors inside common one.\n\t\treturn index < 0 ? 'before' : 'after';\n\t}\n\n\t/**\n\t * Creates position at the given location. The location can be specified as:\n\t *\n\t * * a {@link module:engine/view/position~Position position},\n\t * * parent element and offset (offset defaults to `0`),\n\t * * parent element and `'end'` (sets position at the end of that element),\n\t * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n\t *\n\t * This method is a shortcut to other constructors such as:\n\t *\n\t * * {@link module:engine/view/position~Position.createBefore},\n\t * * {@link module:engine/view/position~Position.createAfter},\n\t * * {@link module:engine/view/position~Position.createFromPosition}.\n\t *\n\t * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/view/item~Item view item}.\n\t */\n\tstatic createAt( itemOrPosition, offset ) {\n\t\tif ( itemOrPosition instanceof Position ) {\n\t\t\treturn this.createFromPosition( itemOrPosition );\n\t\t} else {\n\t\t\tlet node = itemOrPosition;\n\n\t\t\tif ( offset == 'end' ) {\n\t\t\t\toffset = node.is( 'text' ) ? node.data.length : node.childCount;\n\t\t\t} else if ( offset == 'before' ) {\n\t\t\t\treturn this.createBefore( node );\n\t\t\t} else if ( offset == 'after' ) {\n\t\t\t\treturn this.createAfter( node );\n\t\t\t} else if ( !offset ) {\n\t\t\t\toffset = 0;\n\t\t\t}\n\n\t\t\treturn new Position( node, offset );\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new position after given view item.\n\t *\n\t * @param {module:engine/view/item~Item} item View item after which the position should be located.\n\t * @returns {module:engine/view/position~Position}\n\t */\n\tstatic createAfter( item ) {\n\t\t// TextProxy is not a instance of Node so we need do handle it in specific way.\n\t\tif ( item.is( 'textProxy' ) ) {\n\t\t\treturn new Position( item.textNode, item.offsetInText + item.data.length );\n\t\t}\n\n\t\tif ( !item.parent ) {\n\t\t\t/**\n\t\t\t * You can not make a position after a root.\n\t\t\t *\n\t\t\t * @error position-after-root\n\t\t\t * @param {module:engine/view/node~Node} root\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-position-after-root: You can not make position after root.', { root: item } );\n\t\t}\n\n\t\treturn new Position( item.parent, item.index + 1 );\n\t}\n\n\t/**\n\t * Creates a new position before given view item.\n\t *\n\t * @param {module:engine/view/item~Item} item View item before which the position should be located.\n\t * @returns {module:engine/view/position~Position}\n\t */\n\tstatic createBefore( item ) {\n\t\t// TextProxy is not a instance of Node so we need do handle it in specific way.\n\t\tif ( item.is( 'textProxy' ) ) {\n\t\t\treturn new Position( item.textNode, item.offsetInText );\n\t\t}\n\n\t\tif ( !item.parent ) {\n\t\t\t/**\n\t\t\t * You cannot make a position before a root.\n\t\t\t *\n\t\t\t * @error position-before-root\n\t\t\t * @param {module:engine/view/node~Node} root\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-position-before-root: You can not make position before root.', { root: item } );\n\t\t}\n\n\t\treturn new Position( item.parent, item.index );\n\t}\n\n\t/**\n\t * Creates and returns a new instance of `Position`, which is equal to the passed position.\n\t *\n\t * @param {module:engine/view/position~Position} position Position to be cloned.\n\t * @returns {module:engine/view/position~Position}\n\t */\n\tstatic createFromPosition( position ) {\n\t\treturn new this( position.parent, position.offset );\n\t}\n}\n\n/**\n * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.\n * If positions are in different roots `'different'` flag is returned.\n *\n * @typedef {String} module:engine/view/position~PositionRelation\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/position.js\n// module id = 26\n// module chunks = 0","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayMap.js\n// module id = 27\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/moveoperation\n */\n\nimport Operation from './operation';\nimport Position from '../position';\nimport Range from '../range';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';\nimport writer from './../writer';\n\n/**\n * Operation to move a range of {@link module:engine/model/item~Item model items}\n * to given {@link module:engine/model/position~Position target position}.\n */\nexport default class MoveOperation extends Operation {\n\t/**\n\t * Creates a move operation.\n\t *\n\t * @param {module:engine/model/position~Position} sourcePosition\n\t * Position before the first {@link module:engine/model/item~Item model item} to move.\n\t * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at\n\t * `sourcePosition` with offset shifted by `howMany`.\n\t * @param {module:engine/model/position~Position} targetPosition Position at which moved nodes will be inserted.\n\t * @param {Number} baseVersion {@link module:engine/model/document~Document#version} on which operation can be applied.\n\t */\n\tconstructor( sourcePosition, howMany, targetPosition, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Position before the first {@link module:engine/model/item~Item model item} to move.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#sourcePosition\n\t\t */\n\t\tthis.sourcePosition = Position.createFromPosition( sourcePosition );\n\n\t\t/**\n\t\t * Offset size of moved range.\n\t\t *\n\t\t * @member {Number} module:engine/model/operation/moveoperation~MoveOperation#howMany\n\t\t */\n\t\tthis.howMany = howMany;\n\n\t\t/**\n\t\t * Position at which moved nodes will be inserted.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#targetPosition\n\t\t */\n\t\tthis.targetPosition = Position.createFromPosition( targetPosition );\n\n\t\t/**\n\t\t * Defines whether `MoveOperation` is sticky. If `MoveOperation` is sticky, during\n\t\t * {@link module:engine/model/operation/transform~transform operational transformation} if there will be an operation that\n\t\t * inserts some nodes at the position equal to the boundary of this `MoveOperation`, that operation will\n\t\t * get their insertion path updated to the position where this `MoveOperation` moves the range.\n\t\t *\n\t\t * @member {Boolean} module:engine/model/operation/moveoperation~MoveOperation#isSticky\n\t\t */\n\t\tthis.isSticky = false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'move';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/moveoperation~MoveOperation}\n\t */\n\tclone() {\n\t\tconst op = new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion );\n\t\top.isSticky = this.isSticky;\n\n\t\treturn op;\n\t}\n\n\t/**\n\t * Returns the start position of the moved range after it got moved. This may be different than\n\t * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved\n\t * inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}\n\t * is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.\n\t *\n\t *\t\t vv vv\n\t *\t\tabcdefg ===> adefbcg\n\t *\t\t ^ ^\n\t *\t\t targetPos\tmovedRangeStart\n\t *\t\t offset 6\toffset 4\n\t *\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tgetMovedRangeStart() {\n\t\treturn this.targetPosition._getTransformedByDeletion( this.sourcePosition, this.howMany );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/moveoperation~MoveOperation}\n\t */\n\tgetReversed() {\n\t\tlet newTargetPosition = this.sourcePosition._getTransformedByInsertion( this.targetPosition, this.howMany );\n\n\t\tconst op = new this.constructor( this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1 );\n\t\top.isSticky = this.isSticky;\n\n\t\treturn op;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\tlet sourceElement = this.sourcePosition.parent;\n\t\tlet targetElement = this.targetPosition.parent;\n\t\tlet sourceOffset = this.sourcePosition.offset;\n\t\tlet targetOffset = this.targetPosition.offset;\n\n\t\t// Validate whether move operation has correct parameters.\n\t\t// Validation is pretty complex but move operation is one of the core ways to manipulate the document state.\n\t\t// We expect that many errors might be connected with one of scenarios described below.\n\t\tif ( !sourceElement || !targetElement ) {\n\t\t\t/**\n\t\t\t * Source position or target position is invalid.\n\t\t\t *\n\t\t\t * @error move-operation-position-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'move-operation-position-invalid: Source position or target position is invalid.'\n\t\t\t);\n\t\t} else if ( sourceOffset + this.howMany > sourceElement.maxOffset ) {\n\t\t\t/**\n\t\t\t * The nodes which should be moved do not exist.\n\t\t\t *\n\t\t\t * @error move-operation-nodes-do-not-exist\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.'\n\t\t\t);\n\t\t} else if ( sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany ) {\n\t\t\t/**\n\t\t\t * Trying to move a range of nodes into the middle of that range.\n\t\t\t *\n\t\t\t * @error move-operation-range-into-itself\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'move-operation-range-into-itself: Trying to move a range of nodes to the inside of that range.'\n\t\t\t);\n\t\t} else if ( this.sourcePosition.root == this.targetPosition.root ) {\n\t\t\tif ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'prefix' ) {\n\t\t\t\tlet i = this.sourcePosition.path.length - 1;\n\n\t\t\t\tif ( this.targetPosition.path[ i ] >= sourceOffset && this.targetPosition.path[ i ] < sourceOffset + this.howMany ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Trying to move a range of nodes into one of nodes from that range.\n\t\t\t\t\t *\n\t\t\t\t\t * @error move-operation-node-into-itself\n\t\t\t\t\t */\n\t\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t\t'move-operation-node-into-itself: Trying to move a range of nodes into one of nodes from that range.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst range = writer.move( Range.createFromPositionAndShift( this.sourcePosition, this.howMany ), this.targetPosition );\n\n\t\treturn {\n\t\t\tsourcePosition: this.sourcePosition,\n\t\t\trange: range\n\t\t};\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.MoveOperation';\n\t}\n\n\t/**\n\t * Creates `MoveOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/moveoperation~MoveOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tlet sourcePosition = Position.fromJSON( json.sourcePosition, document );\n\t\tlet targetPosition = Position.fromJSON( json.targetPosition, document );\n\n\t\tconst move = new this( sourcePosition, json.howMany, targetPosition, json.baseVersion );\n\n\t\tif ( json.isSticky ) {\n\t\t\tmove.isSticky = true;\n\t\t}\n\n\t\treturn move;\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js\n// module id = 28\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/text\n */\n\nimport Node from './node';\n\n/**\n * Tree view text node.\n *\n * @extends module:engine/view/node~Node\n */\nexport default class Text extends Node {\n\t/**\n\t * Creates a tree view text node.\n\t *\n\t * @param {String} data Text.\n\t */\n\tconstructor( data ) {\n\t\tsuper();\n\n\t\t/**\n\t\t * The text content.\n\t\t *\n\t\t * Setting the data fires the {@link module:engine/view/node~Node#event:change:text change event}.\n\t\t *\n\t\t * @private\n\t\t * @member {String} module:engine/view/text~Text#_data\n\t\t */\n\t\tthis._data = data;\n\t}\n\n\t/**\n\t * Clones this node.\n\t *\n\t * @returns {module:engine/view/text~Text} Text node that is a clone of this node.\n\t */\n\tclone() {\n\t\treturn new Text( this.data );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tis( type ) {\n\t\treturn type == 'text';\n\t}\n\n\t/**\n\t * The text content.\n\t *\n\t * Setting the data fires the {@link module:engine/view/node~Node#event:change:text change event}.\n\t */\n\tget data() {\n\t\treturn this._data;\n\t}\n\n\tset data( data ) {\n\t\tthis._fireChange( 'text', this );\n\n\t\tthis._data = data;\n\t}\n\n\t/**\n\t * Checks if this text node is similar to other text node.\n\t * Both nodes should have the same data to be considered as similar.\n\t *\n\t * @param {module:engine/view/text~Text} otherNode Node to check if it is same as this node.\n\t * @returns {Boolean}\n\t */\n\tisSimilar( otherNode ) {\n\t\tif ( !( otherNode instanceof Text ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this === otherNode || this.data === otherNode.data;\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/text.js\n// module id = 29\n// module chunks = 0","import checkGlobal from './_checkGlobal';\n\n/** Used to determine if values are of the language type `Object`. */\nvar objectTypes = {\n 'function': true,\n 'object': true\n};\n\n/** Detect free variable `exports`. */\nvar freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n/** Detect free variable `module`. */\nvar freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n/** Detect free variable `self`. */\nvar freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n/** Detect free variable `window`. */\nvar freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n/** Detect `this` as the global object. */\nvar thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n/**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\nvar root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\nexport default root;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_root.js\n// module id = 30\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/observablemixin\n */\n\nimport EmitterMixin from './emittermixin';\nimport CKEditorError from './ckeditorerror';\nimport extend from './lib/lodash/extend';\nimport isObject from './lib/lodash/isObject';\n\nconst attributesSymbol = Symbol( 'attributes' );\nconst boundObservablesSymbol = Symbol( 'boundObservables' );\nconst boundAttributesSymbol = Symbol( 'boundAttributes' );\n\n/**\n * Mixin that injects the \"observable attributes\" and data binding functionality.\n * Used mainly in the {@link module:ui/model~Model} class.\n *\n * @mixin ObservableMixin\n * @mixes module:utils/emittermixin~EmitterMixin\n * @implements module:utils/observablemixin~Observable\n */\nconst ObservableMixin = {\n\t/**\n\t * Creates and sets the value of an observable attribute of this object. Such an attribute becomes a part\n\t * of the state and is be observable.\n\t *\n\t * It accepts also a single object literal containing key/value pairs with attributes to be set.\n\t *\n\t * This method throws the observable-set-cannot-override error if the observable instance already\n\t * have a property with a given attribute name. This prevents from mistakenly overriding existing\n\t * properties and methods, but means that `foo.set( 'bar', 1 )` may be slightly slower than `foo.bar = 1`.\n\t *\n\t * @method #set\n\t * @param {String} name The attributes name.\n\t * @param {*} value The attributes value.\n\t */\n\tset( name, value ) {\n\t\t// If the first parameter is an Object, iterate over its properties.\n\t\tif ( isObject( name ) ) {\n\t\t\tObject.keys( name ).forEach( ( attr ) => {\n\t\t\t\tthis.set( attr, name[ attr ] );\n\t\t\t}, this );\n\n\t\t\treturn;\n\t\t}\n\n\t\tinitObservable( this );\n\n\t\tconst attributes = this[ attributesSymbol ];\n\n\t\tif ( ( name in this ) && !attributes.has( name ) ) {\n\t\t\t/**\n\t\t\t * Cannot override an existing property.\n\t\t\t *\n\t\t\t * This error is thrown when trying to {@link ~Observable#set set} an attribute with\n\t\t\t * a name of an already existing property. For example:\n\t\t\t *\n\t\t\t *\t\tlet observable = new Model();\n\t\t\t *\t\tobservable.property = 1;\n\t\t\t *\t\tobservable.set( 'property', 2 );\t\t// throws\n\t\t\t *\n\t\t\t *\t\tobservable.set( 'attr', 1 );\n\t\t\t *\t\tobservable.set( 'attr', 2 );\t\t\t// ok, because this is an existing attribute.\n\t\t\t *\n\t\t\t * @error observable-set-cannot-override\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'observable-set-cannot-override: Cannot override an existing property.' );\n\t\t}\n\n\t\tObject.defineProperty( this, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget() {\n\t\t\t\treturn attributes.get( name );\n\t\t\t},\n\n\t\t\tset( value ) {\n\t\t\t\tconst oldValue = attributes.get( name );\n\n\t\t\t\t// Allow undefined as an initial value like A.define( 'x', undefined ) (#132).\n\t\t\t\t// Note: When attributes map has no such own property, then its value is undefined.\n\t\t\t\tif ( oldValue !== value || !attributes.has( name ) ) {\n\t\t\t\t\tattributes.set( name, value );\n\t\t\t\t\tthis.fire( 'change:' + name, name, value, oldValue );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tthis[ name ] = value;\n\t},\n\n\t/**\n\t * Binds observable attributes to another objects implementing {@link ~ObservableMixin}\n\t * interface (like {@link module:ui/model~Model}).\n\t *\n\t * Once bound, the observable will immediately share the current state of attributes\n\t * of the observable it is bound to and react to the changes to these attributes\n\t * in the future.\n\t *\n\t * **Note**: To release the binding use {@link module:utils/observablemixin~ObservableMixin#unbind}.\n\t *\n\t *\t\tA.bind( 'a' ).to( B );\n\t *\t\tA.bind( 'a' ).to( B, 'b' );\n\t *\t\tA.bind( 'a', 'b' ).to( B, 'c', 'd' );\n\t *\t\tA.bind( 'a' ).to( B, 'b', C, 'd', ( b, d ) => b + d );\n\t *\n\t * @method #bind\n\t * @param {...String} bindAttrs Observable attributes that will be bound to another observable(s).\n\t * @returns {module:utils/observablemixin~BindChain}\n\t */\n\tbind( ...bindAttrs ) {\n\t\tif ( !bindAttrs.length || !isStringArray( bindAttrs ) ) {\n\t\t\t/**\n\t\t\t * All attributes must be strings.\n\t\t\t *\n\t\t\t * @error observable-bind-wrong-attrs\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'observable-bind-wrong-attrs: All attributes must be strings.' );\n\t\t}\n\n\t\tif ( ( new Set( bindAttrs ) ).size !== bindAttrs.length ) {\n\t\t\t/**\n\t\t\t * Attributes must be unique.\n\t\t\t *\n\t\t\t * @error observable-bind-duplicate-attrs\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'observable-bind-duplicate-attrs: Attributes must be unique.' );\n\t\t}\n\n\t\tinitObservable( this );\n\n\t\tconst boundAttributes = this[ boundAttributesSymbol ];\n\n\t\tbindAttrs.forEach( attrName => {\n\t\t\tif ( boundAttributes.has( attrName ) ) {\n\t\t\t\t/**\n\t\t\t\t * Cannot bind the same attribute more that once.\n\t\t\t\t *\n\t\t\t\t * @error observable-bind-rebind\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError( 'observable-bind-rebind: Cannot bind the same attribute more that once.' );\n\t\t\t}\n\t\t} );\n\n\t\tconst bindings = new Map();\n\n\t\t/**\n\t\t * @typedef Binding\n\t\t * @type Object\n\t\t * @property {Array} attr Attribute which is bound.\n\t\t * @property {Array} to Array of observable–attribute components of the binding (`{ observable: ..., attr: .. }`).\n\t\t * @property {Array} callback A function which processes `to` components.\n\t\t */\n\t\tbindAttrs.forEach( a => {\n\t\t\tconst binding = { attr: a, to: [] };\n\n\t\t\tboundAttributes.set( a, binding );\n\t\t\tbindings.set( a, binding );\n\t\t} );\n\n\t\t/**\n\t\t * @typedef BindChain\n\t\t * @type Object\n\t\t * @property {Function} to See {@link ~ObservableMixin#_bindTo}.\n\t\t * @property {module:utils/observablemixin~Observable} _observable The observable which initializes the binding.\n\t\t * @property {Array} _bindAttrs Array of `_observable` attributes to be bound.\n\t\t * @property {Array} _to Array of `to()` observable–attributes (`{ observable: toObservable, attrs: ...toAttrs }`).\n\t\t * @property {Map} _bindings Stores bindings to be kept in\n\t\t * {@link ~ObservableMixin#_boundAttributes}/{@link ~ObservableMixin#_boundObservables}\n\t\t * initiated in this binding chain.\n\t\t */\n\t\treturn {\n\t\t\tto: bindTo,\n\n\t\t\t_observable: this,\n\t\t\t_bindAttrs: bindAttrs,\n\t\t\t_to: [],\n\t\t\t_bindings: bindings\n\t\t};\n\t},\n\n\t/**\n\t * Removes the binding created with {@link ~ObservableMixin#bind}.\n\t *\n\t *\t\tA.unbind( 'a' );\n\t *\t\tA.unbind();\n\t *\n\t * @method #unbind\n\t * @param {...String} [unbindAttrs] Observable attributes to be unbound. All the bindings will\n\t * be released if no attributes provided.\n\t */\n\tunbind( ...unbindAttrs ) {\n\t\t// Nothing to do here if not inited yet.\n\t\tif ( !( attributesSymbol in this ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst boundAttributes = this[ boundAttributesSymbol ];\n\t\tconst boundObservables = this[ boundObservablesSymbol ];\n\n\t\tif ( unbindAttrs.length ) {\n\t\t\tif ( !isStringArray( unbindAttrs ) ) {\n\t\t\t\t/**\n\t\t\t\t * Attributes must be strings.\n\t\t\t\t *\n\t\t\t\t * @error observable-unbind-wrong-attrs\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError( 'observable-unbind-wrong-attrs: Attributes must be strings.' );\n\t\t\t}\n\n\t\t\tunbindAttrs.forEach( attrName => {\n\t\t\t\tconst binding = boundAttributes.get( attrName );\n\t\t\t\tlet toObservable, toAttr, toAttrs, toAttrBindings;\n\n\t\t\t\tbinding.to.forEach( to => {\n\t\t\t\t\t// TODO: ES6 destructuring.\n\t\t\t\t\ttoObservable = to[ 0 ];\n\t\t\t\t\ttoAttr = to[ 1 ];\n\t\t\t\t\ttoAttrs = boundObservables.get( toObservable );\n\t\t\t\t\ttoAttrBindings = toAttrs[ toAttr ];\n\n\t\t\t\t\ttoAttrBindings.delete( binding );\n\n\t\t\t\t\tif ( !toAttrBindings.size ) {\n\t\t\t\t\t\tdelete toAttrs[ toAttr ];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !Object.keys( toAttrs ).length ) {\n\t\t\t\t\t\tboundObservables.delete( toObservable );\n\t\t\t\t\t\tthis.stopListening( toObservable, 'change' );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tboundAttributes.delete( attrName );\n\t\t\t} );\n\t\t} else {\n\t\t\tboundObservables.forEach( ( bindings, boundObservable ) => {\n\t\t\t\tthis.stopListening( boundObservable, 'change' );\n\t\t\t} );\n\n\t\t\tboundObservables.clear();\n\t\t\tboundAttributes.clear();\n\t\t}\n\t}\n\n\t/**\n\t * @private\n\t * @member ~ObservableMixin#_boundAttributes\n\t */\n\n\t/**\n\t * @private\n\t * @member ~ObservableMixin#_boundObservables\n\t */\n\n\t/**\n\t * @private\n\t * @member ~ObservableMixin#_bindTo\n\t */\n};\n\nexport default ObservableMixin;\n\n// Init symbol properties needed to for the observable mechanism to work.\n//\n// @private\n// @param {module:utils/observablemixin~ObservableMixin} observable\nfunction initObservable( observable ) {\n\t// Do nothing if already inited.\n\tif ( attributesSymbol in observable ) {\n\t\treturn;\n\t}\n\n\t// The internal hash containing the observable's state.\n\t//\n\t// @private\n\t// @type {Map}\n\tObject.defineProperty( observable, attributesSymbol, {\n\t\tvalue: new Map()\n\t} );\n\n\t// Map containing bindings to external observables. It shares the binding objects\n\t// (`{ observable: A, attr: 'a', to: ... }`) with {@link module:utils/observablemixin~ObservableMixin#_boundAttributes} and\n\t// it is used to observe external observables to update own attributes accordingly.\n\t// See {@link module:utils/observablemixin~ObservableMixin#bind}.\n\t//\n\t//\t\tA.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );\n\t//\t\tconsole.log( A._boundObservables );\n\t//\n\t//\t\t\tMap( {\n\t//\t\t\t\tB: {\n\t//\t\t\t\t\tx: Set( [\n\t//\t\t\t\t\t\t{ observable: A, attr: 'a', to: [ [ B, 'x' ] ] },\n\t//\t\t\t\t\t\t{ observable: A, attr: 'c', to: [ [ B, 'x' ] ] }\n\t//\t\t\t\t\t] ),\n\t//\t\t\t\t\ty: Set( [\n\t//\t\t\t\t\t\t{ observable: A, attr: 'b', to: [ [ B, 'y' ] ] },\n\t//\t\t\t\t\t] )\n\t//\t\t\t\t}\n\t//\t\t\t} )\n\t//\n\t//\t\tA.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );\n\t//\t\tconsole.log( A._boundObservables );\n\t//\n\t//\t\t\tMap( {\n\t//\t\t\t\tB: {\n\t//\t\t\t\t\tx: Set( [\n\t//\t\t\t\t\t\t{ observable: A, attr: 'a', to: [ [ B, 'x' ] ] },\n\t//\t\t\t\t\t\t{ observable: A, attr: 'c', to: [ [ B, 'x' ] ] }\n\t//\t\t\t\t\t] ),\n\t//\t\t\t\t\ty: Set( [\n\t//\t\t\t\t\t\t{ observable: A, attr: 'b', to: [ [ B, 'y' ] ] },\n\t//\t\t\t\t\t] ),\n\t//\t\t\t\t\tz: Set( [\n\t//\t\t\t\t\t\t{ observable: A, attr: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n\t//\t\t\t\t\t] )\n\t//\t\t\t\t},\n\t//\t\t\t\tC: {\n\t//\t\t\t\t\tw: Set( [\n\t//\t\t\t\t\t\t{ observable: A, attr: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n\t//\t\t\t\t\t] )\n\t//\t\t\t\t}\n\t//\t\t\t} )\n\t//\n\t// @private\n\t// @type {Map}\n\tObject.defineProperty( observable, boundObservablesSymbol, {\n\t\tvalue: new Map()\n\t} );\n\n\t// Object that stores which attributes of this observable are bound and how. It shares\n\t// the binding objects (`{ observable: A, attr: 'a', to: ... }`) with {@link utils.ObservableMixin#_boundObservables}.\n\t// This data structure is a reverse of {@link utils.ObservableMixin#_boundObservables} and it is helpful for\n\t// {@link utils.ObservableMixin#unbind}.\n\t//\n\t// See {@link utils.ObservableMixin#bind}.\n\t//\n\t//\t\tA.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );\n\t//\t\tconsole.log( A._boundAttributes );\n\t//\n\t//\t\t\tMap( {\n\t//\t\t\t\ta: { observable: A, attr: 'a', to: [ [ B, 'x' ] ] },\n\t//\t\t\t\tb: { observable: A, attr: 'b', to: [ [ B, 'y' ] ] },\n\t//\t\t\t\tc: { observable: A, attr: 'c', to: [ [ B, 'x' ] ] }\n\t//\t\t\t} )\n\t//\n\t//\t\tA.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );\n\t//\t\tconsole.log( A._boundAttributes );\n\t//\n\t//\t\t\tMap( {\n\t//\t\t\t\ta: { observable: A, attr: 'a', to: [ [ B, 'x' ] ] },\n\t//\t\t\t\tb: { observable: A, attr: 'b', to: [ [ B, 'y' ] ] },\n\t//\t\t\t\tc: { observable: A, attr: 'c', to: [ [ B, 'x' ] ] },\n\t//\t\t\t\td: { observable: A, attr: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n\t//\t\t\t} )\n\t//\n\t// @private\n\t// @type {Map}\n\tObject.defineProperty( observable, boundAttributesSymbol, {\n\t\tvalue: new Map()\n\t} );\n}\n\n// A chaining for {@link module:utils/observablemixin~ObservableMixin#bind} providing `.to()` interface.\n//\n// @private\n// @param {...[Observable|String|Function]} args Arguments of the `.to( args )` binding.\nfunction bindTo( ...args ) {\n\t/* jshint validthis: true */\n\tconst parsedArgs = parseBindToArgs( ...args );\n\tconst bindingsKeys = Array.from( this._bindings.keys() );\n\tconst numberOfBindings = bindingsKeys.length;\n\n\t// Eliminate A.bind( 'x' ).to( B, C )\n\tif ( !parsedArgs.callback && parsedArgs.to.length > 1 ) {\n\t\t/**\n\t\t * Binding multiple observables only possible with callback.\n\t\t *\n\t\t * @error observable-bind-no-callback\n\t\t */\n\t\tthrow new CKEditorError( 'observable-bind-to-no-callback: Binding multiple observables only possible with callback.' ) ;\n\t}\n\n\t// Eliminate A.bind( 'x', 'y' ).to( B, callback )\n\tif ( numberOfBindings > 1 && parsedArgs.callback ) {\n\t\t/**\n\t\t * Cannot bind multiple attributes and use a callback in one binding.\n\t\t *\n\t\t * @error observable-bind-to-extra-callback\n\t\t */\n\t\tthrow new CKEditorError( 'observable-bind-to-extra-callback: Cannot bind multiple attributes and use a callback in one binding.' ) ;\n\t}\n\n\tparsedArgs.to.forEach( to => {\n\t\t// Eliminate A.bind( 'x', 'y' ).to( B, 'a' )\n\t\tif ( to.attrs.length && to.attrs.length !== numberOfBindings ) {\n\t\t\t/**\n\t\t\t * The number of attributes must match.\n\t\t\t *\n\t\t\t * @error observable-bind-to-attrs-length\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'observable-bind-to-attrs-length: The number of attributes must match.' );\n\t\t}\n\n\t\t// When no to.attrs specified, observing source attributes instead i.e.\n\t\t// A.bind( 'x', 'y' ).to( B ) -> Observe B.x and B.y\n\t\tif ( !to.attrs.length ) {\n\t\t\tto.attrs = this._bindAttrs;\n\t\t}\n\t} );\n\n\tthis._to = parsedArgs.to;\n\n\t// Fill {@link BindChain#_bindings} with callback. When the callback is set there's only one binding.\n\tif ( parsedArgs.callback ) {\n\t\tthis._bindings.get( bindingsKeys[ 0 ] ).callback = parsedArgs.callback;\n\t}\n\n\tattachBindToListeners( this._observable, this._to );\n\n\t// Update observable._boundAttributes and observable._boundObservables.\n\tupdateBindToBound( this );\n\n\t// Set initial values of bound attributes.\n\tthis._bindAttrs.forEach( attrName => {\n\t\tupdateBoundObservableAttr( this._observable, attrName );\n\t} );\n}\n\n// Check if all entries of the array are of `String` type.\n//\n// @private\n// @param {Array} arr An array to be checked.\n// @returns {Boolean}\nfunction isStringArray( arr ) {\n\treturn arr.every( a => typeof a == 'string' );\n}\n\n// Parses and validates {@link Observable#bind}`.to( args )` arguments and returns\n// an object with a parsed structure. For example\n//\n//\t\tA.bind( 'x' ).to( B, 'a', C, 'b', call );\n//\n// becomes\n//\n//\t\t{\n//\t\t\tto: [\n//\t\t\t\t{ observable: B, attrs: [ 'a' ] },\n//\t\t\t\t{ observable: C, attrs: [ 'b' ] },\n//\t\t\t],\n//\t\t\tcallback: call\n// \t\t}\n//\n// @private\n// @param {...*} args Arguments of {@link Observable#bind}`.to( args )`.\n// @returns {Object}\nfunction parseBindToArgs( ...args ) {\n\t// Eliminate A.bind( 'x' ).to()\n\tif ( !args.length ) {\n\t\t/**\n\t\t * Invalid argument syntax in `to()`.\n\t\t *\n\t\t * @error observable-bind-to-parse-error\n\t\t */\n\t\tthrow new CKEditorError( 'observable-bind-to-parse-error: Invalid argument syntax in `to()`.' );\n\t}\n\n\tconst parsed = { to: [] };\n\tlet lastObservable;\n\n\tif ( typeof args[ args.length - 1 ] == 'function' ) {\n\t\tparsed.callback = args.pop();\n\t}\n\n\targs.forEach( a => {\n\t\tif ( typeof a == 'string' ) {\n\t\t\tlastObservable.attrs.push( a );\n\t\t} else if ( typeof a == 'object' ) {\n\t\t\tlastObservable = { observable: a, attrs: [] };\n\t\t\tparsed.to.push( lastObservable );\n\t\t} else {\n\t\t\tthrow new CKEditorError( 'observable-bind-to-parse-error: Invalid argument syntax in `to()`.' );\n\t\t}\n\t} );\n\n\treturn parsed;\n}\n\n// Synchronizes {@link module:utils/observablemixin#_boundObservables} with {@link Binding}.\n//\n// @private\n// @param {Binding} binding A binding to store in {@link Observable#_boundObservables}.\n// @param {Observable} toObservable A observable, which is a new component of `binding`.\n// @param {String} toAttrName A name of `toObservable`'s attribute, a new component of the `binding`.\nfunction updateBoundObservables( observable, binding, toObservable, toAttrName ) {\n\tconst boundObservables = observable[ boundObservablesSymbol ];\n\tconst bindingsToObservable = boundObservables.get( toObservable );\n\tconst bindings = bindingsToObservable || {};\n\n\tif ( !bindings[ toAttrName ] ) {\n\t\tbindings[ toAttrName ] = new Set();\n\t}\n\n\t// Pass the binding to a corresponding Set in `observable._boundObservables`.\n\tbindings[ toAttrName ].add( binding );\n\n\tif ( !bindingsToObservable ) {\n\t\tboundObservables.set( toObservable, bindings );\n\t}\n}\n\n// Synchronizes {@link Observable#_boundAttributes} and {@link Observable#_boundObservables}\n// with {@link BindChain}.\n//\n// Assuming the following binding being created\n//\n// \t\tA.bind( 'a', 'b' ).to( B, 'x', 'y' );\n//\n// the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:\n//\n// \t\t{\n// \t\t\ta: { observable: A, attr: 'a', to: [] },\n// \t\t\tb: { observable: A, attr: 'b', to: [] },\n// \t\t}\n//\n// Iterate over all bindings in this chain and fill their `to` properties with\n// corresponding to( ... ) arguments (components of the binding), so\n//\n// \t\t{\n// \t\t\ta: { observable: A, attr: 'a', to: [ B, 'x' ] },\n// \t\t\tb: { observable: A, attr: 'b', to: [ B, 'y' ] },\n// \t\t}\n//\n// Then update the structure of {@link Observable#_boundObservables} with updated\n// binding, so it becomes:\n//\n// \t\tMap( {\n// \t\t\tB: {\n// \t\t\t\tx: Set( [\n// \t\t\t\t\t{ observable: A, attr: 'a', to: [ [ B, 'x' ] ] }\n// \t\t\t\t] ),\n// \t\t\t\ty: Set( [\n// \t\t\t\t\t{ observable: A, attr: 'b', to: [ [ B, 'y' ] ] },\n// \t\t\t\t] )\n//\t\t\t}\n// \t\t} )\n//\n// @private\n// @param {BindChain} chain The binding initialized by {@link Observable#bind}.\nfunction updateBindToBound( chain ) {\n\tlet toAttr;\n\n\tchain._bindings.forEach( ( binding, attrName ) => {\n\t\t// Note: For a binding without a callback, this will run only once\n\t\t// like in A.bind( 'x', 'y' ).to( B, 'a', 'b' )\n\t\t// TODO: ES6 destructuring.\n\t\tchain._to.forEach( to => {\n\t\t\ttoAttr = to.attrs[ binding.callback ? 0 : chain._bindAttrs.indexOf( attrName ) ];\n\n\t\t\tbinding.to.push( [ to.observable, toAttr ] );\n\t\t\tupdateBoundObservables( chain._observable, binding, to.observable, toAttr );\n\t\t} );\n\t} );\n}\n\n// Updates an attribute of a {@link Observable} with a value\n// determined by an entry in {@link Observable#_boundAttributes}.\n//\n// @private\n// @param {Observable} observable A observable which attribute is to be updated.\n// @param {String} attrName An attribute to be updated.\nfunction updateBoundObservableAttr( observable, attrName ) {\n\tconst boundAttributes = observable[ boundAttributesSymbol ];\n\tconst binding = boundAttributes.get( attrName );\n\tlet attrValue;\n\n\t// When a binding with callback is created like\n\t//\n\t// \t\tA.bind( 'a' ).to( B, 'b', C, 'c', callback );\n\t//\n\t// collect B.b and C.c, then pass them to callback to set A.a.\n\tif ( binding.callback ) {\n\t\tattrValue = binding.callback.apply( observable, binding.to.map( to => to[ 0 ][ to[ 1 ] ] ) );\n\t} else {\n\t\tattrValue = binding.to[ 0 ];\n\t\tattrValue = attrValue[ 0 ][ attrValue[ 1 ] ];\n\t}\n\n\tif ( observable.hasOwnProperty( attrName ) ) {\n\t\tobservable[ attrName ] = attrValue;\n\t} else {\n\t\tobservable.set( attrName, attrValue );\n\t}\n}\n\n// Starts listening to changes in {@link BindChain._to} observables to update\n// {@link BindChain._observable} {@link BindChain._bindAttrs}. Also sets the\n// initial state of {@link BindChain._observable}.\n//\n// @private\n// @param {BindChain} chain The chain initialized by {@link Observable#bind}.\nfunction attachBindToListeners( observable, toBindings ) {\n\ttoBindings.forEach( to => {\n\t\tconst boundObservables = observable[ boundObservablesSymbol ];\n\t\tlet bindings;\n\n\t\t// If there's already a chain between the observables (`observable` listens to\n\t\t// `to.observable`), there's no need to create another `change` event listener.\n\t\tif ( !boundObservables.get( to.observable ) ) {\n\t\t\tobservable.listenTo( to.observable, 'change', ( evt, attrName ) => {\n\t\t\t\tbindings = boundObservables.get( to.observable )[ attrName ];\n\n\t\t\t\t// Note: to.observable will fire for any attribute change, react\n\t\t\t\t// to changes of attributes which are bound only.\n\t\t\t\tif ( bindings ) {\n\t\t\t\t\tbindings.forEach( binding => {\n\t\t\t\t\t\tupdateBoundObservableAttr( observable, binding.attr );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n}\n\nextend( ObservableMixin, EmitterMixin );\n\n/**\n * Fired when an attribute changed value.\n *\n * @event module:utils/observablemixin~ObservableMixin#change:{attribute}\n * @param {String} name The attribute name.\n * @param {*} value The new attribute value.\n * @param {*} oldValue The previous attribute value.\n */\n\n/**\n * Interface representing classes which mix in {@link module:utils/observablemixin~ObservableMixin}.\n *\n * @interface Observable\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/observablemixin.js\n// module id = 31\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/operation\n */\n\nimport clone from '@ckeditor/ckeditor5-utils/src/lib/lodash/clone';\n\n/**\n * Abstract base operation class.\n *\n * @abstract\n */\nexport default class Operation {\n\t/**\n\t * Base operation constructor.\n\t * @param {Number} baseVersion {@link module:engine/model/document~Document#version} on which the operation can be applied.\n\t */\n\tconstructor( baseVersion ) {\n\t\t/**\n\t\t * {@link module:engine/model/document~Document#version} on which operation can be applied. If you try to\n\t\t * {@link module:engine/model/document~Document#applyOperation apply} operation with different base version than the\n\t\t * {@link module:engine/model/document~Document#version document version} the\n\t\t * {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.\n\t\t *\n\t\t * @member {Number}\n\t\t */\n\t\tthis.baseVersion = baseVersion;\n\n\t\t/**\n\t\t * Operation type.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String} #type\n\t\t */\n\n\t\t/**\n\t\t * {@link module:engine/model/delta/delta~Delta Delta} which the operation is a part of. This property is set by the\n\t\t * {@link module:engine/model/delta/delta~Delta delta} when the operations is added to it by the\n\t\t * {@link module:engine/model/delta/delta~Delta#addOperation} method.\n\t\t *\n\t\t * @member {module:engine/model/delta/delta~Delta} #delta\n\t\t */\n\n\t\t/**\n\t\t * Creates and returns an operation that has the same parameters as this operation.\n\t\t *\n\t\t * @method #clone\n\t\t * @returns {module:engine/model/operation/operation~Operation} Clone of this operation.\n\t\t */\n\n\t\t/**\n\t\t * Creates and returns a reverse operation. Reverse operation when executed right after\n\t\t * the original operation will bring back tree model state to the point before the original\n\t\t * operation execution. In other words, it reverses changes done by the original operation.\n\t\t *\n\t\t * Keep in mind that tree model state may change since executing the original operation,\n\t\t * so reverse operation will be \"outdated\". In that case you will need to\n\t\t * {@link module:engine/model/operation/transform~transform} it by all operations that were executed after the original operation.\n\t\t *\n\t\t * @method #getReversed\n\t\t * @returns {module:engine/model/operation/operation~Operation} Reversed operation.\n\t\t */\n\n\t\t/**\n\t\t * Executes the operation - modifications described by the operation attributes\n\t\t * will be applied to the tree model.\n\t\t *\n\t\t * @protected\n\t\t * @method #_execute\n\t\t * @returns {Object} Object with additional information about the applied changes. It properties depends on the\n\t\t * operation type.\n\t\t */\n\t}\n\n\t/**\n\t * Custom toJSON method to solve child-parent circular dependencies.\n\t *\n\t * @method #toJSON\n\t * @returns {Object} Clone of this object with the delta property replaced with string.\n\t */\n\ttoJSON() {\n\t\tconst json = clone( this, true );\n\n\t\tjson.__className = this.constructor.className;\n\n\t\t// Remove parent delta to avoid circular dependencies.\n\t\tdelete json.delta;\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Name of the operation class used for serialization.\n\t *\n\t * @type {String}\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.Operation';\n\t}\n\n\t/**\n\t * Creates Operation object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} doc Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/operation~Operation}\n\t */\n\tstatic fromJSON( json ) {\n\t\treturn new this( json.baseVersion );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/operation.js\n// module id = 32\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/treewalker\n */\n\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport Element from './element';\nimport Position from './position';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Position iterator class. It allows to iterate forward and backward over the document.\n */\nexport default class TreeWalker {\n\t/**\n\t * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.\n\t *\n\t * @constructor\n\t * @param {Object} [options={}] Object with configuration.\n\t * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.\n\t * @param {module:engine/model/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.\n\t * @param {module:engine/model/position~Position} [options.startPosition] Starting position.\n\t * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all consecutive characters with the same attributes\n\t * should be returned one by one as multiple {@link module:engine/model/textproxy~TextProxy} (`true`) objects or as one\n\t * {@link module:engine/model/textproxy~TextProxy} (`false`).\n\t * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the\n\t * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.\n\t * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`\n\t * tags. If the option is true walker will not return a parent node of start position. If this option is `true`\n\t * each {@link module:engine/model/element~Element} will be returned once, while if the option is `false` they might be returned\n\t * twice: for `'elementStart'` and `'elementEnd'`.\n\t */\n\tconstructor( options = {} ) {\n\t\tif ( !options.boundaries && !options.startPosition ) {\n\t\t\t/**\n\t\t\t * Neither boundaries nor starting position have been defined.\n\t\t\t *\n\t\t\t * @error tree-walker-no-start-position\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.' );\n\t\t}\n\n\t\tconst direction = options.direction || 'forward';\n\n\t\tif ( direction != 'forward' && direction != 'backward' ) {\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',\n\t\t\t\t{ direction }\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Walking direction. Defaults `'forward'`.\n\t\t *\n\t\t * @readonly\n\t\t * @member {'backward'|'forward'} module:engine/model/treewalker~TreeWalker#direction\n\t\t */\n\t\tthis.direction = direction;\n\n\t\t/**\n\t\t * Iterator boundaries.\n\t\t *\n\t\t * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`\n\t\t * on the start of boundary, then `{ done: true }` is returned.\n\t\t *\n\t\t * If boundaries are not defined they are set before first and after last child of the root node.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/range~Range} module:engine/model/treewalker~TreeWalker#boundaries\n\t\t */\n\t\tthis.boundaries = options.boundaries || null;\n\n\t\t/**\n\t\t * Iterator position. This is always static position, even if the initial position was a\n\t\t * {@link module:engine/model/liveposition~LivePosition live position}. If start position is not defined then position depends\n\t\t * on {@link #direction}. If direction is `'forward'` position starts form the beginning, when direction\n\t\t * is `'backward'` position starts from the end.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/position~Position} module:engine/model/treewalker~TreeWalker#position\n\t\t */\n\t\tif ( options.startPosition ) {\n\t\t\tthis.position = Position.createFromPosition( options.startPosition );\n\t\t} else {\n\t\t\tthis.position = Position.createFromPosition( this.boundaries[ this.direction == 'backward' ? 'end' : 'start' ] );\n\t\t}\n\n\t\t/**\n\t\t * Flag indicating whether all consecutive characters with the same attributes should be\n\t\t * returned as one {@link module:engine/model/textproxy~TextProxy} (`true`) or one by one (`false`).\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean} module:engine/model/treewalker~TreeWalker#singleCharacters\n\t\t */\n\t\tthis.singleCharacters = !!options.singleCharacters;\n\n\t\t/**\n\t\t * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any\n\t\t * iterated node will not be returned along with `elementEnd` tag.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean} module:engine/model/treewalker~TreeWalker#shallow\n\t\t */\n\t\tthis.shallow = !!options.shallow;\n\n\t\t/**\n\t\t * Flag indicating whether iterator should ignore `elementEnd` tags. If the option is true walker will not\n\t\t * return a parent node of the start position. If this option is `true` each {@link module:engine/model/element~Element} will\n\t\t * be returned once, while if the option is `false` they might be returned twice:\n\t\t * for `'elementStart'` and `'elementEnd'`.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean} module:engine/model/treewalker~TreeWalker#ignoreElementEnd\n\t\t */\n\t\tthis.ignoreElementEnd = !!options.ignoreElementEnd;\n\n\t\t/**\n\t\t * Start boundary cached for optimization purposes.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryStartParent\n\t\t */\n\t\tthis._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;\n\n\t\t/**\n\t\t * End boundary cached for optimization purposes.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryEndParent\n\t\t */\n\t\tthis._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;\n\n\t\t/**\n\t\t * Parent of the most recently visited node. Cached for optimization purposes.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}\n\t\t * module:engine/model/treewalker~TreeWalker#_visitedParent\n\t\t */\n\t\tthis._visitedParent = this.position.parent;\n\t}\n\n\t/**\n\t * Iterator interface.\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.\n\t *\n\t * For example:\n\t *\n\t * \t\twalker.skip( value => value.type == 'text' ); // []foo -> foo[]\n\t * \t\twalker.skip( () => true ); // Move the position to the end: []foo -> foo[]\n\t * \t\twalker.skip( () => false ); // Do not move the position.\n\t *\n\t * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should\n\t * return `true` if the value should be skipped or `false` if not.\n\t */\n\tskip( skip ) {\n\t\tlet done, value, prevPosition, prevVisitedParent;\n\n\t\tdo {\n\t\t\tprevPosition = this.position;\n\t\t\tprevVisitedParent = this._visitedParent;\n\n\t\t\t( { done, value } = this.next() );\n\t\t} while ( !done && skip( value ) );\n\n\t\tif ( !done ) {\n\t\t\tthis.position = prevPosition;\n\t\t\tthis._visitedParent = prevVisitedParent;\n\t\t}\n\t}\n\n\t/**\n\t * Iterator interface method.\n\t * Detects walking direction and makes step forward or backward.\n\t *\n\t * @returns {Object} Object implementing iterator interface, returning information about taken step.\n\t */\n\tnext() {\n\t\tif ( this.direction == 'forward' ) {\n\t\t\treturn this._next();\n\t\t} else {\n\t\t\treturn this._previous();\n\t\t}\n\t}\n\n\t/**\n\t * Makes a step forward in model. Moves the {@link #position} to the next position and returns the encountered value.\n\t *\n\t * @private\n\t * @returns {Object}\n\t * @returns {Boolean} return.done True if iterator is done.\n\t * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.\n\t */\n\t_next() {\n\t\tconst previousPosition = this.position;\n\t\tconst position = Position.createFromPosition( this.position );\n\t\tconst parent = this._visitedParent;\n\n\t\t// We are at the end of the root.\n\t\tif ( parent.parent === null && position.offset === parent.maxOffset ) {\n\t\t\treturn { done: true };\n\t\t}\n\n\t\t// We reached the walker boundary.\n\t\tif ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {\n\t\t\treturn { done: true };\n\t\t}\n\n\t\tconst node = position.textNode ? position.textNode : position.nodeAfter;\n\n\t\tif ( node instanceof Element ) {\n\t\t\tif ( !this.shallow ) {\n\t\t\t\t// Manual operations on path internals for optimization purposes. Here and in the rest of the method.\n\t\t\t\tposition.path.push( 0 );\n\t\t\t\tthis._visitedParent = node;\n\t\t\t} else {\n\t\t\t\tposition.offset++;\n\t\t\t}\n\n\t\t\tthis.position = position;\n\n\t\t\treturn formatReturnValue( 'elementStart', node, previousPosition, position, 1 );\n\t\t} else if ( node instanceof Text ) {\n\t\t\tlet charactersCount, offsetInTextNode;\n\n\t\t\tif ( this.singleCharacters ) {\n\t\t\t\tcharactersCount = 1;\n\t\t\t} else {\n\t\t\t\tlet offset = node.endOffset;\n\n\t\t\t\tif ( this._boundaryEndParent == parent && this.boundaries.end.offset < offset ) {\n\t\t\t\t\toffset = this.boundaries.end.offset;\n\t\t\t\t}\n\n\t\t\t\tcharactersCount = offset - position.offset;\n\t\t\t}\n\n\t\t\toffsetInTextNode = position.offset - node.startOffset;\n\n\t\t\tconst item = new TextProxy( node, offsetInTextNode, charactersCount );\n\n\t\t\tposition.offset += charactersCount;\n\t\t\tthis.position = position;\n\n\t\t\treturn formatReturnValue( 'text', item, previousPosition, position, charactersCount );\n\t\t} else {\n\t\t\t// `node` is not set, we reached the end of current `parent`.\n\t\t\tposition.path.pop();\n\t\t\tposition.offset++;\n\t\t\tthis.position = position;\n\t\t\tthis._visitedParent = parent.parent;\n\n\t\t\tif ( this.ignoreElementEnd ) {\n\t\t\t\treturn this._next();\n\t\t\t} else {\n\t\t\t\treturn formatReturnValue( 'elementEnd', parent, previousPosition, position );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Makes a step backward in model. Moves the {@link #position} to the previous position and returns the encountered value.\n\t *\n\t * @private\n\t * @returns {Object}\n\t * @returns {Boolean} return.done True if iterator is done.\n\t * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.\n\t */\n\t_previous() {\n\t\tconst previousPosition = this.position;\n\t\tconst position = Position.createFromPosition( this.position );\n\t\tconst parent = this._visitedParent;\n\n\t\t// We are at the beginning of the root.\n\t\tif ( parent.parent === null && position.offset === 0 ) {\n\t\t\treturn { done: true };\n\t\t}\n\n\t\t// We reached the walker boundary.\n\t\tif ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {\n\t\t\treturn { done: true };\n\t\t}\n\n\t\t// Get node just before current position\n\t\tconst node = position.textNode ? position.textNode : position.nodeBefore;\n\n\t\tif ( node instanceof Element ) {\n\t\t\tposition.offset--;\n\n\t\t\tif ( !this.shallow ) {\n\t\t\t\tposition.path.push( node.maxOffset );\n\t\t\t\tthis.position = position;\n\t\t\t\tthis._visitedParent = node;\n\n\t\t\t\tif ( this.ignoreElementEnd ) {\n\t\t\t\t\treturn this._previous();\n\t\t\t\t} else {\n\t\t\t\t\treturn formatReturnValue( 'elementEnd', node, previousPosition, position );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.position = position;\n\n\t\t\t\treturn formatReturnValue( 'elementStart', node, previousPosition, position, 1 );\n\t\t\t}\n\t\t} else if ( node instanceof Text ) {\n\t\t\tlet charactersCount, offsetInTextNode;\n\n\t\t\tif ( this.singleCharacters ) {\n\t\t\t\tcharactersCount = 1;\n\t\t\t} else {\n\t\t\t\tlet offset = node.startOffset;\n\n\t\t\t\tif ( this._boundaryStartParent == parent && this.boundaries.start.offset > offset ) {\n\t\t\t\t\toffset = this.boundaries.start.offset;\n\t\t\t\t}\n\n\t\t\t\tcharactersCount = position.offset - offset;\n\t\t\t}\n\n\t\t\toffsetInTextNode = position.offset - node.startOffset;\n\n\t\t\tconst item = new TextProxy( node, offsetInTextNode - charactersCount, charactersCount );\n\n\t\t\tposition.offset -= charactersCount;\n\t\t\tthis.position = position;\n\n\t\t\treturn formatReturnValue( 'text', item, previousPosition, position, charactersCount );\n\t\t} else {\n\t\t\t// `node` is not set, we reached the beginning of current `parent`.\n\t\t\tposition.path.pop();\n\t\t\tthis.position = position;\n\t\t\tthis._visitedParent = parent.parent;\n\n\t\t\treturn formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );\n\t\t}\n\t}\n}\n\nfunction formatReturnValue( type, item, previousPosition, nextPosition, length ) {\n\treturn {\n\t\tdone: false,\n\t\tvalue: {\n\t\t\ttype: type,\n\t\t\titem: item,\n\t\t\tpreviousPosition: previousPosition,\n\t\t\tnextPosition: nextPosition,\n\t\t\tlength: length\n\t\t}\n\t};\n}\n\n/**\n * Type of the step made by {@link module:engine/model/treewalker~TreeWalker}.\n * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end of node,\n * `'character'` if walker traversed over a character, or `'text'` if walker traversed over multiple characters (available in\n * character merging mode, see {@link module:engine/model/treewalker~TreeWalker#constructor}).\n *\n * @typedef {'elementStart'|'elementEnd'|'character'|'text'} module:engine/model/treewalker~TreeWalkerValueType\n */\n\n/**\n * Object returned by {@link module:engine/model/treewalker~TreeWalker} when traversing tree model.\n *\n * @typedef {Object} module:engine/model/treewalker~TreeWalkerValue\n * @property {module:engine/model/treewalker~TreeWalkerValueType} type\n * @property {module:engine/model/item~Item} item Item between old and new positions of {@link module:engine/model/treewalker~TreeWalker}.\n * @property {module:engine/model/position~Position} previousPosition Previous position of the iterator.\n * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the\n * position before the item. Note that it is more efficient to use this position then calculate the position before\n * the node using {@link module:engine/model/position~Position.createBefore}. It is also more efficient to get the\n * position after node by shifting `previousPosition` by `length`, using {@link module:engine/model/position~Position#getShiftedBy},\n * then calculate the position using {@link module:engine/model/position~Position.createAfter}.\n * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is\n * the position after item.\n * @property {module:engine/model/position~Position} nextPosition Next position of the iterator.\n * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is\n * the position after the item.\n * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position\n * before the item.\n * @property {Number} [length] Length of the item. For `'elementStart'` and `'character'` it is 1. For `'text'` it is\n * the length of the text. For `'elementEnd'` it is undefined.\n */\n\n/**\n * Tree walking directions.\n *\n * @typedef {'forward'|'backward'} module:engine/view/treewalker~TreeWalkerDirection\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/treewalker.js\n// module id = 33\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/range\n */\n\nimport Position from './position';\nimport TreeWalker from './treewalker';\n\n/**\n * Tree view range.\n */\nexport default class Range {\n\t/**\n\t * Creates a range spanning from `start` position to `end` position.\n\t *\n\t * **Note:** Constructor creates it's own {@link module:engine/view/position~Position} instances basing on passed values.\n\t *\n\t * @param {module:engine/view/position~Position} start Start position.\n\t * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.\n\t */\n\tconstructor( start, end = null ) {\n\t\t/**\n\t\t * Start position.\n\t\t *\n\t\t * @member {module:engine/view/position~Position}\n\t\t */\n\t\tthis.start = Position.createFromPosition( start );\n\n\t\t/**\n\t\t * End position.\n\t\t *\n\t\t * @member {module:engine/view/position~Position}\n\t\t */\n\t\tthis.end = end ? Position.createFromPosition( end ) : Position.createFromPosition( start );\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns\n\t * them together with additional information like length or {@link module:engine/view/position~Position positions},\n\t * grouped as {@link module:engine/view/treewalker~TreeWalkerValue}.\n\t *\n\t * This iterator uses {@link module:engine/view/treewalker~TreeWalker TreeWalker} with `boundaries` set to this range and\n\t * `ignoreElementEnd` option\n\t * set to `true`.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t*[ Symbol.iterator ]() {\n\t\tyield* new TreeWalker( { boundaries: this, ignoreElementEnd: true } );\n\t}\n\n\t/**\n\t * Returns whether the range is collapsed, that is it start and end positions are equal.\n\t *\n\t * @type {Boolean}\n\t */\n\tget isCollapsed() {\n\t\treturn this.start.isEqual( this.end );\n\t}\n\n\t/**\n\t * Returns whether this range is flat, that is if {@link module:engine/view/range~Range#start start} position and\n\t * {@link module:engine/view/range~Range#end end} position are in the same {@link module:engine/view/position~Position#parent parent}.\n\t *\n\t * @type {Boolean}\n\t */\n\tget isFlat() {\n\t\treturn this.start.parent === this.end.parent;\n\t}\n\n\t/**\n\t * Range root element.\n\t *\n\t * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\treturn this.start.root;\n\t}\n\n\t/**\n\t * Creates a maximal range that has the same content as this range but is expanded in both ways (at the beginning\n\t * and at the end).\n\t *\n\t * For example:\n\t *\n\t * \t\t

Foo

{Bar}

->

Foo

[

Bar]

\n\t * \t\t

foo{bar}

->

foo[bar]

\n\t *\n\t * Note that in the sample above:\n\t * - `

` have type of {@link module:engine/view/containerelement~ContainerElement},\n\t * - `` have type of {@link module:engine/view/attributeelement~AttributeElement},\n\t * - `` have type of {@link module:engine/view/uielement~UIElement}.\n\t *\n\t * @returns {module:engine/view/range~Range} Enlarged range.\n\t */\n\tgetEnlarged() {\n\t\tlet start = this.start.getLastMatchingPosition( enlargeShrinkSkip, { direction: 'backward' } );\n\t\tlet end = this.end.getLastMatchingPosition( enlargeShrinkSkip );\n\n\t\t// Fix positions, in case if they are in Text node.\n\t\tif ( start.parent.is( 'text' ) && start.isAtStart ) {\n\t\t\tstart = Position.createBefore( start.parent );\n\t\t}\n\n\t\tif ( end.parent.is( 'text' ) && end.isAtEnd ) {\n\t\t\tend = Position.createAfter( end.parent );\n\t\t}\n\n\t\treturn new Range( start, end );\n\t}\n\n\t/**\n\t * Creates a minimum range that has the same content as this range but is trimmed in both ways (at the beginning\n\t * and at the end).\n\t *\n\t * For example:\n\t *\n\t * \t\t

Foo

[

Bar]

->

Foo

{Bar}

\n\t * \t\t

foo[bar]

->

foo{bar}

\n\t *\n\t * Note that in the sample above:\n\t * - `

` have type of {@link module:engine/view/containerelement~ContainerElement},\n\t * - `` have type of {@link module:engine/view/attributeelement~AttributeElement},\n\t * - `` have type of {@link module:engine/view/uielement~UIElement}.\n\t *\n\t * @returns {module:engine/view/range~Range} Shrink range.\n\t */\n\tgetTrimmed() {\n\t\tlet start = this.start.getLastMatchingPosition( enlargeShrinkSkip );\n\t\tlet end = this.end.getLastMatchingPosition( enlargeShrinkSkip, { direction: 'backward' } );\n\t\tlet nodeAfterStart = start.nodeAfter;\n\t\tlet nodeBeforeEnd = end.nodeBefore;\n\n\t\t// Because TreeWalker prefers positions next to text node, we need to move them manually into these text nodes.\n\t\tif ( nodeAfterStart && nodeAfterStart.is( 'text' ) ) {\n\t\t\tstart = new Position( nodeAfterStart, 0 );\n\t\t}\n\n\t\tif ( nodeBeforeEnd && nodeBeforeEnd.is( 'text' ) ) {\n\t\t\tend = new Position( nodeBeforeEnd, nodeBeforeEnd.data.length );\n\t\t}\n\n\t\treturn new Range( start, end );\n\t}\n\n\t/**\n\t * Two ranges are equal if their start and end positions are equal.\n\t *\n\t * @param {module:engine/view/range~Range} otherRange Range to compare with.\n\t * @returns {Boolean} `true` if ranges are equal, `false` otherwise\n\t */\n\tisEqual( otherRange ) {\n\t\treturn this == otherRange || ( this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end ) );\n\t}\n\n\t/**\n\t * Checks whether this range contains given {@link module:engine/view/position~Position position}.\n\t *\n\t * @param {module:engine/view/position~Position} position Position to check.\n\t * @returns {Boolean} `true` if given {@link module:engine/view/position~Position position} is contained in this range, `false` otherwise.\n\t */\n\tcontainsPosition( position ) {\n\t\treturn position.isAfter( this.start ) && position.isBefore( this.end );\n\t}\n\n\t/**\n\t * Checks whether this range contains given {@link module:engine/view/range~Range range}.\n\t *\n\t * @param {module:engine/view/range~Range} otherRange Range to check.\n\t * @returns {Boolean} `true` if given {@link module:engine/view/range~Range range} boundaries are contained by this range, `false`\n\t * otherwise.\n\t */\n\tcontainsRange( otherRange ) {\n\t\treturn this.containsPosition( otherRange.start ) && this.containsPosition( otherRange.end );\n\t}\n\n\t/**\n\t * Computes which part(s) of this {@link module:engine/view/range~Range range} is not a part of given\n\t * {@link module:engine/view/range~Range range}.\n\t * Returned array contains zero, one or two {@link module:engine/view/range~Range ranges}.\n\t *\n\t * Examples:\n\t *\n\t *\t\tlet foo = new Text( 'foo' );\n\t *\t\tlet img = new ContainerElement( 'img' );\n\t *\t\tlet bar = new Text( 'bar' );\n\t *\t\tlet p = new ContainerElement( 'p', null, [ foo, img, bar ] );\n\t *\n\t *\t\tlet range = new Range( new Position( foo, 2 ), new Position( bar, 1 ); // \"o\", img, \"b\" are in range.\n\t *\t\tlet otherRange = new Range( new Position( foo, 1 ), new Position( bar, 2 ); \"oo\", img, \"ba\" are in range.\n\t *\t\tlet transformed = range.getDifference( otherRange );\n\t *\t\t// transformed array has no ranges because `otherRange` contains `range`\n\t *\n\t *\t\totherRange = new Range( new Position( foo, 1 ), new Position( p, 2 ); // \"oo\", img are in range.\n\t *\t\ttransformed = range.getDifference( otherRange );\n\t *\t\t// transformed array has one range: from ( p, 2 ) to ( bar, 1 )\n\t *\n\t *\t\totherRange = new Range( new Position( p, 1 ), new Position( p, 2 ) ); // img is in range.\n\t *\t\ttransformed = range.getDifference( otherRange );\n\t *\t\t// transformed array has two ranges: from ( foo, 1 ) to ( p, 1 ) and from ( p, 2 ) to ( bar, 1 )\n\t *\n\t * @param {module:engine/view/range~Range} otherRange Range to differentiate against.\n\t * @returns {Array.} The difference between ranges.\n\t */\n\tgetDifference( otherRange ) {\n\t\tconst ranges = [];\n\n\t\tif ( this.isIntersecting( otherRange ) ) {\n\t\t\t// Ranges intersect.\n\n\t\t\tif ( this.containsPosition( otherRange.start ) ) {\n\t\t\t\t// Given range start is inside this range. This means that we have to\n\t\t\t\t// add shrunken range - from the start to the middle of this range.\n\t\t\t\tranges.push( new Range( this.start, otherRange.start ) );\n\t\t\t}\n\n\t\t\tif ( this.containsPosition( otherRange.end ) ) {\n\t\t\t\t// Given range end is inside this range. This means that we have to\n\t\t\t\t// add shrunken range - from the middle of this range to the end.\n\t\t\t\tranges.push( new Range( otherRange.end, this.end ) );\n\t\t\t}\n\t\t} else {\n\t\t\t// Ranges do not intersect, return the original range.\n\t\t\tranges.push( Range.createFromRange( this ) );\n\t\t}\n\n\t\treturn ranges;\n\t}\n\n\t/**\n\t * Returns an intersection of this {@link module:engine/view/range~Range range} and given {@link module:engine/view/range~Range range}.\n\t * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.\n\t *\n\t * Examples:\n\t *\n\t *\t\tlet foo = new Text( 'foo' );\n\t *\t\tlet img = new ContainerElement( 'img' );\n\t *\t\tlet bar = new Text( 'bar' );\n\t *\t\tlet p = new ContainerElement( 'p', null, [ foo, img, bar ] );\n\t *\n\t *\t\tlet range = new Range( new Position( foo, 2 ), new Position( bar, 1 ); // \"o\", img, \"b\" are in range.\n\t *\t\tlet otherRange = new Range( new Position( foo, 1 ), new Position( p, 2 ); // \"oo\", img are in range.\n\t *\t\tlet transformed = range.getIntersection( otherRange ); // range from ( foo, 1 ) to ( p, 2 ).\n\t *\n\t *\t\totherRange = new Range( new Position( bar, 1 ), new Position( bar, 3 ); \"ar\" is in range.\n\t *\t\ttransformed = range.getIntersection( otherRange ); // null - no common part.\n\t *\n\t * @param {module:engine/view/range~Range} otherRange Range to check for intersection.\n\t * @returns {module:engine/view/range~Range|null} A common part of given ranges or `null` if ranges have no common part.\n\t */\n\tgetIntersection( otherRange ) {\n\t\tif ( this.isIntersecting( otherRange ) ) {\n\t\t\t// Ranges intersect, so a common range will be returned.\n\t\t\t// At most, it will be same as this range.\n\t\t\tlet commonRangeStart = this.start;\n\t\t\tlet commonRangeEnd = this.end;\n\n\t\t\tif ( this.containsPosition( otherRange.start ) ) {\n\t\t\t\t// Given range start is inside this range. This means thaNt we have to\n\t\t\t\t// shrink common range to the given range start.\n\t\t\t\tcommonRangeStart = otherRange.start;\n\t\t\t}\n\n\t\t\tif ( this.containsPosition( otherRange.end ) ) {\n\t\t\t\t// Given range end is inside this range. This means that we have to\n\t\t\t\t// shrink common range to the given range end.\n\t\t\t\tcommonRangeEnd = otherRange.end;\n\t\t\t}\n\n\t\t\treturn new Range( commonRangeStart, commonRangeEnd );\n\t\t}\n\n\t\t// Ranges do not intersect, so they do not have common part.\n\t\treturn null;\n\t}\n\n\t/**\n\t * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.\n\t *\n\t * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n\t * @param {module:engine/view/position~Position} [options.startPosition]\n\t * @param {Boolean} [options.singleCharacters=false]\n\t * @param {Boolean} [options.shallow=false]\n\t * @param {Boolean} [options.ignoreElementEnd=false]\n\t */\n\tgetWalker( options = {} ) {\n\t\toptions.boundaries = this;\n\n\t\treturn new TreeWalker( options );\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns\n\t * them.\n\t *\n\t * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option\n\t * set to `true`. However it returns only {@link module:engine/view/item~Item items},\n\t * not {@link module:engine/view/treewalker~TreeWalkerValue}.\n\t *\n\t * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for\n\t * a full list of available options.\n\t *\n\t * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n\t * @returns {Iterable.}\n\t */\n\t*getItems( options = {} ) {\n\t\toptions.boundaries = this;\n\t\toptions.ignoreElementEnd = true;\n\n\t\tconst treeWalker = new TreeWalker( options );\n\n\t\tfor ( let value of treeWalker ) {\n\t\t\tyield value.item;\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all {@link module:engine/view/position~Position positions} that are boundaries or\n\t * contained in this range.\n\t *\n\t * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only\n\t * {@link module:engine/view/position~Position positions}, not {@link module:engine/view/treewalker~TreeWalkerValue}.\n\t *\n\t * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for\n\t * a full list of available options.\n\t *\n\t * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n\t * @returns {Iterable.}\n\t */\n\t*getPositions( options = {} ) {\n\t\toptions.boundaries = this;\n\n\t\tconst treeWalker = new TreeWalker( options );\n\n\t\tyield treeWalker.position;\n\n\t\tfor ( let value of treeWalker ) {\n\t\t\tyield value.nextPosition;\n\t\t}\n\t}\n\n\t/**\n\t * Checks and returns whether this range intersects with given range.\n\t *\n\t * @param {module:engine/view/range~Range} otherRange Range to compare with.\n\t * @returns {Boolean} True if ranges intersect.\n\t */\n\tisIntersecting( otherRange ) {\n\t\treturn this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );\n\t}\n\n\t/**\n\t * Creates a range from given parents and offsets.\n\t *\n\t * @param {module:engine/view/element~Element} startElement Start position parent element.\n\t * @param {Number} startOffset Start position offset.\n\t * @param {module:engine/view/element~Element} endElement End position parent element.\n\t * @param {Number} endOffset End position offset.\n\t * @returns {module:engine/view/range~Range} Created range.\n\t */\n\tstatic createFromParentsAndOffsets( startElement, startOffset, endElement, endOffset ) {\n\t\treturn new this(\n\t\t\tnew Position( startElement, startOffset ),\n\t\t\tnew Position( endElement, endOffset )\n\t\t);\n\t}\n\n\t/**\n\t * Creates and returns a new instance of Range which is equal to passed range.\n\t *\n\t * @param {module:engine/view/range~Range} range Range to clone.\n\t * @returns {module:engine/view/range~Range}\n\t */\n\tstatic createFromRange( range ) {\n\t\treturn new this( range.start, range.end );\n\t}\n\n\t/**\n\t * Creates a new range, spreading from specified {@link module:engine/view/position~Position position} to a position moved by\n\t * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.\n\t *\n\t * @param {module:engine/view/position~Position} position Beginning of the range.\n\t * @param {Number} shift How long the range should be.\n\t * @returns {module:engine/view/range~Range}\n\t */\n\tstatic createFromPositionAndShift( position, shift ) {\n\t\tconst start = position;\n\t\tconst end = position.getShiftedBy( shift );\n\n\t\treturn shift > 0 ? new this( start, end ) : new this( end, start );\n\t}\n\n\t/**\n\t * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n\t * that element and ends after the last child of that element.\n\t *\n\t * @param {module:engine/view/element~Element} element Element which is a parent for the range.\n\t * @returns {module:engine/view/range~Range}\n\t */\n\tstatic createIn( element ) {\n\t\treturn this.createFromParentsAndOffsets( element, 0, element, element.childCount );\n\t}\n\n\t/**\n\t * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n\t *\n\t * @param {module:engine/view/item~Item} item\n\t * @returns {module:engine/view/range~Range}\n\t */\n\tstatic createOn( item ) {\n\t\treturn this.createFromPositionAndShift( Position.createBefore( item ), 1 );\n\t}\n}\n\n// Function used by getEnlagred and getShrinked methods.\nfunction enlargeShrinkSkip( value ) {\n\tif ( value.item.is( 'attributeElement' ) || value.item.is( 'uiElement' ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/range.js\n// module id = 34\n// module chunks = 0","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nexport default baseSlice;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseSlice.js\n// module id = 35\n// module chunks = 0","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isIndex.js\n// module id = 36\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/buildmodelconverter\n */\n\nimport {\n\tinsertElement,\n\tinsertUIElement,\n\tsetAttribute,\n\tremoveAttribute,\n\tremoveUIElement,\n\twrapItem,\n\tunwrapItem,\n\twrapRange,\n\tunwrapRange\n} from './model-to-view-converters';\n\nimport { convertSelectionAttribute, convertSelectionMarker } from './model-selection-to-view-converters';\n\nimport ViewAttributeElement from '../view/attributeelement';\nimport ViewContainerElement from '../view/containerelement';\nimport ViewUIElement from '../view/uielement';\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Provides chainable, high-level API to easily build basic model-to-view converters that are appended to given\n * dispatchers. In many cases, this is the API that should be used to specify how abstract model elements and\n * attributes should be represented in the view (and then later in DOM). Instances of this class are created by\n * {@link module:engine/conversion/buildmodelconverter~buildModelConverter}.\n *\n * If you need more complex converters, see {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher},\n * {@link module:engine/conversion/model-to-view-converters}, {@link module:engine/conversion/modelconsumable~ModelConsumable},\n * {@link module:engine/conversion/mapper~Mapper}.\n *\n * Using this API it is possible to create four kinds of converters:\n *\n * 1. Model element to view element converter. This is a converter that takes the model element and represents it\n * in the view.\n *\n *\t\tbuildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );\n *\t\tbuildModelConverter().for( dispatcher ).fromElement( 'image' ).toElement( 'img' );\n *\n * 2. Model attribute to view attribute converter. This is a converter that operates on model element attributes\n * and converts them to view element attributes. It is suitable for elements like `image` (`src`, `title` attributes).\n *\n *\t\tbuildModelConverter().for( dispatcher ).fromElement( 'image' ).toElement( 'img' );\n *\t\tbuildModelConverter().for( dispatcher ).fromAttribute( 'src' ).toAttribute();\n *\n * 3. Model attribute to view element converter. This is a converter that takes model attributes and represents them\n * as view elements. Elements created by this kind of converter are wrapping other view elements. Wrapped view nodes\n * correspond to model nodes had converter attribute. It is suitable for attributes like `bold`, where `bold` attribute\n * set on model text nodes is converter to `strong` view element.\n *\n *\t\tbuildModelConverter().for( dispatcher ).fromAttribute( 'bold' ).toElement( 'strong' );\n *\n * 4. Model marker to view element converter. This is a converter that converts markers from given group to view attribute element.\n * Markers, basically, are {@link module:engine/model/liverange~LiveRange} instances, that are named. In this conversion, model range is\n * converted to view range, then that view range is wrapped (or unwrapped, if range is removed) in a view attribute element.\n * To learn more about markers, see {@link module:engine/model/markercollection~MarkerCollection}.\n *\n *\t\tconst viewSpanSearchResult = new ViewAttributeElement( 'span', { class: 'search-result' } );\n *\t\tbuildModelConverter().for( dispatcher ).fromMarker( 'searchResult' ).toElement( viewSpanSearchResult );\n *\n * It is possible to provide various different parameters for\n * {@link module:engine/conversion/buildmodelconverter~ModelConverterBuilder#toElement}\n * and {@link module:engine/conversion/buildmodelconverter~ModelConverterBuilder#toAttribute} methods.\n * See their descriptions to learn more.\n *\n * It is also possible to {@link module:engine/conversion/buildmodelconverter~ModelConverterBuilder#withPriority change default priority}\n * of created converters to decide which converter should be fired earlier and which later. This is useful if you have\n * a general converter but also want to provide different special-case converters (i.e. given model element is converted\n * always to given view element, but if it has given attribute it is converter to other view element). For this,\n * use {@link module:engine/conversion/buildmodelconverter~ModelConverterBuilder#withPriority withPriority} right after `from...` method.\n *\n * Note that `to...` methods are \"terminators\", which means that should be the last one used in building converter.\n *\n * You can use {@link module:engine/conversion/buildviewconverter~ViewConverterBuilder}\n * to create \"opposite\" converters - from view to model.\n */\nclass ModelConverterBuilder {\n\t/**\n\t * Creates `ModelConverterBuilder` with given `dispatchers` registered to it.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Dispatchers to which converters will be attached.\n\t\t *\n\t\t * @type {Array.}\n\t\t * @private\n\t\t */\n\t\tthis._dispatchers = [];\n\n\t\t/**\n\t\t * Contains data about registered \"from\" query.\n\t\t *\n\t\t * @type {Object}\n\t\t * @private\n\t\t */\n\t\tthis._from = null;\n\t}\n\n\t/**\n\t * Set one or more dispatchers which the built converter will be attached to.\n\t *\n\t * @chainable\n\t * @param {...module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher} dispatchers One or more dispatchers.\n\t * @returns {module:engine/conversion/buildmodelconverter~ModelConverterBuilder}\n\t */\n\tfor( ...dispatchers ) {\n\t\tthis._dispatchers = dispatchers;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Registers what model element should be converted.\n\t *\n\t * @chainable\n\t * @param {String} elementName Name of element to convert.\n\t * @returns {module:engine/conversion/buildmodelconverter~ModelConverterBuilder}\n\t */\n\tfromElement( elementName ) {\n\t\tthis._from = {\n\t\t\ttype: 'element',\n\t\t\tname: elementName,\n\t\t\tpriority: null\n\t\t};\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Registers what model attribute should be converted.\n\t *\n\t * @chainable\n\t * @param {String} key Key of attribute to convert.\n\t * @returns {module:engine/conversion/buildmodelconverter~ModelConverterBuilder}\n\t */\n\tfromAttribute( key ) {\n\t\tthis._from = {\n\t\t\ttype: 'attribute',\n\t\t\tkey: key,\n\t\t\tpriority: null\n\t\t};\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Registers what type of marker should be converted.\n\t *\n\t * @chainable\n\t * @param {String} markerName Name of marker to convert.\n\t * @returns {module:engine/conversion/buildmodelconverter~ModelConverterBuilder}\n\t */\n\tfromMarker( markerName ) {\n\t\tthis._from = {\n\t\t\ttype: 'marker',\n\t\t\tname: markerName,\n\t\t\tpriority: null\n\t\t};\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Changes default priority for built converter. The lower the number, the earlier converter will be fired.\n\t * Default priority is `10`.\n\t *\n\t * **Note:** Keep in mind that event priority, that is set by this modifier, is used for attribute priority\n\t * when {@link module:engine/view/writer~writer} is used. This changes how view elements are ordered,\n\t * i.e.: `foo` vs `foo`. Using priority you can also\n\t * prevent node merging, i.e.: `foo` vs `foo`.\n\t * If you want to prevent merging, just set different priority for both converters.\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher ).fromAttribute( 'bold' ).withPriority( 2 ).toElement( 'strong' );\n\t *\t\tbuildModelConverter().for( dispatcher ).fromAttribute( 'italic' ).withPriority( 3 ).toElement( 'em' );\n\t *\n\t * @chainable\n\t * @param {Number} priority Converter priority.\n\t * @returns {module:engine/conversion/buildmodelconverter~ModelConverterBuilder}\n\t */\n\twithPriority( priority ) {\n\t\tthis._from.priority = priority;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Registers what view element will be created by converter.\n\t *\n\t * Method accepts various ways of providing how the view element will be created. You can pass view element name as\n\t * `string`, view element instance which will be cloned and used, or creator function which returns view element that\n\t * will be used. Keep in mind that when you view element instance or creator function, it has to be/return a\n\t * proper type of view element: {@link module:engine/view/containerelement~ContainerElement ViewContainerElement} if you convert\n\t * from element or {@link module:engine/view/attributeelement~AttributeElement ViewAttributeElement} if you convert from attribute.\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher ).fromElement( 'image' ).toElement( new ViewContainerElement( 'img' ) );\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher )\n\t *\t\t\t.fromElement( 'header' )\n\t *\t\t\t.toElement( ( data ) => new ViewContainerElement( 'h' + data.item.getAttribute( 'level' ) ) );\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher ).fromAttribute( 'bold' ).toElement( new ViewAttributeElement( 'strong' ) );\n\t *\n\t * Creator function will be passed different values depending whether conversion is from element or from attribute:\n\t *\n\t * * from element: dispatcher's\n\t * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:insert insert event}\n\t * parameters will be passed,\n\t * * from attribute: there is one parameter and it is attribute value.\n\t *\n\t * This method also registers model selection to view selection converter, if conversion is from attribute.\n\t *\n\t * This method creates the converter and adds it as a callback to a proper\n\t * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher conversion dispatcher} event.\n\t *\n\t * @param {String|module:engine/view/element~Element|Function} element Element created by converter or\n\t * a function that returns view element.\n\t */\n\ttoElement( element ) {\n\t\tconst priority = this._from.priority === null ? 'normal' : this._from.priority;\n\n\t\tfor ( let dispatcher of this._dispatchers ) {\n\t\t\tif ( this._from.type == 'element' ) {\n\t\t\t\t// From model element to view element -> insert element.\n\t\t\t\telement = typeof element == 'string' ? new ViewContainerElement( element ) : element;\n\n\t\t\t\tdispatcher.on( 'insert:' + this._from.name, insertElement( element ), { priority } );\n\t\t\t} else if ( this._from.type == 'attribute' ) {\n\t\t\t\t// From model attribute to view element -> wrap and unwrap.\n\t\t\t\telement = typeof element == 'string' ? new ViewAttributeElement( element ) : element;\n\n\t\t\t\tdispatcher.on( 'addAttribute:' + this._from.key, wrapItem( element ), { priority } );\n\t\t\t\tdispatcher.on( 'changeAttribute:' + this._from.key, wrapItem( element ), { priority } );\n\t\t\t\tdispatcher.on( 'removeAttribute:' + this._from.key, unwrapItem( element ), { priority } );\n\n\t\t\t\tdispatcher.on( 'selectionAttribute:' + this._from.key, convertSelectionAttribute( element ), { priority } );\n\t\t\t} else {\n\t\t\t\telement = typeof element == 'string' ? new ViewAttributeElement( element ) : element;\n\n\t\t\t\tdispatcher.on( 'addMarker:' + this._from.name, wrapRange( element ), { priority } );\n\t\t\t\tdispatcher.on( 'removeMarker:' + this._from.name, unwrapRange( element ), { priority } );\n\n\t\t\t\tdispatcher.on( 'selectionMarker:' + this._from.name, convertSelectionMarker( element ), { priority } );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Registers what view stamp will be created by converter to mark marker range bounds. Separate elements will be\n\t * created at the beginning and at the end of the range. If range is collapsed then only one element will be created.\n\t *\n\t * Method accepts various ways of providing how the view element will be created. You can pass view element name as\n\t * `string`, view element instance which will be cloned and used, or creator function which returns view element that\n\t * will be used. Keep in mind that when you provide view element instance or creator function, it has to be/return a\n\t * proper type of view element: {@link module:engine/view/uielement~UIElement UIElement}.\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher ).fromMarker( 'search' ).toStamp( 'span' );\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher )\n\t *\t\t\t.fromMarker( 'search' )\n\t *\t\t\t.toStamp( new UIElement( 'span', { 'data-name': 'search' } ) );\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher )\n\t *\t\t\t.fromMarker( 'search' )\n\t *\t\t\t.toStamp( ( data ) => new UIElement( 'span', { 'data-name': data.name ) );\n\t *\n\t * Creator function provides additional `data.isOpening` parameter which defined if currently converted element is\n\t * a beginning or end of the marker range. This makes possible to create different opening and closing stamp.\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher )\n\t *\t\t\t.fromMarker( 'search' )\n\t *\t\t\t.toStamp( ( data ) => {\n\t *\t\t\t\tif ( data.isOpening ) {\n\t *\t\t\t\t\treturn new UIElement( 'span', { 'data-name': data.name, 'data-start': true ) );\n\t *\t\t\t\t}\n\t *\n\t *\t\t\t\treturn new UIElement( 'span', { 'data-name': data.name, 'data-end': true ) );\n\t *\t\t\t}\n\t *\n\t * Creator function provides\n\t * {@link module:engine/conversion/buildmodelconverter~ModelConverterBuilder#StampCreatorData} parameters.\n\t *\n\t * See how markers {module:engine/model/buildviewconverter~ViewConverterBuilder#toMarker view -> model serialization}\n\t * works to find out what view element format is the best for you.\n\t *\n\t * @param {String|module:engine/view/element~UIElement|Function} element UIElement created by converter or\n\t * a function that returns view element.\n\t */\n\ttoStamp( element ) {\n\t\tfor ( let dispatcher of this._dispatchers ) {\n\t\t\tif ( this._from.type != 'marker' ) {\n\t\t\t\t/**\n\t\t\t\t * To-stamp conversion is supported only for model markers.\n\t\t\t\t *\n\t\t\t\t * @error build-model-converter-element-to-stamp\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'build-model-converter-non-marker-to-stamp: To-stamp conversion is supported only from model markers.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst priority = this._from.priority === null ? 'normal' : this._from.priority;\n\n\t\t\telement = typeof element == 'string' ? new ViewUIElement( element ) : element;\n\n\t\t\tdispatcher.on( 'addMarker:' + this._from.name, insertUIElement( element ), { priority } );\n\t\t\tdispatcher.on( 'removeMarker:' + this._from.name, removeUIElement( element ), { priority } );\n\t\t}\n\t}\n\n\t/**\n\t * Registers what view attribute will be created by converter. Keep in mind, that only model attribute to\n\t * view attribute conversion is supported.\n\t *\n\t * Method accepts various ways of providing how the view attribute will be created:\n\t *\n\t * * for no passed parameter, attribute key and value will be converted 1-to-1 to view attribute,\n\t * * if you pass one `string`, it will be used as new attribute key while attribute value will be copied,\n\t * * if you pass two `string`s, first one will be used as new attribute key and second one as new attribute value,\n\t * * if you pass a function, it is expected to return an object with `key` and `value` properties representing attribute key and value.\n\t * This function will be passed model attribute value and model attribute key as first two parameters and then\n\t * all dispatcher's\n\t * {module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:changeAttribute changeAttribute event}\n\t * parameters.\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher ).fromAttribute( 'class' ).toAttribute( '' );\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher ).fromAttribute( 'linkTitle' ).toAttribute( 'title' );\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher ).fromAttribute( 'highlighted' ).toAttribute( 'style', 'background:yellow' );\n\t *\n\t *\t\tbuildModelConverter().for( dispatcher )\n\t *\t\t\t.fromAttribute( 'theme' )\n\t *\t\t\t.toAttribute( ( value ) => ( { key: 'class', value: value + '-theme' } ) );\n\t *\n\t * This method creates the converter and adds it as a callback to a proper\n\t * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher conversion dispatcher} event.\n\t *\n\t * @param {String|Function} [keyOrCreator] Attribute key or a creator function.\n\t * @param {*} [value] Attribute value.\n\t */\n\ttoAttribute( keyOrCreator, value ) {\n\t\tif ( this._from.type != 'attribute' ) {\n\t\t\t/**\n\t\t\t * To-attribute conversion is supported only for model attributes.\n\t\t\t *\n\t\t\t * @error build-model-converter-element-to-attribute\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'build-model-converter-non-attribute-to-attribute: ' +\n\t\t\t\t'To-attribute conversion is supported only from model attributes.' );\n\t\t}\n\n\t\tlet attributeCreator;\n\n\t\tif ( !keyOrCreator ) {\n\t\t\t// If `keyOrCreator` is not set, we assume default behavior which is 1:1 attribute re-write.\n\t\t\t// This is also a default behavior for `setAttribute` converter when no attribute creator is passed.\n\t\t\tattributeCreator = undefined;\n\t\t} else if ( typeof keyOrCreator == 'string' ) {\n\t\t\t// `keyOrCreator` is an attribute key.\n\n\t\t\tif ( value ) {\n\t\t\t\t// If value is set, create \"dumb\" creator that always returns the same object.\n\t\t\t\tattributeCreator = function() {\n\t\t\t\t\treturn { key: keyOrCreator, value: value };\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// If value is not set, take it from the passed parameter.\n\t\t\t\tattributeCreator = function( value ) {\n\t\t\t\t\treturn { key: keyOrCreator, value: value };\n\t\t\t\t};\n\t\t\t}\n\t\t} else {\n\t\t\t// `keyOrCreator` is an attribute creator function.\n\t\t\tattributeCreator = keyOrCreator;\n\t\t}\n\n\t\tfor ( let dispatcher of this._dispatchers ) {\n\t\t\tconst options = { priority: this._from.priority || 'normal' };\n\n\t\t\tdispatcher.on( 'addAttribute:' + this._from.key, setAttribute( attributeCreator ), options );\n\t\t\tdispatcher.on( 'changeAttribute:' + this._from.key, setAttribute( attributeCreator ), options );\n\t\t\tdispatcher.on( 'removeAttribute:' + this._from.key, removeAttribute( attributeCreator ), options );\n\t\t}\n\t}\n}\n\n/**\n * Entry point for model-to-view converters builder. This chainable API makes it easy to create basic, most common\n * model-to-view converters and attach them to provided dispatchers. The method returns an instance of\n * {@link module:engine/conversion/buildmodelconverter~ModelConverterBuilder}.\n */\nexport default function buildModelConverter() {\n\treturn new ModelConverterBuilder();\n}\n\n/**\n * @typedef {StampCreatorData} {module:engine/conversion/buildmodelconverter~ModelConverterBuilder#StampCreatorData}\n * @param {Object} data Additional information about the change.\n * @param {String} data.name Marker name.\n * @param {module:engine/model/range~Range} data.range Marker range.\n * @param {Boolean} data.isOpening Defines if currently converted element is a beginning or end of the marker range.\n * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/conversion/buildmodelconverter.js\n// module id = 37\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/buildviewconverter\n */\n\nimport Matcher from '../view/matcher';\nimport ModelElement from '../model/element';\nimport ModelPosition from '../model/position';\nimport modelWriter from '../model/writer';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\n\n/**\n * Provides chainable, high-level API to easily build basic view-to-model converters that are appended to given\n * dispatchers. View-to-model converters are used when external data is added to the editor, i.e. when a user pastes\n * HTML content to the editor. Then, converters are used to translate this structure, possibly removing unknown/incorrect\n * nodes, and add it to the model. Also multiple, different elements might be translated into the same thing in the\n * model, i.e. `` and `` elements might be converted to `bold` attribute (even though `bold` attribute will\n * be then converted only to `` tag). Instances of this class are created by\n * {@link module:engine/conversion/buildviewconverter~buildViewConverter}.\n *\n * If you need more complex converters, see {@link module:engine/conversion/viewconversiondispatcher~ViewConversionDispatcher},\n * {@link module:engine/conversion/view-to-model-converters}, {@link module:engine/conversion/viewconsumable~ViewConsumable}.\n *\n * Using this API it is possible to create various kind of converters:\n *\n * 1. View element to model element:\n *\n *\t\tbuildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );\n *\n * 2. View element to model attribute:\n *\n *\t\tbuildViewConverter().for( dispatcher ).fromElement( 'b' ).fromElement( 'strong' ).toAttribute( 'bold', 'true' );\n *\n * 3. View attribute to model attribute:\n *\n *\t\tbuildViewConverter().for( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );\n *\t\tbuildViewConverter().for( dispatcher )\n *\t\t\t.fromAttribute( 'class' )\n *\t\t\t.toAttribute( ( viewElement ) => ( { class: viewElement.getAttribute( 'class' ) } ) );\n *\n * 4. View elements and attributes to model attribute:\n *\n *\t\tbuildViewConverter().for( dispatcher )\n *\t\t\t.fromElement( 'b' ).fromElement( 'strong' ).fromAttribute( 'style', { 'font-weight': 'bold' } )\n *\t\t\t.toAttribute( 'bold', 'true' );\n *\n * 5. View {@link module:engine/view/matcher~Matcher view element matcher instance} or\n * {@link module:engine/view/matcher~Matcher#add matcher pattern}\n * to model element or attribute:\n *\n *\t\tconst matcher = new ViewMatcher();\n *\t\tmatcher.add( 'div', { class: 'quote' } );\n *\t\tbuildViewConverter().for( dispatcher ).from( matcher ).toElement( 'quote' );\n *\n *\t\tbuildViewConverter().for( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( 'bold', 'true' );\n *\n * Note, that converters built using `ViewConverterBuilder` automatically check {@link module:engine/model/schema~Schema schema}\n * if created model structure is valid. If given conversion would be invalid according to schema, it is ignored.\n *\n * It is possible to provide creator functions as parameters for {@link ~ViewConverterBuilder#toElement}\n * and {@link module:engine/conversion/buildviewconverter~ViewConverterBuilder#toAttribute} methods. See their descriptions to learn more.\n *\n * By default, converter will {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consume} every value specified in\n * given `from...` query, i.e. `.from( { name: 'span', class: 'bold' } )` will make converter consume both `span` name\n * and `bold` class. It is possible to change this behavior using {@link ~ViewConverterBuilder#consuming consuming}\n * modifier. The modifier alters the last `fromXXX` query used before it. To learn more about consuming values,\n * see {@link module:engine/conversion/viewconsumable~ViewConsumable}.\n *\n * It is also possible to {@link module:engine/conversion/buildviewconverter~ViewConverterBuilder#withPriority change default priority}\n * of created converters to decide which converter should be fired earlier and which later. This is useful if you provide\n * a general converter but want to provide different converter for a specific-case (i.e. given view element is converted\n * always to given model element, but if it has given class it is converter to other model element). For this,\n * use {@link module:engine/conversion/buildviewconverter~ViewConverterBuilder#withPriority withPriority} modifier. The modifier alters\n * the last `from...` query used before it.\n *\n * Note that `to...` methods are \"terminators\", which means that should be the last one used in building converter.\n *\n * You can use {@link module:engine/conversion/buildmodelconverter~ModelConverterBuilder}\n * to create \"opposite\" converters - from model to view.\n */\nclass ViewConverterBuilder {\n\t/**\n\t * Creates `ViewConverterBuilder` with given `dispatchers` registered to it.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Dispatchers to which converters will be attached.\n\t\t *\n\t\t * @type {Array.}\n\t\t * @private\n\t\t */\n\t\tthis._dispatchers = [];\n\n\t\t/**\n\t\t * Stores \"from\" queries.\n\t\t *\n\t\t * @type {Array}\n\t\t * @private\n\t\t */\n\t\tthis._from = [];\n\t}\n\n\t/**\n\t * Set one or more dispatchers which the built converter will be attached to.\n\t *\n\t * @chainable\n\t * @param {...module:engine/conversion/viewconversiondispatcher~ViewConversionDispatcher} dispatchers One or more dispatchers.\n\t * @returns {module:engine/conversion/buildviewconverter~ViewConverterBuilder}\n\t */\n\tfor( ...dispatchers ) {\n\t\tthis._dispatchers = dispatchers;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Registers what view element should be converted.\n\t *\n\t *\t\tbuildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );\n\t *\n\t * @chainable\n\t * @param {String} elementName View element name.\n\t * @returns {module:engine/conversion/buildviewconverter~ViewConverterBuilder}\n\t */\n\tfromElement( elementName ) {\n\t\treturn this.from( { name: elementName } );\n\t}\n\n\t/**\n\t * Registers what view attribute should be converted.\n\t *\n\t *\t\tbuildViewConverter().for( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );\n\t *\n\t * @chainable\n\t * @param {String|RegExp} key View attribute key.\n\t * @param {String|RegExp} [value] View attribute value.\n\t * @returns {module:engine/conversion/buildviewconverter~ViewConverterBuilder}\n\t */\n\tfromAttribute( key, value = /.*/ ) {\n\t\tlet pattern = {};\n\t\tpattern[ key ] = value;\n\n\t\treturn this.from( pattern );\n\t}\n\n\t/**\n\t * Registers what view pattern should be converted. The method accepts either {@link module:engine/view/matcher~Matcher view matcher}\n\t * or view matcher pattern.\n\t *\n\t *\t\tconst matcher = new ViewMatcher();\n\t *\t\tmatcher.add( 'div', { class: 'quote' } );\n\t *\t\tbuildViewConverter().for( dispatcher ).from( matcher ).toElement( 'quote' );\n\t *\n\t *\t\tbuildViewConverter().for( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( 'bold', 'true' );\n\t *\n\t * @chainable\n\t * @param {Object|module:engine/view/matcher~Matcher} matcher View matcher or view matcher pattern.\n\t * @returns {module:engine/conversion/buildviewconverter~ViewConverterBuilder}\n\t */\n\tfrom( matcher ) {\n\t\tif ( !( matcher instanceof Matcher ) ) {\n\t\t\tmatcher = new Matcher( matcher );\n\t\t}\n\n\t\tthis._from.push( {\n\t\t\tmatcher: matcher,\n\t\t\tconsume: false,\n\t\t\tpriority: null\n\t\t} );\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Modifies which consumable values will be {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consumed}\n\t * by built converter.\n\t * It modifies the last `from...` query. Can be used after each `from...` query in given chain. Useful for providing\n\t * more specific matches.\n\t *\n\t *\t\t// This converter will only handle class bold conversion (to proper attribute) but span element\n\t *\t\t// conversion will have to be done in separate converter.\n\t *\t\t// Without consuming modifier, the converter would consume both class and name, so a converter for\n\t *\t\t// span element would not be fired.\n\t *\t\tbuildViewConverter().for( dispatcher )\n\t *\t\t\t.from( { name: 'span', class: 'bold' } ).consuming( { class: 'bold' } )\n\t *\t\t\t.toAttribute( 'bold', 'true' } );\n\t *\n\t *\t\tbuildViewConverter().for( dispatcher )\n\t *\t\t\t.fromElement( 'img' ).consuming( { name: true, attributes: [ 'src', 'title' ] } )\n\t *\t\t\t.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ),\n\t *\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle: viewElement.getAttribute( 'title' ) } );\n\t *\n\t * **Note:** All and only values from passed object has to be consumable on converted view element. This means that\n\t * using `consuming` method, you can either make looser conversion conditions (like in first example) or tighter\n\t * conversion conditions (like in second example). So, the view element, to be converter, has to match query of\n\t * `from...` method and then have to have enough consumable values to consume.\n\t *\n\t * @see module:engine/conversion/viewconsumable~ViewConsumable\n\t * @chainable\n\t * @param {Object} consume Values to consume.\n\t * @returns {module:engine/conversion/buildviewconverter~ViewConverterBuilder}\n\t */\n\tconsuming( consume ) {\n\t\tlet lastFrom = this._from[ this._from.length - 1 ];\n\t\tlastFrom.consume = consume;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Changes default priority for built converter. It modifies the last `from...` query. Can be used after each\n\t * `from...` query in given chain. Useful for overwriting converters. The lower the number, the earlier converter will be fired.\n\t *\n\t *\t\tbuildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );\n\t *\t\t// Register converter with proper priority, otherwise \"p\" element would get consumed by first\n\t *\t\t// converter and the second converter would not be fired.\n\t *\t\tbuildViewConverter().for( dispatcher )\n\t *\t\t\t.from( { name: 'p', class: 'custom' } ).withPriority( 9 )\n\t *\t\t\t.toElement( 'customParagraph' );\n\t *\n\t * **Note:** `ViewConverterBuilder` takes care so all `toElement` conversions takes place before all `toAttribute`\n\t * conversions. This is done by setting default `toElement` priority to `10` and `toAttribute` priority to `1000`.\n\t * It is recommended to set converter priority for `toElement` conversions below `500` and `toAttribute` priority\n\t * above `500`. It is important that model elements are created before attributes, otherwise attributes would\n\t * not be applied or other errors may occur.\n\t *\n\t * @chainable\n\t * @param {Number} priority Converter priority.\n\t * @returns {module:engine/conversion/buildviewconverter~ViewConverterBuilder}\n\t */\n\twithPriority( priority ) {\n\t\tlet lastFrom = this._from[ this._from.length - 1 ];\n\t\tlastFrom.priority = priority;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Registers what model element will be created by converter.\n\t *\n\t * Method accepts two ways of providing what kind of model element will be created. You can pass model element\n\t * name as a `string` or a function that will return model element instance. If you provide creator function,\n\t * it will be passed converted view element as first and only parameter.\n\t *\n\t *\t\tbuildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );\n\t *\t\tbuildViewConverter().for( dispatcher )\n\t *\t\t\t.fromElement( 'img' )\n\t *\t\t\t.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ) } );\n\t *\n\t * @param {String|Function} element Model element name or model element creator function.\n\t */\n\ttoElement( element ) {\n\t\tfunction eventCallbackGen( from ) {\n\t\t\treturn ( evt, data, consumable, conversionApi ) => {\n\t\t\t\t// There is one callback for all patterns in the matcher.\n\t\t\t\t// This will be usually just one pattern but we support matchers with many patterns too.\n\t\t\t\tlet matchAll = from.matcher.matchAll( data.input );\n\n\t\t\t\t// If there is no match, this callback should not do anything.\n\t\t\t\tif ( !matchAll ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Now, for every match between matcher and actual element, we will try to consume the match.\n\t\t\t\tfor ( let match of matchAll ) {\n\t\t\t\t\t// Create model element basing on creator function or element name.\n\t\t\t\t\tconst modelElement = element instanceof Function ? element( data.input ) : new ModelElement( element );\n\n\t\t\t\t\t// Check whether generated structure is okay with `Schema`.\n\t\t\t\t\tconst keys = Array.from( modelElement.getAttributeKeys() );\n\n\t\t\t\t\tif ( !conversionApi.schema.check( { name: modelElement.name, attributes: keys, inside: data.context } ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Try to consume appropriate values from consumable values list.\n\t\t\t\t\tif ( !consumable.consume( data.input, from.consume || match.match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If everything is fine, we are ready to start the conversion.\n\t\t\t\t\t// Add newly created `modelElement` to the parents stack.\n\t\t\t\t\tdata.context.push( modelElement );\n\n\t\t\t\t\t// Convert children of converted view element and append them to `modelElement`.\n\t\t\t\t\tconst modelChildren = conversionApi.convertChildren( data.input, consumable, data );\n\t\t\t\t\tconst insertPosition = ModelPosition.createAt( modelElement, 'end' );\n\t\t\t\t\tmodelWriter.insert( insertPosition, modelChildren );\n\n\t\t\t\t\t// Remove created `modelElement` from the parents stack.\n\t\t\t\t\tdata.context.pop();\n\n\t\t\t\t\t// Add `modelElement` as a result.\n\t\t\t\t\tdata.output = modelElement;\n\n\t\t\t\t\t// Prevent multiple conversion if there are other correct matches.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tthis._setCallback( eventCallbackGen, 'normal' );\n\t}\n\n\t/**\n\t * Registers what model attribute will be created by converter.\n\t *\n\t * Method accepts two ways of providing what kind of model attribute will be created. You can either pass two strings\n\t * representing attribute key and attribute value or a function that returns an object with `key` and `value` properties.\n\t * If you provide creator function, it will be passed converted view element as first and only parameter.\n\t *\n\t *\t\tbuildViewConverter().for( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );\n\t *\t\tbuildViewConverter().for( dispatcher )\n\t *\t\t\t.fromAttribute( 'class' )\n\t *\t\t\t.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );\n\t *\n\t * @param {String|Function} keyOrCreator Attribute key or a creator function.\n\t * @param {String} [value] Attribute value. Required if `keyOrCreator` is a `string`. Ignored otherwise.\n\t */\n\ttoAttribute( keyOrCreator, value ) {\n\t\tfunction eventCallbackGen( from ) {\n\t\t\treturn ( evt, data, consumable, conversionApi ) => {\n\t\t\t\t// There is one callback for all patterns in the matcher.\n\t\t\t\t// This will be usually just one pattern but we support matchers with many patterns too.\n\t\t\t\tlet matchAll = from.matcher.matchAll( data.input );\n\n\t\t\t\t// If there is no match, this callback should not do anything.\n\t\t\t\tif ( !matchAll ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Now, for every match between matcher and actual element, we will try to consume the match.\n\t\t\t\tfor ( let match of matchAll ) {\n\t\t\t\t\t// Try to consume appropriate values from consumable values list.\n\t\t\t\t\tif ( !consumable.consume( data.input, from.consume || match.match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Since we are converting to attribute we need an output on which we will set the attribute.\n\t\t\t\t\t// If the output is not created yet, we will create it.\n\t\t\t\t\tif ( !data.output ) {\n\t\t\t\t\t\tdata.output = conversionApi.convertChildren( data.input, consumable, data );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Use attribute creator function, if provided.\n\t\t\t\t\tlet attribute = keyOrCreator instanceof Function ? keyOrCreator( data.input ) : { key: keyOrCreator, value: value };\n\n\t\t\t\t\t// Set attribute on current `output`. `Schema` is checked inside this helper function.\n\t\t\t\t\tsetAttributeOn( data.output, attribute, data, conversionApi );\n\n\t\t\t\t\t// Prevent multiple conversion if there are other correct matches.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tthis._setCallback( eventCallbackGen, 'low' );\n\t}\n\n\t/**\n\t * Registers how model element marking marker range will be created by converter.\n\t *\n\t * Created element has to match the following pattern:\n\t *\n\t * \t\t{ name: '$marker', attribute: { data-name: /^\\w/ } }\n\t *\n\t * There are two ways of creating this element:\n\t *\n\t * 1. Makes sure that converted view element will have property `data-name` then converter will\n\t * automatically take this property value. In this case there is no need to provide creator function.\n\t * For the following view:\n\t *\n\t *\t\tfoo\n\t *\n\t * converter should look like this:\n\t *\n\t *\t\tbuildViewConverter().for( dispatcher ).fromElement( 'marker' ).toMarker();\n\t *\n\t * 2. Creates element by creator:\n\t *\n\t * For the following view:\n\t *\n\t * \t\tfoo\n\t *\n\t * converter should look like this:\n\t *\n\t * \t\tbuildViewConverter().for( dispatcher ).from( { name: 'span', { attribute: foo: /^\\w/ } } ).toMarker( ( data ) => {\n\t * \t\t\treturn new Element( '$marker', { 'data-name': data.getAttribute( 'foo' ) } );\n\t * \t\t} );\n\t *\n\t * @param {Function} [creator] Creator function.\n\t */\n\ttoMarker( creator ) {\n\t\tfunction eventCallbackGen( from ) {\n\t\t\treturn ( evt, data, consumable ) => {\n\t\t\t\t// There is one callback for all patterns in the matcher.\n\t\t\t\t// This will be usually just one pattern but we support matchers with many patterns too.\n\t\t\t\tconst matchAll = from.matcher.matchAll( data.input );\n\n\t\t\t\t// If there is no match, this callback should not do anything.\n\t\t\t\tif ( !matchAll ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet modelElement;\n\n\t\t\t\t// When creator is provided then create model element basing on creator function.\n\t\t\t\tif ( creator instanceof Function ) {\n\t\t\t\t\tmodelElement = creator( data.input );\n\t\t\t\t// When there is no creator then create model element basing on data from view element.\n\t\t\t\t} else {\n\t\t\t\t\tmodelElement = new ModelElement( '$marker', { 'data-name': data.input.getAttribute( 'data-name' ) } );\n\t\t\t\t}\n\n\t\t\t\t// Check if model element is correct (has proper name and property).\n\t\t\t\tif ( modelElement.name != '$marker' || typeof modelElement.getAttribute( 'data-name' ) != 'string' ) {\n\t\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t\t'build-view-converter-invalid-marker: Invalid model element to mark marker range.'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Now, for every match between matcher and actual element, we will try to consume the match.\n\t\t\t\tfor ( const match of matchAll ) {\n\t\t\t\t\t// Try to consume appropriate values from consumable values list.\n\t\t\t\t\tif ( !consumable.consume( data.input, from.consume || match.match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tdata.output = modelElement;\n\n\t\t\t\t\t// Prevent multiple conversion if there are other correct matches.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tthis._setCallback( eventCallbackGen, 'normal' );\n\t}\n\n\t/**\n\t * Helper function that uses given callback generator to created callback function and sets it on registered dispatchers.\n\t *\n\t * @param eventCallbackGen\n\t * @param defaultPriority\n\t * @private\n\t */\n\t_setCallback( eventCallbackGen, defaultPriority ) {\n\t\t// We will add separate event callback for each registered `from` entry.\n\t\tfor ( let from of this._from ) {\n\t\t\t// We have to figure out event name basing on matcher's patterns.\n\t\t\t// If there is exactly one pattern and it has `name` property we will used that name.\n\t\t\tconst matcherElementName = from.matcher.getElementName();\n\t\t\tconst eventName = matcherElementName ? 'element:' + matcherElementName : 'element';\n\t\t\tconst eventCallback = eventCallbackGen( from );\n\n\t\t\tconst priority = from.priority === null ? defaultPriority : from.priority;\n\n\t\t\t// Add event to each registered dispatcher.\n\t\t\tfor ( let dispatcher of this._dispatchers ) {\n\t\t\t\tdispatcher.on( eventName, eventCallback, { priority } );\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Helper function that sets given attributes on given `module:engine/model/node~Node` or\n// `module:engine/model/documentfragment~DocumentFragment`.\nfunction setAttributeOn( toChange, attribute, data, conversionApi ) {\n\tif ( isIterable( toChange ) ) {\n\t\tfor ( let node of toChange ) {\n\t\t\tsetAttributeOn( node, attribute, data, conversionApi );\n\t\t}\n\n\t\treturn;\n\t}\n\n\tconst keys = Array.from( toChange.getAttributeKeys() );\n\tkeys.push( attribute.key );\n\n\tconst schemaQuery = {\n\t\tname: toChange.name || '$text',\n\t\tattributes: keys,\n\t\tinside: data.context\n\t};\n\n\tif ( conversionApi.schema.check( schemaQuery ) ) {\n\t\ttoChange.setAttribute( attribute.key, attribute.value );\n\t}\n}\n\n/**\n * Entry point for view-to-model converters builder. This chainable API makes it easy to create basic, most common\n * view-to-model converters and attach them to provided dispatchers. The method returns an instance of\n * {@link module:engine/conversion/buildviewconverter~ViewConverterBuilder}.\n */\nexport default function buildViewConverter() {\n\treturn new ViewConverterBuilder();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/conversion/buildviewconverter.js\n// module id = 38\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/insertoperation\n */\n\nimport Operation from './operation';\nimport Position from '../position';\nimport NodeList from '../nodelist';\nimport RemoveOperation from './removeoperation';\nimport writer from './../writer';\nimport { normalizeNodes } from './../writer';\nimport Text from '../text';\nimport Element from '../element';\n\n/**\n * Operation to insert one or more nodes at given position in the model.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class InsertOperation extends Operation {\n\t/**\n\t * Creates an insert operation.\n\t *\n\t * @param {module:engine/model/position~Position} position Position of insertion.\n\t * @param {module:engine/model/node~NodeSet} nodes The list of nodes to be inserted.\n\t * @param {Number} baseVersion {@link module:engine/model/document~Document#version} on which operation can be applied.\n\t */\n\tconstructor( position, nodes, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Position of insertion.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/insertoperation~InsertOperation#position\n\t\t */\n\t\tthis.position = Position.createFromPosition( position );\n\n\t\t/**\n\t\t * List of nodes to insert.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/nodelist~NodeList} module:engine/model/operation/insertoperation~InsertOperation#nodeList\n\t\t */\n\t\tthis.nodes = new NodeList( normalizeNodes( nodes ) );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'insert';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/insertoperation~InsertOperation}\n\t */\n\tclone() {\n\t\tconst nodes = new NodeList( [ ...this.nodes ].map( ( node ) => node.clone( true ) ) );\n\n\t\treturn new InsertOperation( this.position, nodes, this.baseVersion );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/removeoperation~RemoveOperation}\n\t */\n\tgetReversed() {\n\t\treturn new RemoveOperation( this.position, this.nodes.maxOffset, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t// What happens here is that we want original nodes be passed to writer because we want original nodes\n\t\t// to be inserted to the model. But in InsertOperation, we want to keep those nodes as they were added\n\t\t// to the operation, not modified. For example, text nodes can get merged or cropped while Elements can\n\t\t// get children. It is important that InsertOperation has the copy of original nodes in intact state.\n\t\tconst originalNodes = this.nodes;\n\t\tthis.nodes = new NodeList( [ ...originalNodes ].map( ( node ) => node.clone( true ) ) );\n\n\t\tconst range = writer.insert( this.position, originalNodes );\n\n\t\treturn { range };\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.InsertOperation';\n\t}\n\n\t/**\n\t * Creates `InsertOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/insertoperation~InsertOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tlet children = [];\n\n\t\tfor ( let child of json.nodes ) {\n\t\t\tif ( child.name ) {\n\t\t\t\t// If child has name property, it is an Element.\n\t\t\t\tchildren.push( Element.fromJSON( child ) );\n\t\t\t} else {\n\t\t\t\t// Otherwise, it is a Text node.\n\t\t\t\tchildren.push( Text.fromJSON( child ) );\n\t\t\t}\n\t\t}\n\n\t\treturn new InsertOperation( Position.fromJSON( json.position, document ), children, json.baseVersion );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js\n// module id = 39\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/removeoperation\n */\n\nimport MoveOperation from './moveoperation';\nimport Position from '../position';\nimport Element from '../element';\nimport ReinsertOperation from './reinsertoperation';\n\n/**\n * Operation to remove a range of nodes.\n */\nexport default class RemoveOperation extends MoveOperation {\n\t/**\n\t * Creates a remove operation.\n\t *\n\t * @param {module:engine/model/position~Position} position Position before the first {@link module:engine/model/item~Item model item} to\n\t * remove.\n\t * @param {Number} howMany Offset size of removed range. {@link module:engine/model/item~Item Model items} will be removed starting\n\t * from `sourcePosition`, up to a `sourcePosition` with offset shifted by `howMany`.\n\t * @param {Number} baseVersion {@link module:engine/model/document~Document#version} on which operation can be applied.\n\t */\n\tconstructor( position, howMany, baseVersion ) {\n\t\tconst graveyard = position.root.document.graveyard;\n\t\tconst graveyardPosition = new Position( graveyard, [ graveyard.maxOffset, 0 ] );\n\n\t\tsuper( position, howMany, graveyardPosition, baseVersion );\n\n\t\t/**\n\t\t * Flag informing whether this operation should insert \"holder\" element (`true`) or should move removed nodes\n\t\t * into existing \"holder\" element (`false`).\n\t\t *\n\t\t * The flag should be set to `true` for each \"new\" `RemoveOperation` that is each `RemoveOperation` originally\n\t\t * created to remove some nodes from document (most likely created through `Batch` API).\n\t\t *\n\t\t * The flag should be set to `false` for each `RemoveOperation` that got created by splitting the original\n\t\t * `RemoveOperation`, for example during operational transformation.\n\t\t *\n\t\t * The flag should be set to `false` whenever removing nodes that were re-inserted from graveyard. This will\n\t\t * ensure correctness of all other operations that might change something on those nodes. This will also ensure\n\t\t * that redundant empty graveyard holder elements are not created.\n\t\t *\n\t\t * @protected\n\t\t * @type {Boolean}\n\t\t */\n\t\tthis._needsHolderElement = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'remove';\n\t}\n\n\t/**\n\t * Offset of the graveyard \"holder\" element, in which nodes removed by this operation are stored.\n\t *\n\t * @protected\n\t * @type {Number}\n\t */\n\tget _holderElementOffset() {\n\t\treturn this.targetPosition.path[ 0 ];\n\t}\n\n\t/**\n\t * Sets {@link module:engine/model/operation/removeoperation~RemoveOperation#_holderElementOffset}.\n\t *\n\t * @protected\n\t * @param {Number} offset\n\t */\n\tset _holderElementOffset( offset ) {\n\t\tthis.targetPosition.path[ 0 ] = offset;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/reinsertoperation~ReinsertOperation}\n\t */\n\tgetReversed() {\n\t\treturn new ReinsertOperation( this.targetPosition, this.howMany, this.sourcePosition, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/removeoperation~RemoveOperation}\n\t */\n\tclone() {\n\t\tlet removeOperation = new RemoveOperation( this.sourcePosition, this.howMany, this.baseVersion );\n\t\tremoveOperation.targetPosition = Position.createFromPosition( this.targetPosition );\n\n\t\treturn removeOperation;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t// Insert \"holder\" element in graveyard root, if the operation needs it.\n\t\tif ( this._needsHolderElement ) {\n\t\t\tconst graveyard = this.targetPosition.root;\n\t\t\tconst holderElement = new Element( '$graveyardHolder' );\n\n\t\t\tgraveyard.insertChildren( this._holderElementOffset, holderElement );\n\n\t\t\t// If the operation removes nodes that are already in graveyard, it may happen that\n\t\t\t// the operation's source position is invalidated by inserting new holder element into the graveyard.\n\t\t\t// If that's the case, we need to fix source position path.\n\t\t\tif ( this.sourcePosition.root == graveyard && this.sourcePosition.path[ 0 ] >= this._holderElementOffset ) {\n\t\t\t\tthis.sourcePosition.path[ 0 ]++;\n\t\t\t}\n\t\t}\n\n\t\t// Then, execute as a move operation.\n\t\treturn super._execute();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.RemoveOperation';\n\t}\n\n\t/**\n\t * Creates `RemoveOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/removeoperation~RemoveOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tlet sourcePosition = Position.fromJSON( json.sourcePosition, document );\n\n\t\tconst removeOp = new RemoveOperation( sourcePosition, json.howMany, json.baseVersion );\n\n\t\tremoveOp.targetPosition = Position.fromJSON( json.targetPosition, document );\n\t\tremoveOp._needsHolderElement = json._needsHolderElement;\n\n\t\treturn removeOp;\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/removeoperation.js\n// module id = 40\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/containerelement\n */\n\nimport Element from './element';\n\n/**\n * Containers are elements which define document structure. They define boundaries for\n * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly use for block elements like `

` or `

`.\n *\n * Editing engine does not define fixed HTML DTD. This is why the type of the {@link module:engine/view/element~Element} need to\n * be defined by the feature developer.\n *\n * Creating an element you should use `ContainerElement` class or {@link module:engine/view/attributeelement~AttributeElement}. This is\n * important to define the type of the element because of two reasons:\n *\n * Firstly, {@link module:engine/view/domconverter~DomConverter} needs the information what is an editable block to convert elements to\n * DOM properly. {@link module:engine/view/domconverter~DomConverter} will ensure that `ContainerElement` is editable and it is possible\n * to put caret inside it, even if the container is empty.\n *\n * Secondly, {@link module:engine/view/writer~writer view writer} uses this information.\n * Nodes {@link module:engine/view/writer~writer.breakAttributes breaking} and {@link module:engine/view/writer~writer.mergeAttributes\n * merging}\n * is performed only in a bounds of a container nodes.\n *\n * For instance if `

` is an container and `` is attribute:\n *\n *\t\t

fo^o

\n *\n * {@link module:engine/view/writer~writer.breakAttributes breakAttributes} will create:\n *\n *\t\t

foo

\n *\n * There might be a need to mark `` element as a container node, for example in situation when it will be a\n * container of an inline widget:\n *\n *\t\tfoobar\t\t// attribute\n *\t\tfoobar\t\t// container\n *\n * @extends module:engine/view/element~Element\n */\nexport default class ContainerElement extends Element {\n\t/**\n\t * Creates a container element.\n\t *\n\t * @see module:engine/view/element~Element\n\t */\n\tconstructor( name, attrs, children ) {\n\t\tsuper( name, attrs, children );\n\n\t\t/**\n\t\t * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.\n\t\t *\n\t\t * @method #getFillerOffset\n\t\t * @returns {Number|null} Block filler offset or `null` if block filler is not needed.\n\t\t */\n\t\tthis.getFillerOffset = getFillerOffset;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tis( type, name = null ) {\n\t\tif ( !name ) {\n\t\t\treturn type == 'containerElement' || super.is( type );\n\t\t} else {\n\t\t\treturn ( type == 'containerElement' && name == this.name ) || super.is( type, name );\n\t\t}\n\t}\n}\n\n// Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.\n//\n// @returns {Number|null} Block filler offset or `null` if block filler is not needed.\nfunction getFillerOffset() {\n\t/*jshint validthis:true */\n\treturn this.childCount === 0 ? 0 : null;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/containerelement.js\n// module id = 41\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module image/image/utils\n */\n\nimport { toWidget, isWidget } from '@ckeditor/ckeditor5-widget/src/utils';\nimport ModelElement from '@ckeditor/ckeditor5-engine/src/model/element';\n\nconst imageSymbol = Symbol( 'isImage' );\n\n/**\n * Converts given {@link module:engine/view/element~Element} to image widget:\n * * adds {@link module:engine/view/element~Element#setCustomProperty custom property} allowing to recognize image widget element,\n * * calls {@link module:widget/utils~toWidget toWidget} function with proper element's label creator.\n *\n * @param {module:engine/view/element~Element} viewElement\n * @param {String} label Element's label. It will be concatenated with image's `alt` attribute if one is present.\n * @returns {module:engine/view/element~Element}\n */\nexport function toImageWidget( viewElement, label ) {\n\tviewElement.setCustomProperty( imageSymbol, true );\n\n\treturn toWidget( viewElement, { label: labelCreator } );\n\n\tfunction labelCreator() {\n\t\tconst imgElement = viewElement.getChild( 0 );\n\t\tconst altText = imgElement.getAttribute( 'alt' );\n\n\t\treturn altText ? `${ altText } ${ label }` : label;\n\t}\n}\n\n/**\n * Checks if given view element is an image widget.\n *\n * @param {module:engine/view/element~Element} viewElement\n * @returns {Boolean}\n */\nexport function isImageWidget( viewElement ) {\n\treturn !!viewElement.getCustomProperty( imageSymbol ) && isWidget( viewElement );\n}\n\n/**\n * Checks if provided modelElement is an instance of {@link module:engine/model/element~Element Element} and its name\n * is `image`.\n *\n * @param {module:engine/model/element~Element} modelElement\n * @returns {Boolean}\n */\nexport function isImage( modelElement ) {\n\treturn modelElement instanceof ModelElement && modelElement.name == 'image';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-image/src/image/utils.js\n// module id = 42\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/isiterable\n */\n\n/**\n * Checks if value implements iterator interface.\n *\n * @param {*} value The value to check.\n * @returns {Boolean} True if value implements iterator interface.\n */\nexport default function isIterable( value ) {\n\treturn !!( value && value[ Symbol.iterator ] );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/isiterable.js\n// module id = 43\n// module chunks = 0","import SetCache from './_SetCache';\nimport arrayIncludes from './_arrayIncludes';\nimport arrayIncludesWith from './_arrayIncludesWith';\nimport cacheHas from './_cacheHas';\nimport createSet from './_createSet';\nimport setToArray from './_setToArray';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseUniq;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseUniq.js\n// module id = 44\n// module chunks = 0","export { default } from './assignIn'\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/extend.js\n// module id = 45\n// module chunks = 0","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nexport default isObjectLike;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isObjectLike.js\n// module id = 46\n// module chunks = 0","import isObjectLike from './isObjectLike';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified,\n * else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\nexport default isSymbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isSymbol.js\n// module id = 47\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* global console */\n\n/**\n * @module utils/log\n */\n\n/**\n * The logging module.\n *\n * This object features two functions that should be used across CKEditor code base to log errors and warnings.\n * Despite being an overridable interface for native `console.*` this module serves also the goal to limit the\n * code size of a minified CKEditor package. During minification process the messages will be shortened and\n * links to their documentation will be logged to the console.\n *\n * All errors and warning should be documented in the following way:\n *\n *\t\t/**\n *\t\t * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.\n *\t\t *\n *\t\t * @error plugin-load\n *\t\t * @param pluginName The name of the plugin that could not be loaded.\n *\t\t * @param moduleName The name of the module which tried to load this plugin.\n *\t\t * /\n *\t\tlog.error( 'plugin-load: It was not possible to load the \"{$pluginName}\" plugin in module \"{$moduleName}', {\n *\t\t\tpluginName: 'foo',\n *\t\t\tmoduleName: 'bar'\n *\t\t} );\n *\n * ### Warning vs Error vs Throw\n *\n * * Whenever a potentially incorrect situation occurs, which does not directly lead to an incorrect behavior,\n * log a warning.\n * * Whenever an incorrect situation occurs, but the app may continue working (although perhaps incorrectly),\n * log an error.\n * * Whenever it's really bad and it does not make sense to continue working, throw a {@link module:utils/ckeditorerror~CKEditorError}.\n *\n * @namespace\n */\nconst log = {\n\t/**\n\t * Logs an error to the console.\n\t *\n\t * Read more about error logging in the {@link module:utils/log} module.\n\t *\n\t * @param {String} message The error message in an `error-name: Error message.` format.\n\t * During the minification process the \"Error message\" part will be removed to limit the code size\n\t * and a link to this error documentation will be logged to the console.\n\t * @param {Object} [data] Additional data describing the error.\n\t */\n\terror( message, data ) {\n\t\tconsole.error( message, data );\n\t},\n\n\t/**\n\t * Logs a warning to the console.\n\t *\n\t * Read more about error logging in the {@link module:utils/log} module.\n\t *\n\t * @param {String} message The warning message in a `warning-name: Warning message.` format.\n\t * During the minification process the \"Warning message\" part will be removed to limit the code size\n\t * and a link to this error documentation will be logged to the console.\n\t * @param {Object} [data] Additional data describing the warning.\n\t */\n\twarn( message, data ) {\n\t\tconsole.warn( message, data );\n\t}\n};\n\nexport default log;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/log.js\n// module id = 48\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module module:engine/model/documentfragment\n */\n\nimport NodeList from './nodelist';\nimport Element from './element';\nimport Text from './text';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\n\n/**\n * DocumentFragment represents a part of model which does not have a common root but it's top-level nodes\n * can be seen as siblings. In other words, it is a detached part of model tree, without a root.\n *\n * DocumentFragment has own {@link module:engine/model/markercollection~MarkerCollection}. Markers from this collection\n * will be set to the {@link module:engine/model/document~Document#markers document markers} by a\n * {@link module:engine/model/writer~writer.insert} function.\n */\nexport default class DocumentFragment {\n\t/**\n\t * Creates an empty `DocumentFragment`.\n\t *\n\t * @param {module:engine/model/node~Node|Iterable.} [children]\n\t * Nodes to be contained inside the `DocumentFragment`.\n\t */\n\tconstructor( children ) {\n\t\t/**\n\t\t * DocumentFragment static markers map. This is a list of names and {@link module:engine/model/range~Range ranges}\n\t\t * which will be set as Markers to {@link module:engine/model/document~Document#markers document markers collection}\n\t\t * when DocumentFragment will be inserted to the document.\n\t\t *\n\t\t * @member {Map} module:engine/model/documentfragment~DocumentFragment#markers\n\t\t */\n\t\tthis.markers = new Map();\n\n\t\t/**\n\t\t * List of nodes contained inside the document fragment.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/nodelist~NodeList} module:engine/model/documentfragment~DocumentFragment#_children\n\t\t */\n\t\tthis._children = new NodeList();\n\n\t\tif ( children ) {\n\t\t\tthis.insertChildren( 0, children );\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all nodes contained inside this document fragment.\n\t *\n\t * @returns {Iterator.}\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this.getChildren();\n\t}\n\n\t/**\n\t * Number of this document fragment's children.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget childCount() {\n\t\treturn this._children.length;\n\t}\n\n\t/**\n\t * Sum of {module:engine/model/node~Node#offsetSize offset sizes} of all of this document fragment's children.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget maxOffset() {\n\t\treturn this._children.maxOffset;\n\t}\n\n\t/**\n\t * Is `true` if there are no nodes inside this document fragment, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isEmpty() {\n\t\treturn this.childCount === 0;\n\t}\n\n\t/**\n\t * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n\t *\n\t * @readonly\n\t * @type {null}\n\t */\n\tget parent() {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Checks whether given model tree object is of given type.\n\t *\n\t * Read more in {@link module:engine/model/node~Node#is}.\n\t *\n\t * @param {String} type\n\t * @returns {Boolean}\n\t */\n\tis( type ) {\n\t\treturn type == 'documentFragment';\n\t}\n\n\t/**\n\t * Gets the child at the given index. Returns `null` if incorrect index was passed.\n\t *\n\t * @param {Number} index Index of child.\n\t * @returns {module:engine/model/node~Node|null} Child node.\n\t */\n\tgetChild( index ) {\n\t\treturn this._children.getNode( index );\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all of this document fragment's children.\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetChildren() {\n\t\treturn this._children[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Returns an index of the given child node. Returns `null` if given node is not a child of this document fragment.\n\t *\n\t * @param {module:engine/model/node~Node} node Child node to look for.\n\t * @returns {Number|null} Child node's index.\n\t */\n\tgetChildIndex( node ) {\n\t\treturn this._children.getNodeIndex( node );\n\t}\n\n\t/**\n\t * Returns the starting offset of given child. Starting offset is equal to the sum of\n\t * {module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if\n\t * given node is not a child of this document fragment.\n\t *\n\t * @param {module:engine/model/node~Node} node Child node to look for.\n\t * @returns {Number|null} Child node's starting offset.\n\t */\n\tgetChildStartOffset( node ) {\n\t\treturn this._children.getNodeStartOffset( node );\n\t}\n\n\t/**\n\t * Returns path to a `DocumentFragment`, which is an empty array. Added for compatibility reasons.\n\t *\n\t * @returns {Array}\n\t */\n\tgetPath() {\n\t\treturn [];\n\t}\n\n\t/**\n\t * Converts offset \"position\" to index \"position\".\n\t *\n\t * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is\n\t * too high, returns index after last child}.\n\t *\n\t *\t\tconst textNode = new Text( 'foo' );\n\t *\t\tconst pElement = new Element( 'p' );\n\t *\t\tconst docFrag = new DocumentFragment( [ textNode, pElement ] );\n\t *\t\tdocFrag.offsetToIndex( -1 ); // Returns 0, because offset is too low.\n\t *\t\tdocFrag.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.\n\t *\t\tdocFrag.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.\n\t *\t\tdocFrag.offsetToIndex( 2 ); // Returns 0.\n\t *\t\tdocFrag.offsetToIndex( 3 ); // Returns 1.\n\t *\t\tdocFrag.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.\n\t *\n\t * @param {Number} offset Offset to look for.\n\t * @returns {Number} Index of a node that occupies given offset.\n\t */\n\toffsetToIndex( offset ) {\n\t\treturn this._children.offsetToIndex( offset );\n\t}\n\n\t/**\n\t * {@link #insertChildren Inserts} one or more nodes at the end of this document fragment.\n\t *\n\t * @param {module:engine/model/node~Node|Iterable.} nodes Nodes to be inserted.\n\t */\n\tappendChildren( nodes ) {\n\t\tthis.insertChildren( this.childCount, nodes );\n\t}\n\n\t/**\n\t * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes\n\t * to this document fragment.\n\t *\n\t * @param {Number} index Index at which nodes should be inserted.\n\t * @param {module:engine/model/node~Node|Iterable.} nodes Nodes to be inserted.\n\t */\n\tinsertChildren( index, nodes ) {\n\t\tnodes = normalize( nodes );\n\n\t\tfor ( let node of nodes ) {\n\t\t\tnode.parent = this;\n\t\t}\n\n\t\tthis._children.insertNodes( index, nodes );\n\t}\n\n\t/**\n\t * Removes one or more nodes starting at the given index\n\t * and sets {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.\n\t *\n\t * @param {Number} index Index of the first node to remove.\n\t * @param {Number} [howMany=1] Number of nodes to remove.\n\t * @returns {Array.} Array containing removed nodes.\n\t */\n\tremoveChildren( index, howMany = 1 ) {\n\t\tconst nodes = this._children.removeNodes( index, howMany );\n\n\t\tfor ( let node of nodes ) {\n\t\t\tnode.parent = null;\n\t\t}\n\n\t\treturn nodes;\n\t}\n\n\t/**\n\t * Converts `DocumentFragment` instance to plain object and returns it.\n\t * Takes care of converting all of this document fragment's children.\n\t *\n\t * @returns {Object} `DocumentFragment` instance converted to plain object.\n\t */\n\ttoJSON() {\n\t\tlet json = [];\n\n\t\tfor ( let node of this._children ) {\n\t\t\tjson.push( node.toJSON() );\n\t\t}\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Creates a `DocumentFragment` instance from given plain object (i.e. parsed JSON string).\n\t * Converts `DocumentFragment` children to proper nodes.\n\t *\n\t * @param {Object} json Plain object to be converted to `DocumentFragment`.\n\t * @returns {module:engine/model/documentfragment~DocumentFragment} `DocumentFragment` instance created using given plain object.\n\t */\n\tstatic fromJSON( json ) {\n\t\tlet children = [];\n\n\t\tfor ( let child of json ) {\n\t\t\tif ( child.name ) {\n\t\t\t\t// If child has name property, it is an Element.\n\t\t\t\tchildren.push( Element.fromJSON( child ) );\n\t\t\t} else {\n\t\t\t\t// Otherwise, it is a Text node.\n\t\t\t\tchildren.push( Text.fromJSON( child ) );\n\t\t\t}\n\t\t}\n\n\t\treturn new DocumentFragment( children );\n\t}\n}\n\n// Converts strings to Text and non-iterables to arrays.\n//\n// @param {String|module:engine/model/node~Node|Iterable.}\n// @return {Iterable.}\nfunction normalize( nodes ) {\n\t// Separate condition because string is iterable.\n\tif ( typeof nodes == 'string' ) {\n\t\treturn [ new Text( nodes ) ];\n\t}\n\n\tif ( !isIterable( nodes ) ) {\n\t\tnodes = [ nodes ];\n\t}\n\n\t// Array.from to enable .map() on non-arrays.\n\treturn Array.from( nodes ).map( ( node ) => typeof node == 'string' ? new Text( node ) : node );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/documentfragment.js\n// module id = 49\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/observer/observer\n */\n\nimport DomEmitterMixin from '@ckeditor/ckeditor5-utils/src/dom/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * Abstract base observer class. Observers are classes which observe changes on DOM elements, do the preliminary\n * processing and fire events on the {@link module:engine/view/document~Document} objects. Observers can also add features to the view,\n * for instance by updating its status or marking elements which need refresh on DOM events.\n *\n * @abstract\n */\nexport default class Observer {\n\t/**\n\t * Creates an instance of the observer.\n\t *\n\t * @param {module:engine/view/document~Document} document\n\t */\n\tconstructor( document ) {\n\t\t/**\n\t\t * Reference to the {@link module:engine/view/document~Document} object.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/document~Document}\n\t\t */\n\t\tthis.document = document;\n\n\t\t/**\n\t\t * State of the observer. If it is disabled events will not be fired.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis.isEnabled = false;\n\t}\n\n\t/**\n\t * Enables the observer. This method is called when then observer is registered to the\n\t * {@link module:engine/view/document~Document} and after {@link module:engine/view/document~Document#render rendering}\n\t * (all observers are {@link #disable disabled} before rendering).\n\t *\n\t * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.\n\t * However, a child class may not need to be disabled, so it can implement an empty method.\n\t *\n\t * @see module:engine/view/observer/observer~Observer#disable\n\t */\n\tenable() {\n\t\tthis.isEnabled = true;\n\t}\n\n\t/**\n\t * Disables the observer. This method is called before\n\t * {@link module:engine/view/document~Document#render rendering} to prevent firing events during rendering.\n\t *\n\t * @see module:engine/view/observer/observer~Observer#enable\n\t */\n\tdisable() {\n\t\tthis.isEnabled = false;\n\t}\n\n\t/**\n\t * Disables and destroys the observer, among others removes event listeners created by the observer.\n\t */\n\tdestroy() {\n\t\tthis.disable();\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Starts observing the given root element.\n\t *\n\t * @method #observe\n\t * @param {HTMLElement} domElement\n\t * @param {String} name The name of the root element.\n\t */\n}\n\nmix( Observer, DomEmitterMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/observer/observer.js\n// module id = 50\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/treewalker\n */\n\nimport Element from './element';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport Position from './position';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Position iterator class. It allows to iterate forward and backward over the document.\n */\nexport default class TreeWalker {\n\t/**\n\t * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.\n\t *\n\t * @constructor\n\t * @param {Object} options Object with configuration.\n\t * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.\n\t * @param {module:engine/view/position~Position} [options.startPosition] Starting position.\n\t * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.\n\t * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all characters from\n\t * {@link module:engine/view/text~Text} should be returned as one {@link module:engine/view/text~Text} (`false`) ore one by one as\n\t * {@link module:engine/view/textproxy~TextProxy} (`true`).\n\t * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the\n\t * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.\n\t * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`\n\t * tags. If the option is true walker will not return a parent node of start position. If this option is `true`\n\t * each {@link module:engine/view/element~Element} will be returned once, while if the option is `false` they might be returned\n\t * twice: for `'elementStart'` and `'elementEnd'`.\n\t */\n\tconstructor( options = {} ) {\n\t\tif ( !options.boundaries && !options.startPosition ) {\n\t\t\t/**\n\t\t\t * Neither boundaries nor starting position have been defined.\n\t\t\t *\n\t\t\t * @error tree-walker-no-start-position\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.' );\n\t\t}\n\n\t\tif ( options.direction && options.direction != 'forward' && options.direction != 'backward' ) {\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',\n\t\t\t\t{ direction: options.direction }\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Iterator boundaries.\n\t\t *\n\t\t * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`\n\t\t * on the start of boundary, then `{ done: true }` is returned.\n\t\t *\n\t\t * If boundaries are not defined they are set before first and after last child of the root node.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/range~Range} module:engine/view/treewalker~TreeWalker#boundaries\n\t\t */\n\t\tthis.boundaries = options.boundaries || null;\n\n\t\t/**\n\t\t * Iterator position. If start position is not defined then position depends on {@link #direction}. If direction is\n\t\t * `'forward'` position starts form the beginning, when direction is `'backward'` position starts from the end.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/position~Position} module:engine/view/treewalker~TreeWalker#position\n\t\t */\n\t\tif ( options.startPosition ) {\n\t\t\tthis.position = Position.createFromPosition( options.startPosition );\n\t\t} else {\n\t\t\tthis.position = Position.createFromPosition( options.boundaries[ options.direction == 'backward' ? 'end' : 'start' ] );\n\t\t}\n\n\t\t/**\n\t\t * Walking direction. Defaults `'forward'`.\n\t\t *\n\t\t * @readonly\n\t\t * @member {'backward'|'forward'} module:engine/view/treewalker~TreeWalker#direction\n\t\t */\n\t\tthis.direction = options.direction || 'forward';\n\n\t\t/**\n\t\t * Flag indicating whether all characters from {@link module:engine/view/text~Text} should be returned as one\n\t\t * {@link module:engine/view/text~Text} or one by one as {@link module:engine/view/textproxy~TextProxy}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean} module:engine/view/treewalker~TreeWalker#singleCharacters\n\t\t */\n\t\tthis.singleCharacters = !!options.singleCharacters;\n\n\t\t/**\n\t\t * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any\n\t\t * iterated node will not be returned along with `elementEnd` tag.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean} module:engine/view/treewalker~TreeWalker#shallow\n\t\t */\n\t\tthis.shallow = !!options.shallow;\n\n\t\t/**\n\t\t * Flag indicating whether iterator should ignore `elementEnd` tags. If set to `true`, walker will not\n\t\t * return a parent node of the start position. Each {@link module:engine/view/element~Element} will be returned once.\n\t\t * When set to `false` each element might be returned twice: for `'elementStart'` and `'elementEnd'`.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean} module:engine/view/treewalker~TreeWalker#ignoreElementEnd\n\t\t */\n\t\tthis.ignoreElementEnd = !!options.ignoreElementEnd;\n\n\t\t/**\n\t\t * Start boundary parent.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryStartParent\n\t\t */\n\t\tthis._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;\n\n\t\t/**\n\t\t * End boundary parent.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryEndParent\n\t\t */\n\t\tthis._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;\n\t}\n\n\t/**\n\t * Iterator interface.\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.\n\t *\n\t * For example:\n\t *\n\t * \t\twalker.skip( value => value.type == 'text' ); //

{}foo

->

foo[]

\n\t * \t\twalker.skip( value => true ); // Move the position to the end:

{}foo

->

foo

[]\n\t * \t\twalker.skip( value => false ); // Do not move the position.\n\t *\n\t * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should\n\t * return `true` if the value should be skipped or `false` if not.\n\t */\n\tskip( skip ) {\n\t\tlet done, value, prevPosition;\n\n\t\tdo {\n\t\t\tprevPosition = this.position;\n\n\t\t\t( { done, value } = this.next() );\n\t\t} while ( !done && skip( value ) );\n\n\t\tif ( !done ) {\n\t\t\tthis.position = prevPosition;\n\t\t}\n\t}\n\n\t/**\n\t * Iterator interface method.\n\t * Detects walking direction and makes step forward or backward.\n\t *\n\t * @returns {Object} Object implementing iterator interface, returning information about taken step.\n\t */\n\tnext() {\n\t\tif ( this.direction == 'forward' ) {\n\t\t\treturn this._next();\n\t\t} else {\n\t\t\treturn this._previous();\n\t\t}\n\t}\n\n\t/**\n\t * Makes a step forward in view. Moves the {@link #position} to the next position and returns the encountered value.\n\t *\n\t * @private\n\t * @returns {Object}\n\t * @returns {Boolean} return.done `true` if iterator is done, `false` otherwise.\n\t * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.\n\t */\n\t_next() {\n\t\tlet position = Position.createFromPosition( this.position );\n\t\tconst previousPosition = this.position;\n\t\tconst parent = position.parent;\n\n\t\t// We are at the end of the root.\n\t\tif ( parent.parent === null && position.offset === parent.childCount ) {\n\t\t\treturn { done: true };\n\t\t}\n\n\t\t// We reached the walker boundary.\n\t\tif ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {\n\t\t\treturn { done: true };\n\t\t}\n\n\t\t// Get node just after current position.\n\t\tlet node;\n\n\t\t// Text is a specific parent because it contains string instead of child nodes.\n\t\tif ( parent instanceof Text ) {\n\t\t\tif ( position.isAtEnd ) {\n\t\t\t\t// Prevent returning \"elementEnd\" for Text node. Skip that value and return the next walker step.\n\t\t\t\tthis.position = Position.createAfter( parent );\n\n\t\t\t\treturn this._next();\n\t\t\t}\n\n\t\t\tnode = parent.data[ position.offset ];\n\t\t} else {\n\t\t\tnode = parent.getChild( position.offset );\n\t\t}\n\n\t\tif ( node instanceof Element ) {\n\t\t\tif ( !this.shallow ) {\n\t\t\t\tposition = new Position( node, 0 );\n\t\t\t} else {\n\t\t\t\tposition.offset++;\n\t\t\t}\n\n\t\t\tthis.position = position;\n\n\t\t\treturn this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );\n\t\t} else if ( node instanceof Text ) {\n\t\t\tif ( this.singleCharacters ) {\n\t\t\t\tposition = new Position( node, 0 );\n\t\t\t\tthis.position = position;\n\n\t\t\t\treturn this._next();\n\t\t\t} else {\n\t\t\t\tlet charactersCount = node.data.length;\n\t\t\t\tlet item = node;\n\n\t\t\t\t// If text stick out of walker range, we need to cut it and wrap by TextProxy.\n\t\t\t\tif ( node == this._boundaryEndParent ) {\n\t\t\t\t\tcharactersCount = this.boundaries.end.offset;\n\t\t\t\t\titem = new TextProxy( node, 0, charactersCount );\n\t\t\t\t\tposition = Position.createAfter( item );\n\t\t\t\t} else {\n\t\t\t\t\t// If not just keep moving forward.\n\t\t\t\t\tposition.offset++;\n\t\t\t\t}\n\n\t\t\t\tthis.position = position;\n\n\t\t\t\treturn this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );\n\t\t\t}\n\t\t} else if ( typeof node == 'string' ) {\n\t\t\tlet textLength;\n\n\t\t\tif ( this.singleCharacters ) {\n\t\t\t\ttextLength = 1;\n\t\t\t} else {\n\t\t\t\t// Check if text stick out of walker range.\n\t\t\t\tconst endOffset = parent === this._boundaryEndParent ? this.boundaries.end.offset : parent.data.length;\n\n\t\t\t\ttextLength = endOffset - position.offset;\n\t\t\t}\n\n\t\t\tconst textProxy = new TextProxy( parent, position.offset, textLength );\n\n\t\t\tposition.offset += textLength;\n\t\t\tthis.position = position;\n\n\t\t\treturn this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );\n\t\t} else {\n\t\t\t// `node` is not set, we reached the end of current `parent`.\n\t\t\tposition = Position.createAfter( parent );\n\t\t\tthis.position = position;\n\n\t\t\tif ( this.ignoreElementEnd ) {\n\t\t\t\treturn this._next();\n\t\t\t} else {\n\t\t\t\treturn this._formatReturnValue( 'elementEnd', parent, previousPosition, position );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Makes a step backward in view. Moves the {@link #position} to the previous position and returns the encountered value.\n\t *\n\t * @private\n\t * @returns {Object}\n\t * @returns {Boolean} return.done True if iterator is done.\n\t * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.\n\t */\n\t_previous() {\n\t\tlet position = Position.createFromPosition( this.position );\n\t\tconst previousPosition = this.position;\n\t\tconst parent = position.parent;\n\n\t\t// We are at the beginning of the root.\n\t\tif ( parent.parent === null && position.offset === 0 ) {\n\t\t\treturn { done: true };\n\t\t}\n\n\t\t// We reached the walker boundary.\n\t\tif ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {\n\t\t\treturn { done: true };\n\t\t}\n\n\t\t// Get node just before current position.\n\t\tlet node;\n\n\t\t// Text {@link module:engine/view/text~Text} element is a specific parent because contains string instead of child nodes.\n\t\tif ( parent instanceof Text ) {\n\t\t\tif ( position.isAtStart ) {\n\t\t\t\t// Prevent returning \"elementStart\" for Text node. Skip that value and return the next walker step.\n\t\t\t\tthis.position = Position.createBefore( parent );\n\n\t\t\t\treturn this._previous();\n\t\t\t}\n\n\t\t\tnode = parent.data[ position.offset - 1 ];\n\t\t} else {\n\t\t\tnode = parent.getChild( position.offset - 1 );\n\t\t}\n\n\t\tif ( node instanceof Element ) {\n\t\t\tif ( !this.shallow ) {\n\t\t\t\tposition = new Position( node, node.childCount );\n\t\t\t\tthis.position = position;\n\n\t\t\t\tif ( this.ignoreElementEnd ) {\n\t\t\t\t\treturn this._previous();\n\t\t\t\t} else {\n\t\t\t\t\treturn this._formatReturnValue( 'elementEnd', node, previousPosition, position );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tposition.offset--;\n\t\t\t\tthis.position = position;\n\n\t\t\t\treturn this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );\n\t\t\t}\n\t\t} else if ( node instanceof Text ) {\n\t\t\tif ( this.singleCharacters ) {\n\t\t\t\tposition = new Position( node, node.data.length );\n\t\t\t\tthis.position = position;\n\n\t\t\t\treturn this._previous();\n\t\t\t} else {\n\t\t\t\tlet charactersCount = node.data.length;\n\t\t\t\tlet item = node;\n\n\t\t\t\t// If text stick out of walker range, we need to cut it and wrap by TextProxy.\n\t\t\t\tif ( node == this._boundaryStartParent ) {\n\t\t\t\t\tconst offset = this.boundaries.start.offset;\n\n\t\t\t\t\titem = new TextProxy( node, offset, node.data.length - offset );\n\t\t\t\t\tcharactersCount = item.data.length;\n\t\t\t\t\tposition = Position.createBefore( item );\n\t\t\t\t} else {\n\t\t\t\t\t// If not just keep moving backward.\n\t\t\t\t\tposition.offset--;\n\t\t\t\t}\n\n\t\t\t\tthis.position = position;\n\n\t\t\t\treturn this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );\n\t\t\t}\n\t\t} else if ( typeof node == 'string' ) {\n\t\t\tlet textLength;\n\n\t\t\tif ( !this.singleCharacters ) {\n\t\t\t\t// Check if text stick out of walker range.\n\t\t\t\tconst startOffset = parent === this._boundaryStartParent ? this.boundaries.start.offset : 0;\n\n\t\t\t\ttextLength = position.offset - startOffset;\n\t\t\t} else {\n\t\t\t\ttextLength = 1;\n\t\t\t}\n\n\t\t\tposition.offset -= textLength;\n\n\t\t\tconst textProxy = new TextProxy( parent, position.offset, textLength );\n\n\t\t\tthis.position = position;\n\n\t\t\treturn this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );\n\t\t} else {\n\t\t\t// `node` is not set, we reached the beginning of current `parent`.\n\t\t\tposition = Position.createBefore( parent );\n\t\t\tthis.position = position;\n\n\t\t\treturn this._formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );\n\t\t}\n\t}\n\n\t/**\n\t * Format returned data and adjust `previousPosition` and `nextPosition` if reach the bound of the {@link module:engine/view/text~Text}.\n\t *\n\t * @private\n\t * @param {module:engine/view/treewalker~TreeWalkerValueType} type Type of step.\n\t * @param {module:engine/view/item~Item} item Item between old and new position.\n\t * @param {module:engine/view/position~Position} previousPosition Previous position of iterator.\n\t * @param {module:engine/view/position~Position} nextPosition Next position of iterator.\n\t * @param {Number} [length] Length of the item.\n\t * @returns {module:engine/view/treewalker~TreeWalkerValue}\n\t */\n\t_formatReturnValue( type, item, previousPosition, nextPosition, length ) {\n\t\t// Text is a specific parent, because contains string instead of children.\n\t\t// Walker doesn't enter to the Text except situations when walker is iterating over every single character,\n\t\t// or the bound starts/ends inside the Text. So when the position is at the beginning or at the end of the Text\n\t\t// we move it just before or just after Text.\n\t\tif ( item instanceof TextProxy ) {\n\t\t\t// Position is at the end of Text.\n\t\t\tif ( item.offsetInText + item.data.length == item.textNode.data.length ) {\n\t\t\t\tif ( this.direction == 'forward' && !( this.boundaries && this.boundaries.end.isEqual( this.position ) ) ) {\n\t\t\t\t\tnextPosition = Position.createAfter( item.textNode );\n\t\t\t\t\t// When we change nextPosition of returned value we need also update walker current position.\n\t\t\t\t\tthis.position = nextPosition;\n\t\t\t\t} else {\n\t\t\t\t\tpreviousPosition = Position.createAfter( item.textNode );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Position is at the begining ot the text.\n\t\t\tif ( item.offsetInText === 0 ) {\n\t\t\t\tif ( this.direction == 'backward' && !( this.boundaries && this.boundaries.start.isEqual( this.position ) ) ) {\n\t\t\t\t\tnextPosition = Position.createBefore( item.textNode );\n\t\t\t\t\t// When we change nextPosition of returned value we need also update walker current position.\n\t\t\t\t\tthis.position = nextPosition;\n\t\t\t\t} else {\n\t\t\t\t\tpreviousPosition = Position.createBefore( item.textNode );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdone: false,\n\t\t\tvalue: {\n\t\t\t\ttype: type,\n\t\t\t\titem: item,\n\t\t\t\tpreviousPosition: previousPosition,\n\t\t\t\tnextPosition: nextPosition,\n\t\t\t\tlength: length\n\t\t\t}\n\t\t};\n\t}\n}\n\n/**\n * Type of the step made by {@link module:engine/view/treewalker~TreeWalker}.\n * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end\n * of node, or `'text'` if walker traversed over single and multiple characters.\n * For {@link module:engine/view/text~Text} `elementStart` and `elementEnd` is not returned.\n *\n * @typedef {String} module:engine/view/treewalker~TreeWalkerValueType\n */\n\n/**\n * Object returned by {@link module:engine/view/treewalker~TreeWalker} when traversing tree view.\n *\n * @typedef {Object} module:engine/view/treewalker~TreeWalkerValue\n * @property {module:engine/view/treewalker~TreeWalkerValueType} type\n * @property {module:engine/view/item~Item} item Item between old and new positions of {@link module:engine/view/treewalker~TreeWalker}.\n * @property {module:engine/view/position~Position} previousPosition Previous position of the iterator.\n * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the\n * position before the item. Note that it is more efficient to use this position then calculate the position before\n * the node using {@link module:engine/view/position~Position.createBefore}.\n * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is\n * the position after item.\n * * If the position is at the beginning or at the end of the {@link module:engine/view/text~Text} it is always moved from the\n * inside of the Text to its parent just before or just after Text.\n * @property {module:engine/view/position~Position} nextPosition Next position of the iterator.\n * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is\n * the position after the item.\n * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position\n * before the item.\n * * If the position is at the beginning or at the end of the {@link module:engine/view/text~Text} it is always moved from the\n * inside of the Text to its parent just before or just after Text.\n * @property {Number} [length] Length of the item. For `'elementStart'` it is 1. For `'text'` it is\n * the length of the text. For `'elementEnd'` it is undefined.\n */\n\n/**\n * Tree walking directions.\n *\n * @typedef {'forward'|'backward'} module:engine/view/treewalker~TreeWalkerDirection\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/treewalker.js\n// module id = 51\n// module chunks = 0","import isNative from './isNative';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = object[key];\n return isNative(value) ? value : undefined;\n}\n\nexport default getNative;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getNative.js\n// module id = 52\n// module chunks = 0","import isArray from './isArray';\nimport isSymbol from './isSymbol';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isKey.js\n// module id = 53\n// module chunks = 0","import isSymbol from './isSymbol';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_toKey.js\n// module id = 54\n// module chunks = 0","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/eq.js\n// module id = 55\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/node\n */\n\nimport toMap from '@ckeditor/ckeditor5-utils/src/tomap';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Model node. Most basic structure of model tree.\n *\n * This is an abstract class that is a base for other classes representing different nodes in model.\n *\n * **Note:** If a node is detached from the model tree, you can manipulate it using it's API.\n * However, it is **very important** that nodes already attached to model tree should be only changed through\n * {@link module:engine/model/document~Document#batch Batch API}.\n *\n * Changes done by `Node` methods, like {@link module:engine/model/element~Element#insertChildren insertChildren} or\n * {@link module:engine/model/node~Node#setAttribute setAttribute}\n * do not generate {@link module:engine/model/operation/operation~Operation operations}\n * which are essential for correct editor work if you modify nodes in {@link module:engine/model/document~Document document} root.\n *\n * The flow of working on `Node` (and classes that inherits from it) is as such:\n * 1. You can create a `Node` instance, modify it using it's API.\n * 2. Add `Node` to the model using `Batch` API.\n * 3. Change `Node` that was already added to the model using `Batch` API.\n *\n * Similarly, you cannot use `Batch` API on a node that has not been added to the model tree, with the exception\n * of {@link module:engine/model/batch~Batch#insert inserting} that node to the model tree.\n *\n * Be aware that using {@link module:engine/model/batch~Batch#remove remove from Batch API} does not allow to use `Node` API because\n * the information about `Node` is still kept in model document.\n *\n * In case of {@link module:engine/model/element~Element element node}, adding and removing children also counts as changing a node and\n * follows same rules.\n */\nexport default class Node {\n\t/**\n\t * Creates a model node.\n\t *\n\t * This is an abstract class, so this constructor should not be used directly.\n\t *\n\t * @abstract\n\t * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n\t */\n\tconstructor( attrs ) {\n\t\t/**\n\t\t * Parent of this node. It could be {@link module:engine/model/element~Element}\n\t\t * or {@link module:engine/model/documentfragment~DocumentFragment}.\n\t\t * Equals to `null` if the node has no parent.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}\n\t\t */\n\t\tthis.parent = null;\n\n\t\t/**\n\t\t * Attributes set on this node.\n\t\t *\n\t\t * @private\n\t\t * @member {Map} module:engine/model/node~Node#_attrs\n\t\t */\n\t\tthis._attrs = toMap( attrs );\n\t}\n\n\t/**\n\t * Index of this node in it's parent or `null` if the node has no parent.\n\t *\n\t * Accessing this property throws an error if this node's parent element does not contain it.\n\t * This means that model tree got broken.\n\t *\n\t * @readonly\n\t * @type {Number|null}\n\t */\n\tget index() {\n\t\tlet pos;\n\n\t\tif ( !this.parent ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( ( pos = this.parent.getChildIndex( this ) ) === null ) {\n\t\t\t/**\n\t\t\t * The node's parent does not contain this node.\n\t\t\t *\n\t\t\t * @error node-not-found-in-parent\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-node-not-found-in-parent: The node\\'s parent does not contain this node.' );\n\t\t}\n\n\t\treturn pos;\n\t}\n\n\t/**\n\t * Offset at which this node starts in it's parent. It is equal to the sum of {@link #offsetSize offsetSize}\n\t * of all it's previous siblings. Equals to `null` if node has no parent.\n\t *\n\t * Accessing this property throws an error if this node's parent element does not contain it.\n\t * This means that model tree got broken.\n\t *\n\t * @readonly\n\t * @type {Number|Null}\n\t */\n\tget startOffset() {\n\t\tlet pos;\n\n\t\tif ( !this.parent ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( ( pos = this.parent.getChildStartOffset( this ) ) === null ) {\n\t\t\t/**\n\t\t\t * The node's parent does not contain this node.\n\t\t\t *\n\t\t\t * @error node-not-found-in-parent\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-node-not-found-in-parent: The node\\'s parent does not contain this node.' );\n\t\t}\n\n\t\treturn pos;\n\t}\n\n\t/**\n\t * Offset size of this node. Represents how much \"offset space\" is occupied by the node in it's parent.\n\t * It is important for {@link module:engine/model/position~Position position}. When node has `offsetSize` greater than `1`, position\n\t * can be placed between that node start and end. `offsetSize` greater than `1` is for nodes that represents more\n\t * than one entity, i.e. {@link module:engine/model/text~Text text node}.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget offsetSize() {\n\t\treturn 1;\n\t}\n\n\t/**\n\t * Offset at which this node ends in it's parent. It is equal to the sum of this node's\n\t * {@link module:engine/model/node~Node#startOffset start offset} and {@link #offsetSize offset size}.\n\t * Equals to `null` if the node has no parent.\n\t *\n\t * @readonly\n\t * @type {Number|null}\n\t */\n\tget endOffset() {\n\t\tif ( !this.parent ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.startOffset + this.offsetSize;\n\t}\n\n\t/**\n\t * Node's next sibling or `null` if the node is a last child of it's parent or if the node has no parent.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/node~Node|null}\n\t */\n\tget nextSibling() {\n\t\tconst index = this.index;\n\n\t\treturn ( index !== null && this.parent.getChild( index + 1 ) ) || null;\n\t}\n\n\t/**\n\t * Node's previous sibling or `null` if the node is a first child of it's parent or if the node has no parent.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/node~Node|null}\n\t */\n\tget previousSibling() {\n\t\tconst index = this.index;\n\n\t\treturn ( index !== null && this.parent.getChild( index - 1 ) ) || null;\n\t}\n\n\t/**\n\t * The top-most ancestor of the node. If node has no parent it is the root itself. If the node is a part\n\t * of {@link module:engine/model/documentfragment~DocumentFragment}, it's `root` is equal to that `DocumentFragment`.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\tlet root = this;\n\n\t\twhile ( root.parent ) {\n\t\t\troot = root.parent;\n\t\t}\n\n\t\treturn root;\n\t}\n\n\t/**\n\t * {@link module:engine/model/document~Document Document} that owns this node or `null` if the node has no parent or is inside\n\t * a {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment}.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/document~Document|null}\n\t */\n\tget document() {\n\t\t// This is a top element of a sub-tree.\n\t\tif ( this.root == this ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Root may be `DocumentFragment` which does not have document property.\n\t\treturn this.root.document || null;\n\t}\n\n\t/**\n\t * Creates a copy of this node, that is a node with exactly same attributes, and returns it.\n\t *\n\t * @returns {module:engine/model/node~Node} Node with same attributes as this node.\n\t */\n\tclone() {\n\t\treturn new Node( this._attrs );\n\t}\n\n\t/**\n\t * Gets path to the node. The path is an array containing starting offsets of consecutive ancestors of this node,\n\t * beginning from {@link module:engine/model/node~Node#root root}, down to this node's starting offset. The path can be used to\n\t * create {@link module:engine/model/position~Position Position} instance.\n\t *\n\t *\t\tconst abc = new Text( 'abc' );\n\t *\t\tconst foo = new Text( 'foo' );\n\t *\t\tconst h1 = new Element( 'h1', null, new Text( 'header' ) );\n\t *\t\tconst p = new Element( 'p', null, [ abc, foo ] );\n\t *\t\tconst div = new Element( 'div', null, [ h1, p ] );\n\t *\t\tfoo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.\n\t *\t\th1.getPath(); // Returns [ 0 ].\n\t *\t\tdiv.getPath(); // Returns [].\n\t *\n\t * @returns {Array.} The path.\n\t */\n\tgetPath() {\n\t\tconst path = [];\n\t\tlet node = this;\n\n\t\twhile ( node.parent ) {\n\t\t\tpath.unshift( node.startOffset );\n\t\t\tnode = node.parent;\n\t\t}\n\n\t\treturn path;\n\t}\n\n\t/**\n\t * Returns ancestors array of this node.\n\t *\n\t * @param {Object} options Options object.\n\t * @param {Boolean} [options.includeNode=false] When set to `true` this node will be also included in parent's array.\n\t * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,\n\t * otherwise root element will be the first item in the array.\n\t * @returns {Array} Array with ancestors.\n\t */\n\tgetAncestors( options = { includeNode: false, parentFirst: false } ) {\n\t\tconst ancestors = [];\n\t\tlet parent = options.includeNode ? this : this.parent;\n\n\t\twhile ( parent ) {\n\t\t\tancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );\n\t\t\tparent = parent.parent;\n\t\t}\n\n\t\treturn ancestors;\n\t}\n\n\t/**\n\t * Removes this node from it's parent.\n\t */\n\tremove() {\n\t\tthis.parent.removeChildren( this.index );\n\t}\n\n\t/**\n\t * Checks if the node has an attribute with given key.\n\t *\n\t * @param {String} key Key of attribute to check.\n\t * @returns {Boolean} `true` if attribute with given key is set on node, `false` otherwise.\n\t */\n\thasAttribute( key ) {\n\t\treturn this._attrs.has( key );\n\t}\n\n\t/**\n\t * Gets an attribute value for given key or `undefined` if that attribute is not set on node.\n\t *\n\t * @param {String} key Key of attribute to look for.\n\t * @returns {*} Attribute value or `undefined`.\n\t */\n\tgetAttribute( key ) {\n\t\treturn this._attrs.get( key );\n\t}\n\n\t/**\n\t * Returns iterator that iterates over this node's attributes.\n\t *\n\t * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n\t * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n\t *\n\t * @returns {Iterable.<*>}\n\t */\n\tgetAttributes() {\n\t\treturn this._attrs.entries();\n\t}\n\n\t/**\n\t * Returns iterator that iterates over this node's attribute keys.\n\t *\n\t * @returns {Iterator.}\n\t */\n\tgetAttributeKeys() {\n\t\treturn this._attrs.keys();\n\t}\n\n\t/**\n\t * Sets attribute on the node. If attribute with the same key already is set, it's value is overwritten.\n\t *\n\t * @param {String} key Key of attribute to set.\n\t * @param {*} value Attribute value.\n\t */\n\tsetAttribute( key, value ) {\n\t\tthis._attrs.set( key, value );\n\t}\n\n\t/**\n\t * Removes all attributes from the node and sets given attributes.\n\t *\n\t * @param {Object} [attrs] Attributes to set. See {@link module:utils/tomap~toMap} for a list of accepted values.\n\t */\n\tsetAttributesTo( attrs ) {\n\t\tthis._attrs = toMap( attrs );\n\t}\n\n\t/**\n\t * Removes an attribute with given key from the node.\n\t *\n\t * @param {String} key Key of attribute to remove.\n\t * @returns {Boolean} `true` if the attribute was set on the element, `false` otherwise.\n\t */\n\tremoveAttribute( key ) {\n\t\treturn this._attrs.delete( key );\n\t}\n\n\t/**\n\t * Removes all attributes from the node.\n\t */\n\tclearAttributes() {\n\t\tthis._attrs.clear();\n\t}\n\n\t/**\n\t * Converts `Node` to plain object and returns it.\n\t *\n\t * @returns {Object} `Node` converted to plain object.\n\t */\n\ttoJSON() {\n\t\tlet json = {};\n\n\t\tif ( this._attrs.size ) {\n\t\t\tjson.attributes = [ ...this._attrs ];\n\t\t}\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Checks whether given model tree object is of given type.\n\t *\n\t * This method is useful when processing model tree objects that are of unknown type. For example, a function\n\t * may return {@link module:engine/model/documentfragment~DocumentFragment} or {@link module:engine/model/node~Node}\n\t * that can be either text node or element. This method can be used to check what kind of object is returned.\n\t *\n\t *\t\tobj.is( 'node' ); // true for any node, false for document fragment\n\t *\t\tobj.is( 'documentFragment' ); // true for document fragment, false for any node\n\t *\t\tobj.is( 'element' ); // true for any element, false for text node or document fragment\n\t *\t\tobj.is( 'element', 'paragraph' ); // true only for element which name is 'paragraph'\n\t *\t\tobj.is( 'paragraph' ); // shortcut for obj.is( 'element', 'paragraph' )\n\t *\t\tobj.is( 'text' ); // true for text node, false for element and document fragment\n\t *\t\tobj.is( 'textProxy' ); // true for text proxy object\n\t *\n\t * @method #is\n\t * @param {'element'|'rootElement'|'text'|'textProxy'|'documentFragment'} type\n\t * @returns {Boolean}\n\t */\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/node.js\n// module id = 56\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/selection\n */\n\nimport Position from './position';\nimport Element from './element';\nimport Range from './range';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport toMap from '@ckeditor/ckeditor5-utils/src/tomap';\nimport mapsEqual from '@ckeditor/ckeditor5-utils/src/mapsequal';\n\n/**\n * `Selection` is a group of {@link module:engine/model/range~Range ranges} which has a direction specified by\n * {@link module:engine/model/selection~Selection#anchor anchor} and {@link module:engine/model/selection~Selection#focus focus}.\n * Additionally, `Selection` may have it's own attributes.\n */\nexport default class Selection {\n\t/**\n\t * Creates an empty selection.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Specifies whether the last added range was added as a backward or forward range.\n\t\t *\n\t\t * @private\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis._lastRangeBackward = false;\n\n\t\t/**\n\t\t * Stores selection ranges.\n\t\t *\n\t\t * @protected\n\t\t * @member {Array.}\n\t\t */\n\t\tthis._ranges = [];\n\n\t\t/**\n\t\t * List of attributes set on current selection.\n\t\t *\n\t\t * @protected\n\t\t * @member {Map} module:engine/model/selection~Selection#_attrs\n\t\t */\n\t\tthis._attrs = new Map();\n\t}\n\n\t/**\n\t * Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.\n\t * Together with {@link #focus} they define the direction of selection, which is important\n\t * when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~Range#start start} or\n\t * {@link module:engine/model/range~Range#end end} position of the most recently added range.\n\t *\n\t * Is set to `null` if there are no ranges in selection.\n\t *\n\t * @see #focus\n\t * @readonly\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget anchor() {\n\t\tif ( this._ranges.length > 0 ) {\n\t\t\tconst range = this._ranges[ this._ranges.length - 1 ];\n\n\t\t\treturn this._lastRangeBackward ? range.end : range.start;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Selection focus. Focus is a position where the selection ends.\n\t *\n\t * Is set to `null` if there are no ranges in selection.\n\t *\n\t * @see #anchor\n\t * @readonly\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget focus() {\n\t\tif ( this._ranges.length > 0 ) {\n\t\t\tconst range = this._ranges[ this._ranges.length - 1 ];\n\n\t\t\treturn this._lastRangeBackward ? range.start : range.end;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n\t * collapsed.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isCollapsed() {\n\t\tconst length = this._ranges.length;\n\n\t\tif ( length === 1 ) {\n\t\t\treturn this._ranges[ 0 ].isCollapsed;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Returns number of ranges in selection.\n\t *\n\t * @type {Number}\n\t */\n\tget rangeCount() {\n\t\treturn this._ranges.length;\n\t}\n\n\t/**\n\t * Specifies whether the {@link #focus}\n\t * precedes {@link #anchor}.\n\t *\n\t * @type {Boolean}\n\t */\n\tget isBackward() {\n\t\treturn !this.isCollapsed && this._lastRangeBackward;\n\t}\n\n\t/**\n\t * Checks whether this selection is equal to given selection. Selections are equal if they have same directions,\n\t * same number of ranges and all ranges from one selection equal to a range from other selection.\n\t *\n\t * @param {module:engine/model/selection~Selection} otherSelection Selection to compare with.\n\t * @returns {Boolean} `true` if selections are equal, `false` otherwise.\n\t */\n\tisEqual( otherSelection ) {\n\t\tif ( this.rangeCount != otherSelection.rangeCount ) {\n\t\t\treturn false;\n\t\t} else if ( this.rangeCount === 0 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor ( let thisRange of this._ranges ) {\n\t\t\tlet found = false;\n\n\t\t\tfor ( let otherRange of otherSelection._ranges ) {\n\t\t\t\tif ( thisRange.isEqual( otherRange ) ) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !found ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over copies of selection ranges.\n\t *\n\t * @returns {Iterator.}\n\t */\n\t*getRanges() {\n\t\tfor ( let range of this._ranges ) {\n\t\t\tyield Range.createFromRange( range );\n\t\t}\n\t}\n\n\t/**\n\t * Returns a copy of the first range in the selection.\n\t * First range is the one which {@link module:engine/model/range~Range#start start} position\n\t * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges\n\t * (not to confuse with the first range added to the selection).\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/range~Range|null}\n\t */\n\tgetFirstRange() {\n\t\tlet first = null;\n\n\t\tfor ( let range of this._ranges ) {\n\t\t\tif ( !first || range.start.isBefore( first.start ) ) {\n\t\t\t\tfirst = range;\n\t\t\t}\n\t\t}\n\n\t\treturn first ? Range.createFromRange( first ) : null;\n\t}\n\n\t/**\n\t * Returns a copy of the last range in the selection.\n\t * Last range is the one which {@link module:engine/model/range~Range#end end} position\n\t * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most\n\t * recently added to the selection).\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/range~Range|null}\n\t */\n\tgetLastRange() {\n\t\tlet last = null;\n\n\t\tfor ( let range of this._ranges ) {\n\t\t\tif ( !last || range.end.isAfter( last.end ) ) {\n\t\t\t\tlast = range;\n\t\t\t}\n\t\t}\n\n\t\treturn last ? Range.createFromRange( last ) : null;\n\t}\n\n\t/**\n\t * Returns the first position in the selection.\n\t * First position is the position that {@link module:engine/model/position~Position#isBefore is before}\n\t * any other position in the selection.\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/position~Position|null}\n\t */\n\tgetFirstPosition() {\n\t\tconst first = this.getFirstRange();\n\n\t\treturn first ? Position.createFromPosition( first.start ) : null;\n\t}\n\n\t/**\n\t * Returns the last position in the selection.\n\t * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}\n\t * any other position in the selection.\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/position~Position|null}\n\t */\n\tgetLastPosition() {\n\t\tconst lastRange = this.getLastRange();\n\n\t\treturn lastRange ? Position.createFromPosition( lastRange.end ) : null;\n\t}\n\n\t/**\n\t * Adds a range to this selection. Added range is copied. This means that passed range is not saved in `Selection`\n\t * instance and operating on it will not change `Selection` state.\n\t *\n\t * Accepts a flag describing in which way the selection is made - passed range might be selected from\n\t * {@link module:engine/model/range~Range#start start} to {@link module:engine/model/range~Range#end end}\n\t * or from {@link module:engine/model/range~Range#end end}\n\t * to {@link module:engine/model/range~Range#start start}.\n\t * The flag is used to set {@link #anchor} and\n\t * {@link #focus} properties.\n\t *\n\t * @fires change:range\n\t * @param {module:engine/model/range~Range} range Range to add.\n\t * @param {Boolean} [isBackward=false] Flag describing if added range was selected forward - from start to end (`false`)\n\t * or backward - from end to start (`true`).\n\t */\n\taddRange( range, isBackward = false ) {\n\t\tthis._pushRange( range );\n\t\tthis._lastRangeBackward = !!isBackward;\n\n\t\tthis.fire( 'change:range', { directChange: true } );\n\t}\n\n\t/**\n\t * Removes all ranges that were added to the selection.\n\t *\n\t * @fires change:range\n\t */\n\tremoveAllRanges() {\n\t\tif ( this._ranges.length > 0 ) {\n\t\t\tthis._removeAllRanges();\n\t\t\tthis.fire( 'change:range', { directChange: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array\n\t * is treated like the last added range and is used to set {@link module:engine/model/selection~Selection#anchor} and\n\t * {@link module:engine/model/selection~Selection#focus}. Accepts a flag describing in which direction the selection is made\n\t * (see {@link module:engine/model/selection~Selection#addRange}).\n\t *\n\t * @fires change:range\n\t * @param {Iterable.} newRanges Ranges to set.\n\t * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end (`false`)\n\t * or backward - from end to start (`true`).\n\t */\n\tsetRanges( newRanges, isLastBackward = false ) {\n\t\tnewRanges = Array.from( newRanges );\n\n\t\t// Check whether there is any range in new ranges set that is different than all already added ranges.\n\t\tconst anyNewRange = newRanges.some( ( newRange ) => {\n\t\t\tif ( !( newRange instanceof Range ) ) {\n\t\t\t\tthrow new CKEditorError( 'model-selection-added-not-range: Trying to add an object that is not an instance of Range.' );\n\t\t\t}\n\n\t\t\treturn this._ranges.every( ( oldRange ) => {\n\t\t\t\treturn !oldRange.isEqual( newRange );\n\t\t\t} );\n\t\t} );\n\n\t\t// Don't do anything if nothing changed.\n\t\tif ( newRanges.length === this._ranges.length && !anyNewRange ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._removeAllRanges();\n\n\t\tfor ( let range of newRanges ) {\n\t\t\tthis._pushRange( range );\n\t\t}\n\n\t\tthis._lastRangeBackward = !!isLastBackward;\n\n\t\tthis.fire( 'change:range', { directChange: true } );\n\t}\n\n\t/**\n\t * Sets this selection's ranges and direction to the ranges and direction of the given selection.\n\t *\n\t * @param {module:engine/model/selection~Selection} otherSelection\n\t */\n\tsetTo( otherSelection ) {\n\t\tthis.setRanges( otherSelection.getRanges(), otherSelection.isBackward );\n\t}\n\n\t/**\n\t * Sets collapsed selection in the specified location.\n\t *\n\t * The location can be specified in the same form as {@link module:engine/model/position~Position.createAt} parameters.\n\t *\n\t * @fires change:range\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tcollapse( itemOrPosition, offset ) {\n\t\tconst pos = Position.createAt( itemOrPosition, offset );\n\t\tconst range = new Range( pos, pos );\n\n\t\tthis.setRanges( [ range ] );\n\t}\n\n\t/**\n\t * Collapses selection to the selection's {@link module:engine/model/selection~Selection#getFirstPosition first position}.\n\t * All ranges, besides the collapsed one, will be removed. Nothing will change if there are no ranges stored\n\t * inside selection.\n\t *\n\t * @fires change\n\t */\n\tcollapseToStart() {\n\t\tconst startPosition = this.getFirstPosition();\n\n\t\tif ( startPosition !== null ) {\n\t\t\tthis.setRanges( [ new Range( startPosition, startPosition ) ] );\n\t\t}\n\t}\n\n\t/**\n\t * Collapses selection to the selection's {@link module:engine/model/selection~Selection#getLastPosition last position}.\n\t * All ranges, besides the collapsed one, will be removed. Nothing will change if there are no ranges stored\n\t * inside selection.\n\t *\n\t * @fires change\n\t */\n\tcollapseToEnd() {\n\t\tconst endPosition = this.getLastPosition();\n\n\t\tif ( endPosition !== null ) {\n\t\t\tthis.setRanges( [ new Range( endPosition, endPosition ) ] );\n\t\t}\n\t}\n\n\t/**\n\t * Sets {@link module:engine/model/selection~Selection#focus} to the specified location.\n\t *\n\t * The location can be specified in the same form as {@link module:engine/model/position~Position.createAt} parameters.\n\t *\n\t * @fires change:range\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tsetFocus( itemOrPosition, offset ) {\n\t\tif ( this.anchor === null ) {\n\t\t\t/**\n\t\t\t * Cannot set selection focus if there are no ranges in selection.\n\t\t\t *\n\t\t\t * @error model-selection-setFocus-no-ranges\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.' );\n\t\t}\n\n\t\tconst newFocus = Position.createAt( itemOrPosition, offset );\n\n\t\tif ( newFocus.compareWith( this.focus ) == 'same' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst anchor = this.anchor;\n\n\t\tif ( this._ranges.length ) {\n\t\t\tthis._popRange();\n\t\t}\n\n\t\tif ( newFocus.compareWith( anchor ) == 'before' ) {\n\t\t\tthis.addRange( new Range( newFocus, anchor ), true );\n\t\t} else {\n\t\t\tthis.addRange( new Range( anchor, newFocus ) );\n\t\t}\n\t}\n\n\t/**\n\t * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.\n\t *\n\t * @param {String} key Key of attribute to look for.\n\t * @returns {*} Attribute value or `undefined`.\n\t */\n\tgetAttribute( key ) {\n\t\treturn this._attrs.get( key );\n\t}\n\n\t/**\n\t * Returns iterator that iterates over this selection's attributes.\n\t *\n\t * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n\t * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n\t *\n\t * @returns {Iterable.<*>}\n\t */\n\tgetAttributes() {\n\t\treturn this._attrs.entries();\n\t}\n\n\t/**\n\t * Returns iterator that iterates over this selection's attribute keys.\n\t *\n\t * @returns {Iterator.}\n\t */\n\tgetAttributeKeys() {\n\t\treturn this._attrs.keys();\n\t}\n\n\t/**\n\t * Checks if the selection has an attribute for given key.\n\t *\n\t * @param {String} key Key of attribute to check.\n\t * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.\n\t */\n\thasAttribute( key ) {\n\t\treturn this._attrs.has( key );\n\t}\n\n\t/**\n\t * Removes all attributes from the selection.\n\t *\n\t * If there were any attributes in selection, fires the {@link #event:change} event with\n\t * removed attributes' keys.\n\t *\n\t * @fires change:attribute\n\t */\n\tclearAttributes() {\n\t\tif ( this._attrs.size > 0 ) {\n\t\t\tconst attributeKeys = Array.from( this._attrs.keys() );\n\t\t\tthis._attrs.clear();\n\n\t\t\tthis.fire( 'change:attribute', { attributeKeys, directChange: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Removes an attribute with given key from the selection.\n\t *\n\t * If given attribute was set on the selection, fires the {@link #event:change} event with\n\t * removed attribute key.\n\t *\n\t * @fires change:attribute\n\t * @param {String} key Key of attribute to remove.\n\t */\n\tremoveAttribute( key ) {\n\t\tif ( this.hasAttribute( key ) ) {\n\t\t\tthis._attrs.delete( key );\n\n\t\t\tthis.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.\n\t *\n\t * If the attribute value has changed, fires the {@link #event:change} event with\n\t * the attribute key.\n\t *\n\t * @fires change:attribute\n\t * @param {String} key Key of attribute to set.\n\t * @param {*} value Attribute value.\n\t */\n\tsetAttribute( key, value ) {\n\t\tif ( this.getAttribute( key ) !== value ) {\n\t\t\tthis._attrs.set( key, value );\n\n\t\t\tthis.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Removes all attributes from the selection and sets given attributes.\n\t *\n\t * If given set of attributes is different than set of attributes already added to selection, fires\n\t * {@link #event:change change event} with keys of attributes that changed.\n\t *\n\t * @fires event:change:attribute\n\t * @param {Iterable|Object} attrs Iterable object containing attributes to be set.\n\t */\n\tsetAttributesTo( attrs ) {\n\t\tattrs = toMap( attrs );\n\n\t\tif ( !mapsEqual( attrs, this._attrs ) ) {\n\t\t\t// Create a set from keys of old and new attributes.\n\t\t\tconst changed = new Set( Array.from( attrs.keys() ).concat( Array.from( this._attrs.keys() ) ) );\n\n\t\t\tfor ( let [ key, value ] of attrs ) {\n\t\t\t\t// If the attribute remains unchanged, remove it from changed set.\n\t\t\t\tif ( this._attrs.get( key ) === value ) {\n\t\t\t\t\tchanged.delete( key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._attrs = attrs;\n\n\t\t\tthis.fire( 'change:attribute', { attributeKeys: Array.from( changed ), directChange: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only\n\t * one range in the selection, and that range contains exactly one element.\n\t * Returns `null` if there is no selected element.\n\t *\n\t * @returns {module:engine/model/element~Element|null}\n\t */\n\tgetSelectedElement() {\n\t\tif ( this.rangeCount !== 1 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst range = this.getFirstRange();\n\t\tconst nodeAfterStart = range.start.nodeAfter;\n\t\tconst nodeBeforeEnd = range.end.nodeBefore;\n\n\t\treturn ( nodeAfterStart instanceof Element && nodeAfterStart == nodeBeforeEnd ) ? nodeAfterStart : null;\n\t}\n\n\t/**\n\t * Gets elements of type \"block\" touched by the selection.\n\t *\n\t * This method's result can be used for example to apply block styling to all blocks covered by this selection.\n\t *\n\t * *Note:* `getSelectedBlocks` always returns the deepest block.\n\t *\n\t * In this case the function will return exactly all 3 paragraphs:\n\t *\n\t *\t\t[a\n\t *\t\t\n\t *\t\t\tb\n\t *\t\t\n\t *\t\tc]d\n\t *\n\t * In this case the paragraph will also be returned, despite the collapsed selection:\n\t *\n\t *\t\t[]a\n\t *\n\t * @returns {Iterator.}\n\t */\n\t*getSelectedBlocks() {\n\t\tconst visited = new WeakSet();\n\n\t\tfor ( const range of this.getRanges() ) {\n\t\t\tconst startBlock = getParentBlock( range.start, visited );\n\n\t\t\tif ( startBlock ) {\n\t\t\t\tyield startBlock;\n\t\t\t}\n\n\t\t\tfor ( const value of range.getWalker() ) {\n\t\t\t\tif ( value.type == 'elementEnd' && isUnvisitedBlockContainer( value.item, visited ) ) {\n\t\t\t\t\tyield value.item;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst endBlock = getParentBlock( range.end, visited );\n\n\t\t\tif ( endBlock ) {\n\t\t\t\tyield endBlock;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates and returns an instance of `Selection` that is a clone of given selection, meaning that it has same\n\t * ranges and same direction as this selection.\n\t *\n\t * @params {module:engine/model/selection~Selection} otherSelection Selection to be cloned.\n\t * @returns {module:engine/model/selection~Selection} `Selection` instance that is a clone of given selection.\n\t */\n\tstatic createFromSelection( otherSelection ) {\n\t\tconst selection = new this();\n\t\tselection.setTo( otherSelection );\n\n\t\treturn selection;\n\t}\n\n\t/**\n\t * Adds given range to internal {@link #_ranges ranges array}. Throws an error\n\t * if given range is intersecting with any range that is already stored in this selection.\n\t *\n\t * @protected\n\t * @param {module:engine/model/range~Range} range Range to add.\n\t */\n\t_pushRange( range ) {\n\t\tif ( !( range instanceof Range ) ) {\n\t\t\tthrow new CKEditorError( 'model-selection-added-not-range: Trying to add an object that is not an instance of Range.' );\n\t\t}\n\n\t\tthis._checkRange( range );\n\t\tthis._ranges.push( Range.createFromRange( range ) );\n\t}\n\n\t/**\n\t * Checks if given range intersects with ranges that are already in the selection. Throws an error if it does.\n\t *\n\t * @protected\n\t * @param {module:engine/model/range~Range} range Range to check.\n\t */\n\t_checkRange( range ) {\n\t\tfor ( let i = 0; i < this._ranges.length; i++ ) {\n\t\t\tif ( range.isIntersecting( this._ranges[ i ] ) ) {\n\t\t\t\t/**\n\t\t\t\t * Trying to add a range that intersects with another range from selection.\n\t\t\t\t *\n\t\t\t\t * @error selection-range-intersects\n\t\t\t\t * @param {module:engine/model/range~Range} addedRange Range that was added to the selection.\n\t\t\t\t * @param {module:engine/model/range~Range} intersectingRange Range from selection that intersects with `addedRange`.\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'model-selection-range-intersects: Trying to add a range that intersects with another range from selection.',\n\t\t\t\t\t{ addedRange: range, intersectingRange: this._ranges[ i ] }\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Removes most recently added range from the selection.\n\t *\n\t * @protected\n\t */\n\t_popRange() {\n\t\tthis._ranges.pop();\n\t}\n\n\t/**\n\t * Deletes ranges from internal range array. Uses {@link #_popRange _popRange} to\n\t * ensure proper ranges removal.\n\t *\n\t * @private\n\t */\n\t_removeAllRanges() {\n\t\twhile ( this._ranges.length > 0 ) {\n\t\t\tthis._popRange();\n\t\t}\n\t}\n\n\t/**\n\t * @event change\n\t */\n\n\t/**\n\t * Fired whenever selection ranges are changed.\n\t *\n\t * @event change:range\n\t * @param {Boolean} directChange Specifies whether the range change was caused by direct usage of `Selection` API (`true`)\n\t * or by changes done to {@link module:engine/model/document~Document model document}\n\t * using {@link module:engine/model/batch~Batch Batch} API (`false`).\n\t */\n\n\t/**\n\t * Fired whenever selection attributes are changed.\n\t *\n\t * @event change:attribute\n\t * @param {Boolean} directChange Specifies whether the attributes changed by direct usage of the Selection API (`true`)\n\t * or by changes done to the {@link module:engine/model/document~Document model document}\n\t * using the {@link module:engine/model/batch~Batch Batch} API (`false`).\n\t * @param {Array.} attributeKeys Array containing keys of attributes that changed.\n\t */\n}\n\nmix( Selection, EmitterMixin );\n\n// Checks whether the given element extends $block in the schema and has a parent (is not a root).\n// Marks it as already visited.\nfunction isUnvisitedBlockContainer( element, visited ) {\n\tif ( visited.has( element ) ) {\n\t\treturn false;\n\t}\n\n\tvisited.add( element );\n\n\t// TODO https://github.com/ckeditor/ckeditor5-engine/issues/532#issuecomment-278900072.\n\t// This should not be a `$block` check.\n\treturn element.document.schema.itemExtends( element.name, '$block' ) && element.parent;\n}\n\n// Finds the lowest element in position's ancestors which is a block.\n// Marks all ancestors as already visited to not include any of them later on.\nfunction getParentBlock( position, visited ) {\n\tconst ancestors = position.parent.getAncestors( { parentFirst: true, includeNode: true } );\n\tconst block = ancestors.find( ( element ) => isUnvisitedBlockContainer( element, visited ) );\n\n\t// Mark all ancestors of this position's parent, because find() might've stopped early and\n\t// the found block may be a child of another block.\n\tancestors.forEach( element => visited.add( element ) );\n\n\treturn block;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/selection.js\n// module id = 57\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/textproxy\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * `TextProxy` represents a part of {@link module:engine/model/text~Text text node}.\n *\n * Since {@link module:engine/model/position~Position positions} can be placed between characters of a text node,\n * {@link module:engine/model/range~Range ranges} may contain only parts of text nodes. When {@link module:engine/model/range~Range#getItems\n * getting items}\n * contained in such range, we need to represent a part of that text node, since returning the whole text node would be incorrect.\n * `TextProxy` solves this issue.\n *\n * `TextProxy` has an API similar to {@link module:engine/model/text~Text Text} and allows to do most of the common tasks performed\n * on model nodes.\n *\n * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.\n * See {@link module:engine/model/textproxy~TextProxy#isPartial}.\n *\n * **Note:** `TextProxy` is not an instance of {@link module:engine/model/node~Node node}. Keep this in mind when using it as a\n * parameter of methods.\n *\n * **Note:** `TextProxy` is a readonly interface. If you want to perform changes on model data represented by a `TextProxy`\n * use {@link module:engine/model/writer~writer model writer API}.\n *\n * **Note:** `TextProxy` instances are created on the fly, basing on the current state of model. Because of this, it is\n * highly unrecommended to store references to `TextProxy` instances. `TextProxy` instances are not refreshed when\n * model changes, so they might get invalidated. Instead, consider creating {@link module:engine/model/liveposition~LivePosition live\n * position}.\n *\n * `TextProxy` instances are created by {@link module:engine/model/treewalker~TreeWalker model tree walker}. You should not need to create\n * an instance of this class by your own.\n */\nexport default class TextProxy {\n\t/**\n\t * Creates a text proxy.\n\t *\n\t * @protected\n\t * @param {module:engine/model/text~Text} textNode Text node which part is represented by this text proxy.\n\t * @param {Number} offsetInText Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy\n\t * starts.\n\t * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.\n\t * @constructor\n\t */\n\tconstructor( textNode, offsetInText, length ) {\n\t\t/**\n\t\t * Text node which part is represented by this text proxy.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/text~Text}\n\t\t */\n\t\tthis.textNode = textNode;\n\n\t\tif ( offsetInText < 0 || offsetInText > textNode.offsetSize ) {\n\t\t\t/**\n\t\t\t * Given offsetInText value is incorrect.\n\t\t\t *\n\t\t\t * @error model-textproxy-wrong-offsetintext\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.' );\n\t\t}\n\n\t\tif ( length < 0 || offsetInText + length > textNode.offsetSize ) {\n\t\t\t/**\n\t\t\t * Given length value is incorrect.\n\t\t\t *\n\t\t\t * @error model-textproxy-wrong-length\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-textproxy-wrong-length: Given length value is incorrect.' );\n\t\t}\n\t\t/**\n\t\t * Text data represented by this text proxy.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.data = textNode.data.substring( offsetInText, offsetInText + length );\n\n\t\t/**\n\t\t * Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy starts.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Number}\n\t\t */\n\t\tthis.offsetInText = offsetInText;\n\t}\n\n\t/**\n\t * Offset at which this text proxy starts in it's parent.\n\t *\n\t * @see module:engine/model/node~Node#startOffset\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget startOffset() {\n\t\treturn this.textNode.startOffset !== null ? this.textNode.startOffset + this.offsetInText : null;\n\t}\n\n\t/**\n\t * Offset size of this text proxy. Equal to the number of characters represented by the text proxy.\n\t *\n\t * @see module:engine/model/node~Node#offsetSize\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget offsetSize() {\n\t\treturn this.data.length;\n\t}\n\n\t/**\n\t * Offset at which this text proxy ends in it's parent.\n\t *\n\t * @see module:engine/model/node~Node#endOffset\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget endOffset() {\n\t\treturn this.startOffset !== null ? this.startOffset + this.offsetSize : null;\n\t}\n\n\t/**\n\t * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/model/text~Text text node}\n\t * (`true`) or the whole text node (`false`).\n\t *\n\t * This is `false` when text proxy starts at the very beginning of {@link module:engine/model/textproxy~TextProxy#textNode textNode}\n\t * ({@link module:engine/model/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to\n\t * text node size.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isPartial() {\n\t\treturn this.offsetSize !== this.textNode.offsetSize;\n\t}\n\n\t/**\n\t * Parent of this text proxy, which is same as parent of text node represented by this text proxy.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}\n\t */\n\tget parent() {\n\t\treturn this.textNode.parent;\n\t}\n\n\t/**\n\t * Root of this text proxy, which is same as root of text node represented by this text proxy.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\treturn this.textNode.root;\n\t}\n\n\t/**\n\t * {@link module:engine/model/document~Document Document} that owns text node represented by this text proxy or `null` if the text node\n\t * has no parent or is inside a {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment}.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/document~Document|null}\n\t */\n\tget document() {\n\t\treturn this.textNode.document;\n\t}\n\n\t/**\n\t * Checks whether given model tree object is of given type.\n\t *\n\t * Read more in {@link module:engine/model/node~Node#is}.\n\t *\n\t * @param {String} type\n\t * @returns {Boolean}\n\t */\n\tis( type ) {\n\t\treturn type == 'textProxy';\n\t}\n\n\t/**\n\t * Gets path to this text proxy.\n\t *\n\t * @see module:engine/model/node~Node#getPath\n\t * @returns {Array.}\n\t */\n\tgetPath() {\n\t\tconst path = this.textNode.getPath();\n\n\t\tif ( path.length > 0 ) {\n\t\t\tpath[ path.length - 1 ] += this.offsetInText;\n\t\t}\n\n\t\treturn path;\n\t}\n\n\t/**\n\t * Returns ancestors array of this text proxy.\n\t *\n\t * @param {Object} options Options object.\n\t * @param {Boolean} [options.includeNode=false] When set to `true` this text proxy will be also included in parent's array.\n\t * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to root element,\n\t * otherwise root element will be the first item in the array.\n\t * @returns {Array} Array with ancestors.\n\t */\n\tgetAncestors( options = { includeNode: false, parentFirst: false } ) {\n\t\tconst ancestors = [];\n\t\tlet parent = options.includeNode ? this : this.parent;\n\n\t\twhile ( parent ) {\n\t\t\tancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );\n\t\t\tparent = parent.parent;\n\t\t}\n\n\t\treturn ancestors;\n\t}\n\n\t/**\n\t * Checks if this text proxy has an attribute for given key.\n\t *\n\t * @param {String} key Key of attribute to check.\n\t * @returns {Boolean} `true` if attribute with given key is set on text proxy, `false` otherwise.\n\t */\n\thasAttribute( key ) {\n\t\treturn this.textNode.hasAttribute( key );\n\t}\n\n\t/**\n\t * Gets an attribute value for given key or `undefined` if that attribute is not set on text proxy.\n\t *\n\t * @param {String} key Key of attribute to look for.\n\t * @returns {*} Attribute value or `undefined`.\n\t */\n\tgetAttribute( key ) {\n\t\treturn this.textNode.getAttribute( key );\n\t}\n\n\t/**\n\t * Returns iterator that iterates over this node's attributes. Attributes are returned as arrays containing two\n\t * items. First one is attribute key and second is attribute value.\n\t *\n\t * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n\t *\n\t * @returns {Iterable.<*>}\n\t */\n\tgetAttributes() {\n\t\treturn this.textNode.getAttributes();\n\t}\n\n\t/**\n\t * Returns iterator that iterates over this node's attribute keys.\n\t *\n\t * @returns {Iterator.}\n\t */\n\tgetAttributeKeys() {\n\t\treturn this.textNode.getAttributeKeys();\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/textproxy.js\n// module id = 58\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* globals window, Range, Text */\n\nimport { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';\n\n/**\n * Set of utils related to block and inline fillers handling.\n *\n * Browsers do not allow to put caret in elements which does not have height. Because of it, we need to fill all\n * empty elements which should be selectable with elements or characters called \"fillers\". Unfortunately there is no one\n * universal filler, this is why two types are uses:\n *\n * * Block filler is an element which fill block elements, like `

`. CKEditor uses `
` as a block filler during the editing,\n * as browsers do natively. So instead of an empty `

` there will be `


`. The advantage of block filler is that\n * it is transparent for the selection, so when the caret is before the `
` and user presses right arrow he will be\n * moved to the next paragraph, not after the `
`. The disadvantage is that it breaks a block, so it can not be used\n * in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `
` filler} can be replaced with any other\n * character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space}.\n *\n * * Inline filler is a filler which does not break a line of text, so it can be used inside the text, for instance in the empty\n * `` surrendered by text: `foobar`, if we want to put the caret there. CKEditor uses a sequence of the zero-width\n * spaces as an {@link module:engine/view/filler~INLINE_FILLER inline filler} having the predetermined\n * {@link module:engine/view/filler~INLINE_FILLER_LENGTH length}. A sequence is used, instead of a single character to\n * avoid treating random zero-width spaces as the inline filler. Disadvantage of the inline filler is that it is not\n * transparent for the selection. The arrow key moves the caret between zero-width spaces characters, so the additional\n * code is needed to handle the caret.\n *\n * Both inline and block fillers are handled by the {@link module:engine/view/renderer~Renderer renderer} and are not present in the\n * view.\n *\n * @module engine/view/filler\n */\n\n/**\n * `
filler creator. This is a function which creates `
` element.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~NBSP_FILLER\n * @function\n */\nexport const BR_FILLER = ( domDocument ) => {\n\tconst fillerBr = domDocument.createElement( 'br' );\n\tfillerBr.dataset.ckeFiller = true;\n\n\treturn fillerBr;\n};\n\n/**\n * Non-breaking space filler creator. This is a function which creates ` ` text node.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~BR_FILLER\n * @function\n */\nexport const NBSP_FILLER = ( domDocument ) => domDocument.createTextNode( '\\u00A0' );\n\n/**\n * Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.\n */\nexport const INLINE_FILLER_LENGTH = 7;\n\n/**\n * Inline filler which is sequence of the zero width spaces.\n */\nexport let INLINE_FILLER = '';\n\nfor ( let i = 0; i < INLINE_FILLER_LENGTH; i++ ) {\n\tINLINE_FILLER += '\\u200b';\n}\n\n/**\n * Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n *\n *\t\tstartsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true\n *\t\tstartsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true\n *\t\tstartsWithFiller( document.createTextNode( 'foo' ) ); // false\n *\t\tstartsWithFiller( document.createElement( 'p' ) ); // false\n *\n * @param {Node} domNode DOM node.\n * @returns {Boolean} True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function startsWithFiller( domNode ) {\n\treturn ( domNode instanceof Text ) && ( domNode.data.substr( 0, INLINE_FILLER_LENGTH ) === INLINE_FILLER );\n}\n\n/**\n * Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n *\n *\t\tisInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true\n *\t\tisInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false\n *\n * @param {Text} domText DOM text node.\n * @returns {Boolean} True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function isInlineFiller( domText ) {\n\treturn domText.data.length == INLINE_FILLER_LENGTH && startsWithFiller( domText );\n}\n\n/**\n * Get string data from the text node, removing an {@link module:engine/view/filler~INLINE_FILLER inline filler} from it,\n * if text node contains it.\n *\n *\t\tgetDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true\n *\t\tgetDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true\n *\n * @param {Text} domText DOM text node, possible with inline filler.\n * @returns {String} Data without filler.\n */\nexport function getDataWithoutFiller( domText ) {\n\tif ( startsWithFiller( domText ) ) {\n\t\treturn domText.data.slice( INLINE_FILLER_LENGTH );\n\t} else {\n\t\treturn domText.data;\n\t}\n}\n\n// Cache block fillers templates to improve performance.\nconst templateBlockFillers = new WeakMap();\n\n/**\n * Checks if the node is an instance of the block filler of the given type.\n *\n *\t\tconst brFillerInstance = BR_FILLER( document );\n *\t\tisBlockFiller( brFillerInstance, BR_FILLER ); // true\n *\n * @param {Node} domNode DOM node to check.\n * @param {Function} blockFiller Block filler creator.\n * @returns {Boolean} True if text node contains only {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function isBlockFiller( domNode, blockFiller ) {\n\tlet templateBlockFiller = templateBlockFillers.get( blockFiller );\n\n\tif ( !templateBlockFiller ) {\n\t\ttemplateBlockFiller = blockFiller( window.document );\n\t\ttemplateBlockFillers.set( blockFiller, templateBlockFiller );\n\t}\n\n\treturn domNode.isEqualNode( templateBlockFiller );\n}\n\n/**\n * Assign key observer which move cursor from the end of the inline filler to the begging of it when\n * the left arrow is pressed, so the filler does not break navigation.\n *\n * @param {module:engine/view/document~Document} document Document instance we should inject quirks handling on.\n */\nexport function injectQuirksHandling( document ) {\n\tdocument.on( 'keydown', jumpOverInlineFiller );\n}\n\n// Move cursor from the end of the inline filler to the begging of it when, so the filler does not break navigation.\nfunction jumpOverInlineFiller( evt, data ) {\n\tif ( data.keyCode == keyCodes.arrowleft ) {\n\t\tconst domSelection = data.domTarget.ownerDocument.defaultView.getSelection();\n\n\t\tif ( domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed ) {\n\t\t\tconst domParent = domSelection.getRangeAt( 0 ).startContainer;\n\t\t\tconst domOffset = domSelection.getRangeAt( 0 ).startOffset;\n\n\t\t\tif ( startsWithFiller( domParent ) && domOffset <= INLINE_FILLER_LENGTH ) {\n\t\t\t\tconst domRange = new Range();\n\t\t\t\tdomRange.setStart( domParent, 0 );\n\t\t\t\tdomRange.collapse( true );\n\t\t\t\tdomSelection.removeAllRanges();\n\t\t\t\tdomSelection.addRange( domRange );\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/filler.js\n// module id = 59\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/observer/domeventobserver\n */\n\nimport Observer from './observer';\nimport DomEventData from './domeventdata';\n\n/**\n * Base class for DOM event observers. This class handles\n * {@link module:engine/view/observer/observer~Observer#observe adding} listeners to DOM elements,\n * {@link module:engine/view/observer/observer~Observer#disable disabling} and\n * {@link module:engine/view/observer/observer~Observer#enable re-enabling} events.\n * Child class needs to define\n * {@link module:engine/view/observer/domeventobserver~DomEventObserver#domEventType DOM event type} and\n * {@link module:engine/view/observer/domeventobserver~DomEventObserver#onDomEvent callback}.\n *\n * For instance:\n *\n *\t\tclass ClickObserver extends DomEventObserver {\n *\t\t\t// It can also be defined as a normal property in the constructor.\n *\t\t\tget domEventType() {\n *\t\t\t\treturn 'click';\n *\t\t\t}\n *\n *\t\t\tonDomEvent( domEvent ) {\n *\t\t\t\tthis.fire( 'click', domEvent );\n *\t\t\t}\n *\t\t}\n *\n * @extends module:engine/view/observer/observer~Observer\n */\nexport default class DomEventObserver extends Observer {\n\t/**\n\t * Type of the DOM event the observer should listen on. Array of types can be defined\n\t * if the obsever should listen to multiple DOM events.\n\t *\n\t * @readonly\n\t * @member {String|Array.} #domEventType\n\t */\n\n\t/**\n\t * Callback which should be called when the DOM event occurred. Note that the callback will not be called if\n\t * observer {@link #isEnabled is not enabled}.\n\t *\n\t * @see #domEventType\n\t * @abstract\n\t * @method #onDomEvent\n\t */\n\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( document ) {\n\t\tsuper( document );\n\n\t\t/**\n\t\t * If set to `true` DOM events will be listened on the capturing phase.\n\t\t * Default value is `false`.\n\t\t *\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis.useCapture = false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tobserve( domElement ) {\n\t\tconst types = typeof this.domEventType == 'string' ? [ this.domEventType ] : this.domEventType;\n\n\t\ttypes.forEach( type => {\n\t\t\tthis.listenTo( domElement, type, ( eventInfo, domEvent ) => {\n\t\t\t\tif ( this.isEnabled ) {\n\t\t\t\t\tthis.onDomEvent( domEvent );\n\t\t\t\t}\n\t\t\t}, { useCapture: this.useCapture } );\n\t\t} );\n\t}\n\n\t/**\n\t * Calls `Document#fire()` if observer {@link #isEnabled is enabled}.\n\t *\n\t * @see module:utils/emittermixin~EmitterMixin#fire\n\t * @param {String} eventType The event type (name).\n\t * @param {Event} domEvent The DOM event.\n\t * @param {Object} [additionalData] The additional data which should extend the\n\t * {@link module:engine/view/observer/domeventdata~DomEventData event data} object.\n\t */\n\tfire( eventType, domEvent, additionalData ) {\n\t\tif ( this.isEnabled ) {\n\t\t\tthis.document.fire( eventType, new DomEventData( this.document, domEvent, additionalData ) );\n\t\t}\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js\n// module id = 60\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/selection\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport Range from './range';\nimport Position from './position';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport Element from './element';\n\n/**\n * Class representing selection in tree view.\n *\n * Selection can consist of {@link module:engine/view/range~Range ranges} that can be added using\n * {@link module:engine/view/selection~Selection#addRange addRange}\n * and {@link module:engine/view/selection~Selection#setRanges setRanges} methods.\n * Both methods create copies of provided ranges and store those copies internally. Further modifications to passed\n * ranges will not change selection's state.\n * Selection's ranges can be obtained via {@link module:engine/view/selection~Selection#getRanges getRanges},\n * {@link module:engine/view/selection~Selection#getFirstRange getFirstRange}\n * and {@link module:engine/view/selection~Selection#getLastRange getLastRange}\n * methods, which return copies of ranges stored inside selection. Modifications made on these copies will not change\n * selection's state. Similar situation occurs when getting {@link module:engine/view/selection~Selection#anchor anchor},\n * {@link module:engine/view/selection~Selection#focus focus}, {@link module:engine/view/selection~Selection#getFirstPosition first} and\n * {@link module:engine/view/selection~Selection#getLastPosition last} positions - all will return copies of requested positions.\n */\nexport default class Selection {\n\t/**\n\t * Creates new selection instance.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Stores all ranges that are selected.\n\t\t *\n\t\t * @protected\n\t\t * @member {Array.}\n\t\t */\n\t\tthis._ranges = [];\n\n\t\t/**\n\t\t * Specifies whether the last added range was added as a backward or forward range.\n\t\t *\n\t\t * @protected\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis._lastRangeBackward = false;\n\n\t\t/**\n\t\t * Specifies whether selection instance is fake.\n\t\t *\n\t\t * @private\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis._isFake = false;\n\n\t\t/**\n\t\t * Fake selection's label.\n\t\t *\n\t\t * @private\n\t\t * @member {String}\n\t\t */\n\t\tthis._fakeSelectionLabel = '';\n\t}\n\n\t/**\n\t * Sets this selection instance to be marked as `fake`. A fake selection does not render as browser native selection\n\t * over selected elements and is hidden to the user. This way, no native selection UI artifacts are displayed to\n\t * the user and selection over elements can be represented in other way, for example by applying proper CSS class.\n\t *\n\t * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM (and be\n\t * properly handled by screen readers).\n\t *\n\t * @fires change\n\t * @param {Boolean} [value=true] If set to true selection will be marked as `fake`.\n\t * @param {Object} [options] Additional options.\n\t * @param {String} [options.label=''] Fake selection label.\n\t */\n\tsetFake( value = true, options = {} ) {\n\t\tthis._isFake = value;\n\t\tthis._fakeSelectionLabel = value ? options.label || '' : '';\n\n\t\tthis.fire( 'change' );\n\t}\n\n\t/**\n\t * Returns true if selection instance is marked as `fake`.\n\t *\n\t * @see #setFake\n\t * @returns {Boolean}\n\t */\n\tget isFake() {\n\t\treturn this._isFake;\n\t}\n\n\t/**\n\t * Returns fake selection label.\n\t *\n\t * @see #setFake\n\t * @returns {String}\n\t */\n\tget fakeSelectionLabel() {\n\t\treturn this._fakeSelectionLabel;\n\t}\n\n\t/**\n\t * Selection anchor. Anchor may be described as a position where the selection starts. Together with\n\t * {@link #focus focus} they define the direction of selection, which is important\n\t * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.\n\t * It may be a bit unintuitive when there are multiple ranges in selection.\n\t *\n\t * @see #focus\n\t * @type {module:engine/view/position~Position}\n\t */\n\tget anchor() {\n\t\tif ( !this._ranges.length ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst range = this._ranges[ this._ranges.length - 1 ];\n\t\tconst anchor = this._lastRangeBackward ? range.end : range.start;\n\n\t\treturn Position.createFromPosition( anchor );\n\t}\n\n\t/**\n\t * Selection focus. Focus is a position where the selection ends.\n\t *\n\t * @see #anchor\n\t * @type {module:engine/view/position~Position}\n\t */\n\tget focus() {\n\t\tif ( !this._ranges.length ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst range = this._ranges[ this._ranges.length - 1 ];\n\t\tconst focus = this._lastRangeBackward ? range.start : range.end;\n\n\t\treturn Position.createFromPosition( focus );\n\t}\n\n\t/**\n\t * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n\t * collapsed.\n\t *\n\t * @type {Boolean}\n\t */\n\tget isCollapsed() {\n\t\treturn this.rangeCount === 1 && this._ranges[ 0 ].isCollapsed;\n\t}\n\n\t/**\n\t * Returns number of ranges in selection.\n\t *\n\t * @type {Number}\n */\n\tget rangeCount() {\n\t\treturn this._ranges.length;\n\t}\n\n\t/**\n\t * Specifies whether the {@link #focus} precedes {@link #anchor}.\n\t *\n\t * @type {Boolean}\n\t */\n\tget isBackward() {\n\t\treturn !this.isCollapsed && this._lastRangeBackward;\n\t}\n\n\t/**\n\t * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`\n\t * if the selection is not inside an editable element.\n\t *\n\t * @type {module:engine/view/editableelement~EditableElement|null}\n\t */\n\tget editableElement() {\n\t\tif ( this.anchor ) {\n\t\t\treturn this.anchor.editableElement;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Adds a range to the selection. Added range is copied. This means that passed range is not saved in the\n\t * selection instance and you can safely operate on it.\n\t *\n\t * Accepts a flag describing in which way the selection is made - passed range might be selected from\n\t * {@link module:engine/view/range~Range#start start} to {@link module:engine/view/range~Range#end end}\n\t * or from {@link module:engine/view/range~Range#end end} to {@link module:engine/view/range~Range#start start}.\n\t * The flag is used to set {@link #anchor anchor} and {@link #focus focus} properties.\n\t *\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects\n\t * with ranges already stored in Selection instance.\n\t *\n\t * @fires change\n\t * @param {module:engine/view/range~Range} range\n\t */\n\taddRange( range, isBackward ) {\n\t\tif ( !( range instanceof Range ) ) {\n\t\t\tthrow new CKEditorError( 'view-selection-invalid-range: Invalid Range.' );\n\t\t}\n\n\t\tthis._pushRange( range );\n\t\tthis._lastRangeBackward = !!isBackward;\n\t\tthis.fire( 'change' );\n\t}\n\n\t/**\n\t * Returns an iterator that contains copies of all ranges added to the selection.\n\t *\n\t * @returns {Iterator.}\n\t */\n\t*getRanges() {\n\t\tfor ( let range of this._ranges ) {\n\t\t\tyield Range.createFromRange( range );\n\t\t}\n\t}\n\n\t/**\n\t * Returns copy of the first range in the selection. First range is the one which\n\t * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start\n\t * position of all other ranges (not to confuse with the first range added to the selection).\n\t * Returns `null` if no ranges are added to selection.\n\t *\n\t * @returns {module:engine/view/range~Range|null}\n\t */\n\tgetFirstRange() {\n\t\tlet first = null;\n\n\t\tfor ( let range of this._ranges ) {\n\t\t\tif ( !first || range.start.isBefore( first.start ) ) {\n\t\t\t\tfirst = range;\n\t\t\t}\n\t\t}\n\n\t\treturn first ? Range.createFromRange( first ) : null;\n\t}\n\n\t/**\n\t * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}\n\t * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse\n\t * with the last range added to the selection). Returns `null` if no ranges are added to selection.\n\t *\n\t * @returns {module:engine/view/range~Range|null}\n\t */\n\tgetLastRange() {\n\t\tlet last = null;\n\n\t\tfor ( let range of this._ranges ) {\n\t\t\tif ( !last || range.end.isAfter( last.end ) ) {\n\t\t\t\tlast = range;\n\t\t\t}\n\t\t}\n\n\t\treturn last ? Range.createFromRange( last ) : null;\n\t}\n\n\t/**\n\t * Returns copy of the first position in the selection. First position is the position that\n\t * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.\n\t * Returns `null` if no ranges are added to selection.\n\t *\n\t * @returns {module:engine/view/position~Position|null}\n\t */\n\tgetFirstPosition() {\n\t\tconst firstRange = this.getFirstRange();\n\n\t\treturn firstRange ? Position.createFromPosition( firstRange.start ) : null;\n\t}\n\n\t/**\n\t * Returns copy of the last position in the selection. Last position is the position that\n\t * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.\n\t * Returns `null` if no ranges are added to selection.\n\t *\n\t * @returns {module:engine/view/position~Position|null}\n\t */\n\tgetLastPosition() {\n\t\tconst lastRange = this.getLastRange();\n\n\t\treturn lastRange ? Position.createFromPosition( lastRange.end ) : null;\n\t}\n\n\t/**\n\t * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,\n\t * same number of ranges and all ranges from one selection equal to a range from other selection.\n\t *\n\t * @param {module:engine/view/selection~Selection} otherSelection Selection to compare with.\n\t * @returns {Boolean} `true` if selections are equal, `false` otherwise.\n\t */\n\tisEqual( otherSelection ) {\n\t\tif ( this.isFake != otherSelection.isFake ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( this.isFake && this.fakeSelectionLabel != otherSelection.fakeSelectionLabel ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( this.rangeCount != otherSelection.rangeCount ) {\n\t\t\treturn false;\n\t\t} else if ( this.rangeCount === 0 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor ( let thisRange of this._ranges ) {\n\t\t\tlet found = false;\n\n\t\t\tfor ( let otherRange of otherSelection._ranges ) {\n\t\t\t\tif ( thisRange.isEqual( otherRange ) ) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !found ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Removes all ranges that were added to the selection.\n\t *\n\t * @fires change\n\t */\n\tremoveAllRanges() {\n\t\tif ( this._ranges.length ) {\n\t\t\tthis._ranges = [];\n\t\t\tthis.fire( 'change' );\n\t\t}\n\t}\n\n\t/**\n\t * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array\n\t * is treated like the last added range and is used to set {@link #anchor anchor} and {@link #focus focus}.\n\t * Accepts a flag describing in which way the selection is made (see {@link #addRange addRange}).\n\t *\n\t * @fires change\n\t * @param {Array.} newRanges Array of ranges to set.\n\t * @param {Boolean} [isLastBackward] Flag describing if last added range was selected forward - from start to end\n\t * (`false`) or backward - from end to start (`true`). Defaults to `false`.\n\t */\n\tsetRanges( newRanges, isLastBackward ) {\n\t\tthis._ranges = [];\n\n\t\tfor ( let range of newRanges ) {\n\t\t\tif ( !( range instanceof Range ) ) {\n\t\t\t\tthrow new CKEditorError( 'view-selection-invalid-range: Invalid Range.' );\n\t\t\t}\n\n\t\t\tthis._pushRange( range );\n\t\t}\n\n\t\tthis._lastRangeBackward = !!isLastBackward;\n\t\tthis.fire( 'change' );\n\t}\n\n\t/**\n\t * Sets this selection's ranges and direction to the ranges and direction of the given selection.\n\t *\n\t * @param {module:engine/view/selection~Selection} otherSelection\n\t */\n\tsetTo( otherSelection ) {\n\t\tthis._isFake = otherSelection._isFake;\n\t\tthis._fakeSelectionLabel = otherSelection._fakeSelectionLabel;\n\n\t\tthis.setRanges( otherSelection.getRanges(), otherSelection.isBackward );\n\t}\n\n\t/**\n\t * Sets collapsed selection in the specified location.\n\t *\n\t * The location can be specified in the same form as {@link module:engine/view/position~Position.createAt} parameters.\n\t *\n\t * @fires change\n\t * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/view/item~Item view item}.\n\t */\n\tcollapse( itemOrPosition, offset ) {\n\t\tconst pos = Position.createAt( itemOrPosition, offset );\n\t\tconst range = new Range( pos, pos );\n\n\t\tthis.setRanges( [ range ] );\n\t}\n\n\t/**\n\t * Collapses selection to the selection's {@link #getFirstPosition first position}.\n\t * All ranges, besides the collapsed one, will be removed. Nothing will change if there are no ranges stored\n\t * inside selection.\n\t *\n\t * @fires change\n\t */\n\tcollapseToStart() {\n\t\tconst startPosition = this.getFirstPosition();\n\n\t\tif ( startPosition !== null ) {\n\t\t\tthis.setRanges( [ new Range( startPosition, startPosition ) ] );\n\t\t}\n\t}\n\n\t/**\n\t * Collapses selection to the selection's {@link #getLastPosition last position}.\n\t * All ranges, besides the collapsed one, will be removed. Nothing will change if there are no ranges stored\n\t * inside selection.\n\t *\n\t * @fires change\n\t */\n\tcollapseToEnd() {\n\t\tconst endPosition = this.getLastPosition();\n\n\t\tif ( endPosition !== null ) {\n\t\t\tthis.setRanges( [ new Range( endPosition, endPosition ) ] );\n\t\t}\n\t}\n\n\t/**\n\t * Sets {@link #focus} to the specified location.\n\t *\n\t * The location can be specified in the same form as {@link module:engine/view/position~Position.createAt} parameters.\n\t *\n\t * @fires change:range\n\t * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/view/item~Item view item}.\n\t */\n\tsetFocus( itemOrPosition, offset ) {\n\t\tif ( this.anchor === null ) {\n\t\t\t/**\n\t\t\t * Cannot set selection focus if there are no ranges in selection.\n\t\t\t *\n\t\t\t * @error view-selection-setFocus-no-ranges\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.' );\n\t\t}\n\n\t\tconst newFocus = Position.createAt( itemOrPosition, offset );\n\n\t\tif ( newFocus.compareWith( this.focus ) == 'same' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst anchor = this.anchor;\n\n\t\tthis._ranges.pop();\n\n\t\tif ( newFocus.compareWith( anchor ) == 'before' ) {\n\t\t\tthis.addRange( new Range( newFocus, anchor ), true );\n\t\t} else {\n\t\t\tthis.addRange( new Range( anchor, newFocus ) );\n\t\t}\n\t}\n\n\t/**\n\t * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only\n\t * one range in the selection, and that range contains exactly one element.\n\t * Returns `null` if there is no selected element.\n\t *\n\t * @returns {module:engine/view/element~Element|null}\n\t */\n\tgetSelectedElement() {\n\t\tif ( this.rangeCount !== 1 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst range = this.getFirstRange();\n\t\tconst nodeAfterStart = range.start.nodeAfter;\n\t\tconst nodeBeforeEnd = range.end.nodeBefore;\n\n\t\treturn ( nodeAfterStart instanceof Element && nodeAfterStart == nodeBeforeEnd ) ? nodeAfterStart : null;\n\t}\n\n\t/**\n\t * Creates and returns an instance of `Selection` that is a clone of given selection, meaning that it has same\n\t * ranges and same direction as this selection.\n\t *\n\t * @params {module:engine/view/selection~Selection} otherSelection Selection to be cloned.\n\t * @returns {module:engine/view/selection~Selection} `Selection` instance that is a clone of given selection.\n\t */\n\tstatic createFromSelection( otherSelection ) {\n\t\tconst selection = new Selection();\n\t\tselection.setTo( otherSelection );\n\n\t\treturn selection;\n\t}\n\n\t/**\n\t * Adds range to selection - creates copy of given range so it can be safely used and modified.\n\t *\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects\n\t * with ranges already stored in selection instance.\n\t *\n\t * @private\n\t * @param {module:engine/view/range~Range} range\n\t */\n\t_pushRange( range ) {\n\t\tfor ( let storedRange of this._ranges ) {\n\t\t\tif ( range.isIntersecting( storedRange ) ) {\n\t\t\t\t/**\n\t\t\t\t * Trying to add a range that intersects with another range from selection.\n\t\t\t\t *\n\t\t\t\t * @error selection-range-intersects\n\t\t\t\t * @param {module:engine/view/range~Range} addedRange Range that was added to the selection.\n\t\t\t\t * @param {module:engine/view/range~Range} intersectingRange Range from selection that intersects with `addedRange`.\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'view-selection-range-intersects: Trying to add a range that intersects with another range from selection.',\n\t\t\t\t\t{ addedRange: range, intersectingRange: storedRange }\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis._ranges.push( Range.createFromRange( range ) );\n\t}\n}\n\nmix( Selection, EmitterMixin );\n\n/**\n * Fired whenever selection ranges are changed through {@link ~Selection Selection API}.\n *\n * @event change\n */\n\n/**\n * @event change:range\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/selection.js\n// module id = 61\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/comparearrays\n */\n\n/**\n * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array\n * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,\n * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned\n * it means that arrays differ.\n *\n *\t\tcompareArrays( [ 0, 2 ], [ 0, 2 ] );\t\t// 'same'\n *\t\tcompareArrays( [ 0, 2 ], [ 0, 2, 1 ] );\t\t// 'prefix'\n *\t\tcompareArrays( [ 0, 2 ], [ 0 ] );\t\t\t// 'extension'\n *\t\tcompareArrays( [ 0, 2 ], [ 1, 2 ] );\t\t// 0\n *\t\tcompareArrays( [ 0, 2 ], [ 0, 1 ] );\t\t// 1\n *\n * @param {Array} a Array that is compared.\n * @param {Array} b Array to compare with.\n * @returns {module:utils/comparearrays~ArrayRelation} How array `a` is related to `b`.\n */\nexport default function compareArrays( a, b ) {\n\tconst minLen = Math.min( a.length, b.length );\n\n\tfor ( let i = 0; i < minLen; i++ ) {\n\t\tif ( a[ i ] != b[ i ] ) {\n\t\t\t// The arrays are different.\n\t\t\treturn i;\n\t\t}\n\t}\n\n\t// Both arrays were same at all points.\n\tif ( a.length == b.length ) {\n\t\t// If their length is also same, they are the same.\n\t\treturn 'same';\n\t} else if ( a.length < b.length ) {\n\t\t// Compared array is shorter so it is a prefix of the other array.\n\t\treturn 'prefix';\n\t} else {\n\t\t// Compared array is longer so it is an extension of the other array.\n\t\treturn 'extension';\n\t}\n}\n\n/**\n * @typedef {'extension'|'same'|'prefix'} module:utils/comparearrays~ArrayRelation\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/comparearrays.js\n// module id = 62\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* globals window, document */\n\n/**\n * @module utils/dom/global\n */\n\n/**\n * A helper (module) giving an access to the global DOM objects such as `window` and\n * `document`. Accessing these objects using this helper allows easy and bulletproof\n * testing, i.e. stubbing native properties:\n *\n *\t\timport global from 'ckeditor5/utils/dom/global.js';\n *\n *\t\t// This stub will work for any code using global module.\n *\t\ttestUtils.sinon.stub( global, 'window', {\n *\t\t\tinnerWidth: 10000\n *\t\t} );\n *\n *\t\tconsole.log( global.window.innerWidth );\n */\nexport default { window, document };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/dom/global.js\n// module id = 63\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/first\n */\n\n/**\n * Returns first item of the given `iterable`.\n *\n * @param {Iterable.<*>} iterable\n * @returns {*}\n */\nexport default function first( iterable ) {\n\tconst iteratorItem = iterable.next();\n\n\tif ( iteratorItem.done ) {\n\t\treturn null;\n\t}\n\n\treturn iteratorItem.value;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/first.js\n// module id = 64\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* global setTimeout, clearTimeout */\n\n/**\n * @module utils/focustracker\n */\n\nimport DomEmitterMixin from './dom/emittermixin';\nimport ObservableMixin from './observablemixin';\nimport CKEditorError from './ckeditorerror';\nimport mix from './mix';\n\n/**\n * Allows observing a group of `HTMLElement`s whether at least one of them is focused.\n *\n * Used by the {@link module:core/editor/editor~Editor} in order to track whether the focus is still within the application,\n * or were used outside of its UI.\n *\n * **Note** `focus` and `blur` listeners use event capturing, so it is only needed to register wrapper `HTMLElement`\n * which contain other `focusable` elements. But note that this wrapper element has to be focusable too\n * (have e.g. `tabindex=\"-1\"`).\n *\n * @mixes module:utils/dom/emittermixin~EmitterMixin\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class FocusTracker {\n\tconstructor() {\n\t\t/**\n\t\t * True when one of the registered elements is focused.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Boolean} #isFocused\n\t\t */\n\t\tthis.set( 'isFocused', false );\n\n\t\t/**\n\t\t * Currently focused element.\n\t\t *\n\t\t * @readonly\n\t\t * @member {HTMLElement}\n\t\t */\n\t\tthis.focusedElement = null;\n\n\t\t/**\n\t\t * List of registered elements.\n\t\t *\n\t\t * @private\n\t\t * @member {Set.}\n\t\t */\n\t\tthis._elements = new Set();\n\n\t\t/**\n\t\t * Event loop timeout.\n\t\t *\n\t\t * @private\n\t\t * @member {Number}\n\t\t */\n\t\tthis._nextEventLoopTimeout = null;\n\t}\n\n\t/**\n\t * Starts tracking the specified element.\n\t *\n\t * @param {HTMLElement} element\n\t */\n\tadd( element ) {\n\t\tif ( this._elements.has( element ) ) {\n\t\t\tthrow new CKEditorError( 'focusTracker-add-element-already-exist' );\n\t\t}\n\n\t\tthis.listenTo( element, 'focus', () => this._focus( element ), { useCapture: true } );\n\t\tthis.listenTo( element, 'blur', () => this._blur(), { useCapture: true } );\n\t\tthis._elements.add( element );\n\t}\n\n\t/**\n\t * Stops tracking the specified element and stops listening on this element.\n\t *\n\t * @param {HTMLElement} element\n\t */\n\tremove( element ) {\n\t\tif ( element === this.focusedElement ) {\n\t\t\tthis._blur( element );\n\t\t}\n\n\t\tif ( this._elements.has( element ) ) {\n\t\t\tthis.stopListening( element );\n\t\t\tthis._elements.delete( element );\n\t\t}\n\t}\n\n\t/**\n\t * Stores currently focused element and set {#isFocused} as `true`.\n\t *\n\t * @private\n\t * @param {HTMLElement} element Element which has been focused.\n\t */\n\t_focus( element ) {\n\t\tclearTimeout( this._nextEventLoopTimeout );\n\n\t\tthis.focusedElement = element;\n\t\tthis.isFocused = true;\n\t}\n\n\t/**\n\t * Clears currently focused element and set {@link #isFocused} as `false`.\n\t * This method uses `setTimeout` to change order of fires `blur` and `focus` events.\n\t *\n\t * @private\n\t * @fires blur\n\t */\n\t_blur() {\n\t\tthis._nextEventLoopTimeout = setTimeout( () => {\n\t\t\tthis.focusedElement = null;\n\t\t\tthis.isFocused = false;\n\t\t}, 0 );\n\t}\n\n\t/**\n\t * @event focus\n\t */\n\n\t/**\n\t * @event blur\n\t */\n}\n\nmix( FocusTracker, DomEmitterMixin );\nmix( FocusTracker, ObservableMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/focustracker.js\n// module id = 65\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/keystrokehandler\n */\n\nimport DomEmitterMixin from './dom/emittermixin';\nimport { getCode, parseKeystroke } from './keyboard';\n\n/**\n * Keystroke handler registers keystrokes so the callbacks associated\n * with these keystrokes will be executed if the matching `keydown` is fired\n * by a defined emitter.\n *\n *\t\tconst handler = new KeystrokeHandler();\n *\n *\t\thandler.listenTo( emitter );\n *\n *\t\thandler.set( 'ctrl + a', ( keyEventData, cancel ) => {\n *\t\t\tconsole.log( 'ctrl + a has been pressed' );\n *\t\t\tcancel();\n *\t\t} );\n */\nexport default class KeystrokeHandler {\n\t/**\n\t * Creates an instance of the keystroke handler.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Listener used to listen to events for easier keystroke handler destruction.\n\t\t *\n\t\t * @protected\n\t\t * @member {module:utils/dom/emittermixin~Emitter}\n\t\t */\n\t\tthis._listener = Object.create( DomEmitterMixin );\n\n\t\t/**\n\t\t * Map of the defined keystrokes. Keystroke codes are the keys.\n\t\t *\n\t\t * @private\n\t\t * @member {Map}\n\t\t */\n\t\tthis._keystrokes = new Map();\n\t}\n\n\t/**\n\t * Starts listening for `keydown` events from a given emitter.\n\t *\n\t * @param {module:utils/emittermixin~Emitter} emitter\n\t */\n\tlistenTo( emitter ) {\n\t\tthis._listener.listenTo( emitter, 'keydown', ( evt, data ) => {\n\t\t\tthis.press( data );\n\t\t} );\n\t}\n\n\t/**\n\t * Registers a handler for the specified keystroke.\n\t *\n\t * @param {String|Array.} keystroke Keystroke defined in a format accepted by\n\t * the {@link module:utils/keyboard~parseKeystroke} function.\n\t * @param {Function} callback A function called with the\n\t * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and\n\t * a helper to both `preventDefault` and `stopPropagation` of the event.\n\t */\n\tset( keystroke, callback ) {\n\t\tconst keyCode = parseKeystroke( keystroke );\n\t\tconst callbacks = this._keystrokes.get( keyCode );\n\n\t\tif ( callbacks ) {\n\t\t\tcallbacks.push( callback );\n\t\t} else {\n\t\t\tthis._keystrokes.set( keyCode, [ callback ] );\n\t\t}\n\t}\n\n\t/**\n\t * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.\n\t *\n\t * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData Key event data.\n\t * @returns {Boolean} Whether the keystroke was handled.\n\t */\n\tpress( keyEventData ) {\n\t\tconst keyCode = getCode( keyEventData );\n\t\tconst callbacks = this._keystrokes.get( keyCode );\n\n\t\tif ( !callbacks ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor ( let callback of callbacks ) {\n\t\t\tcallback( keyEventData, () => {\n\t\t\t\tkeyEventData.preventDefault();\n\t\t\t\tkeyEventData.stopPropagation();\n\t\t\t} );\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Destroys the keystroke handler.\n\t */\n\tdestroy() {\n\t\tthis._keystrokes = new Map();\n\t\tthis._listener.stopListening();\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/keystrokehandler.js\n// module id = 66\n// module chunks = 0","import eq from './eq';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\nexport default assignValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_assignValue.js\n// module id = 67\n// module chunks = 0","import SetCache from './_SetCache';\nimport arrayIncludes from './_arrayIncludes';\nimport arrayIncludesWith from './_arrayIncludesWith';\nimport arrayMap from './_arrayMap';\nimport baseUnary from './_baseUnary';\nimport cacheHas from './_cacheHas';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseDifference;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseDifference.js\n// module id = 68\n// module chunks = 0","import baseHas from './_baseHas';\nimport baseKeys from './_baseKeys';\nimport indexKeys from './_indexKeys';\nimport isArrayLike from './isArrayLike';\nimport isIndex from './_isIndex';\nimport isPrototype from './_isPrototype';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default keys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/keys.js\n// module id = 69\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/uid\n */\n\n/**\n * Returns a unique id. This id is a number (starting from 1) which will never get repeated on successive calls\n * to this method.\n *\n * @returns {String} A number representing the id.\n */\nexport default function uid() {\n\tlet uuid = 'e'; // Make sure that id does not start with number.\n\n\tfor ( let i = 0; i < 8; i++ ) {\n\t\tuuid += Math.floor( ( 1 + Math.random() ) * 0x10000 ).toString( 16 ).substring( 1 );\n\t}\n\n\treturn uuid;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/uid.js\n// module id = 70\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/nodelist\n */\n\nimport Node from './node';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally\n * in classes like {@link module:engine/model/element~Element Element}\n * or {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment}.\n */\nexport default class NodeList {\n\t/**\n\t * Creates an empty node list.\n\t *\n\t * @param {Iterable.} nodes Nodes contained in this node list.\n\t */\n\tconstructor( nodes ) {\n\t\t/**\n\t\t * Nodes contained in this node list.\n\t\t *\n\t\t * @private\n\t\t * @member {Array.}\n\t\t */\n\t\tthis._nodes = [];\n\n\t\tif ( nodes ) {\n\t\t\tthis.insertNodes( 0, nodes );\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all nodes contained inside this node list.\n\t *\n\t * @returns {Iterator.}\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this._nodes[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Number of nodes contained inside this node list.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget length() {\n\t\treturn this._nodes.length;\n\t}\n\n\t/**\n\t * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes contained inside this node list.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget maxOffset() {\n\t\treturn this._nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );\n\t}\n\n\t/**\n\t * Gets the node at the given index. Returns `null` if incorrect index was passed.\n\t *\n\t * @param {Number} index Index of node.\n\t * @returns {module:engine/model/node~Node|null} Node at given index.\n\t */\n\tgetNode( index ) {\n\t\treturn this._nodes[ index ] || null;\n\t}\n\n\t/**\n\t * Returns an index of the given node. Returns `null` if given node is not inside this node list.\n\t *\n\t * @param {module:engine/model/node~Node} node Child node to look for.\n\t * @returns {Number|null} Child node's index.\n\t */\n\tgetNodeIndex( node ) {\n\t\tconst index = this._nodes.indexOf( node );\n\n\t\treturn index == -1 ? null : index;\n\t}\n\n\t/**\n\t * Returns the starting offset of given node. Starting offset is equal to the sum of\n\t * {module:engine/model/node~Node#offsetSize offset sizes} of all nodes that are before this node in this node list.\n\t *\n\t * @param {module:engine/model/node~Node} node Node to look for.\n\t * @returns {Number|null} Node's starting offset.\n\t */\n\tgetNodeStartOffset( node ) {\n\t\tconst index = this.getNodeIndex( node );\n\n\t\treturn index === null ? null : this._nodes.slice( 0, index ).reduce( ( sum, node ) => sum + node.offsetSize, 0 );\n\t}\n\n\t/**\n\t * Converts index to offset in node list.\n\t *\n\t * Returns starting offset of a node that is at given index. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n\t * `model-nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link #length}.\n\t *\n\t * @param {Number} index Node's index.\n\t * @returns {Number} Node's starting offset.\n\t */\n\tindexToOffset( index ) {\n\t\tif ( index == this._nodes.length ) {\n\t\t\treturn this.maxOffset;\n\t\t}\n\n\t\tconst node = this._nodes[ index ];\n\n\t\tif ( !node ) {\n\t\t\t/**\n\t\t\t * Given index cannot be found in the node list.\n\t\t\t *\n\t\t\t * @error nodelist-index-out-of-bounds\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.' );\n\t\t}\n\n\t\treturn this.getNodeStartOffset( node );\n\t}\n\n\t/**\n\t * Converts offset in node list to index.\n\t *\n\t * Returns index of a node that occupies given offset. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n\t * `model-nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link #maxOffset}.\n\t *\n\t * @param {Number} offset Offset to look for.\n\t * @returns {Number} Index of a node that occupies given offset.\n\t */\n\toffsetToIndex( offset ) {\n\t\tlet totalOffset = 0;\n\n\t\tfor ( let node of this._nodes ) {\n\t\t\tif ( offset >= totalOffset && offset < totalOffset + node.offsetSize ) {\n\t\t\t\treturn this.getNodeIndex( node );\n\t\t\t}\n\n\t\t\ttotalOffset += node.offsetSize;\n\t\t}\n\n\t\tif ( totalOffset != offset ) {\n\t\t\t/**\n\t\t\t * Given offset cannot be found in the node list.\n\t\t\t *\n\t\t\t * @error nodelist-offset-out-of-bounds\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-nodelist-offset-out-of-bounds: Given offset cannot be found in the node list.' );\n\t\t}\n\n\t\treturn this.length;\n\t}\n\n\t/**\n\t * Inserts given nodes at given index.\n\t *\n\t * @param {Number} index Index at which nodes should be inserted.\n\t * @param {Iterable.} nodes Nodes to be inserted.\n\t */\n\tinsertNodes( index, nodes ) {\n\t\t// Validation.\n\t\tfor ( let node of nodes ) {\n\t\t\tif ( !( node instanceof Node ) ) {\n\t\t\t\t/**\n\t\t\t\t * Trying to insert an object which is not a Node instance.\n\t\t\t\t *\n\t\t\t\t * @error nodelist-insertNodes-not-node\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError( 'model-nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.' );\n\t\t\t}\n\t\t}\n\n\t\tthis._nodes.splice( index, 0, ...nodes );\n\t}\n\n\t/**\n\t * Removes one or more nodes starting at the given index.\n\t *\n\t * @param {Number} indexStart Index of the first node to remove.\n\t * @param {Number} [howMany=1] Number of nodes to remove.\n\t * @returns {Array.} Array containing removed nodes.\n\t */\n\tremoveNodes( indexStart, howMany = 1 ) {\n\t\treturn this._nodes.splice( indexStart, howMany );\n\t}\n\n\t/**\n\t * Converts `NodeList` instance to an array containing nodes that were inserted in the node list. Nodes\n\t * are also converted to their plain object representation.\n\t *\n\t * @returns {Array.} `NodeList` instance converted to `Array`.\n\t */\n\ttoJSON() {\n\t\treturn this._nodes.map( ( node ) => node.toJSON() );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/nodelist.js\n// module id = 71\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/attributeoperation\n */\n\nimport Operation from './operation';\nimport Range from '../range';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport writer from '../writer';\nimport isEqual from '@ckeditor/ckeditor5-utils/src/lib/lodash/isEqual';\n\n/**\n * Operation to change nodes' attribute.\n *\n * Using this class you can add, remove or change value of the attribute.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class AttributeOperation extends Operation {\n\t/**\n\t * Creates an operation that changes, removes or adds attributes.\n\t *\n\t * If only `newValue` is set, attribute will be added on a node. Note that all nodes in operation's range must not\n\t * have an attribute with the same key as the added attribute.\n\t *\n\t * If only `oldValue` is set, then attribute with given key will be removed. Note that all nodes in operation's range\n\t * must have an attribute with that key added.\n\t *\n\t * If both `newValue` and `oldValue` are set, then the operation will change the attribute value. Note that all nodes in\n\t * operation's ranges must already have an attribute with given key and `oldValue` as value\n\t *\n\t * @param {module:engine/model/range~Range} range Range on which the operation should be applied.\n\t * @param {String} key Key of an attribute to change or remove.\n\t * @param {*} oldValue Old value of the attribute with given key or `null`, if attribute was not set before.\n\t * @param {*} newValue New value of the attribute with given key or `null`, if operation should remove attribute.\n\t * @param {Number} baseVersion {@link module:engine/model/document~Document#version} on which the operation can be applied.\n\t */\n\tconstructor( range, key, oldValue, newValue, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Range on which operation should be applied.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/range~Range}\n\t\t */\n\t\tthis.range = Range.createFromRange( range );\n\n\t\t/**\n\t\t * Key of an attribute to change or remove.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.key = key;\n\n\t\t/**\n\t\t * Old value of the attribute with given key or `null`, if attribute was not set before.\n\t\t *\n\t\t * @readonly\n\t\t * @member {*}\n\t\t */\n\t\tthis.oldValue = oldValue === undefined ? null : oldValue;\n\n\t\t/**\n\t\t * New value of the attribute with given key or `null`, if operation should remove attribute.\n\t\t *\n\t\t * @readonly\n\t\t * @member {*}\n\t\t */\n\t\tthis.newValue = newValue === undefined ? null : newValue;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\tif ( this.oldValue === null ) {\n\t\t\treturn 'addAttribute';\n\t\t} else if ( this.newValue === null ) {\n\t\t\treturn 'removeAttribute';\n\t\t} else {\n\t\t\treturn 'changeAttribute';\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}\n\t */\n\tclone() {\n\t\treturn new AttributeOperation( this.range, this.key, this.oldValue, this.newValue, this.baseVersion );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}\n\t */\n\tgetReversed() {\n\t\treturn new AttributeOperation( this.range, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t// Validation.\n\t\tfor ( let item of this.range.getItems() ) {\n\t\t\tif ( this.oldValue !== null && !isEqual( item.getAttribute( this.key ), this.oldValue ) ) {\n\t\t\t\t/**\n\t\t\t\t * Changed node has different attribute value than operation's old attribute value.\n\t\t\t\t *\n\t\t\t\t * @error operation-attribute-wrong-old-value\n\t\t\t\t * @param {module:engine/model/item~Item} item\n\t\t\t\t * @param {String} key\n\t\t\t\t * @param {*} value\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'attribute-operation-wrong-old-value: Changed node has different attribute value than operation\\'s old attribute value.',\n\t\t\t\t\t{ item: item, key: this.key, value: this.oldValue }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( this.oldValue === null && this.newValue !== null && item.hasAttribute( this.key ) ) {\n\t\t\t\t/**\n\t\t\t\t * The attribute with given key already exists for the given node.\n\t\t\t\t *\n\t\t\t\t * @error attribute-operation-attribute-exists\n\t\t\t\t * @param {module:engine/model/node~Node} node\n\t\t\t\t * @param {String} key\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'attribute-operation-attribute-exists: The attribute with given key already exists.',\n\t\t\t\t\t{ node: item, key: this.key }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If value to set is same as old value, don't do anything.\n\t\t\t// By returning `undefined`, this operation will be seen as `NoOperation` - that means\n\t\t\t// that it won't generate any events, etc. `AttributeOperation` with such parameters may be\n\t\t\t// a result of operational transformation.\n\t\t\tif ( isEqual( this.oldValue, this.newValue ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Execution.\n\t\twriter.setAttribute( this.range, this.key, this.newValue );\n\n\t\treturn { range: this.range, key: this.key, oldValue: this.oldValue, newValue: this.newValue };\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.AttributeOperation';\n\t}\n\n\t/**\n\t * Creates `AttributeOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\treturn new AttributeOperation( Range.fromJSON( json.range, document ), json.key, json.oldValue, json.newValue, json.baseVersion );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js\n// module id = 72\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/nooperation\n */\n\nimport Operation from './operation';\n\n/**\n * Operation which is doing nothing (\"empty operation\", \"do-nothing operation\", \"noop\"). This is an operation,\n * which when executed does not change the tree model. It still has some parameters defined for transformation purposes.\n *\n * In most cases this operation is a result of transforming operations. When transformation returns\n * {@link module:engine/model/operation/nooperation~NoOperation} it means that changes done by the transformed operation\n * have already been applied.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class NoOperation extends Operation {\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/nooperation~NoOperation}\n\t */\n\tclone() {\n\t\treturn new NoOperation( this.baseVersion );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/nooperation~NoOperation}\n\t */\n\tgetReversed() {\n\t\treturn new NoOperation( this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t// Do nothing.\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.NoOperation';\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js\n// module id = 73\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/editableelement\n */\n\nimport ContainerElement from './containerelement';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\n\nconst documentSymbol = Symbol( 'document' );\n\n/**\n * Editable element which can be a {@link module:engine/view/rooteditableelement~RootEditableElement root}\n * or nested editable area in the editor.\n *\n * @extends module:engine/view/containerelement~ContainerElement\n * @mixes module:utils/observablemixin~ObservaleMixin\n */\nexport default class EditableElement extends ContainerElement {\n\t/**\n\t * Creates an editable element.\n\t */\n\tconstructor( name, attrs, children ) {\n\t\tsuper( name, attrs, children );\n\n\t\t/**\n\t\t * Whether the editable is in read-write or read-only mode.\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} module:engine/view/editableelement~EditableElement#isReadOnly\n\t\t */\n\t\tthis.set( 'isReadOnly', false );\n\n\t\t/**\n\t\t * Whether the editable is focused.\n\t\t *\n\t\t * This property updates when {@link module:engine/view/document~Document#isFocused document.isFocused} is changed and after each\n\t\t * {@link module:engine/view/document~Document#render render} method call.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Boolean} module:engine/view/editableelement~EditableElement#isFocused\n\t\t */\n\t\tthis.set( 'isFocused', false );\n\n\t\t/**\n\t\t * The {@link module:engine/view/document~Document} which is an owner of this root.\n\t\t * Can only by set once.\n\t\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-editableelement-document-already-set`\n\t\t * when document is already set.\n\t\t *\n\t\t * @member {module:engine/view/document~Document} #document\n\t\t */\n\t}\n\n\tget document() {\n\t\treturn this.getCustomProperty( documentSymbol );\n\t}\n\n\tset document( document ) {\n\t\tif ( this.getCustomProperty( documentSymbol ) ) {\n\t\t\t/**\n\t\t\t * View document is already set. It can only be set once.\n\t\t\t *\n\t\t\t * @error view-editableelement-document-already-set\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-editableelement-document-already-set: View document is already set.' );\n\t\t}\n\n\t\tthis.setCustomProperty( documentSymbol, document );\n\n\t\tthis.bind( 'isFocused' ).to(\n\t\t\tdocument,\n\t\t\t'isFocused',\n\t\t\t( isFocused ) => isFocused && document.selection.editableElement == this\n\t\t);\n\n\t\t// Update focus state before each rendering. Rendering should not change neither the selection nor the value of\n\t\t// document.isFocused property.\n\t\tthis.listenTo( document, 'render', () => {\n\t\t\tthis.isFocused = document.isFocused && document.selection.editableElement == this;\n\t\t}, { priority: 'high' } );\n\t}\n}\n\nmix( EditableElement, ObservableMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/editableelement.js\n// module id = 74\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/node\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * Abstract tree view node class.\n *\n * @abstract\n */\nexport default class Node {\n\t/**\n\t * Creates a tree view node.\n\t *\n\t * This is an abstract class, so this constructor should not be used directly.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Parent element. Null by default. Set by {@link module:engine/view/element~Element#insertChildren}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}\n\t\t */\n\t\tthis.parent = null;\n\t}\n\n\t/**\n\t * Index of the node in the parent element or null if the node has no parent.\n\t *\n\t * Accessing this property throws an error if this node's parent element does not contain it.\n\t * This means that view tree got broken.\n\t *\n\t * @readonly\n\t * @type {Number|null}\n\t */\n\tget index() {\n\t\tlet pos;\n\n\t\tif ( !this.parent ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// No parent or child doesn't exist in parent's children.\n\t\tif ( ( pos = this.parent.getChildIndex( this ) ) == -1 ) {\n\t\t\t/**\n\t\t\t * The node's parent does not contain this node. It means that the document tree is corrupted.\n\t\t\t *\n\t\t\t * @error view-node-not-found-in-parent\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-node-not-found-in-parent: The node\\'s parent does not contain this node.' );\n\t\t}\n\n\t\treturn pos;\n\t}\n\n\t/**\n\t * Node's next sibling, or `null` if it is the last child.\n\t *\n\t * @readonly\n\t * @type {module:engine/view/node~Node|null}\n\t */\n\tget nextSibling() {\n\t\tconst index = this.index;\n\n\t\treturn ( index !== null && this.parent.getChild( index + 1 ) ) || null;\n\t}\n\n\t/**\n\t * Node's previous sibling, or `null` if it is the first child.\n\t *\n\t * @readonly\n\t * @type {module:engine/view/node~Node|null}\n\t */\n\tget previousSibling() {\n\t\tconst index = this.index;\n\n\t\treturn ( index !== null && this.parent.getChild( index - 1 ) ) || null;\n\t}\n\n\t/**\n\t * Top-most ancestor of the node. If the node has no parent it is the root itself.\n\t *\n\t * @readonly\n\t * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\tlet root = this;\n\n\t\twhile ( root.parent ) {\n\t\t\troot = root.parent;\n\t\t}\n\n\t\treturn root;\n\t}\n\n\t/**\n\t * {@link module:engine/view/document~Document View document} that owns this node, or `null` if the node is inside\n\t * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n\t *\n\t * @readonly\n\t * @type {module:engine/view/document~Document|null}\n\t */\n\tget document() {\n\t\t// Parent might be Node, null or DocumentFragment.\n\t\tif ( this.parent instanceof Node ) {\n\t\t\treturn this.parent.document;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Returns ancestors array of this node.\n\t *\n\t * @param {Object} options Options object.\n\t * @param {Boolean} [options.includeNode=false] When set to `true` this node will be also included in parent's array.\n\t * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,\n\t * otherwise root element will be the first item in the array.\n\t * @returns {Array} Array with ancestors.\n\t */\n\tgetAncestors( options = { includeNode: false, parentFirst: false } ) {\n\t\tconst ancestors = [];\n\t\tlet parent = options.includeNode ? this : this.parent;\n\n\t\twhile ( parent ) {\n\t\t\tancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );\n\t\t\tparent = parent.parent;\n\t\t}\n\n\t\treturn ancestors;\n\t}\n\n\t/**\n\t * Removes node from parent.\n\t */\n\tremove() {\n\t\tthis.parent.removeChildren( this.index );\n\t}\n\n\t/**\n\t * @param {module:engine/view/document~ChangeType} type Type of the change.\n\t * @param {module:engine/view/node~Node} node Changed node.\n\t * @fires change\n\t */\n\t_fireChange( type, node ) {\n\t\tthis.fire( 'change:' + type, node );\n\n\t\tif ( this.parent ) {\n\t\t\tthis.parent._fireChange( type, node );\n\t\t}\n\t}\n\n\t/**\n\t * Clones this node.\n\t *\n\t * @method #clone\n\t * @returns {module:engine/view/node~Node} Clone of this node.\n\t */\n\n\t/**\n\t * Checks if provided node is similar to this node.\n\t *\n\t * @method #isSimilar\n\t * @returns {Boolean} True if nodes are similar.\n\t */\n\n\t/**\n\t * Checks whether given view tree object is of given type.\n\t *\n\t * This method is useful when processing view tree objects that are of unknown type. For example, a function\n\t * may return {@link module:engine/view/documentfragment~DocumentFragment} or {@link module:engine/view/node~Node}\n\t * that can be either text node or element. This method can be used to check what kind of object is returned.\n\t *\n\t *\t\tobj.is( 'node' ); // true for any node, false for document fragment\n\t *\t\tobj.is( 'documentFragment' ); // true for document fragment, false for any node\n\t *\t\tobj.is( 'element' ); // true for any element, false for text node or document fragment\n\t *\t\tobj.is( 'element', 'p' ); // true only for element which name is 'p'\n\t *\t\tobj.is( 'p' ); // shortcut for obj.is( 'element', 'p' )\n\t *\t\tobj.is( 'text' ); // true for text node, false for element and document fragment\n\t *\n\t * @method #is\n\t * @param {'element'|'containerElement'|'attributeElement'|'emptyElement'|'uiElement'|\n\t * 'rootElement'|'documentFragment'|'text'|'textProxy'} type\n\t * @returns {Boolean}\n\t */\n}\n\n/**\n * Fired when list of {@link module:engine/view/element~Element elements} children changes.\n *\n * Change event is bubbled – it is fired on all ancestors.\n *\n * @event change:children\n * @param {module:engine/view/node~Node} Changed node.\n */\n\n/**\n * Fired when list of {@link module:engine/view/element~Element elements} attributes changes.\n *\n * Change event is bubbled – it is fired on all ancestors.\n *\n * @event change:attributes\n * @param {module:engine/view/node~Node} Changed node.\n */\n\n/**\n * Fired when {@link module:engine/view/text~Text text nodes} data changes.\n *\n * Change event is bubbled – it is fired on all ancestors.\n *\n * @event change:text\n * @param {module:engine/view/node~Node} Changed node.\n */\n\n/**\n * @event change\n */\n\nmix( Node, EmitterMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/node.js\n// module id = 75\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module paragraph/paragraph\n */\n\nimport ParagraphCommand from './paragraphcommand';\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\n\nimport ModelElement from '@ckeditor/ckeditor5-engine/src/model/element';\nimport ModelPosition from '@ckeditor/ckeditor5-engine/src/model/position';\nimport ModelRange from '@ckeditor/ckeditor5-engine/src/model/range';\nimport ViewElement from '@ckeditor/ckeditor5-engine/src/view/element';\nimport ViewRange from '@ckeditor/ckeditor5-engine/src/view/range';\n\nimport modelWriter from '@ckeditor/ckeditor5-engine/src/model/writer';\nimport buildModelConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildmodelconverter';\nimport buildViewConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildviewconverter';\n\nimport isArray from '@ckeditor/ckeditor5-utils/src/lib/lodash/isArray';\n\n/**\n * The paragraph feature for the editor.\n * Introduces the `` element in the model which renders as a `

` element in the DOM and data.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Paragraph extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'paragraph/paragraph';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst doc = editor.document;\n\t\tconst data = editor.data;\n\t\tconst editing = editor.editing;\n\n\t\t// Schema.\n\t\tdoc.schema.registerItem( 'paragraph', '$block' );\n\n\t\t// Build converter from model to view for data and editing pipelines.\n\t\tbuildModelConverter().for( data.modelToView, editing.modelToView )\n\t\t\t.fromElement( 'paragraph' )\n\t\t\t.toElement( 'p' );\n\n\t\t// Build converter from view to model for data pipeline.\n\t\tbuildViewConverter().for( data.viewToModel )\n\t\t\t.fromElement( 'p' )\n\t\t\t.toElement( 'paragraph' );\n\n\t\t// Autoparagraph text.\n\t\tdata.viewToModel.on( 'text', ( evt, data, consumable, conversionApi ) => {\n\t\t\tautoparagraphText( doc, evt, data, consumable, conversionApi );\n\t\t}, { priority: 'lowest' } );\n\n\t\t// Post-fix potential subsequent paragraphs created by autoparagraphText().\n\t\tdata.viewToModel.on( 'element', mergeSubsequentParagraphs, { priority: 'lowest' } );\n\t\tdata.viewToModel.on( 'documentFragment', mergeSubsequentParagraphs, { priority: 'lowest' } );\n\n\t\t// Convert paragraph-like elements to paragraphs if they weren't consumed.\n\t\t// It's a 'low' priority in order to hook in before the default 'element' converter\n\t\t// which would then convert children before handling this element.\n\t\tdata.viewToModel.on( 'element', ( evt, data, consumable, conversionApi ) => {\n\t\t\tautoparagraphParagraphLikeElements( doc, evt, data, consumable, conversionApi );\n\t\t}, { priority: 'low' } );\n\n\t\teditor.commands.set( 'paragraph', new ParagraphCommand( editor ) );\n\t}\n}\n\n/**\n * List of element names which should be treated by the autoparagraphing algorithms as\n * paragraph-like. This means that e.g. the following content:\n *\n *\t\t

Foo

\n *\t\t\n *\t\t\t\n *\t\t\t\t\n *\t\t\t\t\n *\t\t\t\n *\t\t
X\n *\t\t\t\t\t
    \n *\t\t\t\t\t\t
  • Y
  • \n *\t\t\t\t\t\t
  • Z
  • \n *\t\t\t\t\t
\n *\t\t\t\t
\n *\n * Contains five paragraph-like elements – `

` and two `` and two `
  • `.\n * Hence, if none of the features is going to convert those elements the above content will be automatically handled\n * by the paragraph feature and converted to:\n *\n *\t\t

    Foo

    \n *\t\t

    X

    \n *\t\t

    Y

    \n *\t\t

    Z

    \n *\n * Note: The `` containing two `
  • ` elements was ignored – the inner-most paragraph-like elements\n * have priority upon conversion.\n *\n * @member {Set.} module:paragraph/paragraph~Paragraph.paragraphLikeElements\n */\nParagraph.paragraphLikeElements = new Set( [\n\t'blockquote',\n\t'dd',\n\t'div',\n\t'dt',\n\t'h1',\n\t'h2',\n\t'h3',\n\t'h4',\n\t'h5',\n\t'h6',\n\t'li',\n\t'p',\n\t'td'\n] );\n\nconst paragraphsToMerge = new WeakSet();\n\nfunction autoparagraphText( doc, evt, data, consumable, conversionApi ) {\n\t// If text wasn't consumed by the default converter...\n\tif ( !consumable.test( data.input ) ) {\n\t\treturn;\n\t}\n\n\t// And paragraph is allowed in this context...\n\tif ( !doc.schema.check( { name: 'paragraph', inside: data.context } ) ) {\n\t\treturn;\n\t}\n\n\t// Let's do autoparagraphing.\n\n\tconst paragraph = new ModelElement( 'paragraph' );\n\n\tparagraphsToMerge.add( paragraph );\n\n\tdata.context.push( paragraph );\n\n\tconst text = conversionApi.convertItem( data.input, consumable, data );\n\n\tif ( text ) {\n\t\tdata.output = paragraph;\n\t\tparagraph.appendChildren( text );\n\t}\n\n\tdata.context.pop();\n}\n\nfunction autoparagraphParagraphLikeElements( doc, evt, data, consumable, conversionApi ) {\n\t// If this is a paragraph-like element...\n\tif ( !Paragraph.paragraphLikeElements.has( data.input.name ) ) {\n\t\treturn;\n\t}\n\n\t// Which wasn't consumed by its own converter...\n\tif ( !consumable.test( data.input, { name: true } ) ) {\n\t\treturn;\n\t}\n\n\t// And there are no other paragraph-like elements inside this tree...\n\tif ( hasParagraphLikeContent( data.input ) ) {\n\t\treturn;\n\t}\n\n\t// And paragraph is allowed in this context...\n\tif ( !doc.schema.check( { name: 'paragraph', inside: data.context } ) ) {\n\t\treturn;\n\t}\n\n\t// Let's convert this element to a paragraph and then all its children.\n\n\tconsumable.consume( data.input, { name: true } );\n\n\tconst paragraph = new ModelElement( 'paragraph' );\n\n\tdata.context.push( paragraph );\n\n\tconst convertedChildren = conversionApi.convertChildren( data.input, consumable, data );\n\n\tparagraph.appendChildren( modelWriter.normalizeNodes( convertedChildren ) );\n\n\t// Remove the created paragraph from the stack for other converters.\n\t// See https://github.com/ckeditor/ckeditor5-engine/issues/736\n\tdata.context.pop();\n\n\tdata.output = paragraph;\n}\n\n// Merges subsequent paragraphs if they should be merged (see shouldMerge).\nfunction mergeSubsequentParagraphs( evt, data ) {\n\tif ( !data.output ) {\n\t\treturn;\n\t}\n\n\tlet node;\n\n\tif ( isArray( data.output ) ) {\n\t\tnode = data.output[ 0 ];\n\t} else {\n\t\tnode = data.output.getChild( 0 );\n\t}\n\n\twhile ( node && node.nextSibling ) {\n\t\tconst nextSibling = node.nextSibling;\n\n\t\tif ( paragraphsToMerge.has( node ) && paragraphsToMerge.has( nextSibling ) ) {\n\t\t\tmodelWriter.insert( ModelPosition.createAt( node, 'end' ), Array.from( nextSibling.getChildren() ) );\n\t\t\tmodelWriter.remove( ModelRange.createOn( nextSibling ) );\n\t\t} else {\n\t\t\tnode = node.nextSibling;\n\t\t}\n\t}\n}\n\n// Checks whether an element has paragraph-like descendant.\nfunction hasParagraphLikeContent( element ) {\n\tconst range = ViewRange.createIn( element );\n\n\tfor ( const value of range ) {\n\t\tif ( value.item instanceof ViewElement && Paragraph.paragraphLikeElements.has( value.item.name ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-paragraph/src/paragraph.js\n// module id = 77\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/collection\n */\n\nimport EmitterMixin from './emittermixin';\nimport CKEditorError from './ckeditorerror';\nimport uid from './uid';\nimport mix from './mix';\n\n/**\n * Collections are ordered sets of objects. Items in the collection can be retrieved by their indexes\n * in the collection (like in an array) or by their ids.\n *\n * If an object without an `id` property is being added to the collection, the `id` property will be generated\n * automatically. Note that the automatically generated id is unique only within this single collection instance.\n *\n * By default an item in the collection is identified by its `id` property. The name of the identifier can be\n * configured through the constructor of the collection.\n *\n * @mixes EventEmitter\n */\nexport default class Collection {\n\t/**\n\t * Creates a new Collection instance.\n\t *\n\t * @param {Object} options The options object.\n\t * @param {String} [options.idProperty='id'] The name of the property which is considered to identify an item.\n\t */\n\tconstructor( options ) {\n\t\t/**\n\t\t * The internal list of items in the collection.\n\t\t *\n\t\t * @private\n\t\t * @member {Object[]}\n\t\t */\n\t\tthis._items = [];\n\n\t\t/**\n\t\t * The internal map of items in the collection.\n\t\t *\n\t\t * @private\n\t\t * @member {Map}\n\t\t */\n\t\tthis._itemMap = new Map();\n\n\t\t/**\n\t\t * The name of the property which is considered to identify an item.\n\t\t *\n\t\t * @private\n\t\t * @member {String}\n\t\t */\n\t\tthis._idProperty = options && options.idProperty || 'id';\n\n\t\t/**\n\t\t * A helper mapping external items of a bound collection ({@link #bindTo})\n\t\t * and actual items of this collection. It provides information\n\t\t * necessary to properly remove items bound to another collection.\n\t\t *\n\t\t * See {@link #_bindToInternalToExternalMap}.\n\t\t *\n\t\t * @protected\n\t\t * @member {WeakMap}\n\t\t */\n\t\tthis._bindToExternalToInternalMap = new WeakMap();\n\n\t\t/**\n\t\t * A helper mapping items of this collection to external items of a bound collection\n\t\t * ({@link #bindTo}). It provides information necessary to manage the bindings, e.g.\n\t\t * to avoid loops in two–way bindings.\n\t\t *\n\t\t * See {@link #_bindToExternalToInternalMap}.\n\t\t *\n\t\t * @protected\n\t\t * @member {WeakMap}\n\t\t */\n\t\tthis._bindToInternalToExternalMap = new WeakMap();\n\n\t\t/**\n\t\t * A collection instance this collection is bound to as a result\n\t\t * of calling {@link #bindTo} method.\n\t\t *\n\t\t * @protected\n\t\t * @member {module:utils/collection~Collection} #_bindToCollection\n\t\t */\n\t}\n\n\t/**\n\t * The number of items available in the collection.\n\t *\n\t * @member {Number} #length\n\t */\n\tget length() {\n\t\treturn this._items.length;\n\t}\n\n\t/**\n\t * Adds an item into the collection.\n\t *\n\t * If the item does not have an id, then it will be automatically generated and set on the item.\n\t *\n\t * @chainable\n\t * @param {Object} item\n\t * @param {Number} [index] The position of the item in the collection. The item\n\t * is pushed to the collection when `index` not specified.\n\t * @fires add\n\t */\n\tadd( item, index ) {\n\t\tlet itemId;\n\t\tconst idProperty = this._idProperty;\n\n\t\tif ( ( idProperty in item ) ) {\n\t\t\titemId = item[ idProperty ];\n\n\t\t\tif ( typeof itemId != 'string' ) {\n\t\t\t\t/**\n\t\t\t\t * This item's id should be a string.\n\t\t\t\t *\n\t\t\t\t * @error collection-add-invalid-id\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError( 'collection-add-invalid-id' );\n\t\t\t}\n\n\t\t\tif ( this.get( itemId ) ) {\n\t\t\t\t/**\n\t\t\t\t * This item already exists in the collection.\n\t\t\t\t *\n\t\t\t\t * @error collection-add-item-already-exists\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError( 'collection-add-item-already-exists' );\n\t\t\t}\n\t\t} else {\n\t\t\titem[ idProperty ] = itemId = uid();\n\t\t}\n\n\t\t// TODO: Use ES6 default function argument.\n\t\tif ( index === undefined ) {\n\t\t\tindex = this._items.length;\n\t\t} else if ( index > this._items.length || index < 0 ) {\n\t\t\t/**\n\t\t\t * The index number has invalid value.\n\t\t\t *\n\t\t\t * @error collection-add-item-bad-index\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'collection-add-item-invalid-index' );\n\t\t}\n\n\t\tthis._items.splice( index, 0, item );\n\n\t\tthis._itemMap.set( itemId, item );\n\n\t\tthis.fire( 'add', item, index );\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Gets item by its id or index.\n\t *\n\t * @param {String|Number} idOrIndex The item id or index in the collection.\n\t * @returns {Object} The requested item or `null` if such item does not exist.\n\t */\n\tget( idOrIndex ) {\n\t\tlet item;\n\n\t\tif ( typeof idOrIndex == 'string' ) {\n\t\t\titem = this._itemMap.get( idOrIndex );\n\t\t} else if ( typeof idOrIndex == 'number' ) {\n\t\t\titem = this._items[ idOrIndex ];\n\t\t} else {\n\t\t\t/**\n\t\t\t * Index or id must be given.\n\t\t\t *\n\t\t\t * @error collection-get-invalid-arg\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'collection-get-invalid-arg: Index or id must be given.' );\n\t\t}\n\n\t\treturn item || null;\n\t}\n\n\t/**\n\t * Gets index of item in the collection.\n\t * When item is not defined in the collection then index will be equal -1.\n\t *\n\t * @param {String|Object} idOrItem The item or its id in the collection.\n\t * @returns {Number} Index of given item.\n\t */\n\tgetIndex( idOrItem ) {\n\t\tlet item;\n\n\t\tif ( typeof idOrItem == 'string' ) {\n\t\t\titem = this._itemMap.get( idOrItem );\n\t\t} else {\n\t\t\titem = idOrItem;\n\t\t}\n\n\t\treturn this._items.indexOf( item );\n\t}\n\n\t/**\n\t * Removes an item from the collection.\n\t *\n\t * @param {Object|Number|String} subject The item to remove, its id or index in the collection.\n\t * @returns {Object} The removed item.\n\t * @fires remove\n\t */\n\tremove( subject ) {\n\t\tlet index, id, item;\n\t\tlet itemDoesNotExist = false;\n\t\tconst idProperty = this._idProperty;\n\n\t\tif ( typeof subject == 'string' ) {\n\t\t\tid = subject;\n\t\t\titem = this._itemMap.get( id );\n\t\t\titemDoesNotExist = !item;\n\n\t\t\tif ( item ) {\n\t\t\t\tindex = this._items.indexOf( item );\n\t\t\t}\n\t\t} else if ( typeof subject == 'number' ) {\n\t\t\tindex = subject;\n\t\t\titem = this._items[ index ];\n\t\t\titemDoesNotExist = !item;\n\n\t\t\tif ( item ) {\n\t\t\t\tid = item[ idProperty ];\n\t\t\t}\n\t\t} else {\n\t\t\titem = subject;\n\t\t\tid = item[ idProperty ];\n\t\t\tindex = this._items.indexOf( item );\n\t\t\titemDoesNotExist = ( index == -1 || !this._itemMap.get( id ) );\n\t\t}\n\n\t\tif ( itemDoesNotExist ) {\n\t\t\t/**\n\t\t\t * Item not found.\n\t\t\t *\n\t\t\t * @error collection-remove-404\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'collection-remove-404: Item not found.' );\n\t\t}\n\n\t\tthis._items.splice( index, 1 );\n\t\tthis._itemMap.delete( id );\n\n\t\tconst externalItem = this._bindToInternalToExternalMap.get( item );\n\t\tthis._bindToInternalToExternalMap.delete( item );\n\t\tthis._bindToExternalToInternalMap.delete( externalItem );\n\n\t\tthis.fire( 'remove', item );\n\n\t\treturn item;\n\t}\n\n\t/**\n\t * Executes the callback for each item in the collection and composes an array or values returned by this callback.\n\t *\n\t * @param {Function} callback\n\t * @param {Object} callback.item\n\t * @param {Number} callback.index\n\t * @params {Object} ctx Context in which the `callback` will be called.\n\t * @returns {Array} The result of mapping.\n\t */\n\tmap( callback, ctx ) {\n\t\treturn this._items.map( callback, ctx );\n\t}\n\n\t/**\n\t * Finds the first item in the collection for which the `callback` returns a true value.\n\t *\n\t * @param {Function} callback\n\t * @param {Object} callback.item\n\t * @param {Number} callback.index\n\t * @returns {Object} The item for which `callback` returned a true value.\n\t * @params {Object} ctx Context in which the `callback` will be called.\n\t */\n\tfind( callback, ctx ) {\n\t\treturn this._items.find( callback, ctx );\n\t}\n\n\t/**\n\t * Returns an array with items for which the `callback` returned a true value.\n\t *\n\t * @param {Function} callback\n\t * @param {Object} callback.item\n\t * @param {Number} callback.index\n\t * @params {Object} ctx Context in which the `callback` will be called.\n\t * @returns {Object[]} The array with matching items.\n\t */\n\tfilter( callback, ctx ) {\n\t\treturn this._items.filter( callback, ctx );\n\t}\n\n\t/**\n\t * Removes all items from the collection and destroys the binding created using\n\t * {@link #bindTo}.\n\t */\n\tclear() {\n\t\tif ( this._bindToCollection ) {\n\t\t\tthis.stopListening( this._bindToCollection );\n\t\t\tthis._bindToCollection = null;\n\t\t}\n\n\t\twhile ( this.length ) {\n\t\t\tthis.remove( 0 );\n\t\t}\n\t}\n\n\t/**\n\t * Binds and synchronizes the collection with another one.\n\t *\n\t * The binding can be a simple factory:\n\t *\n\t *\t\tclass FactoryClass {\n\t *\t\t\tconstructor( data ) {\n\t *\t\t\t\tthis.label = data.label;\n\t *\t\t\t}\n\t *\t\t}\n\t *\n\t *\t\tconst source = new Collection( { idProperty: 'label' } );\n\t *\t\tconst target = new Collection();\n\t *\n\t *\t\ttarget.bindTo( source ).as( FactoryClass );\n\t *\n\t *\t\tsource.add( { label: 'foo' } );\n\t *\t\tsource.add( { label: 'bar' } );\n\t *\n\t *\t\tconsole.log( target.length ); // 2\n\t *\t\tconsole.log( target.get( 1 ).label ); // 'bar'\n\t *\n\t *\t\tsource.remove( 0 );\n\t *\t\tconsole.log( target.length ); // 1\n\t *\t\tconsole.log( target.get( 0 ).label ); // 'bar'\n\t *\n\t * or the factory driven by a custom callback:\n\t *\n\t *\t\tclass FooClass {\n\t *\t\t\tconstructor( data ) {\n\t *\t\t\t\tthis.label = data.label;\n\t *\t\t\t}\n\t *\t\t}\n\t *\n\t *\t\tclass BarClass {\n\t *\t\t\tconstructor( data ) {\n\t *\t\t\t\tthis.label = data.label;\n\t *\t\t\t}\n\t *\t\t}\n\t *\n\t *\t\tconst source = new Collection( { idProperty: 'label' } );\n\t *\t\tconst target = new Collection();\n\t *\n\t *\t\ttarget.bindTo( source ).using( ( item ) => {\n\t *\t\t\tif ( item.label == 'foo' ) {\n\t *\t\t\t\treturn new FooClass( item );\n\t *\t\t\t} else {\n\t *\t\t\t\treturn new BarClass( item );\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\tsource.add( { label: 'foo' } );\n\t *\t\tsource.add( { label: 'bar' } );\n\t *\n\t *\t\tconsole.log( target.length ); // 2\n\t *\t\tconsole.log( target.get( 0 ) instanceof FooClass ); // true\n\t *\t\tconsole.log( target.get( 1 ) instanceof BarClass ); // true\n\t *\n\t * or the factory out of property name:\n\t *\n\t *\t\tconst source = new Collection( { idProperty: 'label' } );\n\t *\t\tconst target = new Collection();\n\t *\n\t *\t\ttarget.bindTo( source ).using( 'label' );\n\t *\n\t *\t\tsource.add( { label: { value: 'foo' } } );\n\t *\t\tsource.add( { label: { value: 'bar' } } );\n\t *\n\t *\t\tconsole.log( target.length ); // 2\n\t *\t\tconsole.log( target.get( 0 ).value ); // 'foo'\n\t *\t\tconsole.log( target.get( 1 ).value ); // 'bar'\n\t *\n\t * **Note**: {@link #clear} can be used to break the binding.\n\t *\n\t * @param {module:utils/collection~Collection} collection A collection to be bound.\n\t * @returns {Object}\n\t * @returns {module:utils/collection~Collection#bindTo#as} return.as\n\t * @returns {module:utils/collection~Collection#bindTo#using} return.using\n\t */\n\tbindTo( externalCollection ) {\n\t\tif ( this._bindToCollection ) {\n\t\t\t/**\n\t\t\t * The collection cannot be bound more than once.\n\t\t\t *\n\t\t\t * @error collection-bind-to-rebind\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'collection-bind-to-rebind: The collection cannot be bound more than once.' );\n\t\t}\n\n\t\tthis._bindToCollection = externalCollection;\n\n\t\treturn {\n\t\t\t/**\n\t\t\t * Creates the class factory binding.\n\t\t\t *\n\t\t\t * @static\n\t\t\t * @param {Function} Class Specifies which class factory is to be initialized.\n\t\t\t */\n\t\t\tas: ( Class ) => {\n\t\t\t\tthis._setUpBindToBinding( item => new Class( item ) );\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Creates callback or property binding.\n\t\t\t *\n\t\t\t * @static\n\t\t\t * @param {Function|String} callbackOrProperty When the function is passed, it is used to\n\t\t\t * produce the items. When the string is provided, the property value is used to create\n\t\t\t * the bound collection items.\n\t\t\t */\n\t\t\tusing: ( callbackOrProperty ) => {\n\t\t\t\tif ( typeof callbackOrProperty == 'function' ) {\n\t\t\t\t\tthis._setUpBindToBinding( item => callbackOrProperty( item ) );\n\t\t\t\t} else {\n\t\t\t\t\tthis._setUpBindToBinding( item => item[ callbackOrProperty ] );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Finalizes and activates a binding initiated by {#bindTo}.\n\t *\n\t * @protected\n\t * @param {Function} factory A function which produces collection items.\n\t */\n\t_setUpBindToBinding( factory ) {\n\t\tconst externalCollection = this._bindToCollection;\n\n\t\t// Adds the item to the collection once a change has been done to the external collection.\n\t\t//\n\t\t// @private\n\t\tconst addItem = ( evt, externalItem, index ) => {\n\t\t\tconst isExternalBoundToThis = externalCollection._bindToCollection == this;\n\t\t\tconst externalItemBound = externalCollection._bindToInternalToExternalMap.get( externalItem );\n\n\t\t\t// If an external collection is bound to this collection, which makes it a 2–way binding,\n\t\t\t// and the particular external collection item is already bound, don't add it here.\n\t\t\t// The external item has been created **out of this collection's item** and (re)adding it will\n\t\t\t// cause a loop.\n\t\t\tif ( isExternalBoundToThis && externalItemBound ) {\n\t\t\t\tthis._bindToExternalToInternalMap.set( externalItem, externalItemBound );\n\t\t\t\tthis._bindToInternalToExternalMap.set( externalItemBound, externalItem );\n\t\t\t} else {\n\t\t\t\tconst item = factory( externalItem );\n\n\t\t\t\tthis._bindToExternalToInternalMap.set( externalItem, item );\n\t\t\t\tthis._bindToInternalToExternalMap.set( item, externalItem );\n\n\t\t\t\tthis.add( item, index );\n\t\t\t}\n\t\t};\n\n\t\t// Load the initial content of the collection.\n\t\tfor ( let externalItem of externalCollection ) {\n\t\t\taddItem( null, externalItem );\n\t\t}\n\n\t\t// Synchronize the with collection as new items are added.\n\t\tthis.listenTo( externalCollection, 'add', addItem );\n\n\t\t// Synchronize the with collection as new items are removed.\n\t\tthis.listenTo( externalCollection, 'remove', ( evt, externalItem ) => {\n\t\t\tconst item = this._bindToExternalToInternalMap.get( externalItem );\n\n\t\t\tif ( item ) {\n\t\t\t\tthis.remove( item );\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Collection iterator.\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this._items[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Fired when an item is added to the collection.\n\t *\n\t * @event add\n\t * @param {Object} item The added item.\n\t */\n\n\t/**\n\t * Fired when an item is removed from the collection.\n\t *\n\t * @event remove\n\t * @param {Object} item The removed item.\n\t */\n}\n\nmix( Collection, EmitterMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/collection.js\n// module id = 78\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/dom/emittermixin\n */\n\nimport EmitterMixin from '../emittermixin';\nimport { _getEmitterListenedTo, _setEmitterId } from '../emittermixin';\nimport uid from '../uid';\nimport extend from '../lib/lodash/extend';\nimport isNative from '../lib/lodash/isNative';\n\n/**\n * Mixin that injects the DOM events API into its host. It provides the API\n * compatible with {@link module:utils/emittermixin~EmitterMixin}.\n *\n * DOM emitter mixin is by default available in the {@link module:ui/view~View} class,\n * but it can also be mixed into any other class:\n *\n *\t\timport mix from '../utils/mix.js';\n *\t\timport DomEmitterMixin from '../utils/dom/emittermixin.js';\n *\n *\t\tclass SomeView {}\n *\t\tmix( SomeView, DomEmitterMixin );\n *\n *\t\tconst view = new SomeView();\n *\t\tview.listenTo( domElement, ( evt, domEvt ) => {\n *\t\t\tconsole.log( evt, domEvt );\n *\t\t} );\n *\n * @mixin module:utils/dom/emittermixin~EmitterMixin\n * @mixes module:utils/emittermixin~EmitterMixin\n * @implements module:utils/dom/emittermixin~Emitter\n */\nconst DomEmitterMixin = extend( {}, EmitterMixin, {\n\t/**\n\t * Registers a callback function to be executed when an event is fired in a specific Emitter or DOM Node.\n\t * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.\n\t *\n\t * @param {module:utils/emittermixin~Emitter|Node} emitter The object that fires the event.\n\t * @param {String} event The name of the event.\n\t * @param {Function} callback The function to be called on event.\n\t * @param {Object} [options={}] Additional options.\n\t * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher\n\t * the priority value the sooner the callback will be fired. Events having the same priority are called in the\n\t * order they were added.\n\t * @param {Object} [options.context] The object that represents `this` in the callback. Defaults to the object firing the event.\n\t * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered\n\t * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n\t *\n\t * @method module:utils/dom/emittermixin~EmitterMixin#listenTo\n\t */\n\tlistenTo( ...args ) {\n\t\tconst emitter = args[ 0 ];\n\n\t\t// Check if emitter is an instance of DOM Node. If so, replace the argument with\n\t\t// corresponding ProxyEmitter (or create one if not existing).\n\t\tif ( isDomNode( emitter ) ) {\n\t\t\targs[ 0 ] = this._getProxyEmitter( emitter ) || new ProxyEmitter( emitter );\n\t\t}\n\n\t\t// Execute parent class method with Emitter (or ProxyEmitter) instance.\n\t\tEmitterMixin.listenTo.apply( this, args );\n\t},\n\n\t/**\n\t * Stops listening for events. It can be used at different levels:\n\t * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.\n\t *\n\t * * To stop listening to a specific callback.\n\t * * To stop listening to a specific event.\n\t * * To stop listening to all events fired by a specific object.\n\t * * To stop listening to all events fired by all object.\n\t *\n\t * @param {module:utils/emittermixin~Emitter|Node} [emitter] The object to stop listening to. If omitted, stops it for all objects.\n\t * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it\n\t * for all events from `emitter`.\n\t * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given\n\t * `event`.\n\t *\n\t * @method module:utils/dom/emittermixin~EmitterMixin#stopListening\n\t */\n\tstopListening( ...args ) {\n\t\tconst emitter = args[ 0 ];\n\n\t\t// Check if emitter is an instance of DOM Node. If so, replace the argument with corresponding ProxyEmitter.\n\t\tif ( isDomNode( emitter ) ) {\n\t\t\tlet proxy = this._getProxyEmitter( emitter );\n\n\t\t\t// Element has no listeners.\n\t\t\tif ( !proxy ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\targs[ 0 ] = proxy;\n\t\t}\n\n\t\t// Execute parent class method with Emitter (or ProxyEmitter) instance.\n\t\tEmitterMixin.stopListening.apply( this, args );\n\t},\n\n\t/**\n\t * Retrieves ProxyEmitter instance for given DOM Node residing in this Host.\n\t *\n\t * @param {Node} node DOM Node of the ProxyEmitter.\n\t * @method module:utils/dom/emittermixin~EmitterMixin#_getProxyEmitter\n\t * @return {module:utils/dom/emittermixin~ProxyEmitter} ProxyEmitter instance or null.\n\t */\n\t_getProxyEmitter( node ) {\n\t\treturn _getEmitterListenedTo( this, getNodeUID( node ) );\n\t}\n} );\n\nexport default DomEmitterMixin;\n\n/**\n * Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events\n * and any Host listening to them. It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#on}.\n *\n * listenTo( click, ... )\n * +-----------------------------------------+\n * | stopListening( ... ) |\n * +----------------------------+ | addEventListener( click, ... )\n * | Host | | +---------------------------------------------+\n * +----------------------------+ | | removeEventListener( click, ... ) |\n * | _listeningTo: { | +----------v-------------+ |\n * | UID: { | | ProxyEmitter | |\n * | emitter: ProxyEmitter, | +------------------------+ +------------v----------+\n * | callbacks: { | | events: { | | Node (HTMLElement) |\n * | click: [ callbacks ] | | click: [ callbacks ] | +-----------------------+\n * | } | | }, | | data-ck-expando: UID |\n * | } | | _domNode: Node, | +-----------------------+\n * | } | | _domListeners: {}, | |\n * | +------------------------+ | | _emitterId: UID | |\n * | | DomEmitterMixin | | +--------------^---------+ |\n * | +------------------------+ | | | |\n * +--------------^-------------+ | +---------------------------------------------+\n * | | click (DOM Event)\n * +-----------------------------------------+\n * fire( click, DOM Event )\n *\n * @mixes module:utils/emittermixin~EmitterMixin\n * @implements module:utils/dom/emittermixin~Emitter\n * @private\n */\nclass ProxyEmitter {\n\t/**\n\t * @param {Node} node DOM Node that fires events.\n\t * @returns {Object} ProxyEmitter instance bound to the DOM Node.\n\t */\n\tconstructor( node ) {\n\t\t// Set emitter ID to match DOM Node \"expando\" property.\n\t\t_setEmitterId( this, getNodeUID( node ) );\n\n\t\t// Remember the DOM Node this ProxyEmitter is bound to.\n\t\tthis._domNode = node;\n\t}\n}\n\nextend( ProxyEmitter.prototype, EmitterMixin, {\n\t/**\n\t * Collection of native DOM listeners.\n\t *\n\t * @private\n\t * @member {Object} module:utils/dom/emittermixin~ProxyEmitter#_domListeners\n\t */\n\n\t/**\n\t * Registers a callback function to be executed when an event is fired.\n\t *\n\t * It attaches a native DOM listener to the DOM Node. When fired,\n\t * a corresponding Emitter event will also fire with DOM Event object as an argument.\n\t *\n\t * @param {String} event The name of the event.\n\t * @param {Function} callback The function to be called on event.\n\t * @param {Object} [options={}] Additional options.\n\t * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher\n\t * the priority value the sooner the callback will be fired. Events having the same priority are called in the\n\t * order they were added.\n\t * @param {Object} [options.context] The object that represents `this` in the callback. Defaults to the object firing the event.\n\t * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered\n\t * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n\t *\n\t * @method module:utils/dom/emittermixin~ProxyEmitter#on\n\t */\n\ton( event, callback, options = {} ) {\n\t\t// Execute parent class method first.\n\t\tEmitterMixin.on.apply( this, arguments );\n\n\t\t// If the DOM Listener for given event already exist it is pointless\n\t\t// to attach another one.\n\t\tif ( this._domListeners && this._domListeners[ event ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst domListener = this._createDomListener( event );\n\n\t\t// Attach the native DOM listener to DOM Node.\n\t\tthis._domNode.addEventListener( event, domListener, !!options.useCapture );\n\n\t\tif ( !this._domListeners ) {\n\t\t\tthis._domListeners = {};\n\t\t}\n\n\t\t// Store the native DOM listener in this ProxyEmitter. It will be helpful\n\t\t// when stopping listening to the event.\n\t\tthis._domListeners[ event ] = domListener;\n\t},\n\n\t/**\n\t * Stops executing the callback on the given event.\n\t *\n\t * @param {String} event The name of the event.\n\t * @param {Function} callback The function to stop being called.\n\t * @param {Object} [context] The context object to be removed, pared with the given callback. To handle cases where\n\t * the same callback is used several times with different contexts.\n\t *\n\t * @method module:utils/dom/emittermixin~ProxyEmitter#off\n\t */\n\toff( event ) {\n\t\t// Execute parent class method first.\n\t\tEmitterMixin.off.apply( this, arguments );\n\n\t\tlet events;\n\n\t\t// Remove native DOM listeners which are orphans. If no callbacks\n\t\t// are awaiting given event, detach native DOM listener from DOM Node.\n\t\t// See: {@link on}.\n\n\t\tif ( this._domListeners[ event ] && ( !( events = this._events[ event ] ) || !events.callbacks.length ) ) {\n\t\t\tthis._domListeners[ event ].removeListener();\n\t\t}\n\t},\n\n\t/**\n\t * Create a native DOM listener callback. When the native DOM event\n\t * is fired it will fire corresponding event on this ProxyEmitter.\n\t * Note: A native DOM Event is passed as an argument.\n\t *\n\t * @private\n\t * @param {String} event\n\t *\n\t * @method module:utils/dom/emittermixin~ProxyEmitter#_createDomListener\n\t * @returns {Function} The DOM listener callback.\n\t */\n\t_createDomListener( event ) {\n\t\tconst domListener = domEvt => {\n\t\t\tthis.fire( event, domEvt );\n\t\t};\n\n\t\t// Supply the DOM listener callback with a function that will help\n\t\t// detach it from the DOM Node, when it is no longer necessary.\n\t\t// See: {@link off}.\n\t\tdomListener.removeListener = () => {\n\t\t\tthis._domNode.removeEventListener( event, domListener );\n\t\t\tdelete this._domListeners[ event ];\n\t\t};\n\n\t\treturn domListener;\n\t}\n} );\n\n// Gets an unique DOM Node identifier. The identifier will be set if not defined.\n//\n// @private\n// @param {Node} node\n// @return {String} UID for given DOM Node.\nfunction getNodeUID( node ) {\n\treturn node[ 'data-ck-expando' ] || ( node[ 'data-ck-expando' ] = uid() );\n}\n\n// Checks (naively) if given node is native DOM Node.\n//\n// @private\n// @param {Node} node\n// @return {Boolean} True when native DOM Node.\nfunction isDomNode( node ) {\n\treturn node && isNative( node.addEventListener );\n}\n\n/**\n * Interface representing classes which mix in {@link module:utils/dom/emittermixin~EmitterMixin}.\n *\n * @interface Emitter\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js\n// module id = 79\n// module chunks = 0","import listCacheClear from './_listCacheClear';\nimport listCacheDelete from './_listCacheDelete';\nimport listCacheGet from './_listCacheGet';\nimport listCacheHas from './_listCacheHas';\nimport listCacheSet from './_listCacheSet';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_ListCache.js\n// module id = 80\n// module chunks = 0","import MapCache from './_MapCache';\nimport setCacheAdd from './_setCacheAdd';\nimport setCacheHas from './_setCacheHas';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_SetCache.js\n// module id = 81\n// module chunks = 0","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayFilter.js\n// module id = 82\n// module chunks = 0","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayPush.js\n// module id = 83\n// module chunks = 0","import eq from './eq';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_assocIndexOf.js\n// module id = 84\n// module chunks = 0","import baseSortedIndexBy from './_baseSortedIndexBy';\nimport identity from './identity';\nimport isSymbol from './isSymbol';\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n/**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\nfunction baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array ? array.length : low;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n}\n\nexport default baseSortedIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseSortedIndex.js\n// module id = 85\n// module chunks = 0","import baseSlice from './_baseSlice';\n\n/**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n}\n\nexport default baseWhile;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseWhile.js\n// module id = 86\n// module chunks = 0","import isArray from './isArray';\nimport stringToPath from './_stringToPath';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n return isArray(value) ? value : stringToPath(value);\n}\n\nexport default castPath;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_castPath.js\n// module id = 87\n// module chunks = 0","import isKeyable from './_isKeyable';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getMapData.js\n// module id = 88\n// module chunks = 0","/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\nexport default isHostObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isHostObject.js\n// module id = 89\n// module chunks = 0","import eq from './eq';\nimport isArrayLike from './isArrayLike';\nimport isIndex from './_isIndex';\nimport isObject from './isObject';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isIterateeCall.js\n// module id = 90\n// module chunks = 0","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_isPrototype.js\n// module id = 91\n// module chunks = 0","import getNative from './_getNative';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_nativeCreate.js\n// module id = 92\n// module chunks = 0","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_setToArray.js\n// module id = 93\n// module chunks = 0","import baseClone from './_baseClone';\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, false, true);\n}\n\nexport default clone;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/clone.js\n// module id = 94\n// module chunks = 0","import getLength from './_getLength';\nimport isFunction from './isFunction';\nimport isLength from './isLength';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n}\n\nexport default isArrayLike;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isArrayLike.js\n// module id = 95\n// module chunks = 0","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length,\n * else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isLength.js\n// module id = 96\n// module chunks = 0","import getPrototype from './_getPrototype';\nimport isHostObject from './_isHostObject';\nimport isObjectLike from './isObjectLike';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = Function.prototype.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object,\n * else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) ||\n objectToString.call(value) != objectTag || isHostObject(value)) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n}\n\nexport default isPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isPlainObject.js\n// module id = 97\n// module chunks = 0","import arrayFilter from './_arrayFilter';\nimport arrayMap from './_arrayMap';\nimport baseProperty from './_baseProperty';\nimport baseTimes from './_baseTimes';\nimport isArrayLikeObject from './isArrayLikeObject';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);\n * // => [['fred', 30, true], ['barney', 40, false]]\n *\n * _.unzip(zipped);\n * // => [['fred', 'barney'], [30, 40], [true, false]]\n */\nfunction unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n}\n\nexport default unzip;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/unzip.js\n// module id = 98\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/command/helpers/getschemavalidranges\n */\n\nimport TreeWalker from '@ckeditor/ckeditor5-engine/src/model/treewalker';\nimport Range from '@ckeditor/ckeditor5-engine/src/model/range';\nimport Position from '@ckeditor/ckeditor5-engine/src/model/position';\n\n/**\n * Walks through given array of ranges and removes parts of them that are not allowed by passed schema to have the\n * attribute set. This is done by breaking a range in two and omitting the not allowed part.\n *\n * @param {String} attribute Attribute key.\n * @param {Array.} ranges Ranges to be validated.\n * @param {module:engine/model/schema~Schema} schema Document schema.\n * @returns {Array.} Ranges without invalid parts.\n */\nexport default function getSchemaValidRanges( attribute, ranges, schema ) {\n\tconst validRanges = [];\n\n\tfor ( let range of ranges ) {\n\t\tconst walker = new TreeWalker( { boundaries: range, mergeCharacters: true } );\n\t\tlet step = walker.next();\n\n\t\tlet last = range.start;\n\t\tlet from = range.start;\n\t\tlet to = range.end;\n\n\t\twhile ( !step.done ) {\n\t\t\tconst name = step.value.item.name || '$text';\n\t\t\tconst itemPosition = Position.createBefore( step.value.item );\n\n\t\t\tif ( !schema.check( { name: name, inside: itemPosition, attributes: attribute } ) ) {\n\t\t\t\tif ( !from.isEqual( last ) ) {\n\t\t\t\t\tvalidRanges.push( new Range( from, last ) );\n\t\t\t\t}\n\n\t\t\t\tfrom = walker.position;\n\t\t\t}\n\n\t\t\tlast = walker.position;\n\t\t\tstep = walker.next();\n\t\t}\n\n\t\tif ( from && !from.isEqual( to ) ) {\n\t\t\tvalidRanges.push( new Range( from, to ) );\n\t\t}\n\t}\n\n\treturn validRanges;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-core/src/command/helpers/getschemavalidranges.js\n// module id = 99\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport ViewElement from '../view/element';\nimport ViewText from '../view/text';\nimport ViewRange from '../view/range';\nimport ViewTreeWalker from '../view/treewalker';\nimport viewWriter from '../view/writer';\n\n/**\n * Contains {@link module:engine/model/model model} to {@link module:engine/view/view view} converters for\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}.\n *\n * @module engine/conversion/model-to-view-converters\n */\n\n/**\n * Function factory, creates a converter that converts node insertion changes from the model to the view.\n * The view element that will be added to the view depends on passed parameter. If {@link module:engine/view/element~Element} was passed,\n * it will be cloned and the copy will be inserted. If `Function` is provided, it is passed all the parameters of the\n * dispatcher's {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:insert insert event}.\n * It's expected that the function returns a {@link module:engine/view/element~Element}.\n * The result of the function will be inserted to the view.\n *\n * The converter automatically consumes corresponding value from consumables list, stops the event (see\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}) and bind model and view elements.\n *\n *\t\tmodelDispatcher.on( 'insert:paragraph', insertElement( new ViewElement( 'p' ) ) );\n *\n *\t\tmodelDispatcher.on(\n *\t\t\t'insert:myElem',\n *\t\t\tinsertElement( ( data, consumable, conversionApi ) => {\n *\t\t\t\tlet myElem = new ViewElement( 'myElem', { myAttr: true }, new ViewText( 'myText' ) );\n *\n *\t\t\t\t// Do something fancy with myElem using data/consumable/conversionApi ...\n *\n *\t\t\t\treturn myElem;\n *\t\t\t}\n *\t\t) );\n *\n * @param {module:engine/view/element~Element|Function} elementCreator View element, or function returning a view element, which\n * will be inserted.\n * @returns {Function} Insert element event converter.\n */\nexport function insertElement( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst viewElement = ( elementCreator instanceof ViewElement ) ?\n\t\t\telementCreator.clone( true ) :\n\t\t\telementCreator( data, consumable, conversionApi );\n\n\t\tif ( !viewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( data.item, 'insert' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewPosition = conversionApi.mapper.toViewPosition( data.range.start );\n\n\t\tconversionApi.mapper.bindElements( data.item, viewElement );\n\t\tviewWriter.insert( viewPosition, viewElement );\n\t};\n}\n\n/**\n * Function factory, creates a default model-to-view converter for text insertion changes.\n *\n * The converter automatically consumes corresponding value from consumables list and stops the event (see\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}).\n *\n *\t\tmodelDispatcher.on( 'insert:$text', insertText() );\n *\n * @returns {Function} Insert text event converter.\n */\nexport function insertText() {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tif ( !consumable.consume( data.item, 'insert' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewPosition = conversionApi.mapper.toViewPosition( data.range.start );\n\t\tconst viewText = new ViewText( data.item.data );\n\n\t\tviewWriter.insert( viewPosition, viewText );\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts marker adding change to the view ui element.\n * The view ui element that will be added to the view depends on passed parameter. See {@link ~insertElement}.\n * In a case of collapsed range element will not wrap range but separate elements will be placed at the beginning\n * and at the end of the range.\n *\n * **Note:** unlike {@link ~insertElement}, the converter does not bind view element to model, because this converter\n * uses marker as \"model source of data\". This means that view ui element does not have corresponding model element.\n *\n * @param {module:engine/view/uielement~UIElement|Function} elementCreator View ui element, or function returning a view element, which\n * will be inserted.\n * @returns {Function} Insert element event converter.\n */\nexport function insertUIElement( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tlet viewStartElement, viewEndElement;\n\n\t\tif ( elementCreator instanceof ViewElement ) {\n\t\t\tviewStartElement = elementCreator.clone( true );\n\t\t\tviewEndElement = elementCreator.clone( true );\n\t\t} else {\n\t\t\tdata.isOpening = true;\n\t\t\tviewStartElement = elementCreator( data, consumable, conversionApi );\n\n\t\t\tdata.isOpening = false;\n\t\t\tviewEndElement = elementCreator( data, consumable, conversionApi );\n\t\t}\n\n\t\tif ( !viewStartElement || !viewEndElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( data.range, 'addMarker' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mapper = conversionApi.mapper;\n\n\t\tviewWriter.insert( mapper.toViewPosition( data.range.start ), viewStartElement );\n\n\t\tif ( !data.range.isCollapsed ) {\n\t\t\tviewWriter.insert( mapper.toViewPosition( data.range.end ), viewEndElement );\n\t\t}\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts set/change attribute changes from the model to the view. Attributes\n * from model are converted to the view element attributes in the view. You may provide a custom function to generate a\n * key-value attribute pair to add/change. If not provided, model attributes will be converted to view elements attributes\n * on 1-to-1 basis.\n *\n * **Note:** Provided attribute creator should always return the same `key` for given attribute from the model.\n *\n * The converter automatically consumes corresponding value from consumables list and stops the event (see\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}).\n *\n *\t\tmodelDispatcher.on( 'addAttribute:customAttr:myElem', setAttribute( ( data ) => {\n *\t\t\t// Change attribute key from `customAttr` to `class` in view.\n *\t\t\tconst key = 'class';\n *\t\t\tlet value = data.attributeNewValue;\n *\n *\t\t\t// Force attribute value to 'empty' if the model element is empty.\n *\t\t\tif ( data.item.childCount === 0 ) {\n *\t\t\t\tvalue = 'empty';\n *\t\t\t}\n *\n *\t\t\t// Return key-value pair.\n *\t\t\treturn { key, value };\n *\t\t} ) );\n *\n * @param {Function} [attributeCreator] Function returning an object with two properties: `key` and `value`, which\n * represents attribute key and attribute value to be set on a {@link module:engine/view/element~Element view element}.\n * The function is passed all the parameters of the\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:addAttribute}\n * or {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:changeAttribute} event.\n * @returns {Function} Set/change attribute converter.\n */\nexport function setAttribute( attributeCreator ) {\n\tattributeCreator = attributeCreator || ( ( value, key ) => ( { value, key } ) );\n\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tif ( !consumable.consume( data.item, eventNameToConsumableType( evt.name ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { key, value } = attributeCreator( data.attributeNewValue, data.attributeKey, data, consumable, conversionApi );\n\n\t\tconversionApi.mapper.toViewElement( data.item ).setAttribute( key, value );\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts remove attribute changes from the model to the view. Removes attributes\n * that were converted to the view element attributes in the view. You may provide a custom function to generate a\n * key-value attribute pair to remove. If not provided, model attributes will be removed from view elements on 1-to-1 basis.\n *\n * **Note:** Provided attribute creator should always return the same `key` for given attribute from the model.\n *\n * **Note:** You can use the same attribute creator as in {@link module:engine/conversion/model-to-view-converters~setAttribute}.\n *\n * The converter automatically consumes corresponding value from consumables list and stops the event (see\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}).\n *\n *\t\tmodelDispatcher.on( 'removeAttribute:customAttr:myElem', removeAttribute( ( data ) => {\n *\t\t\t// Change attribute key from `customAttr` to `class` in view.\n *\t\t\tconst key = 'class';\n *\t\t\tlet value = data.attributeNewValue;\n *\n *\t\t\t// Force attribute value to 'empty' if the model element is empty.\n *\t\t\tif ( data.item.childCount === 0 ) {\n *\t\t\t\tvalue = 'empty';\n *\t\t\t}\n *\n *\t\t\t// Return key-value pair.\n *\t\t\treturn { key, value };\n *\t\t} ) );\n *\n * @param {Function} [attributeCreator] Function returning an object with two properties: `key` and `value`, which\n * represents attribute key and attribute value to be removed from {@link module:engine/view/element~Element view element}.\n * The function is passed all the parameters of the\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:addAttribute addAttribute event}\n * or {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:changeAttribute changeAttribute event}.\n * @returns {Function} Remove attribute converter.\n */\nexport function removeAttribute( attributeCreator ) {\n\tattributeCreator = attributeCreator || ( ( value, key ) => ( { key } ) );\n\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tif ( !consumable.consume( data.item, eventNameToConsumableType( evt.name ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { key } = attributeCreator( data.attributeOldValue, data.attributeKey, data, consumable, conversionApi );\n\n\t\tconversionApi.mapper.toViewElement( data.item ).removeAttribute( key );\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts set/change attribute changes from the model to the view. In this case,\n * model attributes are converted to a view element that will be wrapping view nodes which corresponding model nodes had\n * the attribute set. This is useful for attributes like `bold`, which may be set on text nodes in model but are\n * represented as an element in the view:\n *\n *\t\t[paragraph] MODEL ====> VIEW

    \n *\t\t\t|- a {bold: true} |- \n *\t\t\t|- b {bold: true} | |- ab\n *\t\t\t|- c |- c\n *\n * The wrapping node depends on passed parameter. If {@link module:engine/view/element~Element} was passed, it will be cloned and\n * the copy will become the wrapping element. If `Function` is provided, it is passed attribute value and then all the parameters of the\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:addAttribute addAttribute event}.\n * It's expected that the function returns a {@link module:engine/view/element~Element}.\n * The result of the function will be the wrapping element.\n * When provided `Function` does not return element, then will be no conversion.\n *\n * The converter automatically consumes corresponding value from consumables list, stops the event (see\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}).\n *\n *\t\tmodelDispatcher.on( 'addAttribute:bold', wrapItem( new ViewAttributeElement( 'strong' ) ) );\n *\n * @param {module:engine/view/element~Element|Function} elementCreator View element, or function returning a view element, which will\n * be used for wrapping.\n * @returns {Function} Set/change attribute converter.\n */\nexport function wrapItem( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst viewElement = ( elementCreator instanceof ViewElement ) ?\n\t\t\telementCreator.clone( true ) :\n\t\t\telementCreator( data.attributeNewValue, data, consumable, conversionApi );\n\n\t\tif ( !viewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( data.item, eventNameToConsumableType( evt.name ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet viewRange = conversionApi.mapper.toViewRange( data.range );\n\n\t\t// If this is a change event (because old value is not empty) and the creator is a function (so\n\t\t// it may create different view elements basing on attribute value) we have to create\n\t\t// view element basing on old value and unwrap it before wrapping with a newly created view element.\n\t\tif ( data.attributeOldValue !== null && !( elementCreator instanceof ViewElement ) ) {\n\t\t\tconst oldViewElement = elementCreator( data.attributeOldValue, data, consumable, conversionApi );\n\t\t\tviewRange = viewWriter.unwrap( viewRange, oldViewElement );\n\t\t}\n\n\t\tviewWriter.wrap( viewRange, viewElement );\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts remove attribute changes from the model to the view. It assumes, that\n * attributes from model were converted to elements in the view. This converter will unwrap view nodes from corresponding\n * view element if given attribute was removed.\n *\n * The view element type that will be unwrapped depends on passed parameter.\n * If {@link module:engine/view/element~Element} was passed, it will be used to look for similar element in the view for unwrapping.\n * If `Function` is provided, it is passed all the parameters of the\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:addAttribute addAttribute event}.\n * It's expected that the function returns a {@link module:engine/view/element~Element}.\n * The result of the function will be used to look for similar element in the view for unwrapping.\n *\n * The converter automatically consumes corresponding value from consumables list, stops the event (see\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}) and bind model and view elements.\n *\n *\t\tmodelDispatcher.on( 'removeAttribute:bold', unwrapItem( new ViewAttributeElement( 'strong' ) ) );\n *\n * @see module:engine/conversion/model-to-view-converters~wrapItem\n * @param {module:engine/view/element~Element|Function} elementCreator View element, or function returning a view element, which will\n * be used for unwrapping.\n * @returns {Function} Remove attribute converter.\n */\nexport function unwrapItem( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst viewElement = ( elementCreator instanceof ViewElement ) ?\n\t\t\telementCreator.clone( true ) :\n\t\t\telementCreator( data.attributeOldValue, data, consumable, conversionApi );\n\n\t\tif ( !viewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( data.item, eventNameToConsumableType( evt.name ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewRange = conversionApi.mapper.toViewRange( data.range );\n\n\t\tviewWriter.unwrap( viewRange, viewElement );\n\t};\n}\n\n/**\n * Function factory, creates a converter that wraps model range.\n *\n * In contrary to {@link module:engine/conversion/model-to-view-converters~wrapItem}, this converter's input is a\n * {@link module:engine/model/range~Range model range} (not changed model item). The model range is mapped\n * to {@link module:engine/view/range~Range view range} and then, view items within that view range are wrapped in a\n * {@link module:engine/view/attributeelement~AttributeElement view attribute element}. Note, that `elementCreator`\n * function of this converter takes different parameters that `elementCreator` of `wrapItem`.\n *\n * Let's assume following model and view. `{}` represents a range that is added as a marker with `searchResult` name.\n * The range represents a result of search `ab` string in the model document. The range has to be visualized in view.\n *\n *\t\t[paragraph] MODEL ====> VIEW

    \n *\t\t\t|- {a |- \n *\t\t\t|- b} | |- ab\n *\t\t\t|- c |- c\n *\n * The wrapping node depends on passed parameter. If {@link module:engine/view/attributeelement~AttributeElement} was passed, it\n * will be cloned and the copy will become the wrapping element. If `Function` is provided, it is passed all the parameters of the\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:addMarker addMarker event}. It's expected\n * that the function returns a {@link module:engine/view/attributeelement~AttributeElement}. The result of the function will be the\n * wrapping element. When provided `Function` does not return element, then will be no conversion.\n *\n * The converter automatically consumes corresponding value from consumables list, stops the event (see\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}).\n *\n *\t\tmodelDispatcher.on( 'addMarker:searchResult', wrapRange( new ViewAttributeElement( 'span', { class: 'searchResult' } ) ) );\n *\n * @param {module:engine/view/attributeelement~AttributeElement|Function} elementCreator View attribute element, or function returning\n * a view attribute element, which will be used for wrapping.\n * @returns {Function} Wrap range converter.\n */\nexport function wrapRange( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst viewElement = ( elementCreator instanceof ViewElement ) ?\n\t\t\telementCreator.clone( true ) :\n\t\t\telementCreator( data, consumable, conversionApi );\n\n\t\tif ( !viewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( data.range, 'addMarker' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewRange = conversionApi.mapper.toViewRange( data.range );\n\t\tconst flatViewRanges = viewWriter.breakViewRangePerContainer( viewRange );\n\n\t\tfor ( let range of flatViewRanges ) {\n\t\t\tviewWriter.wrap( range, viewElement );\n\t\t}\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts removing of a model marker to view attribute element.\n * This converter will unwrap view nodes from corresponding view range.\n *\n * The view element that will be unwrapped depends on passed parameter. If {@link module:engine/view/attributeelement~AttributeElement}\n * was passed, it will be used to look for similar element in the view for unwrapping. If `Function` is provided, it is passed all\n * the parameters of the\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:removeMarker removeMarker event}.\n * It's expected that the function returns a {@link module:engine/view/attributeelement~AttributeElement}. The result of\n * the function will be used to look for similar element in the view for unwrapping.\n *\n * The converter automatically consumes corresponding value from consumables list, stops the event (see\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}) and bind model and view elements.\n *\n *\t\tmodelDispatcher.on( 'removeMarker:searchResult', unwrapRange( new ViewAttributeElement( 'span', { class: 'searchResult' } ) ) );\n *\n * @see module:engine/conversion/model-to-view-converters~wrapRange\n * @param {module:engine/view/attributeelement~AttributeElement|Function} elementCreator View attribute element, or function returning\n * a view attribute element, which will be used for unwrapping.\n * @returns {Function} Unwrap range converter.\n */\nexport function unwrapRange( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst viewElement = ( elementCreator instanceof ViewElement ) ?\n\t\t\telementCreator.clone( true ) :\n\t\t\telementCreator( data, consumable, conversionApi );\n\n\t\tif ( !viewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( data.range, 'removeMarker' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewRange = conversionApi.mapper.toViewRange( data.range );\n\t\tconst flatViewRanges = viewWriter.breakViewRangePerContainer( viewRange );\n\n\t\tfor ( let range of flatViewRanges ) {\n\t\t\tviewWriter.unwrap( range, viewElement );\n\t\t}\n\t};\n}\n\n/**\n * Function factory, creates a default model-to-view converter for node remove changes.\n *\n *\t\tmodelDispatcher.on( 'remove', remove() );\n *\n * @returns {Function} Remove event converter.\n */\nexport function remove() {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tif ( !consumable.consume( data.item, 'remove' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We cannot map non-existing positions from model to view. Since a range was removed\n\t\t// from the model, we cannot recreate that range and map it to view, because\n\t\t// end of that range is incorrect.\n\t\t// Instead we will use `data.sourcePosition` as this is the last correct model position and\n\t\t// it is a position before the removed item. Then, we will calculate view range to remove \"manually\".\n\t\tconst viewPosition = conversionApi.mapper.toViewPosition( data.sourcePosition );\n\t\tlet viewRange;\n\n\t\tif ( data.item.is( 'element' ) ) {\n\t\t\t// Note: in remove conversion we cannot use model-to-view element mapping because `data.item` may be\n\t\t\t// already mapped to another element (this happens when move change is converted).\n\t\t\t// In this case however, `viewPosition` is the position before view element that corresponds to removed model element.\n\t\t\tviewRange = ViewRange.createOn( viewPosition.nodeAfter );\n\t\t} else {\n\t\t\t// If removed item is a text node, we need to traverse view tree to find the view range to remove.\n\t\t\t// Range to remove will start `viewPosition` and should contain amount of characters equal to the amount of removed characters.\n\t\t\tconst viewRangeEnd = _shiftViewPositionByCharacters( viewPosition, data.item.offsetSize );\n\t\t\tviewRange = new ViewRange( viewPosition, viewRangeEnd );\n\t\t}\n\n\t\t// Trim the range to remove in case some UI elements are on the view range boundaries.\n\t\tviewWriter.remove( viewRange.getTrimmed() );\n\n\t\t// Unbind this element only if it was moved to graveyard.\n\t\t// The dispatcher#remove event will also be fired if the element was moved to another place (remove+insert are fired).\n\t\t// Let's say that is moved before . The view will be changed like this:\n\t\t//\n\t\t// 1) start: \n\t\t// 2) insert: \n\t\t// 3) remove: \n\t\t//\n\t\t// If we'll unbind the element in step 3 we'll also lose binding of the element in the view,\n\t\t// because unbindModelElement() cancels both bindings – (model => view ) and (view => model ).\n\t\t// We can't lose any of these.\n\t\t//\n\t\t// See #847.\n\t\tif ( data.item.root.rootName == '$graveyard' ) {\n\t\t\tconversionApi.mapper.unbindModelElement( data.item );\n\t\t}\n\t};\n}\n\n// Helper function that shifts given view `position` in a way that returned position is after `howMany` characters compared\n// to the original `position`.\n// Because in view there might be view ui elements splitting text nodes, we cannot simply use `ViewPosition#getShiftedBy()`.\nfunction _shiftViewPositionByCharacters( position, howMany ) {\n\t// Create a walker that will walk the view tree starting from given position and walking characters one-by-one.\n\tconst walker = new ViewTreeWalker( { startPosition: position, singleCharacters: true } );\n\t// We will count visited characters and return the position after `howMany` characters.\n\tlet charactersFound = 0;\n\n\tfor ( let value of walker ) {\n\t\tif ( value.type == 'text' ) {\n\t\t\tcharactersFound++;\n\n\t\t\tif ( charactersFound == howMany ) {\n\t\t\t\treturn walker.position;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Function factory, creates a default model-to-view converter for removing {@link module:engine/view/uielement~UIElement ui element}\n * basing on marker remove change.\n *\n * @param {module:engine/view/uielement~UIElement|Function} elementCreator View ui element, or function returning\n * a view ui element, which will be used as a pattern when look for element to remove at the marker start position.\n * @returns {Function} Remove ui element converter.\n */\nexport function removeUIElement( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tlet viewStartElement, viewEndElement;\n\n\t\tif ( elementCreator instanceof ViewElement ) {\n\t\t\tviewStartElement = elementCreator.clone( true );\n\t\t\tviewEndElement = elementCreator.clone( true );\n\t\t} else {\n\t\t\tdata.isOpening = true;\n\t\t\tviewStartElement = elementCreator( data, consumable, conversionApi );\n\n\t\t\tdata.isOpening = false;\n\t\t\tviewEndElement = elementCreator( data, consumable, conversionApi );\n\t\t}\n\n\t\tif ( !viewStartElement || !viewEndElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( data.range, 'removeMarker' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewRange = conversionApi.mapper.toViewRange( data.range );\n\n\t\t// First remove closing element.\n\t\tviewWriter.clear( viewRange.getEnlarged(), viewEndElement );\n\n\t\t// If closing and opening elements are not the same then remove opening element.\n\t\tif ( !viewStartElement.isSimilar( viewEndElement ) ) {\n\t\t\tviewWriter.clear( viewRange.getEnlarged(), viewStartElement );\n\t\t}\n\t};\n}\n\n/**\n * Returns the consumable type that is to be consumed in an event, basing on that event name.\n *\n * @param {String} evtName Event name.\n * @returns {String} Consumable type.\n */\nexport function eventNameToConsumableType( evtName ) {\n\tconst parts = evtName.split( ':' );\n\n\treturn parts[ 0 ] + ':' + parts[ 1 ];\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/conversion/model-to-view-converters.js\n// module id = 100\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/insertdelta\n */\n\nimport Delta from './delta';\nimport RemoveDelta from './removedelta';\nimport DeltaFactory from './deltafactory';\nimport InsertOperation from '../operation/insertoperation';\nimport { register } from '../batch';\nimport { normalizeNodes } from './../writer';\n\nimport DocumentFragment from '../documentfragment';\nimport Range from '../../model/range.js';\nimport Position from '../../model/position.js';\n\n/**\n * @classdesc\n * To provide specific OT behavior and better collisions solving, the {@link module:engine/model/batch~Batch#insert Batch#insert} method\n * uses the `InsertDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class InsertDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'insert';\n\t}\n\n\t/**\n\t * Position where the delta inserts nodes or `null` if there are no operations in the delta.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget position() {\n\t\treturn this._insertOperation ? this._insertOperation.position : null;\n\t}\n\n\t/**\n\t * Node list containing all the nodes inserted by the delta or `null` if there are no operations in the delta.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/nodelist~NodeList|null}\n\t */\n\tget nodes() {\n\t\treturn this._insertOperation ? this._insertOperation.nodes : null;\n\t}\n\n\t/**\n\t * Insert operation that is saved in this delta or `null` if there are no operations in the delta.\n\t *\n\t * @readonly\n\t * @protected\n\t * @type {module:engine/model/operation/insertoperation~InsertOperation|null}\n\t */\n\tget _insertOperation() {\n\t\treturn this.operations[ 0 ] || null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget _reverseDeltaClass() {\n\t\treturn RemoveDelta;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.InsertDelta';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get _priority() {\n\t\treturn 20;\n\t}\n}\n\n/**\n * Inserts a node or nodes at the given position.\n *\n * When inserted element is a {@link engine/model/documentfragment~DocumentFragment} and has markers its markers will\n * be set to {@link engine/model/document~Document#markers}.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#insert\n * @param {module:engine/model/position~Position} position Position of insertion.\n * @param {module:engine/model/node~NodeSet} nodes The list of nodes to be inserted.\n */\nregister( 'insert', function( position, nodes ) {\n\tconst normalizedNodes = normalizeNodes( nodes );\n\n\t// If nothing is inserted do not create delta and operation.\n\tif ( normalizedNodes.length === 0 ) {\n\t\treturn this;\n\t}\n\n\tconst delta = new InsertDelta();\n\tconst insert = new InsertOperation( position, normalizedNodes, this.document.version );\n\n\tthis.addDelta( delta );\n\tdelta.addOperation( insert );\n\tthis.document.applyOperation( insert );\n\n\t// When element is a DocumentFragment we need to move its markers to Document#markers.\n\tif ( nodes instanceof DocumentFragment ) {\n\t\tfor ( const [ markerName, markerRange ] of nodes.markers ) {\n\t\t\t// We need to migrate marker range from DocumentFragment to Document.\n\t\t\tconst rangeRootPosition = Position.createAt( markerRange.root );\n\t\t\tconst range = new Range(\n\t\t\t\tmarkerRange.start._getCombined( rangeRootPosition, position ),\n\t\t\t\tmarkerRange.end._getCombined( rangeRootPosition, position )\n\t\t\t);\n\n\t\t\tthis.setMarker( markerName, range );\n\t\t}\n\t}\n\n\treturn this;\n} );\n\nDeltaFactory.register( InsertDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/insertdelta.js\n// module id = 101\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/mergedelta\n */\n\nimport Delta from './delta';\nimport DeltaFactory from './deltafactory';\nimport SplitDelta from './splitdelta';\nimport { register } from '../batch';\nimport Position from '../position';\nimport Element from '../element';\nimport RemoveOperation from '../operation/removeoperation';\nimport MoveOperation from '../operation/moveoperation';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * @classdesc\n * To provide specific OT behavior and better collisions solving, {@link module:engine/model/batch~Batch#merge} method\n * uses the `MergeDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class MergeDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'merge';\n\t}\n\n\t/**\n\t * Position between to merged nodes or `null` if the delta has no operations.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget position() {\n\t\treturn this._removeOperation ? this._removeOperation.sourcePosition : null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tgetReversed() {\n\t\tlet delta = super.getReversed();\n\n\t\tif ( delta.operations.length > 0 ) {\n\t\t\tdelta.operations[ 1 ].isSticky = false;\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\t/**\n\t * Operation in this delta that removes the node after merge position (which will be empty at that point) or\n\t * `null` if the delta has no operations. Note, that after {@link module:engine/model/delta/transform~transform transformation}\n\t * this might be an instance of {@link module:engine/model/operation/moveoperation~MoveOperation} instead of\n\t * {@link module:engine/model/operation/removeoperation~RemoveOperation}.\n\t *\n\t * @readonly\n\t * @protected\n\t * @type {module:engine/model/operation/moveoperation~MoveOperation|null}\n\t */\n\tget _removeOperation() {\n\t\treturn this.operations[ 1 ] || null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget _reverseDeltaClass() {\n\t\treturn SplitDelta;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.MergeDelta';\n\t}\n}\n\n/**\n * Merges two siblings at the given position.\n *\n * Node before and after the position have to be an element. Otherwise `batch-merge-no-element-before` or\n * `batch-merge-no-element-after` error will be thrown.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#merge\n * @param {module:engine/model/position~Position} position Position of merge.\n */\nregister( 'merge', function( position ) {\n\tconst delta = new MergeDelta();\n\tthis.addDelta( delta );\n\n\tconst nodeBefore = position.nodeBefore;\n\tconst nodeAfter = position.nodeAfter;\n\n\tif ( !( nodeBefore instanceof Element ) ) {\n\t\t/**\n\t\t * Node before merge position must be an element.\n\t\t *\n\t\t * @error batch-merge-no-element-before\n\t\t */\n\t\tthrow new CKEditorError( 'batch-merge-no-element-before: Node before merge position must be an element.' );\n\t}\n\n\tif ( !( nodeAfter instanceof Element ) ) {\n\t\t/**\n\t\t * Node after merge position must be an element.\n\t\t *\n\t\t * @error batch-merge-no-element-after\n\t\t */\n\t\tthrow new CKEditorError( 'batch-merge-no-element-after: Node after merge position must be an element.' );\n\t}\n\n\tconst positionAfter = Position.createFromParentAndOffset( nodeAfter, 0 );\n\tconst positionBefore = Position.createFromParentAndOffset( nodeBefore, nodeBefore.maxOffset );\n\n\tconst move = new MoveOperation( positionAfter, nodeAfter.maxOffset, positionBefore, this.document.version );\n\tmove.isSticky = true;\n\tdelta.addOperation( move );\n\tthis.document.applyOperation( move );\n\n\tconst remove = new RemoveOperation( position, 1, this.document.version );\n\tdelta.addOperation( remove );\n\tthis.document.applyOperation( remove );\n\n\treturn this;\n} );\n\nDeltaFactory.register( MergeDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/mergedelta.js\n// module id = 102\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/movedelta\n */\n\nimport Delta from './delta';\nimport DeltaFactory from './deltafactory';\nimport { register } from '../batch';\nimport MoveOperation from '../operation/moveoperation';\nimport Position from '../position';\nimport Range from '../range';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * @classdesc\n * To provide specific OT behavior and better collisions solving, {@link module:engine/model/batch~Batch#move} method\n * uses the `MoveDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class MoveDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'move';\n\t}\n\n\t/**\n\t * Offset size of moved range or `null` if there are no operations in the delta.\n\t *\n\t * @type {Number|null}\n\t */\n\tget howMany() {\n\t\treturn this._moveOperation ? this._moveOperation.howMany : null;\n\t}\n\n\t/**\n\t * {@link module:engine/model/delta/movedelta~MoveDelta#_moveOperation Move operation}\n\t * {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition source position} or `null` if there are\n\t * no operations in the delta.\n\t *\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget sourcePosition() {\n\t\treturn this._moveOperation ? this._moveOperation.sourcePosition : null;\n\t}\n\n\t/**\n\t * {@link module:engine/model/delta/movedelta~MoveDelta#_moveOperation Move operation}\n\t * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition target position} or `null` if there are\n\t * no operations in the delta.\n\t *\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget targetPosition() {\n\t\treturn this._moveOperation ? this._moveOperation.targetPosition : null;\n\t}\n\n\t/**\n\t * {@link module:engine/model/delta/movedelta~MoveDelta#_moveOperation Move operation} that is saved in this delta or `null`\n\t * if there are no operations in the delta.\n\t *\n\t * @protected\n\t * @type {module:engine/model/operation/moveoperation~MoveOperation|null}\n\t */\n\tget _moveOperation() {\n\t\treturn this.operations[ 0 ] || null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget _reverseDeltaClass() {\n\t\treturn MoveDelta;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.MoveDelta';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get _priority() {\n\t\treturn 20;\n\t}\n}\n\nfunction addMoveOperation( batch, delta, sourcePosition, howMany, targetPosition ) {\n\tconst operation = new MoveOperation( sourcePosition, howMany, targetPosition, batch.document.version );\n\tdelta.addOperation( operation );\n\tbatch.document.applyOperation( operation );\n}\n\n/**\n * Moves given {@link module:engine/model/item~Item model item} or given range to target position.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#move\n * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange Model item or range of nodes to move.\n * @param {module:engine/model/position~Position} targetPosition Position where moved nodes will be inserted.\n */\nregister( 'move', function( itemOrRange, targetPosition ) {\n\tconst delta = new MoveDelta();\n\tthis.addDelta( delta );\n\n\tif ( itemOrRange instanceof Range ) {\n\t\tif ( !itemOrRange.isFlat ) {\n\t\t\t/**\n\t\t\t * Range to move is not flat.\n\t\t\t *\n\t\t\t * @error batch-move-range-not-flat\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'batch-move-range-not-flat: Range to move is not flat.' );\n\t\t}\n\n\t\taddMoveOperation( this, delta, itemOrRange.start, itemOrRange.end.offset - itemOrRange.start.offset, targetPosition );\n\t} else {\n\t\taddMoveOperation( this, delta, Position.createBefore( itemOrRange ), 1, targetPosition );\n\t}\n\n\treturn this;\n} );\n\nDeltaFactory.register( MoveDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/movedelta.js\n// module id = 103\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/removedelta\n */\n\nimport MoveDelta from './movedelta';\nimport { register } from '../batch';\nimport DeltaFactory from './deltafactory';\nimport RemoveOperation from '../operation/removeoperation';\nimport Position from '../position';\nimport Range from '../range';\n\n/**\n * @classdesc\n * To provide specific OT behavior and better collisions solving, {@link module:engine/model/batch~Batch#remove} method\n * uses the `RemoveDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class RemoveDelta extends MoveDelta {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.RemoveDelta';\n\t}\n}\n\nfunction addRemoveOperation( batch, delta, position, howMany ) {\n\tconst operation = new RemoveOperation( position, howMany, batch.document.version );\n\tdelta.addOperation( operation );\n\tbatch.document.applyOperation( operation );\n}\n\n/**\n * Removes given {@link module:engine/model/item~Item model item} or given range.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#remove\n * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange Model item or range to remove.\n */\nregister( 'remove', function( itemOrRange ) {\n\tconst delta = new RemoveDelta();\n\tthis.addDelta( delta );\n\n\tif ( itemOrRange instanceof Range ) {\n\t\t// The array is reversed, so the ranges are correct and do not have to be updated.\n\t\tlet ranges = itemOrRange.getMinimalFlatRanges().reverse();\n\n\t\tfor ( let flat of ranges ) {\n\t\t\taddRemoveOperation( this, delta, flat.start, flat.end.offset - flat.start.offset );\n\t\t}\n\t} else {\n\t\taddRemoveOperation( this, delta, Position.createBefore( itemOrRange ), 1 );\n\t}\n\n\treturn this;\n} );\n\nDeltaFactory.register( RemoveDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/removedelta.js\n// module id = 104\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/splitdelta\n */\n\nimport Delta from './delta';\nimport DeltaFactory from './deltafactory';\nimport { register } from '../batch';\nimport Position from '../position';\nimport Element from '../element';\nimport InsertOperation from '../operation/insertoperation';\nimport MoveOperation from '../operation/moveoperation';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport MergeDelta from '../delta/mergedelta';\n\n/**\n * @classdesc\n * To provide specific OT behavior and better collisions solving, the {@link module:engine/model/batch~Batch#split} method\n * uses `SplitDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class SplitDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'split';\n\t}\n\n\t/**\n\t * Position of split or `null` if there are no operations in the delta.\n\t *\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget position() {\n\t\treturn this._moveOperation ? this._moveOperation.sourcePosition : null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tgetReversed() {\n\t\tlet delta = super.getReversed();\n\n\t\tif ( delta.operations.length > 0 ) {\n\t\t\tdelta.operations[ 0 ].isSticky = true;\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\t/**\n\t * Operation in the delta that adds to model an element into which split nodes will be moved, or `null` if\n\t * there are no operations in the delta.\n\t *\n\t * Most commonly this will be {@link module:engine/model/operation/insertoperation~InsertOperation an insert operation},\n\t * as `SplitDelta` has to create a new node. If `SplitDelta` was created through\n\t * {@link module:engine/model/delta/delta~Delta#getReversed reversing}\n\t * a {@link module:engine/model/delta/mergedelta~MergeDelta merge delta},\n\t * this will be a {@link module:engine/model/operation/reinsertoperation~ReinsertOperation reinsert operation},\n\t * as we will want to re-insert the exact element that was removed by that merge delta.\n\t *\n\t * @protected\n\t * @type {module:engine/model/operation/insertoperation~InsertOperation|\n\t * module:engine/model/operation/reinsertoperation~ReinsertOperation|null}\n\t */\n\tget _cloneOperation() {\n\t\treturn this.operations[ 0 ] || null;\n\t}\n\n\t/**\n\t * Operation in the delta that moves model items, that are after split position, to their new parent or `null`\n\t * if there are no operations in the delta.\n\t *\n\t * @protected\n\t * @type {module:engine/model/operation/moveoperation~MoveOperation|null}\n\t */\n\tget _moveOperation() {\n\t\treturn this.operations[ 1 ] || null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget _reverseDeltaClass() {\n\t\treturn MergeDelta;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.SplitDelta';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get _priority() {\n\t\treturn 5;\n\t}\n}\n\n/**\n * Splits an element at the given position.\n *\n * The element cannot be a root element, as root element cannot be split. The `batch-split-root` error will be thrown if\n * you try to split the root element.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#split\n * @param {module:engine/model/position~Position} position Position of split.\n */\nregister( 'split', function( position ) {\n\tconst delta = new SplitDelta();\n\tthis.addDelta( delta );\n\n\tconst splitElement = position.parent;\n\n\tif ( !splitElement.parent ) {\n\t\t/**\n\t\t * Root element can not be split.\n\t\t *\n\t\t * @error batch-split-root\n\t\t */\n\t\tthrow new CKEditorError( 'batch-split-root: Root element can not be split.' );\n\t}\n\n\tconst copy = new Element( splitElement.name, splitElement.getAttributes() );\n\n\tconst insert = new InsertOperation( Position.createAfter( splitElement ), copy, this.document.version );\n\n\tdelta.addOperation( insert );\n\tthis.document.applyOperation( insert );\n\n\tconst move = new MoveOperation(\n\t\tposition,\n\t\tsplitElement.maxOffset - position.offset,\n\t\tPosition.createFromParentAndOffset( copy, 0 ),\n\t\tthis.document.version\n\t);\n\tmove.isSticky = true;\n\n\tdelta.addOperation( move );\n\tthis.document.applyOperation( move );\n\n\treturn this;\n} );\n\nDeltaFactory.register( SplitDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/splitdelta.js\n// module id = 105\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/transform\n */\n\nimport Delta from './delta';\nimport operationTransform from '../operation/transform';\nimport NoOperation from '../operation/nooperation';\nimport arrayUtils from '@ckeditor/ckeditor5-utils/src/lib/lodash/array';\n\nconst specialCases = new Map();\n\n/**\n * Transforms given {@link module:engine/model/delta/delta~Delta delta} by another {@link module:engine/model/delta/delta~Delta delta} and\n * returns the result of that transformation as an array containing one or more {@link module:engine/model/delta/delta~Delta delta}\n * instances.\n *\n * Delta transformations heavily base on {@link module:engine/model/operation/transform~transform operational transformations}. Since\n * delta is a list of operations most situations can be handled thanks to operational transformation. Unfortunately,\n * deltas are more complicated than operations and have they semantic meaning, as they represent user's editing intentions.\n *\n * Sometimes, simple operational transformation on deltas' operations might result in some unexpected results. Those\n * results would be fine from OT point of view, but would not reflect user's intentions. Because of such conflicts\n * we need to handle transformations in special cases in a custom way.\n *\n * The function itself looks whether two given delta types have a special case function registered. If so, the deltas are\n * transformed using that function. If not, {@link module:engine/model/delta/transform~defaultTransform default transformation algorithm}\n * is used.\n *\n * @param {module:engine/model/delta/delta~Delta} a Delta that will be transformed.\n * @param {module:engine/model/delta/delta~Delta} b Delta to transform by.\n * @param {Boolean} isAMoreImportantThanB Flag indicating whether the delta which will be transformed (`a`) should be treated\n * as more important when resolving conflicts. Note that this flag is used only if provided deltas have same\n * {@link module:engine/model/delta/delta~Delta._priority priority}. If deltas have different priorities, their importance is resolved\n * automatically and overwrites this flag.\n * @returns {Array.} Result of the transformation.\n */\nexport default function transform( a, b, isAMoreImportantThanB ) {\n\tconst transformAlgorithm = getTransformationCase( a, b ) || defaultTransform;\n\n\tconst transformed = transformAlgorithm( a, b, isAMoreImportantThanB );\n\tconst baseVersion = arrayUtils.last( b.operations ).baseVersion;\n\n\treturn updateBaseVersion( baseVersion, transformed );\n}\n\n// Updates base versions of operations inside deltas (which are the results of delta transformation).\nfunction updateBaseVersion( baseVersion, deltas ) {\n\tfor ( let delta of deltas ) {\n\t\tfor ( let op of delta.operations ) {\n\t\t\top.baseVersion = ++baseVersion;\n\t\t}\n\t}\n\n\treturn deltas;\n}\n\n/**\n * The default delta transformation function. It is used for those deltas that are not in special case conflict.\n *\n * This algorithm is similar to a popular `dOPT` algorithm used in operational transformation, as we are in fact\n * transforming two sets of operations by each other.\n *\n * @param {module:engine/model/delta/delta~Delta} a Delta that will be transformed.\n * @param {module:engine/model/delta/delta~Delta} b Delta to transform by.\n * @param {Boolean} isAMoreImportantThanB Flag indicating whether the delta which will be transformed (`a`) should be treated\n * as more important when resolving conflicts. Note that this flag is used only if provided deltas have same\n * {@link module:engine/model/delta/delta~Delta._priority priority}. If deltas have different priorities, their importance is resolved\n * automatically and overwrites this flag.\n * @returns {Array.} Result of the transformation, that is an array with single delta instance.\n */\nexport function defaultTransform( a, b, isAMoreImportantThanB ) {\n\t// First, resolve the flag real value.\n\tisAMoreImportantThanB = getPriority( a.constructor, b.constructor, isAMoreImportantThanB );\n\n\t// Create a new delta instance. Make sure that the new delta is of same type as transformed delta.\n\t// We will transform operations in that delta but it doesn't mean the delta's \"meaning\" which is connected to\n\t// the delta's type. Since the delta's type is heavily used in transformations and probably other parts\n\t// of system it is important to keep proper delta type through all transformation process.\n\tconst transformed = new a.constructor();\n\n\t// Array containing operations that we will transform by. At the beginning these are just operations from\n\tlet byOps = b.operations;\n\n\t// This array is storing operations from `byOps` which got transformed by operation from delta `a`.\n\tlet newByOps = [];\n\n\t// We take each operation from original set of operations to transform.\n\tfor ( let opA of a.operations ) {\n\t\t// We wrap the operation in the array. This is important, because operation transformation algorithm returns\n\t\t// an array of operations so we need to make sure that our algorithm is ready to handle arrays.\n\t\tconst ops = [ opA ];\n\n\t\t// Now the real algorithm takes place.\n\t\tfor ( let opB of byOps ) {\n\t\t\t// For each operation that we need transform by...\n\t\t\tfor ( let i = 0; i < ops.length; i++ ) {\n\t\t\t\t// We take each operation to transform...\n\t\t\t\tconst op = ops[ i ];\n\n\t\t\t\t// And transform both of them by themselves.\n\n\t\t\t\t// The result of transforming operation from delta B by operation from delta A is saved in\n\t\t\t\t// `newByOps` array. We will use that array for transformations in next loops. We need delta B\n\t\t\t\t// operations after transformed by delta A operations to get correct results of transformations\n\t\t\t\t// of next operations from delta A.\n\t\t\t\t//\n\t\t\t\t// It's like this because 2nd operation from delta A assumes that 1st operation from delta A\n\t\t\t\t// is \"already applied\". When we transform 2nd operation from delta A by operations from delta B\n\t\t\t\t// we have to be sure that operations from delta B are in a state that acknowledges 1st operation\n\t\t\t\t// from delta A.\n\t\t\t\t//\n\t\t\t\t// This can be easier understood when operations sets to transform are represented by diamond diagrams:\n\t\t\t\t// http://www.codecommit.com/blog/java/understanding-and-applying-operational-transformation\n\n\t\t\t\t// Using push.apply because operationTransform function is returning an array with one or multiple results.\n\t\t\t\tArray.prototype.push.apply( newByOps, operationTransform( opB, op, !isAMoreImportantThanB ) );\n\n\t\t\t\t// Then, we transform operation from delta A by operation from delta B.\n\t\t\t\tconst results = operationTransform( op, opB, isAMoreImportantThanB );\n\n\t\t\t\t// We replace currently processed operation from `ops` array by the results of transformation.\n\t\t\t\t// Note, that we process single operation but the operationTransform result might be an array, so we\n\t\t\t\t// might splice-in more operations. We will process them further in next iterations. Right now we\n\t\t\t\t// just save them in `ops` array and move `i` pointer by proper offset.\n\t\t\t\tArray.prototype.splice.apply( ops, [ i, 1 ].concat( results ) );\n\n\t\t\t\ti += results.length - 1;\n\t\t\t}\n\n\t\t\t// At this point a single operation from delta A got transformed by a single operation from delta B.\n\t\t\t// The transformation result is in `ops` array and it may be one or more operations. This was just the first step.\n\t\t\t// Operation from delta A has to be further transformed by the other operations from delta B.\n\t\t\t// So in next iterator loop we will take another operation from delta B and use transformed delta A (`ops`)\n\t\t\t// to transform it further.\n\t\t}\n\n\t\t// We got through all delta B operations and have a final transformed state of an operation from delta A.\n\n\t\t// As previously mentioned, we substitute operations from delta B by their transformed equivalents.\n\t\tbyOps = newByOps;\n\t\tnewByOps = [];\n\n\t\t// We add transformed operation from delta A to newly created delta.\n\t\t// Remember that transformed operation from delta A may consist of multiple operations.\n\t\tfor ( let op of ops ) {\n\t\t\ttransformed.addOperation( op );\n\t\t}\n\n\t\t// In next loop, we will take another operation from delta A and transform it through (transformed) operations\n\t\t// from delta B...\n\t}\n\n\treturn [ transformed ];\n}\n\n/**\n * Adds a special case callback for given delta classes.\n *\n * @external module:engine/model/delta/transform~transform\n * @function module:engine/model/delta/transform~transform.addTransformationCase\n * @param {Function} A Delta constructor which instance will get transformed.\n * @param {Function} B Delta constructor which instance will be transformed by.\n * @param {Function} resolver A callback that will handle custom special case transformation for instances of given delta classes.\n */\nexport function addTransformationCase( A, B, resolver ) {\n\tlet casesA = specialCases.get( A );\n\n\tif ( !casesA ) {\n\t\tcasesA = new Map();\n\t\tspecialCases.set( A, casesA );\n\t}\n\n\tcasesA.set( B, resolver );\n}\n\n/**\n * Gets a special case callback which was previously {@link module:engine/model/delta/transform~transform.addTransformationCase added}.\n *\n * @param {module:engine/model/delta/delta~Delta} a Delta to transform.\n * @param {module:engine/model/delta/delta~Delta} b Delta to be transformed by.\n */\nexport function getTransformationCase( a, b ) {\n\tlet casesA = specialCases.get( a.constructor );\n\n\t// If there are no special cases registered for class which `a` is instance of, we will\n\t// check if there are special cases registered for any parent class.\n\tif ( !casesA || !casesA.get( b.constructor ) ) {\n\t\tconst cases = specialCases.keys();\n\n\t\tfor ( let caseClass of cases ) {\n\t\t\tif ( a instanceof caseClass && specialCases.get( caseClass ).get( b.constructor ) ) {\n\t\t\t\tcasesA = specialCases.get( caseClass );\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( casesA ) {\n\t\treturn casesA.get( b.constructor );\n\t}\n\n\treturn undefined;\n}\n\n// Checks priorities of passed constructors and decides which one is more important.\n// If both priorities are same, value passed in `isAMoreImportantThanB` parameter is used.\nfunction getPriority( A, B, isAMoreImportantThanB ) {\n\tif ( A._priority > B._priority ) {\n\t\treturn true;\n\t} else if ( A._priority < B._priority ) {\n\t\treturn false;\n\t} else {\n\t\treturn isAMoreImportantThanB;\n\t}\n}\n\n/**\n * Transforms two sets of deltas by themselves. Returns both transformed sets. Does not modify passed parameters.\n *\n * @param {Array.} deltasA Array with first set of deltas to transform.\n * @param {Array.} deltasB Array with second set of deltas to transform.\n * @param {Boolean} isAMoreImportantThanB Flag indicating whether the deltas from `deltasA` set should be treated as more\n * important when resolving conflicts.\n * @returns {Object}\n * @returns {Array.} return.deltasA The first set of deltas transformed by the second set of deltas.\n * @returns {Array.} return.deltasB The second set of deltas transformed by the first set of deltas.\n */\nexport function transformDeltaSets( deltasA, deltasB, isAMoreImportantThanB ) {\n\tlet transformedDeltasA = Array.from( deltasA );\n\tlet transformedDeltasB = Array.from( deltasB );\n\n\tfor ( let i = 0; i < transformedDeltasA.length; i++ ) {\n\t\tlet deltaA = [ transformedDeltasA[ i ] ];\n\n\t\tfor ( let j = 0; j < transformedDeltasB.length; j++ ) {\n\t\t\tlet deltaB = [ transformedDeltasB[ j ] ];\n\n\t\t\tfor ( let k = 0; k < deltaA.length; k++ ) {\n\t\t\t\tfor ( let l = 0; l < deltaB.length; l++ ) {\n\t\t\t\t\tlet resultAB = transform( deltaA[ k ], deltaB[ l ], isAMoreImportantThanB );\n\t\t\t\t\tlet resultBA = transform( deltaB[ l ], deltaA[ k ], !isAMoreImportantThanB );\n\n\t\t\t\t\tdeltaA.splice( k, 1, ...resultAB );\n\t\t\t\t\tk += resultAB.length - 1;\n\n\t\t\t\t\tdeltaB.splice( l, 1, ...resultBA );\n\t\t\t\t\tl += resultBA.length - 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttransformedDeltasB.splice( j, 1, ...deltaB );\n\t\t\tj += deltaB.length - 1;\n\t\t}\n\n\t\ttransformedDeltasA.splice( i, 1, ...deltaA );\n\t\ti += deltaA.length - 1;\n\t}\n\n\tconst opsDiffA = getOpsCount( transformedDeltasA ) - getOpsCount( deltasA );\n\tconst opsDiffB = getOpsCount( transformedDeltasB ) - getOpsCount( deltasB );\n\n\tif ( opsDiffB < opsDiffA ) {\n\t\tpadWithNoOps( transformedDeltasB, opsDiffA - opsDiffB );\n\t} else if ( opsDiffA < opsDiffB ) {\n\t\tpadWithNoOps( transformedDeltasA, opsDiffB - opsDiffA );\n\t}\n\n\treturn { deltasA: transformedDeltasA, deltasB: transformedDeltasB };\n}\n\n// Returns number of operations in given array of deltas.\nfunction getOpsCount( deltas ) {\n\treturn deltas.reduce( ( current, delta ) => {\n\t\treturn current + delta.operations.length;\n\t}, 0 );\n}\n\n// Adds a delta containing `howMany` `NoOperation` instances to given array with deltas.\n// Used to \"synchronize\" the number of operations in two delta sets.\nfunction padWithNoOps( deltas, howMany ) {\n\tconst lastDelta = deltas[ deltas.length - 1 ];\n\tlet baseVersion = lastDelta.operations.length + lastDelta.baseVersion;\n\n\tlet noDelta = new Delta();\n\n\tfor ( let i = 0; i < howMany; i++ ) {\n\t\tnoDelta.addOperation( new NoOperation( baseVersion++ ) );\n\t}\n\n\tdeltas.push( noDelta );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/transform.js\n// module id = 106\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/unwrapdelta\n */\n\nimport Delta from './delta';\nimport DeltaFactory from './deltafactory';\nimport WrapDelta from './wrapdelta';\nimport { register } from '../batch';\nimport Position from '../position';\nimport RemoveOperation from '../operation/removeoperation';\nimport MoveOperation from '../operation/moveoperation';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * @classdesc\n * To provide specific OT behavior and better collisions solving, {@link module:engine/model/batch~Batch#merge} method\n * uses the `UnwrapDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class UnwrapDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'unwrap';\n\t}\n\n\t/**\n\t * Position before unwrapped element or `null` if there are no operations in the delta.\n\t *\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget position() {\n\t\treturn this._moveOperation ? this._moveOperation.targetPosition : null;\n\t}\n\n\t/**\n\t * Operation in the delta that moves unwrapped nodes to their new parent or `null` if there are no operations in the delta.\n\t *\n\t * @protected\n\t * @type {module:engine/model/operation/moveoperation~MoveOperation|null}\n\t */\n\tget _moveOperation() {\n\t\treturn this.operations[ 0 ] || null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget _reverseDeltaClass() {\n\t\treturn WrapDelta;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.UnwrapDelta';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get _priority() {\n\t\treturn 10;\n\t}\n}\n\n/**\n * Unwraps children of the given element – all its children are moved before it and then the element is removed.\n * Throws error if you try to unwrap an element which does not have a parent.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#unwrap\n * @param {module:engine/model/element~Element} position Element to unwrap.\n */\nregister( 'unwrap', function( element ) {\n\tif ( element.parent === null ) {\n\t\t/**\n\t\t * Trying to unwrap an element which has no parent.\n\t\t *\n\t\t * @error batch-unwrap-element-no-parent\n\t\t */\n\t\tthrow new CKEditorError( 'batch-unwrap-element-no-parent: Trying to unwrap an element which has no parent.' );\n\t}\n\n\tconst delta = new UnwrapDelta();\n\tthis.addDelta( delta );\n\n\tlet sourcePosition = Position.createFromParentAndOffset( element, 0 );\n\n\tconst move = new MoveOperation( sourcePosition, element.maxOffset, Position.createBefore( element ), this.document.version );\n\tmove.isSticky = true;\n\tdelta.addOperation( move );\n\tthis.document.applyOperation( move );\n\n\t// Computing new position because we moved some nodes before `element`.\n\t// If we would cache `Position.createBefore( element )` we remove wrong node.\n\tconst remove = new RemoveOperation( Position.createBefore( element ), 1, this.document.version );\n\tdelta.addOperation( remove );\n\tthis.document.applyOperation( remove );\n\n\treturn this;\n} );\n\nDeltaFactory.register( UnwrapDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/unwrapdelta.js\n// module id = 107\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/wrapdelta\n */\n\nimport Delta from './delta';\nimport DeltaFactory from './deltafactory';\nimport UnwrapDelta from './unwrapdelta';\nimport { register } from '../batch';\nimport Position from '../position';\nimport Range from '../range';\nimport Element from '../element';\nimport InsertOperation from '../operation/insertoperation';\nimport MoveOperation from '../operation/moveoperation';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * @classdesc\n * To provide specific OT behavior and better collisions solving, {@link module:engine/model/batch~Batch#merge} method\n * uses the `WrapDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class WrapDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'wrap';\n\t}\n\n\t/**\n\t * Range to wrap or `null` if there are no operations in the delta.\n\t *\n\t * @type {module:engine/model/range~Range|null}\n\t */\n\tget range() {\n\t\tlet moveOp = this._moveOperation;\n\n\t\treturn moveOp ? Range.createFromPositionAndShift( moveOp.sourcePosition, moveOp.howMany ) : null;\n\t}\n\n\t/**\n\t * Offset size of range to wrap by the delta or `null` if there are no operations in delta.\n\t *\n\t * @type {Number}\n\t */\n\tget howMany() {\n\t\tlet range = this.range;\n\n\t\treturn range ? range.end.offset - range.start.offset : 0;\n\t}\n\n\t/**\n\t * Operation that inserts wrapping element or `null` if there are no operations in the delta.\n\t *\n\t * @protected\n\t * @type {module:engine/model/operation/insertoperation~InsertOperation|module:engine/model/operation/reinsertoperation~ReinsertOperation}\n\t */\n\tget _insertOperation() {\n\t\treturn this.operations[ 0 ] || null;\n\t}\n\n\t/**\n\t * Operation that moves wrapped nodes to their new parent or `null` if there are no operations in the delta.\n\t *\n\t * @protected\n\t * @type {module:engine/model/operation/moveoperation~MoveOperation|null}\n\t */\n\tget _moveOperation() {\n\t\treturn this.operations[ 1 ] || null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget _reverseDeltaClass() {\n\t\treturn UnwrapDelta;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.WrapDelta';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get _priority() {\n\t\treturn 10;\n\t}\n}\n\n/**\n * Wraps given range with given element or with a new element with specified name, if string has been passed.\n * **Note:** range to wrap should be a \"flat range\" (see {@link module:engine/model/range~Range#isFlat}). If not, error will be thrown.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#wrap\n * @param {module:engine/model/range~Range} range Range to wrap.\n * @param {module:engine/model/element~Element|String} elementOrString Element or name of element to wrap the range with.\n */\nregister( 'wrap', function( range, elementOrString ) {\n\tif ( !range.isFlat ) {\n\t\t/**\n\t\t * Range to wrap is not flat.\n\t\t *\n\t\t * @error batch-wrap-range-not-flat\n\t\t */\n\t\tthrow new CKEditorError( 'batch-wrap-range-not-flat: Range to wrap is not flat.' );\n\t}\n\n\tlet element = elementOrString instanceof Element ? elementOrString : new Element( elementOrString );\n\n\tif ( element.childCount > 0 ) {\n\t\t/**\n\t\t * Element to wrap with is not empty.\n\t\t *\n\t\t * @error batch-wrap-element-not-empty\n\t\t */\n\t\tthrow new CKEditorError( 'batch-wrap-element-not-empty: Element to wrap with is not empty.' );\n\t}\n\n\tif ( element.parent !== null ) {\n\t\t/**\n\t\t * Element to wrap with is already attached to a tree model.\n\t\t *\n\t\t * @error batch-wrap-element-attached\n\t\t */\n\t\tthrow new CKEditorError( 'batch-wrap-element-attached: Element to wrap with is already attached to tree model.' );\n\t}\n\n\tconst delta = new WrapDelta();\n\tthis.addDelta( delta );\n\n\tlet insert = new InsertOperation( range.end, element, this.document.version );\n\tdelta.addOperation( insert );\n\tthis.document.applyOperation( insert );\n\n\tlet targetPosition = Position.createFromParentAndOffset( element, 0 );\n\tlet move = new MoveOperation( range.start, range.end.offset - range.start.offset, targetPosition, this.document.version );\n\tdelta.addOperation( move );\n\tthis.document.applyOperation( move );\n\n\treturn this;\n} );\n\nDeltaFactory.register( WrapDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/wrapdelta.js\n// module id = 108\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/liverange\n */\n\nimport Range from './range';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * `LiveRange` is a type of {@link module:engine/model/range~Range Range}\n * that updates itself as {@link module:engine/model/document~Document document}\n * is changed through operations. It may be used as a bookmark.\n *\n * **Note:** Be very careful when dealing with `LiveRange`. Each `LiveRange` instance bind events that might\n * have to be unbound. Use {@link module:engine/model/liverange~LiveRange#detach detach} whenever you don't need `LiveRange` anymore.\n */\nexport default class LiveRange extends Range {\n\t/**\n\t * Creates a live range.\n\t *\n\t * @see module:engine/model/range~Range\n\t */\n\tconstructor( start, end ) {\n\t\tsuper( start, end );\n\n\t\tbindWithDocument.call( this );\n\t}\n\n\t/**\n\t * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance\n\t * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was\n\t * referring to it).\n\t */\n\tdetach() {\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * @see module:engine/model/range~Range.createIn\n\t * @static\n\t * @method module:engine/model/liverange~LiveRange.createIn\n\t * @param {module:engine/model/element~Element} element\n\t * @returns {module:engine/model/liverange~LiveRange}\n\t */\n\n\t/**\n\t * @see module:engine/model/range~Range.createFromPositionAndShift\n\t * @static\n\t * @method module:engine/model/liverange~LiveRange.createFromPositionAndShift\n\t * @param {module:engine/model/position~Position} position\n\t * @param {Number} shift\n\t * @returns {module:engine/model/liverange~LiveRange}\n\t */\n\n\t/**\n\t * @see module:engine/model/range~Range.createFromParentsAndOffsets\n\t * @static\n\t * @method module:engine/model/liverange~LiveRange.createFromParentsAndOffsets\n\t * @param {module:engine/model/element~Element} startElement\n\t * @param {Number} startOffset\n\t * @param {module:engine/model/element~Element} endElement\n\t * @param {Number} endOffset\n\t * @returns {module:engine/model/liverange~LiveRange}\n\t */\n\n\t/**\n\t * @see module:engine/model/range~Range.createFromRange\n\t * @static\n\t * @method module:engine/model/liverange~LiveRange.createFromRange\n\t * @param {module:engine/model/range~Range} range\n\t * @returns {module:engine/model/liverange~LiveRange}\n\t */\n\n\t/**\n\t * Fired when `LiveRange` instance is changed due to changes on {@link module:engine/model/document~Document}.\n\t *\n\t * @event change\n\t * @param {module:engine/model/range~Range} oldRange\n\t * Range with start and end position equal to start and end position of this live range before it got changed.\n\t */\n}\n\n/**\n * Binds this `LiveRange` to the {@link module:engine/model/document~Document document}\n * that owns this range's {@link module:engine/model/range~Range#root root}.\n *\n * @ignore\n * @private\n * @method module:engine/model/liverange~LiveRange#bindWithDocument\n */\nfunction bindWithDocument() {\n\t/*jshint validthis: true */\n\t// Operation types that a range can be transformed by.\n\tconst supportedTypes = new Set( [ 'insert', 'move', 'remove', 'reinsert' ] );\n\n\tthis.listenTo(\n\t\tthis.root.document,\n\t\t'change',\n\t\t( event, type, changes, batch, deltaType ) => {\n\t\t\tif ( supportedTypes.has( type ) ) {\n\t\t\t\ttransform.call( this, type, deltaType, changes.range, changes.sourcePosition );\n\t\t\t}\n\t\t},\n\t\t{ priority: 'high' }\n\t);\n}\n\n/**\n * Updates this range accordingly to the updates applied to the model. Bases on change events.\n *\n * @ignore\n * @private\n * @method transform\n * @param {String} [changeType] Type of change applied to the model document.\n * @param {String} [deltaType] Type of delta which introduced the change.\n * @param {module:engine/model/range~Range} targetRange Range containing the result of applied change.\n * @param {module:engine/model/position~Position} [sourcePosition] Source position for move, remove and reinsert change types.\n */\nfunction transform( changeType, deltaType, targetRange, sourcePosition ) {\n\t/* jshint validthis: true */\n\tconst howMany = targetRange.end.offset - targetRange.start.offset;\n\tlet targetPosition = targetRange.start;\n\n\tif ( changeType == 'move' ) {\n\t\t// Range._getTransformedByDocumentChange is expecting `targetPosition` to be \"before\" move\n\t\t// (before transformation). `targetRange.start` is already after the move happened.\n\t\t// We have to revert `targetPosition` to the state before the move.\n\t\ttargetPosition = targetPosition._getTransformedByInsertion( sourcePosition, howMany );\n\t}\n\n\tconst result = this._getTransformedByDocumentChange( changeType, deltaType, targetPosition, howMany, sourcePosition );\n\n\t// Decide whether moved part should be included in the range.\n\t//\n\t// First, this concerns only `move` change, because insert change includes inserted part always (changeType == 'move').\n\t// Second, this is a case only if moved range was intersecting with this range and was inserted into this range (result.length == 3).\n\tif ( changeType == 'move' && result.length == 3 ) {\n\t\t// `result[ 2 ]` is a \"common part\" of this range and moved range. We substitute that common part with the whole\n\t\t// `targetRange` because we want to include whole `targetRange` in this range.\n\t\tresult[ 2 ] = targetRange;\n\t}\n\n\tconst updated = Range.createFromRanges( result );\n\n\t// If anything changed, update the range and fire an event.\n\tif ( !updated.isEqual( this ) ) {\n\t\tconst oldRange = Range.createFromRange( this );\n\n\t\tthis.start = updated.start;\n\t\tthis.end = updated.end;\n\n\t\tthis.fire( 'change', oldRange );\n\t}\n}\n\nmix( LiveRange, EmitterMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/liverange.js\n// module id = 109\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/markeroperation\n */\n\nimport Operation from './operation';\nimport Range from '../range';\n\n/**\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class MarkerOperation extends Operation {\n\t/**\n\t * @param {String} name Marker name.\n\t * @param {module:engine/model/range~Range} oldRange Marker range before the change.\n\t * @param {module:engine/model/range~Range} newRange Marker range after the change.\n\t * @param {module:engine/model/markercollection~MarkerCollection} markers Marker collection on which change should be executed.\n\t * @param {Number} baseVersion {@link module:engine/model/document~Document#version} on which the operation can be applied.\n\t */\n\tconstructor( name, oldRange, newRange, markers, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Marker name.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t * Marker range before the change.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/range~Range}\n\t\t */\n\t\tthis.oldRange = oldRange ? Range.createFromRange( oldRange ) : null;\n\n\t\t/**\n\t\t * Marker range after the change.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/range~Range}\n\t\t */\n\t\tthis.newRange = newRange ? Range.createFromRange( newRange ) : null;\n\n\t\t/**\n\t\t * Marker collection on which change should be executed.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/markercollection~MarkerCollection}\n\t\t */\n\t\tthis._markers = markers;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'marker';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/markeroperation~MarkerOperation}\n\t */\n\tclone() {\n\t\treturn new MarkerOperation( this.name, this.oldRange, this.newRange, this._markers, this.baseVersion );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/markeroperation~MarkerOperation}\n\t */\n\tgetReversed() {\n\t\treturn new MarkerOperation( this.name, this.newRange, this.oldRange, this._markers, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\tconst type = this.newRange ? 'set' : 'remove';\n\n\t\tthis._markers[ type ]( this.name, this.newRange );\n\n\t\treturn { name: this.name, type: type };\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tdelete json._markers;\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.MarkerOperation';\n\t}\n\n\t/**\n\t * Creates `MarkerOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/markeroperation~MarkerOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\treturn new MarkerOperation(\n\t\t\tjson.name,\n\t\t\tjson.oldRange ? Range.fromJSON( json.oldRange, document ) : null,\n\t\t\tjson.newRange ? Range.fromJSON( json.newRange, document ) : null,\n\t\t\tdocument.markers,\n\t\t\tjson.baseVersion\n\t\t);\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js\n// module id = 110\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/reinsertoperation\n */\n\nimport MoveOperation from './moveoperation';\nimport RemoveOperation from './removeoperation';\n\n/**\n * Operation to reinsert previously removed nodes back to the non-graveyard root. This operation acts like\n * {@link module:engine/model/operation/moveoperation~MoveOperation} but it returns\n * {@link module:engine/model/operation/removeoperation~RemoveOperation} when reversed\n * and fires different change event.\n */\nexport default class ReinsertOperation extends MoveOperation {\n\t/**\n\t * Position where nodes will be re-inserted.\n\t *\n\t * @type {module:engine/model/position~Position}\n\t */\n\tget position() {\n\t\treturn this.targetPosition;\n\t}\n\n\t/**\n\t * @param {module:engine/model/position~Position} pos\n\t */\n\tset position( pos ) {\n\t\tthis.targetPosition = pos;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'reinsert';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/removeoperation~RemoveOperation}\n\t */\n\tgetReversed() {\n\t\tconst removeOp = new RemoveOperation( this.targetPosition, this.howMany, this.baseVersion + 1 );\n\n\t\t// Make sure that nodes are put back into the `$graveyardHolder` from which they got reinserted.\n\t\tremoveOp.targetPosition = this.sourcePosition;\n\t\tremoveOp._needsHolderElement = false;\n\n\t\treturn removeOp;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.ReinsertOperation';\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/reinsertoperation.js\n// module id = 111\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/renameoperation\n */\n\nimport Operation from './operation';\nimport Element from '../element';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport Position from '../position';\n\n/**\n * Operation to change element's name.\n *\n * Using this class you can change element's name.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class RenameOperation extends Operation {\n\t/**\n\t * Creates an operation that changes element's name.\n\t *\n\t * @param {module:engine/model/position~Position} position Position before an element to change.\n\t * @param {String} oldName Current name of the element.\n\t * @param {String} newName New name for the element.\n\t * @param {Number} baseVersion {@link module:engine/model/document~Document#version} on which the operation can be applied.\n\t */\n\tconstructor( position, oldName, newName, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Position before an element to change.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/renameoperation~RenameOperation#position\n\t\t */\n\t\tthis.position = position;\n\n\t\t/**\n\t\t * Current name of the element.\n\t\t *\n\t\t * @member {String} module:engine/model/operation/renameoperation~RenameOperation#oldName\n\t\t */\n\t\tthis.oldName = oldName;\n\n\t\t/**\n\t\t * New name for the element.\n\t\t *\n\t\t * @member {String} module:engine/model/operation/renameoperation~RenameOperation#newName\n\t\t */\n\t\tthis.newName = newName;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'rename';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/renameoperation~RenameOperation}\n\t */\n\tclone() {\n\t\treturn new RenameOperation( Position.createFromPosition( this.position ), this.oldName, this.newName, this.baseVersion );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @returns {module:engine/model/operation/renameoperation~RenameOperation}\n\t */\n\tgetReversed() {\n\t\treturn new RenameOperation( Position.createFromPosition( this.position ), this.newName, this.oldName, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t// Validation.\n\t\tconst element = this.position.nodeAfter;\n\n\t\tif ( !( element instanceof Element ) ) {\n\t\t\t/**\n\t\t\t * Given position is invalid or node after it is not instance of Element.\n\t\t\t *\n\t\t\t * @error rename-operation-wrong-position\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.'\n\t\t\t);\n\t\t} else if ( element.name !== this.oldName ) {\n\t\t\t/**\n\t\t\t * Element to change has different name than operation's old name.\n\t\t\t *\n\t\t\t * @error rename-operation-wrong-name\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rename-operation-wrong-name: Element to change has different name than operation\\'s old name.'\n\t\t\t);\n\t\t}\n\n\t\t// If value to set is same as old value, don't do anything.\n\t\t// By not returning `undefined`, this operation will be seen as `NoOperation` - that means\n\t\t// that it won't generate any events, etc. `RenameOperation` with such parameters may be\n\t\t// a result of Operational Transformation.\n\t\tif ( this.oldName == this.newName ) {\n\t\t\treturn;\n\t\t}\n\n\t\telement.name = this.newName;\n\n\t\treturn { element, oldName: this.oldName };\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.RenameOperation';\n\t}\n\n\t/**\n\t * Creates `RenameOperation` object from deserialized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\treturn new RenameOperation( Position.fromJSON( json.position, document ), json.oldName, json.newName, json.baseVersion );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js\n// module id = 112\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/rootattributeoperation\n */\n\nimport Operation from './operation';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.\n *\n * This operation is needed, because root elements can't be changed through\n * @link module:engine/model/operation/attributeoperation~AttributeOperation}.\n * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}\n * requires a range to change and root element can't\n * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.\n * {@link module:engine/model/position~Position} can't be created before a root element.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class RootAttributeOperation extends Operation {\n\t/**\n\t * Creates an operation that changes, removes or adds attributes on root element.\n\t *\n\t * @see module:engine/model/operation/attributeoperation~AttributeOperation\n\t * @param {module:engine/model/rootelement~RootElement} root Root element to change.\n\t * @param {String} key Key of an attribute to change or remove.\n\t * @param {*} oldValue Old value of the attribute with given key or `null` if adding a new attribute.\n\t * @param {*} newValue New value to set for the attribute. If `null`, then the operation just removes the attribute.\n\t * @param {Number} baseVersion {@link module:engine/model/document~Document#version} on which the operation can be applied.\n\t */\n\tconstructor( root, key, oldValue, newValue, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Root element to change.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/rootelement~RootElement}\n\t\t */\n\t\tthis.root = root;\n\n\t\t/**\n\t\t * Key of an attribute to change or remove.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.key = key;\n\n\t\t/**\n\t\t * Old value of the attribute with given key or `null` if adding a new attribute.\n\t\t *\n\t\t * @readonly\n\t\t * @member {*}\n\t\t */\n\t\tthis.oldValue = oldValue;\n\n\t\t/**\n\t\t * New value to set for the attribute. If `null`, then the operation just removes the attribute.\n\t\t *\n\t\t * @readonly\n\t\t * @member {*}\n\t\t */\n\t\tthis.newValue = newValue;\n\t}\n\n\tget type() {\n\t\tif ( this.oldValue === null ) {\n\t\t\treturn 'addRootAttribute';\n\t\t} else if ( this.newValue === null ) {\n\t\t\treturn 'removeRootAttribute';\n\t\t} else {\n\t\t\treturn 'changeRootAttribute';\n\t\t}\n\t}\n\n\t/**\n\t * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}\n\t */\n\tclone() {\n\t\treturn new RootAttributeOperation( this.root, this.key, this.oldValue, this.newValue, this.baseVersion );\n\t}\n\n\t/**\n\t * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}\n\t */\n\tgetReversed() {\n\t\treturn new RootAttributeOperation( this.root, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );\n\t}\n\n\t_execute() {\n\t\tif ( this.oldValue !== null && this.root.getAttribute( this.key ) !== this.oldValue ) {\n\t\t\t/**\n\t\t\t * The attribute which should be removed does not exists for the given node.\n\t\t\t *\n\t\t\t * @error rootattribute-operation-wrong-old-value\n\t\t\t * @param {module:engine/model/rootelement~RootElement} root\n\t\t\t * @param {String} key\n\t\t\t * @param {*} value\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation\\'s old attribute value.',\n\t\t\t\t{ root: this.root, key: this.key }\n\t\t\t);\n\t\t}\n\n\t\tif ( this.oldValue === null && this.newValue !== null && this.root.hasAttribute( this.key ) ) {\n\t\t\t/**\n\t\t\t * The attribute with given key already exists for the given node.\n\t\t\t *\n\t\t\t * @error rootattribute-operation-attribute-exists\n\t\t\t * @param {module:engine/model/rootelement~RootElement} root\n\t\t\t * @param {String} key\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rootattribute-operation-attribute-exists: The attribute with given key already exists.',\n\t\t\t\t{ root: this.root, key: this.key }\n\t\t\t);\n\t\t}\n\n\t\tif ( this.newValue !== null ) {\n\t\t\tthis.root.setAttribute( this.key, this.newValue );\n\t\t} else {\n\t\t\tthis.root.removeAttribute( this.key );\n\t\t}\n\n\t\treturn { root: this.root, key: this.key, oldValue: this.oldValue, newValue: this.newValue };\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.operation.RootAttributeOperation';\n\t}\n\n\t/**\n\t * Creates RootAttributeOperation object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tif ( !document.hasRoot( json.root ) ) {\n\t\t\t/**\n\t\t\t * Cannot create RootAttributeOperation for document. Root with specified name does not exist.\n\t\t\t *\n\t\t\t * @error rootattributeoperation-fromjson-no-root\n\t\t\t * @param {String} rootName\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.',\n\t\t\t\t{ rootName: json }\n\t\t\t);\n\t\t}\n\n\t\treturn new RootAttributeOperation( document.getRoot( json.root ), json.key, json.oldValue, json.newValue, json.baseVersion );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js\n// module id = 113\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/attributeelement\n */\n\nimport Element from './element';\n\n// Default attribute priority.\nconst DEFAULT_PRIORITY = 10;\n\n/**\n * Attributes are elements which define document presentation. They are mostly elements like `` or ``.\n * Attributes can be broken and merged by the {@link module:engine/view/writer~writer view writer}.\n *\n * Editing engine does not define fixed HTML DTD. This is why the type of the {@link module:engine/view/element~Element} need to\n * be defined by the feature developer. Creating an element you should use {@link module:engine/view/containerelement~ContainerElement}\n * class or `AttributeElement`.\n *\n * @extends module:engine/view/element~Element\n */\nexport default class AttributeElement extends Element {\n\t/**\n\t * Creates a attribute element.\n\t *\n\t * @see module:engine/view/element~Element\n\t */\n\tconstructor( name, attrs, children ) {\n\t\tsuper( name, attrs, children );\n\n\t\t/**\n\t\t * Element priority. Attributes have to have the same priority to be\n\t\t * {@link module:engine/view/element~Element#isSimilar similar}. Setting different priorities on similar\n \t\t * nodes may prevent merging, e.g. two `` nodes next each other shouldn't be merged.\n\t\t *\n\t\t * @member {Number}\n\t\t */\n\t\tthis.priority = DEFAULT_PRIORITY;\n\n\t\t/**\n\t\t * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.\n\t\t *\n\t\t * @method #getFillerOffset\n\t\t * @returns {Number|null} Block filler offset or `null` if block filler is not needed.\n\t\t */\n\t\tthis.getFillerOffset = getFillerOffset;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tis( type, name = null ) {\n\t\tif ( !name ) {\n\t\t\treturn type == 'attributeElement' || super.is( type );\n\t\t} else {\n\t\t\treturn ( type == 'attributeElement' && name == this.name ) || super.is( type, name );\n\t\t}\n\t}\n\n\t/**\n\t * Clones provided element with priority.\n\t *\n\t * @param {Boolean} deep If set to `true` clones element and all its children recursively. When set to `false`,\n\t * element will be cloned without any children.\n\t * @returns {module:engine/view/attributeelement~AttributeElement} Clone of this element.\n\t */\n\tclone( deep ) {\n\t\tconst cloned = super.clone( deep );\n\n\t\t// Clone priority too.\n\t\tcloned.priority = this.priority;\n\n\t\treturn cloned;\n\t}\n\n\t/**\n\t * Checks if this element is similar to other element.\n\t * Both elements should have the same name, attributes and priority to be considered as similar.\n\t * Two similar elements can contain different set of children nodes.\n\t *\n\t * @param {module:engine/view/element~Element} otherElement\n\t * @returns {Boolean}\n\t */\n\tisSimilar( otherElement ) {\n\t\treturn super.isSimilar( otherElement ) && this.priority == otherElement.priority;\n\t}\n}\n\n/**\n * Default attribute priority.\n *\n * @member {Number} module:engine/view/attributeelement~AttributeElement.DEFAULT_PRIORITY\n */\nAttributeElement.DEFAULT_PRIORITY = DEFAULT_PRIORITY;\n\n// Returns block {@link module:engine/view/filler~Filler filler} offset or `null` if block filler is not needed.\n//\n// @returns {Number|null} Block filler offset or `null` if block filler is not needed.\nfunction getFillerOffset() {\n\t/*jshint validthis:true */\n\n\t// foo does not need filler.\n\tif ( this.childCount ) {\n\t\treturn null;\n\t}\n\n\tlet element = this.parent;\n\n\t//

    needs filler ->


    \n\twhile ( element && element.is( 'attributeElement' ) ) {\n\t\tif ( element.childCount > 1 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\telement = element.parent;\n\t}\n\n\tif ( !element || element.childCount > 1 ) {\n\t\treturn null;\n\t}\n\n\treturn 0;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/attributeelement.js\n// module id = 114\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/documentfragment\n */\n\nimport Text from './text';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\n\n/**\n * DocumentFragment class.\n */\nexport default class DocumentFragment {\n\t/**\n\t * Creates new DocumentFragment instance.\n\t *\n\t * @param {module:engine/view/node~Node|Iterable.} [children] List of nodes to be inserted into\n\t * created document fragment.\n\t */\n\tconstructor( children ) {\n\t\t/**\n\t\t * Array of child nodes.\n\t\t *\n\t\t * @protected\n\t\t * @member {Array.} module:engine/view/documentfragment~DocumentFragment#_children\n\t\t */\n\t\tthis._children = [];\n\n\t\tif ( children ) {\n\t\t\tthis.insertChildren( 0, children );\n\t\t}\n\t}\n\n\t/**\n\t * Iterates over nodes added to this DocumentFragment.\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this._children[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Number of child nodes in this document fragment.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget childCount() {\n\t\treturn this._children.length;\n\t}\n\n\t/**\n\t * Is `true` if there are no nodes inside this document fragment, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isEmpty() {\n\t\treturn this.childCount === 0;\n\t}\n\n\t/**\n\t * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n\t *\n\t * @readonly\n\t * @type {null}\n\t */\n\tget parent() {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Checks whether given view tree object is of given type.\n\t *\n\t * Read more in {@link module:engine/view/node~Node#is}.\n\t *\n\t * @param {String} type\n\t * @returns {Boolean}\n\t */\n\tis( type ) {\n\t\treturn type == 'documentFragment';\n\t}\n\n\t/**\n\t * {@link module:engine/view/documentfragment~DocumentFragment#insertChildren Insert} a child node or a list of child nodes at the end\n\t * and sets the parent of these nodes to this fragment.\n\t *\n\t * @param {module:engine/view/node~Node|Iterable.} nodes Node or the list of nodes to be inserted.\n\t * @returns {Number} Number of appended nodes.\n\t */\n\tappendChildren( nodes ) {\n\t\treturn this.insertChildren( this.childCount, nodes );\n\t}\n\n\t/**\n\t * Gets child at the given index.\n\t *\n\t * @param {Number} index Index of child.\n\t * @returns {module:engine/view/node~Node} Child node.\n\t */\n\tgetChild( index ) {\n\t\treturn this._children[ index ];\n\t}\n\n\t/**\n\t * Gets index of the given child node. Returns `-1` if child node is not found.\n\t *\n\t * @param {module:engine/view/node~Node} node Child node.\n\t * @returns {Number} Index of the child node.\n\t */\n\tgetChildIndex( node ) {\n\t\treturn this._children.indexOf( node );\n\t}\n\n\t/**\n\t * Gets child nodes iterator.\n\t *\n\t * @returns {Iterable.} Child nodes iterator.\n\t */\n\tgetChildren() {\n\t\treturn this._children[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to\n\t * this fragment.\n\t *\n\t * @param {Number} index Position where nodes should be inserted.\n\t * @param {module:engine/view/node~Node|Iterable.} nodes Node or list of nodes to be inserted.\n\t * @returns {Number} Number of inserted nodes.\n\t */\n\tinsertChildren( index, nodes ) {\n\t\tthis._fireChange( 'children', this );\n\t\tlet count = 0;\n\n\t\tnodes = normalize( nodes );\n\n\t\tfor ( let node of nodes ) {\n\t\t\tnode.parent = this;\n\n\t\t\tthis._children.splice( index, 0, node );\n\t\t\tindex++;\n\t\t\tcount++;\n\t\t}\n\n\t\treturn count;\n\t}\n\n\t/**\n\t * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.\n\t *\n\t * @param {Number} index Number of the first node to remove.\n\t * @param {Number} [howMany=1] Number of nodes to remove.\n\t * @returns {Array.} The array of removed nodes.\n\t */\n\tremoveChildren( index, howMany = 1 ) {\n\t\tthis._fireChange( 'children', this );\n\n\t\tfor ( let i = index; i < index + howMany; i++ ) {\n\t\t\tthis._children[ i ].parent = null;\n\t\t}\n\n\t\treturn this._children.splice( index, howMany );\n\t}\n\n\t/**\n\t * Fires `change` event with given type of the change.\n\t *\n\t * @private\n\t * @param {module:engine/view/document~ChangeType} type Type of the change.\n\t * @param {module:engine/view/node~Node} node Changed node.\n\t * @fires module:engine/view/node~Node#change\n\t */\n\t_fireChange( type, node ) {\n\t\tthis.fire( 'change:' + type, node );\n\t}\n}\n\nmix( DocumentFragment, EmitterMixin );\n\n// Converts strings to Text and non-iterables to arrays.\n//\n// @param {String|module:engine/view/node~Node|Iterable.}\n// @return {Iterable.}\nfunction normalize( nodes ) {\n\t// Separate condition because string is iterable.\n\tif ( typeof nodes == 'string' ) {\n\t\treturn [ new Text( nodes ) ];\n\t}\n\n\tif ( !isIterable( nodes ) ) {\n\t\tnodes = [ nodes ];\n\t}\n\n\t// Array.from to enable .map() on non-arrays.\n\treturn Array.from( nodes ).map( ( node ) => typeof node == 'string' ? new Text( node ) : node );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/documentfragment.js\n// module id = 115\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/observer/domeventdata\n */\n\nimport extend from '@ckeditor/ckeditor5-utils/src/lib/lodash/extend';\n\n/**\n * Information about a DOM event in context of the {@link module:engine/view/document~Document}.\n * It wraps the native event, which usually should not be used as the wrapper contains\n * additional data (like key code for keyboard events).\n */\nexport default class DomEventData {\n\t/**\n\t * @param {module:engine/view/document~Document} document The instance of the tree view Document.\n\t * @param {Event} domEvent The DOM event.\n\t * @param {Object} [additionalData] Additional properties that the instance should contain.\n\t */\n\tconstructor( document, domEvent, additionalData ) {\n\t\t/**\n\t\t * The instance of the document.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/document~Document} module:engine/view/observer/observer~Observer.DomEvent#view\n\t\t */\n\t\tthis.document = document;\n\n\t\t/**\n\t\t * The DOM event.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Event} module:engine/view/observer/observer~Observer.DomEvent#domEvent\n\t\t */\n\t\tthis.domEvent = domEvent;\n\n\t\t/**\n\t\t * The DOM target.\n\t\t *\n\t\t * @readonly\n\t\t * @member {HTMLElement} module:engine/view/observer/observer~Observer.DomEvent#target\n\t\t */\n\t\tthis.domTarget = domEvent.target;\n\n\t\textend( this, additionalData );\n\t}\n\n\t/**\n\t * The tree view element representing the target.\n\t *\n\t * @readonly\n\t * @type module:engine/view/element~Element\n\t */\n\tget target() {\n\t\treturn this.document.domConverter.getCorrespondingViewElement( this.domTarget );\n\t}\n\n\t/**\n\t * Prevents the native's event default action.\n\t */\n\tpreventDefault() {\n\t\tthis.domEvent.preventDefault();\n\t}\n\n\t/**\n\t * Stops native event propagation.\n\t */\n\tstopPropagation() {\n\t\tthis.domEvent.stopPropagation();\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js\n// module id = 116\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/focuscycler\n */\n\n/**\n * Helps cycling over focusable views in a {@link module:ui/viewcollection~ViewCollection}\n * when the focus is tracked by {@link module:utils/focustracker~FocusTracker} instance.\n *\n * It requires a collection of focusable views and associated focus tracker:\n *\n *\t\tconst focusables = new ViewCollection();\n *\t\tconst focusTracker = new FocusTracker();\n *\n *\t\t// Add focusables to the focus tracker.\n *\t\tfocusTracker.add( ... );\n *\n * The cycler can be used manually:\n *\n *\t\tconst cycler = new FocusCycler( { focusables, focusTracker } );\n *\n *\t\t// Will focus the first forusable view in #focusables.\n *\t\tcycler.focusFirst();\n *\n *\t\t// Will log next focusable item in #focusables.\n *\t\tconsole.log( cycler.next );\n *\n * or it can be used as an automated, keystroke–detecting utility:\n *\n *\t\tconst keystrokeHandler = new KeystrokeHandler();\n *\n *\t\t// Activate the keystroke handler.\n *\t\tkeystrokeHandler.listenTo( sourceOfEvents );\n *\n *\t\tconst cycler = new FocusCycler( {\n *\t\t\tfocusables, focusTracker, keystrokeHandler,\n *\t\t\tactions: {\n *\t\t\t\t// When arrowup of arrowleft is detected by the #keystrokeHandler\n *\t\t\t\t// focusPrevious() will be called by the cycler.\n *\t\t\t\tfocusPrevious: [ 'arrowup', 'arrowleft' ],\n *\t\t\t}\n *\t\t} );\n */\nexport default class FocusCycler {\n\t/**\n\t * Creates an instance of the focus cycler utility.\n\t *\n\t * @param {Object} options Configuration options.\n\t * @param {module:utils/collection~Collection|Object} options.focusables\n\t * @param {module:utils/focustracker~FocusTracker} options.focusTracker\n\t * @param {module:utils/keystrokehandler~KeystrokeHandler} [options.keystrokeHandler]\n\t * @param {Object} [options.actions]\n\t */\n\tconstructor( options ) {\n\t\tObject.assign( this, options );\n\n\t\t/**\n\t\t * A view collection the cycler operates on.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:utils/collection~Collection} #focusables\n\t\t */\n\n\t\t/**\n\t\t * A focus tracker instance that cycler uses to determine focus\n\t\t * state in {@link #focusables}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:utils/focustracker~FocusTracker} #focusTracker\n\t\t */\n\n\t\t/**\n\t\t * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:utils/keystrokehandler~KeystrokeHandler} #keystrokeHandler\n\t\t */\n\n\t\t/**\n\t\t * Actions that the cycler can take when a keystroke is pressed. Requires\n\t\t * `options.keystrokeHandler` to be passed and working. When an action is\n\t\t * performed, the event the keystroke fired is will be `preventDefault` and\n\t\t * `stopPropagation` in DOM.\n\t\t *\n\t\t *\t\tactions: {\n\t\t *\t\t\t// Will call #focusPrevious() when arrowleft or arrowup is pressed.\n\t\t *\t\t\tfocusPrevious: [ 'arrowleft', 'arrowup' ],\n\t\t *\n\t\t *\t\t\t// Will call #focusNext() when arrowdown is pressed.\n\t\t *\t\t\tfocusNext: 'arrowdown'\n\t\t *\t\t}\n\t\t *\n\t\t * @readonly\n\t\t * @member {Object} #actions\n\t\t */\n\n\t\tif ( options.actions && options.keystrokeHandler ) {\n\t\t\tfor ( let methodName in options.actions ) {\n\t\t\t\tlet actions = options.actions[ methodName ];\n\n\t\t\t\tif ( typeof actions == 'string' ) {\n\t\t\t\t\tactions = [ actions ];\n\t\t\t\t}\n\n\t\t\t\tfor ( let keystroke of actions ) {\n\t\t\t\t\toptions.keystrokeHandler.set( keystroke, ( data, cancel ) => {\n\t\t\t\t\t\tthis[ methodName ]();\n\t\t\t\t\t\tcancel();\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns the first focusable view in {@link #focusables}.\n\t * `null` if there's none.\n\t *\n\t * @readonly\n\t * @member {module:ui/view~View|null} #first\n\t */\n\tget first() {\n\t\treturn this.focusables.find( isFocusable ) || null;\n\t}\n\n\t/**\n\t * Returns the last focusable view in {@link #focusables}.\n\t * `null` if there's none.\n\t *\n\t * @readonly\n\t * @member {module:ui/view~View|null} #last\n\t */\n\tget last() {\n\t\treturn this.focusables.filter( isFocusable ).slice( -1 )[ 0 ] || null;\n\t}\n\n\t/**\n\t * Returns the next focusable view in {@link #focusables} based on {@link #current}.\n\t * `null` if there's none.\n\t *\n\t * @readonly\n\t * @member {module:ui/view~View|null} #next\n\t */\n\tget next() {\n\t\treturn this._getFocusableItem( 1 );\n\t}\n\n\t/**\n\t * Returns the previous focusable view in {@link #focusables} based on {@link #current}.\n\t * `null` if there's none.\n\t *\n\t * @readonly\n\t * @member {module:ui/view~View|null} #previous\n\t */\n\tget previous() {\n\t\treturn this._getFocusableItem( -1 );\n\t}\n\n\t/**\n\t * An index of the view in the {@link #focusables} which is focused according\n\t * to {@link #focusTracker}. `null` when there's no such view.\n\t *\n\t * @readonly\n\t * @member {Number|null} #current\n\t */\n\tget current() {\n\t\tlet index = null;\n\n\t\t// There's no focused view in the focusables.\n\t\tif ( this.focusTracker.focusedElement === null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tthis.focusables.find( ( view, viewIndex ) => {\n\t\t\tconst focused = view.element === this.focusTracker.focusedElement;\n\n\t\t\tif ( focused ) {\n\t\t\t\tindex = viewIndex;\n\t\t\t}\n\n\t\t\treturn focused;\n\t\t} );\n\n\t\treturn index;\n\t}\n\n\t/**\n\t * Focuses the {@link #first} item.\n\t */\n\tfocusFirst() {\n\t\tthis._focus( this.first );\n\t}\n\n\t/**\n\t * Focuses the {@link #last} item.\n\t */\n\tfocusLast() {\n\t\tthis._focus( this.last );\n\t}\n\n\t/**\n\t * Focuses the {@link #next} item.\n\t */\n\tfocusNext() {\n\t\tthis._focus( this.next );\n\t}\n\n\t/**\n\t * Focuses the {@link #previous} item.\n\t */\n\tfocusPrevious() {\n\t\tthis._focus( this.previous );\n\t}\n\n\t/**\n\t * Focuses the given view, if exists.\n\t *\n\t * @protected\n\t * @param {module:ui/view~View} view\n\t */\n\t_focus( view ) {\n\t\tif ( view ) {\n\t\t\tview.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Returns the next/previous focusable view in {@link #focusables} with respect\n\t * to {@link #current}.\n\t *\n\t * @protected\n\t * @param {Number} step Either `1` for checking forward of {@link #current} or\n\t * `-1` for checking backwards.\n\t * @returns {module:ui/view~View|null}\n\t */\n\t_getFocusableItem( step ) {\n\t\t// Cache for speed.\n\t\tconst current = this.current;\n\t\tconst collectionLength = this.focusables.length;\n\n\t\tif ( !collectionLength || current === null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Cycle in both directions.\n\t\tlet index = ( current + collectionLength + step ) % collectionLength;\n\n\t\tdo {\n\t\t\tlet view = this.focusables.get( index );\n\n\t\t\t// TODO: Check if view is visible.\n\t\t\tif ( isFocusable( view ) ) {\n\t\t\t\treturn view;\n\t\t\t}\n\n\t\t\t// Cycle in both directions.\n\t\t\tindex = ( index + collectionLength + step ) % collectionLength;\n\t\t} while ( index !== current );\n\n\t\treturn null;\n\t}\n}\n\n// Checks whether an view is focusable.\n//\n// @private\n// @param {module:ui/view~View} view A view to be checked.\n// @returns {Boolean}\nfunction isFocusable( view ) {\n\treturn view.focus;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-ui/src/focuscycler.js\n// module id = 117\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/viewcollection\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport Collection from '@ckeditor/ckeditor5-utils/src/collection';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * Collects {@link module:ui/view~View} instances.\n *\n * @extends module:utils/collection~Collection\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class ViewCollection extends Collection {\n\t/**\n\t * Creates a new {@link module:ui/viewcollection~ViewCollection} instance.\n\t *\n\t * @param {module:utils/locale~Locale} [locale] The {@link module:core/editor~Editor editor's locale} instance.\n\t */\n\tconstructor( locale ) {\n\t\tsuper( {\n\t\t\t// An #id Number attribute should be legal and not break the `ViewCollection` instance.\n\t\t\t// https://github.com/ckeditor/ckeditor5-ui/issues/93\n\t\t\tidProperty: 'viewUid'\n\t\t} );\n\n\t\t// Handle {@link module:ui/view~View#element} in DOM when a new view is added to the collection.\n\t\tthis.on( 'add', ( evt, view, index ) => {\n\t\t\tif ( view.element && this._parentElement ) {\n\t\t\t\tthis._parentElement.insertBefore( view.element, this._parentElement.children[ index ] );\n\t\t\t}\n\t\t} );\n\n\t\t// Handle {@link module:ui/view~View#element} in DOM when a view is removed from the collection.\n\t\tthis.on( 'remove', ( evt, view ) => {\n\t\t\tif ( view.element && this._parentElement ) {\n\t\t\t\tview.element.remove();\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * The {@link module:core/editor~Editor editor's locale} instance.\n\t\t *\n\t\t * @member {module:utils/locale~Locale}\n\t\t */\n\t\tthis.locale = locale;\n\n\t\t/**\n\t\t * Set to `true` once the parent's {@link module:ui/view~View#ready} is true, which means\n\t\t * that all the views in the collection are also ready (which can be asynchronous).\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Boolean} #ready\n\t\t */\n\t\tthis.set( 'ready', false );\n\n\t\t/**\n\t\t * A parent element within which child views are rendered and managed in DOM.\n\t\t *\n\t\t * @protected\n\t\t * @member {HTMLElement}\n\t\t */\n\t\tthis._parentElement = null;\n\t}\n\n\t/**\n\t * Initializes child views by injecting {@link module:ui/view~View#element} into DOM\n\t * and calling {@link module:ui/view~View#init}.\n\t *\n\t * @returns {Promise} A Promise resolved when the initialization process is finished.\n\t */\n\tinit() {\n\t\tif ( this.ready ) {\n\t\t\t/**\n\t\t\t * This ViewCollection has already been initialized.\n\t\t\t *\n\t\t\t * @error ui-viewcollection-init-reinit\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'ui-viewcollection-init-reinit: This ViewCollection has already been initialized.' );\n\t\t}\n\n\t\treturn Promise.all( this.map( v => v.init() ) )\n\t\t\t.then( () => {\n\t\t\t\tthis.ready = true;\n\t\t\t} );\n\t}\n\n\t/**\n\t * Destroys the view collection along with child views.\n\t *\n\t * @returns {Promise} A Promise resolved when the destruction process is finished.\n\t */\n\tdestroy() {\n\t\tlet promises = [];\n\n\t\tfor ( let view of this ) {\n\t\t\tpromises.push( view.destroy() );\n\t\t}\n\n\t\treturn Promise.all( promises );\n\t}\n\n\t/**\n\t * Adds a child view to the collection. If {@link module:ui/viewcollection~ViewCollection#ready}, the child view\n\t * is also initialized when added.\n\t *\n\t * @param {module:ui/view~View} view A child view.\n\t * @param {Number} [index] Index at which the child will be added to the collection.\n\t * @returns {Promise} A Promise resolved when the child {@link module:ui/view~View#init} is done.\n\t */\n\tadd( view, index ) {\n\t\tsuper.add( view, index );\n\n\t\t// {@link module:ui/view~View#init} returns `Promise`.\n\t\tlet promise = Promise.resolve();\n\n\t\tif ( this.ready && !view.ready ) {\n\t\t\tpromise = promise.then( () => {\n\t\t\t\treturn view.init();\n\t\t\t} );\n\t\t}\n\n\t\treturn promise;\n\t}\n\n\t/**\n\t * Sets {@link #_parentElement} of this collection.\n\t *\n\t * @param {HTMLElement} element A new parent.\n\t */\n\tsetParent( elementOrDocFragment ) {\n\t\tthis._parentElement = elementOrDocFragment;\n\t}\n\n\t/**\n\t * Delegates selected events coming from within the collection to desired {@link module:utils/emittermixin~EmitterMixin}.\n\t *\n\t * For instance:\n\t *\n\t *\t\tconst viewA = new View();\n\t *\t\tconst viewB = new View();\n\t *\t\tconst viewC = new View();\n\t *\n\t *\t\tconst views = parentView.createCollection();\n\t *\n\t *\t\tviews.delegate( 'eventX' ).to( viewB );\n\t *\t\tviews.delegate( 'eventX', 'eventY' ).to( viewC );\n\t *\n\t *\t\tviews.add( viewA );\n\t *\n\t * then `eventX` is delegated (fired by) `viewB` and `viewC` along with `customData`:\n\t *\n\t *\t\tviewA.fire( 'eventX', customData );\n\t *\n\t * and `eventY` is delegated (fired by) `viewC` along with `customData`:\n\t *\n\t *\t\tviewA.fire( 'eventY', customData );\n\t *\n\t * See {@link module:utils/emittermixin~EmitterMixin#delegate}.\n\t *\n\t * @param {...String} events {@link module:ui/view~View} event names to be delegated to another {@link\n\t * module:utils/emittermixin~EmitterMixin}.\n\t * @returns {module:ui/viewcollection~ViewCollection#delegate.to}\n\t */\n\tdelegate( ...events ) {\n\t\tif ( !events.length || !isStringArray( events ) ) {\n\t\t\t/**\n\t\t\t * All event names must be strings.\n\t\t\t *\n\t\t\t * @error ui-viewcollection-delegate-wrong-events\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'ui-viewcollection-delegate-wrong-events: All event names must be strings.' );\n\t\t}\n\n\t\treturn {\n\t\t\t/**\n\t\t\t * Selects destination for {@link module:utils/emittermixin~EmitterMixin#delegate} events.\n\t\t\t *\n\t\t\t * @memberOf module:ui/viewcollection~ViewCollection#delegate\n\t\t\t * @function module:ui/viewcollection~ViewCollection#delegate.to\n\t\t\t * @param {module:utils/emittermixin~EmitterMixin} dest An `EmitterMixin` instance which is the destination for delegated events.\n\t\t\t */\n\t\t\tto: ( dest ) => {\n\t\t\t\t// Activate delegating on existing views in this collection.\n\t\t\t\tfor ( let view of this ) {\n\t\t\t\t\tfor ( let evtName of events ) {\n\t\t\t\t\t\tview.delegate( evtName ).to( dest );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Activate delegating on future views in this collection.\n\t\t\t\tthis.on( 'add', ( evt, view ) => {\n\t\t\t\t\tfor ( let evtName of events ) {\n\t\t\t\t\t\tview.delegate( evtName ).to( dest );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\t// Deactivate delegating when view is removed from this collection.\n\t\t\t\tthis.on( 'remove', ( evt, view ) => {\n\t\t\t\t\tfor ( let evtName of events ) {\n\t\t\t\t\t\tview.stopDelegating( evtName, dest );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\t}\n}\n\nmix( Collection, ObservableMixin );\n\n// Check if all entries of the array are of `String` type.\n//\n// @private\n// @param {Array} arr An array to be checked.\n// @returns {Boolean}\nfunction isStringArray( arr ) {\n\treturn arr.every( a => typeof a == 'string' );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-ui/src/viewcollection.js\n// module id = 118\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module undo/basecommand\n */\n\nimport Command from '@ckeditor/ckeditor5-core/src/command/command';\n\n/**\n * Base class for undo feature commands: {@link module:undo/undocommand~UndoCommand} and {@link module:undo/redocommand~RedoCommand}.\n *\n * @protected\n * @extends module:core/command/command~Command\n */\nexport default class BaseCommand extends Command {\n\tconstructor( editor ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * Stack of items stored by the command. These are pairs of:\n\t\t *\n\t\t * * {@link module:engine/model/batch~Batch batch} saved by the command,\n\t\t * * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.\n\t\t *\n\t\t * @protected\n\t\t * @member {Array} #_stack\n\t\t */\n\t\tthis._stack = [];\n\n\t\t/**\n\t\t * Stores all batches that were created by this command.\n\t\t *\n\t\t * @protected\n\t\t * @member {WeakSet.} #_createdBatches\n\t\t */\n\t\tthis._createdBatches = new WeakSet();\n\n\t\t// Refresh state, so command is inactive just after initialization.\n\t\tthis.refreshState();\n\t}\n\n\t/**\n\t * Stores a batch in the command, together with the selection state of the {@link module:engine/model/document~Document document}\n\t * created by the editor which this command is registered to.\n\t *\n\t * @param {module:engine/model/batch~Batch} batch The batch to add.\n\t */\n\taddBatch( batch ) {\n\t\tconst selection = {\n\t\t\tranges: Array.from( this.editor.document.selection.getRanges() ),\n\t\t\tisBackward: this.editor.document.selection.isBackward\n\t\t};\n\n\t\tthis._stack.push( { batch, selection } );\n\t\tthis.refreshState();\n\t}\n\n\t/**\n\t * Removes all items from the stack.\n\t */\n\tclearStack() {\n\t\tthis._stack = [];\n\t\tthis.refreshState();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_checkEnabled() {\n\t\treturn this._stack.length > 0;\n\t}\n\n\t/**\n\t * Restores the {@link module:engine/model/document~Document#selection document selection} state after a batch was undone.\n\t *\n\t * @protected\n\t * @param {Array.} ranges Ranges to be restored.\n\t * @param {Boolean} isBackward A flag describing whether the restored range was selected forward or backward.\n\t */\n\t_restoreSelection( ranges, isBackward, deltas ) {\n\t\tconst document = this.editor.document;\n\n\t\t// This will keep the transformed selection ranges.\n\t\tconst selectionRanges = [];\n\n\t\t// Transform all ranges from the restored selection.\n\t\tfor ( let range of ranges ) {\n\t\t\tconst transformedRanges = transformSelectionRange( range, deltas );\n\n\t\t\t// For each `range` from `ranges`, we take only one transformed range.\n\t\t\t// This is because we want to prevent situation where single-range selection\n\t\t\t// got transformed to multi-range selection. We will take the first range that\n\t\t\t// is not in the graveyard.\n\t\t\tconst transformedRange = transformedRanges.find(\n\t\t\t\t( range ) => range.start.root != document.graveyard\n\t\t\t);\n\n\t\t\t// `transformedRange` might be `undefined` if transformed range ended up in graveyard.\n\t\t\tif ( transformedRange ) {\n\t\t\t\tselectionRanges.push( transformedRange );\n\t\t\t}\n\t\t}\n\n\t\t// `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.\n\t\tif ( selectionRanges.length ) {\n\t\t\tdocument.selection.setRanges( selectionRanges, isBackward );\n\t\t}\n\t}\n}\n\n// Transforms given range `range` by deltas from `document` history, starting from a delta with given `baseVersion`.\n// Returns an array containing one or more ranges, which are result of the transformation.\nfunction transformSelectionRange( range, deltas ) {\n\t// The range will be transformed by history deltas that happened after the selection got stored.\n\t// Note, that at this point, the document history is already updated by undo command execution. We will\n\t// not transform the range by deltas that got undone or their reversing counterparts.\n\tlet transformed = transformRangesByDeltas( [ range ], deltas );\n\n\t// After `range` got transformed, we have an array of ranges. Some of those\n\t// ranges may be \"touching\" -- they can be next to each other and could be merged.\n\t// First, we have to sort those ranges because they don't have to be in an order.\n\ttransformed.sort( ( a, b ) => a.start.isBefore( b.start ) ? -1 : 1 );\n\n\t// Then, we check if two consecutive ranges are touching.\n\tfor ( let i = 1 ; i < transformed.length; i++ ) {\n\t\tlet a = transformed[ i - 1 ];\n\t\tlet b = transformed[ i ];\n\n\t\tif ( a.end.isTouching( b.start ) ) {\n\t\t\ta.end = b.end;\n\t\t\ttransformed.splice( i, 1 );\n\t\t\ti--;\n\t\t}\n\t}\n\n\treturn transformed;\n}\n\n// Transforms given set of `ranges` by given set of `deltas`. Returns transformed `ranges`.\nexport function transformRangesByDeltas( ranges, deltas ) {\n\tfor ( let delta of deltas ) {\n\t\tfor ( let operation of delta.operations ) {\n\t\t\t// We look through all operations from all deltas.\n\n\t\t\tfor ( let i = 0; i < ranges.length; i++ ) {\n\t\t\t\t// We transform every range by every operation.\n\t\t\t\tlet result;\n\n\t\t\t\tswitch ( operation.type ) {\n\t\t\t\t\tcase 'insert':\n\t\t\t\t\t\tresult = ranges[ i ]._getTransformedByInsertion(\n\t\t\t\t\t\t\toperation.position,\n\t\t\t\t\t\t\toperation.nodes.maxOffset,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'move':\n\t\t\t\t\tcase 'remove':\n\t\t\t\t\tcase 'reinsert':\n\t\t\t\t\t\tresult = ranges[ i ]._getTransformedByMove(\n\t\t\t\t\t\t\toperation.sourcePosition,\n\t\t\t\t\t\t\toperation.targetPosition,\n\t\t\t\t\t\t\toperation.howMany,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// If we have a transformation result, we substitute transformed range with it in `transformed` array.\n\t\t\t\t// Keep in mind that the result is an array and may contain multiple ranges.\n\t\t\t\tif ( result ) {\n\t\t\t\t\tranges.splice( i, 1, ...result );\n\n\t\t\t\t\t// Fix iterator.\n\t\t\t\t\ti = i + result.length - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ranges;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-undo/src/basecommand.js\n// module id = 119\n// module chunks = 0","import mapCacheClear from './_mapCacheClear';\nimport mapCacheDelete from './_mapCacheDelete';\nimport mapCacheGet from './_mapCacheGet';\nimport mapCacheHas from './_mapCacheHas';\nimport mapCacheSet from './_mapCacheSet';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_MapCache.js\n// module id = 120\n// module chunks = 0","import ListCache from './_ListCache';\nimport stackClear from './_stackClear';\nimport stackDelete from './_stackDelete';\nimport stackGet from './_stackGet';\nimport stackHas from './_stackHas';\nimport stackSet from './_stackSet';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Stack.js\n// module id = 121\n// module chunks = 0","import root from './_root';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_Symbol.js\n// module id = 122\n// module chunks = 0","import baseIndexOf from './_baseIndexOf';\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n return !!array.length && baseIndexOf(array, value, 0) > -1;\n}\n\nexport default arrayIncludes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayIncludes.js\n// module id = 123\n// module chunks = 0","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nexport default arrayIncludesWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_arrayIncludesWith.js\n// module id = 124\n// module chunks = 0","import castPath from './_castPath';\nimport isKey from './_isKey';\nimport toKey from './_toKey';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseGet.js\n// module id = 125\n// module chunks = 0","import indexOfNaN from './_indexOfNaN';\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n if (value !== value) {\n return indexOfNaN(array, fromIndex);\n }\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIndexOf.js\n// module id = 126\n// module chunks = 0","import SetCache from './_SetCache';\nimport arrayIncludes from './_arrayIncludes';\nimport arrayIncludesWith from './_arrayIncludesWith';\nimport arrayMap from './_arrayMap';\nimport baseUnary from './_baseUnary';\nimport cacheHas from './_cacheHas';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseIntersection;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIntersection.js\n// module id = 127\n// module chunks = 0","import baseIsEqualDeep from './_baseIsEqualDeep';\nimport isObject from './isObject';\nimport isObjectLike from './isObjectLike';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\nexport default baseIsEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseIsEqual.js\n// module id = 128\n// module chunks = 0","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default baseProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseProperty.js\n// module id = 129\n// module chunks = 0","import arrayMap from './_arrayMap';\nimport baseIndexOf from './_baseIndexOf';\nimport baseIndexOfWith from './_baseIndexOfWith';\nimport baseUnary from './_baseUnary';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n}\n\nexport default basePullAll;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_basePullAll.js\n// module id = 130\n// module chunks = 0","import isSymbol from './isSymbol';\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor,\n nativeMin = Math.min;\n\n/**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\nfunction baseSortedIndexBy(array, value, iteratee, retHighest) {\n value = iteratee(value);\n\n var low = 0,\n high = array ? array.length : 0,\n valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n}\n\nexport default baseSortedIndexBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseSortedIndexBy.js\n// module id = 131\n// module chunks = 0","/**\n * The base implementation of `_.unary` without support for storing wrapper metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseUnary.js\n// module id = 132\n// module chunks = 0","import arrayPush from './_arrayPush';\nimport baseDifference from './_baseDifference';\nimport baseUniq from './_baseUniq';\n\n/**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\nfunction baseXor(arrays, iteratee, comparator) {\n var index = -1,\n length = arrays.length;\n\n while (++index < length) {\n var result = result\n ? arrayPush(\n baseDifference(result, arrays[index], iteratee, comparator),\n baseDifference(arrays[index], result, iteratee, comparator)\n )\n : arrays[index];\n }\n return (result && result.length) ? baseUniq(result, iteratee, comparator) : [];\n}\n\nexport default baseXor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_baseXor.js\n// module id = 133\n// module chunks = 0","/**\n * Checks if a cache value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cacheHas.js\n// module id = 134\n// module chunks = 0","import isArrayLikeObject from './isArrayLikeObject';\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nexport default castArrayLikeObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_castArrayLikeObject.js\n// module id = 135\n// module chunks = 0","import Uint8Array from './_Uint8Array';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_cloneArrayBuffer.js\n// module id = 136\n// module chunks = 0","import assignValue from './_assignValue';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n}\n\nexport default copyObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_copyObject.js\n// module id = 137\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetPrototype = Object.getPrototypeOf;\n\n/**\n * Gets the `[[Prototype]]` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {null|Object} Returns the `[[Prototype]]`.\n */\nfunction getPrototype(value) {\n return nativeGetPrototype(Object(value));\n}\n\nexport default getPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getPrototype.js\n// module id = 138\n// module chunks = 0","import DataView from './_DataView';\nimport Map from './_Map';\nimport Promise from './_Promise';\nimport Set from './_Set';\nimport WeakMap from './_WeakMap';\nimport toSource from './_toSource';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction getTag(value) {\n return objectToString.call(value);\n}\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_getTag.js\n// module id = 139\n// module chunks = 0","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/_mapToArray.js\n// module id = 140\n// module chunks = 0","import isObject from './isObject';\nimport now from './now';\nimport toNumber from './toNumber';\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide an options object to indicate whether `func` should be invoked on\n * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent calls\n * to the debounced function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime = 0,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (!lastCallTime || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n clearTimeout(timerId);\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastCallTime = lastInvokeTime = 0;\n lastArgs = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/debounce.js\n// module id = 141\n// module chunks = 0","import baseSlice from './_baseSlice';\nimport toInteger from './toInteger';\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction drop(array, n, guard) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n}\n\nexport default drop;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/drop.js\n// module id = 142\n// module chunks = 0","import baseSlice from './_baseSlice';\nimport toInteger from './toInteger';\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction dropRight(array, n, guard) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n}\n\nexport default dropRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/dropRight.js\n// module id = 143\n// module chunks = 0","/**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\nfunction head(array) {\n return (array && array.length) ? array[0] : undefined;\n}\n\nexport default head;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/head.js\n// module id = 144\n// module chunks = 0","import isArrayLikeObject from './isArrayLikeObject';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\nexport default isArguments;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isArguments.js\n// module id = 145\n// module chunks = 0","import isObject from './isObject';\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified,\n * else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\nexport default isFunction;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isFunction.js\n// module id = 146\n// module chunks = 0","import isArray from './isArray';\nimport isObjectLike from './isObjectLike';\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified,\n * else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n}\n\nexport default isString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/isString.js\n// module id = 147\n// module chunks = 0","import basePullAll from './_basePullAll';\n\n/**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3, 1, 2, 3];\n *\n * _.pullAll(array, [2, 3]);\n * console.log(array);\n * // => [1, 1]\n */\nfunction pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n}\n\nexport default pullAll;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/pullAll.js\n// module id = 148\n// module chunks = 0","import apply from './_apply';\nimport arrayMap from './_arrayMap';\nimport unzip from './unzip';\n\n/**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\nfunction unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n}\n\nexport default unzipWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/lib/lodash/unzipWith.js\n// module id = 149\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/tomap\n */\n\nimport isPlainObject from './lib/lodash/isPlainObject';\nimport objectToMap from './objecttomap';\n\n/**\n * Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.\n *\n *\t\tmap = toMap( { 'foo': 1, 'bar': 2 } );\n *\t\tmap = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );\n *\t\tmap = toMap( anotherMap );\n *\n * @param {Object|Iterable} data Object or iterable to transform.\n * @returns {Map} Map created from data.\n */\nexport default function toMap( data ) {\n\tif ( isPlainObject( data ) ) {\n\t\treturn objectToMap( data );\n\t} else {\n\t\treturn new Map( data );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-utils/src/tomap.js\n// module id = 150\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module widget/utils\n */\n\nconst widgetSymbol = Symbol( 'isWidget' );\nconst labelSymbol = Symbol( 'label' );\n\n/**\n * CSS class added to each widget element.\n *\n * @const {String}\n */\nexport const WIDGET_CLASS_NAME = 'ck-widget';\n\n/**\n * CSS class added to currently selected widget element.\n *\n * @const {String}\n */\nexport const WIDGET_SELECTED_CLASS_NAME = 'ck-widget_selected';\n\n/**\n * Returns `true` if given {@link module:engine/view/element~Element} is a widget.\n *\n * @param {module:engine/view/element~Element} element\n * @returns {Boolean}\n */\nexport function isWidget( element ) {\n\treturn !!element.getCustomProperty( widgetSymbol );\n}\n\n/**\n * Converts given {@link module:engine/view/element~Element} to widget in following way:\n * * sets `contenteditable` attribute to `true`,\n * * adds custom `getFillerOffset` method returning `null`,\n * * adds `ck-widget` CSS class,\n * * adds custom property allowing to recognize widget elements by using {@link ~isWidget}.\n *\n * @param {module:engine/view/element~Element} element\n * @param {Object} [options]\n * @param {String|Function} [options.label] Element's label provided to {@link ~setLabel} function. It can be passed as\n * a plain string or a function returning a string.\n * @returns {module:engine/view/element~Element} Returns same element.\n */\nexport function toWidget( element, options ) {\n\toptions = options || {};\n\telement.setAttribute( 'contenteditable', false );\n\telement.getFillerOffset = getFillerOffset;\n\telement.addClass( WIDGET_CLASS_NAME );\n\telement.setCustomProperty( widgetSymbol, true );\n\n\tif ( options.label ) {\n\t\tsetLabel( element, options.label );\n\t}\n\n\treturn element;\n}\n\n/**\n * Sets label for given element.\n * It can be passed as a plain string or a function returning a string. Function will be called each time label is retrieved by\n * {@link ~getLabel}.\n *\n * @param {module:engine/view/element~Element} element\n * @param {String|Function} labelOrCreator\n */\nexport function setLabel( element, labelOrCreator ) {\n\telement.setCustomProperty( labelSymbol, labelOrCreator );\n}\n\n/**\n * Returns label for provided element.\n *\n * @param {module:engine/view/element~Element} element\n * @return {String}\n */\nexport function getLabel( element ) {\n\tconst labelCreator = element.getCustomProperty( labelSymbol );\n\n\tif ( !labelCreator ) {\n\t\treturn '';\n\t}\n\n\treturn typeof labelCreator == 'function' ? labelCreator() : labelCreator;\n}\n\n/**\n * Adds functionality to provided {module:engine/view/editableelement~EditableElement} to act as a widget's editable:\n * * sets `contenteditable` attribute to `true`,\n * * adds `ck-editable` CSS class,\n * * adds `ck-editable_focused` CSS class when editable is focused and removes it when it's blurred.\n *\n * @param {module:engine/view/editableelement~EditableElement} editable\n * @returns {module:engine/view/editableelement~EditableElement} Returns same element that was provided in `editable` param.\n */\nexport function toWidgetEditable( editable ) {\n\teditable.setAttribute( 'contenteditable', 'true' );\n\teditable.addClass( 'ck-editable' );\n\n\teditable.on( 'change:isFocused', ( evt, property, is ) => {\n\t\tif ( is ) {\n\t\t\teditable.addClass( 'ck-editable_focused' );\n\t\t} else {\n\t\t\teditable.removeClass( 'ck-editable_focused' );\n\t\t}\n\t} );\n\n\treturn editable;\n}\n\n// Default filler offset function applied to all widget elements.\n//\n// @returns {null}\nfunction getFillerOffset() {\n\treturn null;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-widget/src/utils.js\n// module id = 151\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module basic-styles/boldengine\n */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport buildModelConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildmodelconverter';\nimport buildViewConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildviewconverter';\nimport ToggleAttributeCommand from '@ckeditor/ckeditor5-core/src/command/toggleattributecommand';\n\nconst BOLD = 'bold';\n\n/**\n * The bold engine feature.\n *\n * It registers the `bold` command and introduces the `bold` attribute in the model which renders to the view\n * as a `` element.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BoldEngine extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst data = editor.data;\n\t\tconst editing = editor.editing;\n\n\t\t// Allow bold attribute on all inline nodes.\n\t\teditor.document.schema.allow( { name: '$inline', attributes: [ BOLD ] } );\n\n\t\t// Build converter from model to view for data and editing pipelines.\n\t\tbuildModelConverter().for( data.modelToView, editing.modelToView )\n\t\t\t.fromAttribute( BOLD )\n\t\t\t.toElement( 'strong' );\n\n\t\t// Build converter from view to model for data pipeline.\n\t\tbuildViewConverter().for( data.viewToModel )\n\t\t\t.fromElement( 'strong' )\n\t\t\t.fromElement( 'b' )\n\t\t\t.fromAttribute( 'style', { 'font-weight': 'bold' } )\n\t\t\t.toAttribute( BOLD, true );\n\n\t\t// Create bold command.\n\t\teditor.commands.set( BOLD, new ToggleAttributeCommand( editor, BOLD ) );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-basic-styles/src/boldengine.js\n// module id = 152\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module basic-styles/italicengine\n */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport buildModelConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildmodelconverter';\nimport buildViewConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildviewconverter';\nimport ToggleAttributeCommand from '@ckeditor/ckeditor5-core/src/command/toggleattributecommand';\n\nconst ITALIC = 'italic';\n\n/**\n * The italic engine feature.\n *\n * It registers the `italic` command and introduces the `italic` attribute in the model which renders to the view\n * as an `` element.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class ItalicEngine extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst data = editor.data;\n\t\tconst editing = editor.editing;\n\n\t\t// Allow italic attribute on all inline nodes.\n\t\teditor.document.schema.allow( { name: '$inline', attributes: [ ITALIC ] } );\n\n\t\t// Build converter from model to view for data and editing pipelines.\n\t\tbuildModelConverter().for( data.modelToView, editing.modelToView )\n\t\t\t.fromAttribute( ITALIC )\n\t\t\t.toElement( 'em' );\n\n\t\t// Build converter from view to model for data pipeline.\n\t\tbuildViewConverter().for( data.viewToModel )\n\t\t\t.fromElement( 'em' )\n\t\t\t.fromElement( 'i' )\n\t\t\t.fromAttribute( 'style', { 'font-style': 'italic' } )\n\t\t\t.toAttribute( ITALIC, true );\n\n\t\t// Create italic command.\n\t\teditor.commands.set( ITALIC, new ToggleAttributeCommand( editor, ITALIC ) );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-basic-styles/src/italicengine.js\n// module id = 153\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/command/helpers/isattributeallowedinselection\n */\n\nimport TreeWalker from '@ckeditor/ckeditor5-engine/src/model/treewalker';\n\n/**\n * Checks {@link module:engine/model/document~Document#schema} if attribute is allowed in selection:\n *\n * * if selection is on range, the command is enabled if any of nodes in that range can have bold,\n * * if selection is collapsed, the command is enabled if text with bold is allowed in that node.\n *\n * @param {String} attribute Attribute key.\n * @param {module:engine/model/selection~Selection} selection Selection which ranges will be validate.\n * @param {module:engine/model/schema~Schema} schema Document schema.\n * @returns {Boolean}\n */\nexport default function isAttributeAllowedInSelection( attribute, selection, schema ) {\n\tif ( selection.isCollapsed ) {\n\t\t// Check whether schema allows for a test with `attributeKey` in caret position.\n\t\treturn schema.check( { name: '$text', inside: selection.getFirstPosition(), attributes: attribute } );\n\t} else {\n\t\tconst ranges = selection.getRanges();\n\n\t\t// For all ranges, check nodes in them until you find a node that is allowed to have `attributeKey` attribute.\n\t\tfor ( let range of ranges ) {\n\t\t\tconst walker = new TreeWalker( { boundaries: range, mergeCharacters: true } );\n\t\t\tlet last = walker.position;\n\t\t\tlet step = walker.next();\n\n\t\t\t// Walk the range.\n\t\t\twhile ( !step.done ) {\n\t\t\t\t// If returned item does not have name property, it is a model.TextFragment.\n\t\t\t\tconst name = step.value.item.name || '$text';\n\n\t\t\t\tif ( schema.check( { name: name, inside: last, attributes: attribute } ) ) {\n\t\t\t\t\t// If we found a node that is allowed to have the attribute, return true.\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tlast = walker.position;\n\t\t\t\tstep = walker.next();\n\t\t\t}\n\t\t}\n\t}\n\n\t// If we haven't found such node, return false.\n\treturn false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-core/src/command/helpers/isattributeallowedinselection.js\n// module id = 154\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/command/toggleattributecommand\n */\n\nimport Command from './command';\nimport getSchemaValidRanges from './helpers/getschemavalidranges';\nimport isAttributeAllowedInSelection from './helpers/isattributeallowedinselection';\n\n/**\n * An extension of the base {@link module:core/command/command~Command} class, which provides utilities for a command which toggles a single\n * attribute on a text or an element. `ToggleAttributeCommand` uses {@link module:engine/model/document~Document#selection}\n * to decide which nodes (if any) should be changed, and applies or removes attributes from them.\n *\n * The command checks {@link module:engine/model/document~Document#schema} to decide if it should be enabled.\n */\nexport default class ToggleAttributeCommand extends Command {\n\t/**\n\t * @see module:core/command/command~Command\n\t * @param {module:core/editor/editor~Editor} editor\n\t * @param {String} attributeKey Attribute that will be set by the command.\n\t */\n\tconstructor( editor, attributeKey ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * Attribute that will be set by the command.\n\t\t *\n\t\t * @member {String}\n\t\t */\n\t\tthis.attributeKey = attributeKey;\n\n\t\t/**\n\t\t * Flag indicating whether command is active. For collapsed selection it means that typed characters will have\n\t\t * the command's attribute set. For range selection it means that all nodes inside have the attribute applied.\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #value\n\t\t */\n\t\tthis.set( 'value', false );\n\n\t\tthis.listenTo( this.editor.document.selection, 'change:attribute', () => {\n\t\t\tthis.value = this.editor.document.selection.hasAttribute( this.attributeKey );\n\t\t} );\n\t}\n\n\t/**\n\t * Checks if {@link module:engine/model/document~Document#schema} allows to create attribute in\n\t * {@link module:engine/model/document~Document#selection}.\n\t *\n\t * @private\n\t * @returns {Boolean}\n\t */\n\t_checkEnabled() {\n\t\tconst document = this.editor.document;\n\n\t\treturn isAttributeAllowedInSelection( this.attributeKey, document.selection, document.schema );\n\t}\n\n\t/**\n\t * Executes the command: adds or removes attributes to nodes or selection.\n\t *\n\t * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.\n\t *\n\t * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:\n\t * * if selection is on a range, the command applies the attribute on all nodes in that ranges\n\t * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}),\n\t * * if selection is collapsed in non-empty node, the command applies attribute to the\n\t * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from selection),\n\t * * if selection is collapsed in empty node, the command applies attribute to the parent node of selection (note\n\t * that selection inherits all attributes from a node if it is in empty node).\n\t *\n\t * If the command is disabled (`isEnabled == false`) when it is executed, nothing will happen.\n\t *\n\t * @private\n\t * @param {Object} [options] Options of command.\n\t * @param {Boolean} [options.forceValue] If set it will force command behavior. If `true`, command will apply attribute,\n\t * otherwise command will remove attribute. If not set, command will look for it's current value to decide what it should do.\n\t * @param {module:engine/model/batch~Batch} [options.batch] Batch to group undo steps.\n\t */\n\t_doExecute( options = {} ) {\n\t\tconst document = this.editor.document;\n\t\tconst selection = document.selection;\n\t\tconst value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;\n\n\t\t// If selection has non-collapsed ranges, we change attribute on nodes inside those ranges.\n\t\tdocument.enqueueChanges( () => {\n\t\t\tif ( selection.isCollapsed ) {\n\t\t\t\tif ( value ) {\n\t\t\t\t\tselection.setAttribute( this.attributeKey, true );\n\t\t\t\t} else {\n\t\t\t\t\tselection.removeAttribute( this.attributeKey );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst ranges = getSchemaValidRanges( this.attributeKey, selection.getRanges(), document.schema );\n\n\t\t\t\t// Keep it as one undo step.\n\t\t\t\tconst batch = options.batch || document.batch();\n\n\t\t\t\tfor ( let range of ranges ) {\n\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\tbatch.setAttribute( range, this.attributeKey, value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbatch.removeAttribute( range, this.attributeKey );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-core/src/command/toggleattributecommand.js\n// module id = 155\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/mapper\n */\n\nimport ModelPosition from '../model/position';\nimport ModelRange from '../model/range';\n\nimport ViewPosition from '../view/position';\nimport ViewRange from '../view/range';\nimport ViewText from '../view/text';\n\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * Maps elements and positions between {@link module:engine/view/document~Document view} and {@link module:engine/model/model model}.\n *\n * Mapper use bound elements to find corresponding elements and positions, so, to get proper results,\n * all model elements should be {@link module:engine/conversion/mapper~Mapper#bindElements bound}.\n *\n * To map complex model to/from view relations, you may provide custom callbacks for\n * {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition modelToViewPosition event} and\n * {@link module:engine/conversion/mapper~Mapper#event:viewToModelPosition viewToModelPosition event} that are fired whenever\n * a position mapping request occurs.\n * Those events are fired by {@link module:engine/conversion/mapper~Mapper#toViewPosition toViewPosition}\n * and {@link module:engine/conversion/mapper~Mapper#toModelPosition toModelPosition} methods. `Mapper` adds it's own default callbacks\n * with `'lowest'` priority. To override default `Mapper` mapping, add custom callback with higher priority and\n * stop the event.\n */\nexport default class Mapper {\n\t/**\n\t * Creates an instance of the mapper.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Model element to view element mapping.\n\t\t *\n\t\t * @private\n\t\t * @member {WeakMap}\n\t\t */\n\t\tthis._modelToViewMapping = new WeakMap();\n\n\t\t/**\n\t\t * View element to model element mapping.\n\t\t *\n\t\t * @private\n\t\t * @member {WeakMap}\n\t\t */\n\t\tthis._viewToModelMapping = new WeakMap();\n\n\t\t/**\n\t\t * A map containing callbacks between view element names and functions evaluating length of view elements\n\t\t * in model.\n\t\t *\n\t\t * @private\n\t\t * @member {Map}\n\t\t */\n\t\tthis._viewToModelLengthCallbacks = new Map();\n\n\t\t// Default mapper algorithm for mapping model position to view position.\n\t\tthis.on( 'modelToViewPosition', ( evt, data ) => {\n\t\t\tif ( data.viewPosition ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet viewContainer = this._modelToViewMapping.get( data.modelPosition.parent );\n\n\t\t\tdata.viewPosition = this._findPositionIn( viewContainer, data.modelPosition.offset );\n\t\t}, { priority: 'low' } );\n\n\t\t// Default mapper algorithm for mapping view position to model position.\n\t\tthis.on( 'viewToModelPosition', ( evt, data ) => {\n\t\t\tif ( data.modelPosition ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet viewBlock = data.viewPosition.parent;\n\t\t\tlet modelParent = this._viewToModelMapping.get( viewBlock );\n\n\t\t\twhile ( !modelParent ) {\n\t\t\t\tviewBlock = viewBlock.parent;\n\t\t\t\tmodelParent = this._viewToModelMapping.get( viewBlock );\n\t\t\t}\n\n\t\t\tlet modelOffset = this._toModelOffset( data.viewPosition.parent, data.viewPosition.offset, viewBlock );\n\n\t\t\tdata.modelPosition = ModelPosition.createFromParentAndOffset( modelParent, modelOffset );\n\t\t}, { priority: 'low' } );\n\t}\n\n\t/**\n\t * Marks model and view elements as corresponding. Corresponding elements can be retrieved by using\n\t * the {@link module:engine/conversion/mapper~Mapper#toModelElement toModelElement} and\n\t * {@link module:engine/conversion/mapper~Mapper#toViewElement toViewElement} methods.\n\t * The information that elements are bound is also used to translate positions.\n\t *\n\t * @param {module:engine/model/element~Element} modelElement Model element.\n\t * @param {module:engine/view/element~Element} viewElement View element.\n\t */\n\tbindElements( modelElement, viewElement ) {\n\t\tthis._modelToViewMapping.set( modelElement, viewElement );\n\t\tthis._viewToModelMapping.set( viewElement, modelElement );\n\t}\n\n\t/**\n\t * Unbinds given {@link module:engine/view/element~Element view element} from the map.\n\t *\n\t * @param {module:engine/view/element~Element} viewElement View element to unbind.\n\t */\n\tunbindViewElement( viewElement ) {\n\t\tconst modelElement = this.toModelElement( viewElement );\n\n\t\tthis._unbindElements( modelElement, viewElement );\n\t}\n\n\t/**\n\t * Unbinds given {@link module:engine/model/element~Element model element} from the map.\n\t *\n\t * @param {module:engine/model/element~Element} modelElement Model element to unbind.\n\t */\n\tunbindModelElement( modelElement ) {\n\t\tconst viewElement = this.toViewElement( modelElement );\n\n\t\tthis._unbindElements( modelElement, viewElement );\n\t}\n\n\t/**\n\t * Removes all model to view and view to model bindings.\n\t */\n\tclearBindings() {\n\t\tthis._modelToViewMapping = new WeakMap();\n\t\tthis._viewToModelMapping = new WeakMap();\n\t}\n\n\t/**\n\t * Gets the corresponding model element.\n\t *\n\t * **Note:** {@link module:engine/view/uielement~UIElement} does not have corresponding element in model.\n\t *\n\t * @param {module:engine/view/element~Element} viewElement View element.\n\t * @returns {module:engine/model/element~Element|undefined} Corresponding model element or `undefined` if not found.\n\t */\n\ttoModelElement( viewElement ) {\n\t\treturn this._viewToModelMapping.get( viewElement );\n\t}\n\n\t/**\n\t * Gets the corresponding view element.\n\t *\n\t * @param {module:engine/model/element~Element} modelElement Model element.\n\t * @returns {module:engine/view/element~Element|undefined} Corresponding view element or `undefined` if not found.\n\t */\n\ttoViewElement( modelElement ) {\n\t\treturn this._modelToViewMapping.get( modelElement );\n\t}\n\n\t/**\n\t * Gets the corresponding model range.\n\t *\n\t * @param {module:engine/view/range~Range} viewRange View range.\n\t * @returns {module:engine/model/range~Range} Corresponding model range.\n\t */\n\ttoModelRange( viewRange ) {\n\t\treturn new ModelRange( this.toModelPosition( viewRange.start ), this.toModelPosition( viewRange.end ) );\n\t}\n\n\t/**\n\t * Gets the corresponding view range.\n\t *\n\t * @param {module:engine/model/range~Range} modelRange Model range.\n\t * @returns {module:engine/view/range~Range} Corresponding view range.\n\t */\n\ttoViewRange( modelRange ) {\n\t\treturn new ViewRange( this.toViewPosition( modelRange.start ), this.toViewPosition( modelRange.end ) );\n\t}\n\n\t/**\n\t * Gets the corresponding model position.\n\t *\n\t * @fires viewToModelPosition\n\t * @param {module:engine/view/position~Position} viewPosition View position.\n\t * @returns {module:engine/model/position~Position} Corresponding model position.\n\t */\n\ttoModelPosition( viewPosition ) {\n\t\tconst data = {\n\t\t\tviewPosition: viewPosition,\n\t\t\tmapper: this\n\t\t};\n\n\t\tthis.fire( 'viewToModelPosition', data );\n\n\t\treturn data.modelPosition;\n\t}\n\n\t/**\n\t * Gets the corresponding view position.\n\t *\n\t * @fires modelToViewPosition\n\t * @param {module:engine/model/position~Position} modelPosition Model position.\n\t * @returns {module:engine/view/position~Position} Corresponding view position.\n\t */\n\ttoViewPosition( modelPosition ) {\n\t\tconst data = {\n\t\t\tmodelPosition: modelPosition,\n\t\t\tmapper: this\n\t\t};\n\n\t\tthis.fire( 'modelToViewPosition', data );\n\n\t\treturn data.viewPosition;\n\t}\n\n\t/**\n\t * Registers a callback that evaluates the length in the model of a view element with given name.\n\t *\n\t * The callback is fired with one argument, which is a view element instance. The callback is expected to return\n\t * a number representing the length of view element in model.\n\t *\n\t *\t\t// List item in view may contain nested list, which have other list items. In model though,\n\t *\t\t// the lists are represented by flat structure. Because of those differences, length of list view element\n\t *\t\t// may be greater than one. In the callback it's checked how many nested list items are in evaluated list item.\n\t *\n\t *\t\tfunction getViewListItemLength( element ) {\n\t *\t\t\tlet length = 1;\n\t *\n\t *\t\t\tfor ( let child of element.getChildren() ) {\n\t *\t\t\t\tif ( child.name == 'ul' || child.name == 'ol' ) {\n\t *\t\t\t\t\tfor ( let item of child.getChildren() ) {\n\t *\t\t\t\t\t\tlength += getViewListItemLength( item );\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\n\t *\t\t\treturn length;\n\t *\t\t}\n\t *\n\t *\t\tmapper.registerViewToModelLength( 'li', getViewListItemLength );\n\t *\n\t * @param {String} viewElementName Name of view element for which callback is registered.\n\t * @param {Function} lengthCallback Function return a length of view element instance in model.\n\t */\n\tregisterViewToModelLength( viewElementName, lengthCallback ) {\n\t\tthis._viewToModelLengthCallbacks.set( viewElementName, lengthCallback );\n\t}\n\n\t/**\n\t * Calculates model offset based on the view position and the block element.\n\t *\n\t * Example:\n\t *\n\t *\t\t

    fooba|r

    // _toModelOffset( b, 2, p ) -> 5\n\t *\n\t * Is a sum of:\n\t *\n\t *\t\t

    foo|bar

    // _toModelOffset( p, 3, p ) -> 3\n\t *\t\t

    fooba|r

    // _toModelOffset( b, 2, b ) -> 2\n\t *\n\t * @private\n\t * @param {module:engine/view/element~Element} viewParent Position parent.\n\t * @param {Number} viewOffset Position offset.\n\t * @param {module:engine/view/element~Element} viewBlock Block used as a base to calculate offset.\n\t * @returns {Number} Offset in the model.\n\t */\n\t_toModelOffset( viewParent, viewOffset, viewBlock ) {\n\t\tif ( viewBlock != viewParent ) {\n\t\t\t// See example.\n\t\t\tconst offsetToParentStart = this._toModelOffset( viewParent.parent, viewParent.index, viewBlock );\n\t\t\tconst offsetInParent = this._toModelOffset( viewParent, viewOffset, viewParent );\n\n\t\t\treturn offsetToParentStart + offsetInParent;\n\t\t}\n\n\t\t// viewBlock == viewParent, so we need to calculate the offset in the parent element.\n\n\t\t// If the position is a text it is simple (\"ba|r\" -> 2).\n\t\tif ( viewParent.is( 'text' ) ) {\n\t\t\treturn viewOffset;\n\t\t}\n\n\t\t// If the position is in an element we need to sum lengths of siblings ( bar foo | -> 3 + 3 = 6 ).\n\t\tlet modelOffset = 0;\n\n\t\tfor ( let i = 0; i < viewOffset; i++ ) {\n\t\t\tmodelOffset += this.getModelLength( viewParent.getChild( i ) );\n\t\t}\n\n\t\treturn modelOffset;\n\t}\n\n\t/**\n\t * Removes binding between given elements.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} modelElement Model element to unbind.\n\t * @param {module:engine/view/element~Element} viewElement View element to unbind.\n\t */\n\t_unbindElements( modelElement, viewElement ) {\n\t\tthis._viewToModelMapping.delete( viewElement );\n\t\tthis._modelToViewMapping.delete( modelElement );\n\t}\n\n\t/**\n\t * Gets the length of the view element in the model.\n\t *\n\t * The length is calculated as follows:\n\t * * if {@link #registerViewToModelLength length mapping callback} is provided for given `viewNode` it is used to\n\t * evaluate model length (`viewNode` is used as first and only parameter passed to the callback),\n\t * * length of a {@link module:engine/view/text~Text text node} is equal to the length of it's\n\t * {@link module:engine/view/text~Text#data data},\n\t * * length of a {@link module:engine/view/uielement~UIElement ui element} is equal to 0,\n\t * * length of a mapped {@link module:engine/view/element~Element element} is equal to 1,\n\t * * length of a not-mapped {@link module:engine/view/element~Element element} is equal to the length of it's children.\n\t *\n\t * Examples:\n\t *\n\t *\t\tfoo -> 3 // Text length is equal to it's data length.\n\t *\t\t

    foo

    -> 1 // Length of an element which is mapped is by default equal to 1.\n\t *\t\tfoo -> 3 // Length of an element which is not mapped is a length of its children.\n\t *\t\t

    x

    y

    -> 2 // Assuming that
    is not mapped and

    are mapped.\n\t *\n\t * @param {module:engine/view/element~Element} viewNode View node.\n\t * @returns {Number} Length of the node in the tree model.\n\t */\n\tgetModelLength( viewNode ) {\n\t\tif ( this._viewToModelLengthCallbacks.get( viewNode.name ) ) {\n\t\t\tconst callback = this._viewToModelLengthCallbacks.get( viewNode.name );\n\n\t\t\treturn callback( viewNode );\n\t\t} else if ( this._viewToModelMapping.has( viewNode ) ) {\n\t\t\treturn 1;\n\t\t} else if ( viewNode.is( 'text' ) ) {\n\t\t\treturn viewNode.data.length;\n\t\t} else if ( viewNode.is( 'uiElement' ) ) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tlet len = 0;\n\n\t\t\tfor ( let child of viewNode.getChildren() ) {\n\t\t\t\tlen += this.getModelLength( child );\n\t\t\t}\n\n\t\t\treturn len;\n\t\t}\n\t}\n\n\t/**\n\t * Finds the position in the view node (or its children) with the expected model offset.\n\t *\n\t * Example:\n\t *\n\t *\t\t

    fobarbom

    -> expected offset: 4\n\t *\n\t *\t\t_findPositionIn( p, 4 ):\n\t *\t\t

    |fobarbom

    -> expected offset: 4, actual offset: 0\n\t *\t\t

    fo|barbom

    -> expected offset: 4, actual offset: 2\n\t *\t\t

    fobar|bom

    -> expected offset: 4, actual offset: 5 -> we are too far\n\t *\n\t *\t\t_findPositionIn( b, 4 - ( 5 - 3 ) ):\n\t *\t\t

    fo|barbom

    -> expected offset: 2, actual offset: 0\n\t *\t\t

    fobar|bom

    -> expected offset: 2, actual offset: 3 -> we are too far\n\t *\n\t *\t\t_findPositionIn( bar, 2 - ( 3 - 3 ) ):\n\t *\t\tWe are in the text node so we can simple find the offset.\n\t *\t\t

    foba|rbom

    -> expected offset: 2, actual offset: 2 -> position found\n\t *\n\t * @private\n\t * @param {module:engine/view/element~Element} viewParent Tree view element in which we are looking for the position.\n\t * @param {Number} expectedOffset Expected offset.\n\t * @returns {module:engine/view/position~Position} Found position.\n\t */\n\t_findPositionIn( viewParent, expectedOffset ) {\n\t\t// Last scanned view node.\n\t\tlet viewNode;\n\t\t// Length of the last scanned view node.\n\t\tlet lastLength = 0;\n\n\t\tlet modelOffset = 0;\n\t\tlet viewOffset = 0;\n\n\t\t// In the text node it is simple: offset in the model equals offset in the text.\n\t\tif ( viewParent.is( 'text' ) ) {\n\t\t\treturn new ViewPosition( viewParent, expectedOffset );\n\t\t}\n\n\t\t// In other cases we add lengths of child nodes to find the proper offset.\n\n\t\t// If it is smaller we add the length.\n\t\twhile ( modelOffset < expectedOffset ) {\n\t\t\tviewNode = viewParent.getChild( viewOffset );\n\t\t\tlastLength = this.getModelLength( viewNode );\n\t\t\tmodelOffset += lastLength;\n\t\t\tviewOffset++;\n\t\t}\n\n\t\t// If it equals we found the position.\n\t\tif ( modelOffset == expectedOffset ) {\n\t\t\treturn this._moveViewPositionToTextNode( new ViewPosition( viewParent, viewOffset ) );\n\t\t}\n\t\t// If it is higher we need to enter last child.\n\t\telse {\n\t\t\t// ( modelOffset - lastLength ) is the offset to the child we enter,\n\t\t\t// so we subtract it from the expected offset to fine the offset in the child.\n\t\t\treturn this._findPositionIn( viewNode, expectedOffset - ( modelOffset - lastLength ) );\n\t\t}\n\t}\n\n\t/**\n\t * Because we prefer positions in text nodes over positions next to text node moves view position to the text node\n\t * if it was next to it.\n\t *\n\t *\t\t

    []foo

    ->

    []foo

    // do not touch if position is not directly next to text\n\t *\t\t

    foo[]foo

    ->

    foo{}foo

    // move to text node\n\t *\t\t

    []foo

    ->

    {}foo

    // move to text node\n\t *\n\t * @private\n\t * @param {module:engine/view/position~Position} viewPosition Position potentially next to text node.\n\t * @returns {module:engine/view/position~Position} Position in text node if possible.\n\t */\n\t_moveViewPositionToTextNode( viewPosition ) {\n\t\t// If the position is just after text node, put it at the end of that text node.\n\t\t// If the position is just before text node, put it at the beginning of that text node.\n\t\tconst nodeBefore = viewPosition.nodeBefore;\n\t\tconst nodeAfter = viewPosition.nodeAfter;\n\n\t\tif ( nodeBefore instanceof ViewText ) {\n\t\t\treturn new ViewPosition( nodeBefore, nodeBefore.data.length );\n\t\t} else if ( nodeAfter instanceof ViewText ) {\n\t\t\treturn new ViewPosition( nodeAfter, 0 );\n\t\t}\n\n\t\t// Otherwise, just return the given position.\n\t\treturn viewPosition;\n\t}\n\n\t/**\n\t * Fired for each model-to-view position mapping request. The purpose of this event is to enable custom model-to-view position\n\t * mapping. Callbacks added to this event take {@link module:engine/model/position~Position model position} and are expected to calculate\n\t * {@link module:engine/view/position~Position view position}. Calculated view position should be added as `viewPosition` value in\n\t * `data` object that is passed as one of parameters to the event callback.\n\t *\n\t * \t\t// Assume that \"captionedImage\" model element is converted to and following elements in view,\n\t * \t\t// and the model element is bound to element. Force mapping model positions inside \"captionedImage\" to that element.\n\t *\t\tmapper.on( 'modelToViewPosition', ( evt, data ) => {\n\t *\t\t\tconst positionParent = modelPosition.parent;\n\t *\n\t *\t\t\tif ( positionParent.name == 'captionedImage' ) {\n\t *\t\t\t\tconst viewImg = data.mapper.toViewElement( positionParent );\n\t *\t\t\t\tconst viewCaption = viewImg.nextSibling; // The element.\n\t *\n\t *\t\t\t\tdata.viewPosition = new ViewPosition( viewCaption, modelPosition.offset );\n\t *\n\t *\t\t\t\t// Stop the event if other callbacks should not modify calculated value.\n\t *\t\t\t\tevt.stop();\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * **Note:** keep in mind that custom callback provided for this event should use provided `data.modelPosition` only to check\n\t * what is before the position (or position's parent). This is important when model-to-view position mapping is used in\n\t * remove change conversion. Model after the removed position (that is being mapped) does not correspond to view, so it cannot be used:\n\t *\n\t *\t\t// Incorrect:\n\t *\t\tconst modelElement = data.modelPosition.nodeAfter;\n\t *\t\tconst viewElement = data.mapper.toViewElement( modelElement );\n\t *\t\t// ... Do something with `viewElement` and set `data.viewPosition`.\n\t *\n\t *\t\t// Correct:\n\t *\t\tconst prevModelElement = data.modelPosition.nodeBefore;\n\t *\t\tconst prevViewElement = data.mapper.toViewElement( prevModelElement );\n\t *\t\t// ... Use `prevViewElement` to find correct `data.viewPosition`.\n\t *\n\t * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to attach\n\t * a custom callback after default callback and also use `data.viewPosition` calculated by default callback (for example to fix it).\n\t *\n\t * **Note:** default mapping callback will not fire if `data.viewPosition` is already set.\n\t *\n\t * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position\n\t * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,\n\t * the condition that checks if special case scenario happened should be as simple as possible.\n\t *\n\t * @event modelToViewPosition\n\t * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add\n\t * `viewPosition` value to that object with calculated {@link module:engine/view/position~Position view position}.\n\t * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.\n\t */\n\n\t/**\n\t * Fired for each view-to-model position mapping request. See {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition}.\n\t *\n\t * \t\t// See example in `modelToViewPosition` event description.\n\t * \t\t// This custom mapping will map positions from element next to to the \"captionedImage\" element.\n\t *\t\tmapper.on( 'viewToModelPosition', ( evt, data ) => {\n\t *\t\t\tconst positionParent = viewPosition.parent;\n\t *\n\t *\t\t\tif ( positionParent.hasClass( 'image-caption' ) ) {\n\t *\t\t\t\tconst viewImg = positionParent.previousSibling;\n\t *\t\t\t\tconst modelImg = data.mapper.toModelElement( viewImg );\n\t *\n\t *\t\t\t\tdata.modelPosition = new ModelPosition( modelImg, viewPosition.offset );\n\t *\t\t\t\tevt.stop();\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to attach\n\t * a custom callback after default callback and also use `data.modelPosition` calculated by default callback (for example to fix it).\n\t *\n\t * **Note:** default mapping callback will not fire if `data.modelPosition` is already set.\n\t *\n\t * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position\n\t * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,\n\t * the condition that checks if special case scenario happened should be as simple as possible.\n\t *\n\t * @event viewToModelPosition\n\t * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add\n\t * `modelPosition` value to that object with calculated {@link module:engine/model/position~Position model position}.\n\t * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.\n\t */\n}\n\nmix( Mapper, EmitterMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/conversion/mapper.js\n// module id = 156\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport ViewElement from '../view/element';\nimport ViewRange from '../view/range';\nimport viewWriter from '../view/writer';\n\n/**\n * Contains {@link module:engine/model/selection~Selection model selection} to\n * {@link module:engine/view/selection~Selection view selection} converters for\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher}.\n *\n * @module engine/conversion/model-selection-to-view-converters\n */\n\n/**\n * Function factory, creates a converter that converts non-collapsed {@link module:engine/model/selection~Selection model selection} to\n * {@link module:engine/view/selection~Selection view selection}. The converter consumes appropriate value from `consumable` object\n * and maps model positions from selection to view positions.\n *\n *\t\tmodelDispatcher.on( 'selection', convertRangeSelection() );\n *\n * @returns {Function} Selection converter.\n */\nexport function convertRangeSelection() {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst selection = data.selection;\n\n\t\tif ( selection.isCollapsed ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( selection, 'selection' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconversionApi.viewSelection.removeAllRanges();\n\n\t\tfor ( let range of selection.getRanges() ) {\n\t\t\tconst viewRange = conversionApi.mapper.toViewRange( range );\n\t\t\tconversionApi.viewSelection.addRange( viewRange, selection.isBackward );\n\t\t}\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts collapsed {@link module:engine/model/selection~Selection model selection} to\n * {@link module:engine/view/selection~Selection view selection}. The converter consumes appropriate value from `consumable` object,\n * maps model selection position to view position and breaks {@link module:engine/view/attributeelement~AttributeElement attribute elements}\n * at the selection position.\n *\n *\t\tmodelDispatcher.on( 'selection', convertCollapsedSelection() );\n *\n * Example of view state before and after converting collapsed selection:\n *\n *\t\t

    f^oobar

    \n *\t\t->

    f^oobar

    \n *\n * By breaking attribute elements like ``, selection is in correct element. See also complementary\n * {@link module:engine/conversion/model-selection-to-view-converters~convertSelectionAttribute attribute converter}\n * for selection attributes,\n * which wraps collapsed selection into view elements. Those converters together ensure, that selection ends up in\n * appropriate attribute elements.\n *\n * See also {@link module:engine/conversion/model-selection-to-view-converters~clearAttributes} which does a clean-up\n * by merging attributes.\n *\n * @returns {Function} Selection converter.\n */\nexport function convertCollapsedSelection() {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst selection = data.selection;\n\n\t\tif ( !selection.isCollapsed ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !consumable.consume( selection, 'selection' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst modelPosition = selection.getFirstPosition();\n\t\tconst viewPosition = conversionApi.mapper.toViewPosition( modelPosition );\n\t\tconst brokenPosition = viewWriter.breakAttributes( viewPosition );\n\n\t\tconversionApi.viewSelection.removeAllRanges();\n\t\tconversionApi.viewSelection.addRange( new ViewRange( brokenPosition, brokenPosition ) );\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts {@link module:engine/model/selection~Selection model selection} attributes to\n * {@link module:engine/view/attributeelement~AttributeElement view attribute elements}. The converter works only for collapsed selection.\n * The converter consumes appropriate value from `consumable` object, maps model selection position to view position and\n * wraps that position into a view attribute element.\n *\n * The wrapping node depends on passed parameter. If {@link module:engine/view/element~Element} was passed, it will be cloned and\n * the copy will become the wrapping element. If `Function` is provided, it is passed all the parameters of the\n * {@link module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:selectionAttribute selectionAttribute event}.\n * It's expected that the function returns a {@link module:engine/view/attributeelement~AttributeElement}.\n * The result of the function will be the wrapping element.\n *\n *\t\tmodelDispatcher.on( 'selectionAttribute:italic', convertSelectionAttribute( new ViewAttributeElement( 'em' ) ) );\n *\n *\t\tfunction styleElementCreator( styleValue ) {\n *\t\t\tif ( styleValue == 'important' ) {\n *\t\t\t\treturn new ViewAttributeElement( 'strong', { style: 'text-transform:uppercase;' } );\n *\t\t\t} else if ( styleValue == 'gold' ) {\n *\t\t\t\treturn new ViewAttributeElement( 'span', { style: 'color:yellow;' } );\n *\t\t\t}\n *\t\t}\n *\t\tmodelDispatcher.on( 'selectionAttribute:style', convertSelectionAttribute( styleCreator ) );\n *\n * **Note:** You can use the same `elementCreator` function for this converter factory\n * and {@link module:engine/conversion/model-to-view-converters~wrapRange}\n * model to view converter, as long as the `elementCreator` function uses only the first parameter (attribute value).\n *\n *\t\tmodelDispatcher.on( 'selection', convertCollapsedSelection() );\n *\t\tmodelDispatcher.on( 'selectionAttribute:italic', convertSelectionAttribute( new ViewAttributeElement( 'em' ) ) );\n *\t\tmodelDispatcher.on( 'selectionAttribute:bold', convertSelectionAttribute( new ViewAttributeElement( 'strong' ) ) );\n *\n * Example of view states before and after converting collapsed selection:\n *\n *\t\t

    f^oobar

    \n *\t\t->

    f^oobar

    \n *\t\t->

    f^oobar

    \n *\n * Example of view state after converting collapsed selection. The scenario is: selection is inside bold text (`` element)\n * but it does not have bold attribute itself and has italic attribute instead (let's assume that user turned off bold and turned\n * on italic with selection collapsed):\n *\n *\t\t

    f^oobar

    \n *\t\t->

    f^oobar

    \n *\t\t->

    f^oobar

    \n *\n * In first example, nothing has changed, because first `` element got broken by `convertCollapsedSelection()` converter,\n * but then it got wrapped-back by `convertSelectionAttribute()` converter. In second example, notice how `` element\n * is broken to prevent putting selection in it, since selection has no `bold` attribute.\n *\n * @param {module:engine/view/attributeelement~AttributeElement|Function} elementCreator View element,\n * or function returning a view element, which will be used for wrapping.\n * @returns {Function} Selection converter.\n */\nexport function convertSelectionAttribute( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst viewElement = elementCreator instanceof ViewElement ?\n\t\t\telementCreator.clone( true ) :\n\t\t\telementCreator( data.value, data, data.selection, consumable, conversionApi );\n\n\t\tif ( !viewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst consumableName = 'selectionAttribute:' + data.key;\n\n\t\twrapCollapsedSelectionPosition( data.selection, conversionApi.viewSelection, viewElement, consumable, consumableName );\n\t};\n}\n\n/**\n * Performs similar conversion as {@link ~convertSelectionAttribute}, but depends on a marker name of a marker in which\n * collapsed selection is placed.\n *\n *\t\tmodelDispatcher.on( 'selectionMarker:searchResult', wrapRange( new ViewAttributeElement( 'span', { class: 'searchResult' } ) ) );\n *\n * **Note:** You can use the same `elementCreator` function for this converter factory\n * and {@link module:engine/conversion/model-to-view-converters~wrapRange}.\n *\n * @see module:engine/conversion/model-selection-to-view-converters~convertSelectionAttribute\n * @param {module:engine/view/attributeelement~AttributeElement|Function} elementCreator View element,\n * or function returning a view element, which will be used for wrapping.\n * @returns {Function} Selection converter.\n */\nexport function convertSelectionMarker( elementCreator ) {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tconst viewElement = elementCreator instanceof ViewElement ?\n\t\t\telementCreator.clone( true ) :\n\t\t\telementCreator( data, consumable, conversionApi );\n\n\t\tif ( !viewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst consumableName = 'selectionMarker:' + data.name;\n\n\t\twrapCollapsedSelectionPosition( data.selection, conversionApi.viewSelection, viewElement, consumable, consumableName );\n\t};\n}\n\n// Helper function for `convertSelectionAttribute` and `convertSelectionMarker`, which perform similar task.\nfunction wrapCollapsedSelectionPosition( modelSelection, viewSelection, viewElement, consumable, consumableName ) {\n\tif ( !modelSelection.isCollapsed ) {\n\t\treturn;\n\t}\n\n\tif ( !consumable.consume( modelSelection, consumableName ) ) {\n\t\treturn;\n\t}\n\n\tlet viewPosition = viewSelection.getFirstPosition();\n\tviewPosition = viewWriter.wrapPosition( viewPosition, viewElement );\n\n\tviewSelection.removeAllRanges();\n\tviewSelection.addRange( new ViewRange( viewPosition, viewPosition ) );\n}\n\n/**\n * Function factory, creates a converter that clears artifacts after the previous\n * {@link module:engine/model/selection~Selection model selection} conversion. It removes all empty\n * {@link module:engine/view/attributeelement~AttributeElement view attribute elements} and merge sibling attributes at all start and end\n * positions of all ranges.\n *\n *\t\t

    ^

    \n *\t\t->

    ^

    \n *\n *\t\t

    foo^barbar

    \n *\t\t->

    foo^barbar

    \n *\n *\t\t

    foo^barbar

    \n *\t\t->

    foo^barbar

    \n *\n * This listener should be assigned before any converter for the new selection:\n *\n *\t\tmodelDispatcher.on( 'selection', clearAttributes() );\n *\n * See {@link module:engine/conversion/model-selection-to-view-converters~convertCollapsedSelection}\n * which do the opposite by breaking attributes in the selection position.\n *\n * @returns {Function} Selection converter.\n */\nexport function clearAttributes() {\n\treturn ( evt, data, consumable, conversionApi ) => {\n\t\tfor ( let range of conversionApi.viewSelection.getRanges() ) {\n\t\t\t// Not collapsed selection should not have artifacts.\n\t\t\tif ( range.isCollapsed ) {\n\t\t\t\t// Position might be in the node removed by the view writer.\n\t\t\t\tif ( range.end.parent.document ) {\n\t\t\t\t\tviewWriter.mergeAttributes( range.start );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconversionApi.viewSelection.removeAllRanges();\n\t};\n}\n\n/**\n * Function factory, creates a converter that clears fake selection marking after the previous\n * {@link module:engine/model/selection~Selection model selection} conversion.\n */\nexport function clearFakeSelection() {\n\treturn ( evt, data, consumable, conversionApi ) => conversionApi.viewSelection.setFake( false );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/conversion/model-selection-to-view-converters.js\n// module id = 157\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/modelconversiondispatcher\n */\n\nimport Consumable from './modelconsumable';\nimport Range from '../model/range';\nimport Position from '../model/position';\nimport DocumentFragment from '../model/documentfragment';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport extend from '@ckeditor/ckeditor5-utils/src/lib/lodash/extend';\n\n/**\n * `ModelConversionDispatcher` is a central point of {@link module:engine/model/model model} conversion, which is\n * a process of reacting to changes in the model and reflecting them by listeners that listen to those changes.\n * In default application, {@link module:engine/model/model model} is converted to {@link module:engine/view/view view}. This means\n * that changes in the model are reflected by changing the view (i.e. adding view nodes or changing attributes on view elements).\n *\n * During conversion process, `ModelConversionDispatcher` fires data-manipulation events, basing on state of the model and prepares\n * data for those events. It is important to note that the events are connected with \"change actions\" like \"inserting\"\n * or \"removing\" so one might say that we are converting \"changes\". This is in contrary to view to model conversion,\n * where we convert view nodes (the structure, not \"changes\" to the view). Note, that because changes are converted\n * and not the structure itself, there is a need to have a mapping between model and the structure on which changes are\n * reflected. To map elements during model to view conversion use {@link module:engine/conversion/mapper~Mapper}.\n *\n * The main use for this class is to listen to {@link module:engine/model/document~Document#event:change Document change event}, process it\n * and then fire specific events telling what exactly has changed. For those events, `ModelConversionDispatcher`\n * creates {@link module:engine/conversion/modelconsumable~ModelConsumable list of consumable values} that should be handled by event\n * callbacks. Those events are listened to by model-to-view converters which convert changes done in the\n * {@link module:engine/model/model model} to changes in the {@link module:engine/view/view view}. `ModelConversionController` also checks\n * the current state of consumables, so it won't fire events for parts of model that were already consumed. This is\n * especially important in callbacks that consume multiple values. See {@link module:engine/conversion/modelconsumable~ModelConsumable}\n * for an example of such callback.\n *\n * Although the primary usage for this class is the model-to-view conversion, `ModelConversionDispatcher` can be used\n * to build custom data processing pipelines that converts model to anything that is needed. Existing model structure can\n * be used to generate events (listening to {@link module:engine/model/document~Document#event:change Document change event} is not\n * required)\n * and custom callbacks can be added to the events (these does not have to be limited to changes in the view).\n *\n * When providing your own event listeners for `ModelConversionDispatcher` keep in mind that any callback that had\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} a value from consumable (and did some changes, i.e. to\n * the view) should also stop the event. This is because whenever a callback is fired it is assumed that there is something\n * to be consumed. Thanks to that approach, you do not have to test whether there is anything to consume at the beginning\n * of your listener callback.\n *\n * Example of providing a converter for `ModelConversionDispatcher`:\n *\n *\t\t// We will convert inserting \"paragraph\" model element into the model.\n *\t\tmodelDispatcher.on( 'insert:paragraph', ( evt, data, consumable, conversionApi ) => {\n *\t\t\t// Remember to consume the part of consumable.\n *\t\t\tconsumable.consume( data.item, 'insert' );\n *\n *\t\t\t// Translate position in model to position in the view.\n *\t\t\tconst viewPosition = conversionApi.mapper.toViewPosition( data.range.start );\n *\n *\t\t\t// Create a P element (note that this converter is for inserting P elements -> 'insert:paragraph').\n *\t\t\tconst viewElement = new ViewElement( 'p' );\n *\n *\t\t\t// Bind the newly created view element to model element so positions will map accordingly in future.\n *\t\t\tconversionApi.mapper.bindElements( data.item, viewElement );\n *\n *\t\t\t// Add the newly created view element to the view.\n *\t\t\tviewWriter.insert( viewPosition, viewElement );\n *\n *\t\t\t// Remember to stop the event propagation if the data.item was consumed.\n *\t\t\tevt.stop();\n *\t\t} );\n *\n * Callback that \"overrides\" other callback:\n *\n *\t\t// Special converter for `linkHref` attribute added on custom `quote` element. Note, that this\n *\t\t// attribute may be the same as the attribute added by other features (link feature in this case).\n *\t\t// It might be even added by that feature! It makes sense that a part of content that is a quote is linked\n *\t\t// to an external source so it makes sense that link feature works on the custom quote element.\n *\t\t// However, we have to make sure that the attributes added by link feature are correctly converted.\n *\t\t// To block default `linkHref` conversion we have to:\n *\t\t// 1) add this callback with higher priority than link feature callback,\n *\t\t// 2) consume `linkHref` attribute add change.\n *\t\tmodelConversionDispatcher.on( 'addAttribute:linkHref:quote', ( evt, data, consumable, conversionApi ) => {\n *\t\t\tconsumable.consume( data.item, 'addAttribute:linkHref' );\n *\n *\t\t\t// Create a button that will represent the `linkHref` attribute.\n *\t\t\tlet viewSourceBtn = new ViewElement( 'a', {\n *\t\t\t\thref: data.item.getAttribute( 'linkHref' ),\n *\t\t\t\ttitle: 'source'\n *\t\t\t} );\n *\n *\t\t\t// Add a class for the button.\n *\t\t\tviewSourceBtn.addClass( 'source' );\n *\n *\t\t\t// Insert the button using writer API.\n *\t\t\t// If `addAttribute` event is fired by\n *\t\t\t// `module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#convertInsert` it is fired\n *\t\t\t// after `data.item` insert conversion was done. If the event is fired due to attribute insertion coming from\n *\t\t\t// different source, `data.item` already existed. This means we are safe to get `viewQuote` from mapper.\n *\t\t\tconst viewQuote = conversionApi.mapper.toViewElement( data.item );\n *\t\t\tconst position = new ViewPosition( viewQuote, viewQuote.childCount );\n *\t\t\tviewWriter.insert( position, viewSourceBtn );\n *\n *\t\t\tevt.stop();\n *\t\t}, { priority: 'high' } );\n */\nexport default class ModelConversionDispatcher {\n\t/**\n\t * Creates a `ModelConversionDispatcher` that operates using passed API.\n\t *\n\t * @param {module:engine/model/document~Document} modelDocument Model document instance bound with this dispatcher.\n\t * @param {Object} [conversionApi] Interface passed by dispatcher to the events callbacks.\n\t */\n\tconstructor( modelDocument, conversionApi = {} ) {\n\t\t/**\n\t\t * Model document instance bound with this dispatcher.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/document~Document}\n\t\t */\n\t\tthis._modelDocument = modelDocument;\n\n\t\t/**\n\t\t * Interface passed by dispatcher to the events callbacks.\n\t\t *\n\t\t * @member {Object}\n\t\t */\n\t\tthis.conversionApi = extend( { dispatcher: this }, conversionApi );\n\t}\n\n\t/**\n\t * Prepares data and fires a proper event.\n\t *\n\t * The method is crafted to take use of parameters passed in {@link module:engine/model/document~Document#event:change Document change\n\t * event}.\n\t *\n\t * @see module:engine/model/document~Document#event:change\n\t * @fires insert\n\t * @fires remove\n\t * @fires addAttribute\n\t * @fires removeAttribute\n\t * @fires changeAttribute\n\t * @fires addMarker\n\t * @param {String} type Change type.\n\t * @param {Object} data Additional information about the change.\n\t */\n\tconvertChange( type, data ) {\n\t\t// Do not convert changes if they happen in graveyard.\n\t\t// Graveyard is a special root that has no view / no other representation and changes done in it should not be converted.\n\t\tif ( type !== 'remove' && data.range && data.range.root.rootName == '$graveyard' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type == 'remove' && data.sourcePosition.root.rootName == '$graveyard' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type == 'rename' && data.element.root.rootName == '$graveyard' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We can safely dispatch changes.\n\t\tif ( type == 'insert' || type == 'reinsert' ) {\n\t\t\tthis.convertInsertion( data.range );\n\t\t} else if ( type == 'move' ) {\n\t\t\tthis.convertMove( data.sourcePosition, data.range );\n\t\t} else if ( type == 'remove' ) {\n\t\t\tthis.convertRemove( data.sourcePosition, data.range );\n\t\t} else if ( type == 'addAttribute' || type == 'removeAttribute' || type == 'changeAttribute' ) {\n\t\t\tthis.convertAttribute( type, data.range, data.key, data.oldValue, data.newValue );\n\t\t} else if ( type == 'rename' ) {\n\t\t\tthis.convertRename( data.element, data.oldName );\n\t\t}\n\t}\n\n\t/**\n\t * Starts conversion of insertion-change on given `range`.\n\t *\n\t * Analyzes given range and fires insertion-connected events with data based on that range.\n\t *\n\t * **Note**: This method will fire separate events for node insertion and attributes insertion. All\n\t * attributes that are set on inserted nodes are treated like they were added just after node insertion.\n\t *\n\t * @fires insert\n\t * @fires addAttribute\n\t * @fires addMarker\n\t * @param {module:engine/model/range~Range} range Inserted range.\n\t */\n\tconvertInsertion( range ) {\n\t\t// Create a list of things that can be consumed, consisting of nodes and their attributes.\n\t\tconst consumable = this._createInsertConsumable( range );\n\n\t\t// Fire a separate insert event for each node and text fragment contained in the range.\n\t\tfor ( let value of range ) {\n\t\t\tconst item = value.item;\n\t\t\tconst itemRange = Range.createFromPositionAndShift( value.previousPosition, value.length );\n\t\t\tconst data = {\n\t\t\t\titem: item,\n\t\t\t\trange: itemRange\n\t\t\t};\n\n\t\t\tthis._testAndFire( 'insert', data, consumable );\n\n\t\t\t// Fire a separate addAttribute event for each attribute that was set on inserted items.\n\t\t\t// This is important because most attributes converters will listen only to add/change/removeAttribute events.\n\t\t\t// If we would not add this part, attributes on inserted nodes would not be converted.\n\t\t\tfor ( let key of item.getAttributeKeys() ) {\n\t\t\t\tdata.attributeKey = key;\n\t\t\t\tdata.attributeOldValue = null;\n\t\t\t\tdata.attributeNewValue = item.getAttribute( key );\n\n\t\t\t\tthis._testAndFire( `addAttribute:${ key }`, data, consumable );\n\t\t\t}\n\t\t}\n\n\t\tfor ( let marker of this._modelDocument.markers ) {\n\t\t\tconst markerRange = marker.getRange();\n\n\t\t\t// Check if inserted content is inserted into a marker.\n\t\t\tif ( markerRange.containsPosition( range.start ) ) {\n\t\t\t\tthis.convertMarker( 'addMarker', marker.name, markerRange.getIntersection( range ) );\n\t\t\t}\n\n\t\t\t// Check if inserted content contains a marker.\n\t\t\tif ( range.containsRange( markerRange ) || range.isEqual( markerRange ) ) {\n\t\t\t\tthis.convertMarker( 'addMarker', marker.name, markerRange );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Starts conversion of move-change of given `range`, that was moved from given `sourcePosition`.\n\t *\n\t * Fires {@link ~#event:remove remove event} and {@link ~#event:insert insert event} based on passed parameters.\n\t *\n\t * @fires remove\n\t * @fires insert\n\t * @param {module:engine/model/position~Position} sourcePosition The original position from which the range was moved.\n\t * @param {module:engine/model/range~Range} range The range containing the moved content.\n\t */\n\tconvertMove( sourcePosition, range ) {\n\t\t// Move left – convert insertion first (#847).\n\t\tif ( range.start.isBefore( sourcePosition ) ) {\n\t\t\tthis.convertInsertion( range );\n\n\t\t\tconst sourcePositionAfterInsertion\n\t\t\t\t= sourcePosition._getTransformedByInsertion( range.start, range.end.offset - range.start.offset );\n\n\t\t\tthis.convertRemove( sourcePositionAfterInsertion, range );\n\t\t} else {\n\t\t\tthis.convertRemove( sourcePosition, range );\n\t\t\tthis.convertInsertion( range );\n\t\t}\n\t}\n\n\t/**\n\t * Starts conversion of remove-change of given `range`, that was removed from given `sourcePosition`.\n\t *\n\t * Fires {@link ~#event:remove remove event} with data based on passed values.\n\t *\n\t * @fires remove\n\t * @param {module:engine/model/position~Position} sourcePosition Position from where the range has been removed.\n\t * @param {module:engine/model/range~Range} range Removed range (after remove, in\n\t * {@link module:engine/model/document~Document#graveyard graveyard root}).\n\t */\n\tconvertRemove( sourcePosition, range ) {\n\t\tconst consumable = this._createConsumableForRange( range, 'remove' );\n\n\t\tfor ( let item of range.getItems( { shallow: true } ) ) {\n\t\t\tconst data = {\n\t\t\t\tsourcePosition: sourcePosition,\n\t\t\t\titem: item\n\t\t\t};\n\n\t\t\tthis._testAndFire( `remove`, data, consumable );\n\t\t}\n\t}\n\n\t/**\n\t * Starts conversion of attribute-change on given `range`.\n\t *\n\t * Analyzes given attribute change and fires attributes-connected events with data based on passed values.\n\t *\n\t * @fires addAttribute\n\t * @fires removeAttribute\n\t * @fires changeAttribute\n\t * @param {String} type Change type. Possible values: `addAttribute`, `removeAttribute`, `changeAttribute`.\n\t * @param {module:engine/model/range~Range} range Changed range.\n\t * @param {String} key Attribute key.\n\t * @param {*} oldValue Attribute value before the change or `null` if attribute has not been set.\n\t * @param {*} newValue New attribute value or `null` if attribute has been removed.\n\t */\n\tconvertAttribute( type, range, key, oldValue, newValue ) {\n\t\t// Create a list with attributes to consume.\n\t\tconst consumable = this._createConsumableForRange( range, type + ':' + key );\n\n\t\t// Create a separate attribute event for each node in the range.\n\t\tfor ( let value of range ) {\n\t\t\tconst item = value.item;\n\t\t\tconst itemRange = Range.createFromPositionAndShift( value.previousPosition, value.length );\n\t\t\tconst data = {\n\t\t\t\titem: item,\n\t\t\t\trange: itemRange,\n\t\t\t\tattributeKey: key,\n\t\t\t\tattributeOldValue: oldValue,\n\t\t\t\tattributeNewValue: newValue\n\t\t\t};\n\n\t\t\tthis._testAndFire( `${ type }:${ key }`, data, consumable );\n\t\t}\n\t}\n\n\t/**\n\t * Starts conversion of rename-change of given `element` that had given `oldName`.\n\t *\n\t * Fires {@link ~#event:remove remove event} and {@link ~#event:insert insert event} based on passed values.\n\t *\n\t * @fires remove\n\t * @fires insert\n\t * @param {module:engine/model/element~Element} element Renamed element.\n\t * @param {String} oldName Name of the renamed element before it was renamed.\n\t */\n\tconvertRename( element, oldName ) {\n\t\t// Create fake element that will be used to fire remove event. The fake element will have the old element name.\n\t\tconst fakeElement = element.clone( true );\n\t\tfakeElement.name = oldName;\n\n\t\t// Bind fake element with original view element so the view element will be removed.\n\t\tthis.conversionApi.mapper.bindElements(\n\t\t\tfakeElement,\n\t\t\tthis.conversionApi.mapper.toViewElement( element )\n\t\t);\n\n\t\t// Create fake document fragment so a range can be created on fake element.\n\t\tconst fakeDocumentFragment = new DocumentFragment();\n\t\tfakeDocumentFragment.appendChildren( fakeElement );\n\n\t\tthis.convertRemove( Position.createBefore( element ), Range.createOn( fakeElement ) );\n\t\tthis.convertInsertion( Range.createOn( element ) );\n\t}\n\n\t/**\n\t * Starts selection conversion.\n\t *\n\t * Fires events for given {@link module:engine/model/selection~Selection selection} to start selection conversion.\n\t *\n\t * @fires selection\n\t * @fires selectionAttribute\n\t * @param {module:engine/model/selection~Selection} selection Selection to convert.\n\t */\n\tconvertSelection( selection ) {\n\t\tconst markers = Array.from( this._modelDocument.markers.getMarkersAtPosition( selection.getFirstPosition() ) );\n\t\tconst consumable = this._createSelectionConsumable( selection, markers );\n\n\t\tthis.fire( 'selection', { selection }, consumable, this.conversionApi );\n\n\t\tfor ( let marker of markers ) {\n\t\t\tconst data = {\n\t\t\t\tselection: selection,\n\t\t\t\tname: marker.name\n\t\t\t};\n\n\t\t\tif ( consumable.test( selection, 'selectionMarker:' + marker.name ) ) {\n\t\t\t\tthis.fire( 'selectionMarker:' + marker.name, data, consumable, this.conversionApi );\n\t\t\t}\n\t\t}\n\n\t\tfor ( let key of selection.getAttributeKeys() ) {\n\t\t\tconst data = {\n\t\t\t\tselection: selection,\n\t\t\t\tkey: key,\n\t\t\t\tvalue: selection.getAttribute( key )\n\t\t\t};\n\n\t\t\t// Do not fire event if the attribute has been consumed.\n\t\t\tif ( consumable.test( selection, 'selectionAttribute:' + data.key ) ) {\n\t\t\t\tthis.fire( 'selectionAttribute:' + data.key, data, consumable, this.conversionApi );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Starts marker-conversion.\n\t *\n\t * Fires {@link ~#event:addMarker addMarker event} or {@link ~#event:removeMarker removeMarker event} based on\n\t * given `type` with data based on passed parameters.\n\t *\n\t * @fires addMarker\n\t * @fires removeMarker\n\t * @param {'addMarker'|'removeMarker'} type Change type.\n\t * @param {String} name Marker name.\n\t * @param {module:engine/model/range~Range} range Marker range.\n\t */\n\tconvertMarker( type, name, range ) {\n\t\t// Do not convert if range is in graveyard or not in the document (e.g. in DocumentFragment).\n\t\tif ( !range.root.document || range.root.rootName == '$graveyard' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst consumable = this._createMarkerConsumable( type, range );\n\t\tconst data = { name, range };\n\n\t\tthis.fire( type + ':' + name, data, consumable, this.conversionApi );\n\t}\n\n\t/**\n\t * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume from given range, assuming that\n\t * given range has just been inserted to the model.\n\t *\n\t * @private\n\t * @param {module:engine/model/range~Range} range Inserted range.\n\t * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.\n\t */\n\t_createInsertConsumable( range ) {\n\t\tconst consumable = new Consumable();\n\n\t\tfor ( let value of range ) {\n\t\t\tconst item = value.item;\n\n\t\t\tconsumable.add( item, 'insert' );\n\n\t\t\tfor ( let key of item.getAttributeKeys() ) {\n\t\t\t\tconsumable.add( item, 'addAttribute:' + key );\n\t\t\t}\n\t\t}\n\n\t\treturn consumable;\n\t}\n\n\t/**\n\t * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values of given `type`\n\t * for each item from given `range`.\n\t *\n\t * @private\n\t * @param {module:engine/model/range~Range} range Affected range.\n\t * @param {String} type Consumable type.\n\t * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.\n\t */\n\t_createConsumableForRange( range, type ) {\n\t\tconst consumable = new Consumable();\n\n\t\tfor ( let item of range.getItems() ) {\n\t\t\tconsumable.add( item, type );\n\t\t}\n\n\t\treturn consumable;\n\t}\n\n\t/**\n\t * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with selection consumable values.\n\t *\n\t * @private\n\t * @param {module:engine/model/selection~Selection} selection Selection to create consumable from.\n\t * @param {Iterable.} markers Markers which contains selection.\n\t * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.\n\t */\n\t_createSelectionConsumable( selection, markers ) {\n\t\tconst consumable = new Consumable();\n\n\t\tconsumable.add( selection, 'selection' );\n\n\t\tfor ( let marker of markers ) {\n\t\t\tconsumable.add( selection, 'selectionMarker:' + marker.name );\n\t\t}\n\n\t\tfor ( let key of selection.getAttributeKeys() ) {\n\t\t\tconsumable.add( selection, 'selectionAttribute:' + key );\n\t\t}\n\n\t\treturn consumable;\n\t}\n\n\t/**\n\t * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} for adding or removing marker on given `range`.\n\t *\n\t * @private\n\t * @param {'addMarker'|'removeMarker'} type Change type.\n\t * @param {module:engine/model/range~Range} range Range on which marker was added or removed.\n\t * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.\n\t */\n\t_createMarkerConsumable( type, range ) {\n\t\tconst consumable = new Consumable();\n\n\t\tconsumable.add( range, type );\n\n\t\treturn consumable;\n\t}\n\n\t/**\n\t * Tests passed `consumable` to check whether given event can be fired and if so, fires it.\n\t *\n\t * @private\n\t * @fires insert\n\t * @fires remove\n\t * @fires addAttribute\n\t * @fires removeAttribute\n\t * @fires changeAttribute\n\t * @param {String} type Event type.\n\t * @param {Object} data Event data.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t */\n\t_testAndFire( type, data, consumable ) {\n\t\tif ( !consumable.test( data.item, type ) ) {\n\t\t\t// Do not fire event if the item was consumed.\n\t\t\treturn;\n\t\t}\n\n\t\tconst name = data.item.name || '$text';\n\n\t\tthis.fire( type + ':' + name, data, consumable, this.conversionApi );\n\t}\n\n\t/**\n\t * Fired for inserted nodes.\n\t *\n\t * `insert` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `insert:`. `name` is either `'$text'` when one or more characters has been inserted or\n\t * {@link module:engine/model/element~Element#name name} of inserted element.\n\t *\n\t * This way listeners can either listen to a general `insert` event or specific event (for example `insert:paragraph`).\n\t *\n\t * @event insert\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/item~Item} data.item Inserted item.\n\t * @param {module:engine/model/range~Range} data.range Range spanning over inserted item.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired for removed nodes.\n\t *\n\t * `remove` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `remove:`. `name` is either `'$text'` when one or more characters has been removed or the\n\t * {@link module:engine/model/element~Element#name name} of removed element.\n\t *\n\t * This way listeners can either listen to a general `remove` event or specific event (for example `remove:paragraph`).\n\t *\n\t * @event remove\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/position~Position} data.sourcePosition Position from where the range has been removed.\n\t * @param {module:engine/model/range~Range} data.range Removed range (in {@link module:engine/model/document~Document#graveyard\n\t * graveyard root}).\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired when attribute has been added on a node.\n\t *\n\t * `addAttribute` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `addAttribute::`. `attributeKey` is the key of added attribute. `name` is either `'$text'`\n\t * if attribute was added on one or more characters, or the {@link module:engine/model/element~Element#name name} of\n\t * the element on which attribute was added.\n\t *\n\t * This way listeners can either listen to a general `addAttribute:bold` event or specific event\n\t * (for example `addAttribute:link:image`).\n\t *\n\t * @event addAttribute\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/item~Item} data.item Changed item.\n\t * @param {module:engine/model/range~Range} data.range Range spanning over changed item.\n\t * @param {String} data.attributeKey Attribute key.\n\t * @param {null} data.attributeOldValue Attribute value before the change - always `null`. Kept for the sake of unifying events.\n\t * @param {*} data.attributeNewValue New attribute value.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired when attribute has been removed from a node.\n\t *\n\t * `removeAttribute` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `removeAttribute::`. `attributeKey` is the key of removed attribute. `name` is either `'$text'`\n\t * if attribute was removed from one or more characters, or the {@link module:engine/model/element~Element#name name} of\n\t * the element from which attribute was removed.\n\t *\n\t * This way listeners can either listen to a general `removeAttribute:bold` event or specific event\n\t * (for example `removeAttribute:link:image`).\n\t *\n\t * @event removeAttribute\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/item~Item} data.item Changed item.\n\t * @param {module:engine/model/range~Range} data.range Range spanning over changed item.\n\t * @param {String} data.attributeKey Attribute key.\n\t * @param {*} data.attributeOldValue Attribute value before it was removed.\n\t * @param {null} data.attributeNewValue New attribute value - always `null`. Kept for the sake of unifying events.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired when attribute of a node has been changed.\n\t *\n\t * `changeAttribute` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `changeAttribute::`. `attributeKey` is the key of changed attribute. `name` is either `'$text'`\n\t * if attribute was changed on one or more characters, or the {@link module:engine/model/element~Element#name name} of\n\t * the element on which attribute was changed.\n\t *\n\t * This way listeners can either listen to a general `changeAttribute:link` event or specific event\n\t * (for example `changeAttribute:link:image`).\n\t *\n\t * @event changeAttribute\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/item~Item} data.item Changed item.\n\t * @param {module:engine/model/range~Range} data.range Range spanning over changed item.\n\t * @param {String} data.attributeKey Attribute key.\n\t * @param {*} data.attributeOldValue Attribute value before the change.\n\t * @param {*} data.attributeNewValue New attribute value.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired for {@link module:engine/model/selection~Selection selection} changes.\n\t *\n\t * @event selection\n\t * @param {module:engine/model/selection~Selection} selection `Selection` instance that is converted.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired for {@link module:engine/model/selection~Selection selection} attributes changes.\n\t *\n\t * `selectionAttribute` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `selectionAttribute:`. `attributeKey` is the key of selection attribute. This way listen can listen to\n\t * certain attribute, i.e. `addAttribute:bold`.\n\t *\n\t * @event selectionAttribute\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/selection~Selection} data.selection Selection that is converted.\n\t * @param {String} data.attributeKey Key of changed attribute.\n\t * @param {*} data.attributeValue Value of changed attribute.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired when a new marker is added to the model.\n\t *\n\t * `addMarker` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `addMarker:`. By specifying certain marker names, you can make the events even more gradual. For example,\n\t * markers can be named `foo:abc`, `foo:bar`, then it is possible to listen to `addMarker:foo` or `addMarker:foo:abc` and\n\t * `addMarker:foo:bar` events.\n\t *\n\t * @event addMarker\n\t * @param {Object} data Additional information about the change.\n\t * @param {String} data.name Marker name.\n\t * @param {module:engine/model/range~Range} data.range Marker range.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired when marker is removed from the model.\n\t *\n\t * `removeMarker` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `removeMarker:`. By specifying certain marker names, you can make the events even more gradual. For example,\n\t * markers can be named `foo:abc`, `foo:bar`, then it is possible to listen to `removeMarker:foo` or `removeMarker:foo:abc` and\n\t * `removeMarker:foo:bar` events.\n\t *\n\t * @event removeMarker\n\t * @param {Object} data Additional information about the change.\n\t * @param {String} data.name Marker name.\n\t * @param {module:engine/model/range~Range} data.range Marker range.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {Object} conversionApi Conversion interface to be used by callback, passed in `ModelConversionDispatcher` constructor.\n\t */\n}\n\nmix( ModelConversionDispatcher, EmitterMixin );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/conversion/modelconversiondispatcher.js\n// module id = 158\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/dataprocessor/htmldataprocessor\n */\n\n/* globals document, DOMParser */\n\nimport BasicHtmlWriter from './basichtmlwriter';\nimport DomConverter from '../view/domconverter';\nimport { NBSP_FILLER } from '../view/filler';\n\n/**\n * HtmlDataProcessor class.\n * This data processor implementation uses HTML as input/output data.\n *\n * @implements module:engine/dataprocessor/dataprocessor~DataProcessor\n */\nexport default class HtmlDataProcessor {\n\t/**\n\t * Creates a new instance of the HtmlDataProcessor class.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * DOMParser instance used to parse HTML string to HTMLDocument.\n\t\t *\n\t\t * @private\n\t\t * @member {DOMParser}\n\t\t */\n\t\tthis._domParser = new DOMParser();\n\n\t\t/**\n\t\t * DOM converter used to convert DOM elements to view elements.\n\t\t *\n\t\t * @private\n\t\t * @member\n\t\t */\n\t\tthis._domConverter = new DomConverter( { blockFiller: NBSP_FILLER } );\n\n\t\t/**\n\t\t * BasicHtmlWriter instance used to convert DOM elements to HTML string.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/dataprocessor/basichtmlwriter~BasicHtmlWriter}\n\t\t */\n\t\tthis._htmlWriter = new BasicHtmlWriter();\n\t}\n\n\t/**\n\t * Converts provided {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment}\n\t * to data format - in this case HTML string.\n\t *\n\t * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment\n\t * @returns {String} HTML string.\n\t */\n\ttoData( viewFragment ) {\n\t\t// Convert view DocumentFragment to DOM DocumentFragment.\n\t\tconst domFragment = this._domConverter.viewToDom( viewFragment, document );\n\n\t\t// Convert DOM DocumentFragment to HTML output.\n\t\treturn this._htmlWriter.getHtml( domFragment );\n\t}\n\n\t/**\n\t * Converts provided HTML string to view tree.\n\t *\n\t * @param {String} data HTML string.\n\t * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} Converted view element.\n\t */\n\ttoView( data ) {\n\t\t// Convert input HTML data to DOM DocumentFragment.\n\t\tconst domFragment = this._toDom( data );\n\n\t\t// Convert DOM DocumentFragment to view DocumentFragment.\n\t\treturn this._domConverter.domToView( domFragment );\n\t}\n\n\t/**\n\t * Converts HTML String to its DOM representation. Returns DocumentFragment, containing nodes parsed from\n\t * provided data.\n\t *\n\t * @private\n\t * @param {String} data\n\t * @returns {DocumentFragment}\n\t */\n\t_toDom( data ) {\n\t\tconst document = this._domParser.parseFromString( data, 'text/html' );\n\t\tconst fragment = document.createDocumentFragment();\n\t\tconst nodes = document.body.childNodes;\n\n\t\twhile ( nodes.length > 0 ) {\n\t\t\tfragment.appendChild( nodes[ 0 ] );\n\t\t}\n\n\t\treturn fragment;\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js\n// module id = 159\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/attributedelta\n */\n\nimport Delta from './delta';\nimport DeltaFactory from './deltafactory';\nimport { register } from '../batch';\nimport AttributeOperation from '../operation/attributeoperation';\nimport RootAttributeOperation from '../operation/rootattributeoperation';\nimport Position from '../position';\nimport Range from '../range';\n\n/**\n * To provide specific OT behavior and better collisions solving, methods to change attributes\n * ({@link module:engine/model/batch~Batch#setAttribute} and {@link module:engine/model/batch~Batch#removeAttribute})\n * use `AttributeDelta` class which inherits from the `Delta` class and may overwrite some methods.\n * @extends module:engine/model/delta/delta~Delta\n */\nexport default class AttributeDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'attribute';\n\t}\n\n\t/**\n\t * The attribute key that is changed by the delta or `null` if the delta has no operations.\n\t *\n\t * @readonly\n\t * @type {String|null}\n\t */\n\tget key() {\n\t\treturn this.operations[ 0 ] ? this.operations[ 0 ].key : null;\n\t}\n\n\t/**\n\t * The attribute value that is set by the delta or `null` if the delta has no operations.\n\t *\n\t * @readonly\n\t * @type {*|null}\n\t */\n\tget value() {\n\t\treturn this.operations[ 0 ] ? this.operations[ 0 ].newValue : null;\n\t}\n\n\t/**\n\t * The range on which delta operates or `null` if the delta has no operations.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/range~Range|null}\n\t */\n\tget range() {\n\t\t// Check if it is cached.\n\t\tif ( this._range ) {\n\t\t\treturn this._range;\n\t\t}\n\n\t\tlet start = null;\n\t\tlet end = null;\n\n\t\tfor ( let operation of this.operations ) {\n\t\t\tif ( start === null || start.isAfter( operation.range.start ) ) {\n\t\t\t\tstart = operation.range.start;\n\t\t\t}\n\n\t\t\tif ( end === null || end.isBefore( operation.range.end ) ) {\n\t\t\t\tend = operation.range.end;\n\t\t\t}\n\t\t}\n\n\t\tif ( start && end ) {\n\t\t\tthis._range = new Range( start, end );\n\n\t\t\treturn this._range;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget _reverseDeltaClass() {\n\t\treturn AttributeDelta;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.AttributeDelta';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get _priority() {\n\t\treturn 20;\n\t}\n}\n\n/**\n * To provide specific OT behavior and better collisions solving, methods to change attributes\n * ({@link module:engine/model/batch~Batch#setAttribute} and {@link module:engine/model/batch~Batch#removeAttribute})\n * use `RootAttributeDelta` class which inherits from the `Delta` class and may\n * overwrite some methods.\n *\n * @extends module:engine/model/delta/delta~Delta\n */\nexport class RootAttributeDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.RootAttributeDelta';\n\t}\n}\n\n/**\n * Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}\n * or on a {@link module:engine/model/range~Range range}.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#setAttribute\n * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange\n * Model item or range on which the attribute will be set.\n * @param {String} key Attribute key.\n * @param {*} value Attribute new value.\n */\nregister( 'setAttribute', function( itemOrRange, key, value ) {\n\tattribute( this, key, value, itemOrRange );\n\n\treturn this;\n} );\n\n/**\n * Removes an attribute with given key from a {@link module:engine/model/item~Item model item}\n * or from a {@link module:engine/model/range~Range range}.\n *\n * @chainable\n * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange\n * Model item or range from which the attribute will be removed.\n * @method module:engine/model/batch~Batch#removeAttribute\n * @param {String} key Attribute key.\n */\nregister( 'removeAttribute', function( itemOrRange, key ) {\n\tattribute( this, key, null, itemOrRange );\n\n\treturn this;\n} );\n\nfunction attribute( batch, key, value, itemOrRange ) {\n\tif ( itemOrRange instanceof Range ) {\n\t\tchangeRange( batch, batch.document, key, value, itemOrRange );\n\t} else {\n\t\tchangeItem( batch, batch.document, key, value, itemOrRange );\n\t}\n}\n\nfunction changeItem( batch, doc, key, value, item ) {\n\tconst previousValue = item.getAttribute( key );\n\tlet range, operation;\n\n\tconst delta = item.is( 'rootElement' ) ? new RootAttributeDelta() : new AttributeDelta();\n\n\tif ( previousValue != value ) {\n\t\tbatch.addDelta( delta );\n\n\t\tif ( item.is( 'rootElement' ) ) {\n\t\t\t// If we change attributes of root element, we have to use `RootAttributeOperation`.\n\t\t\toperation = new RootAttributeOperation( item, key, previousValue, value, doc.version );\n\t\t} else {\n\t\t\tif ( item.is( 'element' ) ) {\n\t\t\t\t// If we change the attribute of the element, we do not want to change attributes of its children, so\n\t\t\t\t// the end of the range cannot be after the closing tag, it should be inside that element, before any of\n\t\t\t\t// it's children, so the range will contain only the opening tag.\n\t\t\t\trange = new Range( Position.createBefore( item ), Position.createFromParentAndOffset( item, 0 ) );\n\t\t\t} else {\n\t\t\t\t// If `item` is text proxy, we create a range from the beginning to the end of that text proxy, to change\n\t\t\t\t// all characters represented by it.\n\t\t\t\trange = new Range( Position.createBefore( item ), Position.createAfter( item ) );\n\t\t\t}\n\n\t\t\toperation = new AttributeOperation( range, key, previousValue, value, doc.version );\n\t\t}\n\n\t\tdelta.addOperation( operation );\n\t\tdoc.applyOperation( operation );\n\t}\n}\n\n// Because attribute operation needs to have the same attribute value on the whole range, this function splits the range\n// into smaller parts.\nfunction changeRange( batch, doc, attributeKey, attributeValue, range ) {\n\tconst delta = new AttributeDelta();\n\n\t// Position of the last split, the beginning of the new range.\n\tlet lastSplitPosition = range.start;\n\n\t// Currently position in the scanning range. Because we need value after the position, it is not a current\n\t// position of the iterator but the previous one (we need to iterate one more time to get the value after).\n\tlet position;\n\t// Value before the currently position.\n\tlet attributeValueBefore;\n\t// Value after the currently position.\n\tlet attributeValueAfter;\n\n\tfor ( let value of range ) {\n\t\tattributeValueAfter = value.item.getAttribute( attributeKey );\n\n\t\t// At the first run of the iterator the position in undefined. We also do not have a attributeValueBefore, but\n\t\t// because attributeValueAfter may be null, attributeValueBefore may be equal attributeValueAfter ( undefined == null ).\n\t\tif ( position && attributeValueBefore != attributeValueAfter ) {\n\t\t\t// if attributeValueBefore == attributeValue there is nothing to change, so we add operation only if these values are different.\n\t\t\tif ( attributeValueBefore != attributeValue ) {\n\t\t\t\taddOperation();\n\t\t\t}\n\n\t\t\tlastSplitPosition = position;\n\t\t}\n\n\t\tposition = value.nextPosition;\n\t\tattributeValueBefore = attributeValueAfter;\n\t}\n\n\t// Because position in the loop is not the iterator position (see let position comment), the last position in\n\t// the while loop will be last but one position in the range. We need to check the last position manually.\n\tif ( position instanceof Position && position != lastSplitPosition && attributeValueBefore != attributeValue ) {\n\t\taddOperation();\n\t}\n\n\tfunction addOperation() {\n\t\t// Add delta to the batch only if there is at least operation in the delta. Add delta only once.\n\t\tif ( delta.operations.length === 0 ) {\n\t\t\tbatch.addDelta( delta );\n\t\t}\n\n\t\tlet range = new Range( lastSplitPosition, position );\n\t\tconst operation = new AttributeOperation( range, attributeKey, attributeValueBefore, attributeValue, doc.version );\n\n\t\tdelta.addOperation( operation );\n\t\tdoc.applyOperation( operation );\n\t}\n}\n\nDeltaFactory.register( AttributeDelta );\nDeltaFactory.register( RootAttributeDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/attributedelta.js\n// module id = 160\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/renamedelta\n */\n\nimport Delta from './delta';\nimport DeltaFactory from './deltafactory';\nimport { register } from '../batch';\nimport RenameOperation from '../operation/renameoperation';\nimport Element from '../element';\nimport Position from '../position';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * To provide specific OT behavior and better collisions solving, the {@link module:engine/model/batch~Batch#rename Batch#rename} method\n * uses the `RenameDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class RenameDelta extends Delta {\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'rename';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget _reverseDeltaClass() {\n\t\treturn RenameDelta;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.RenameDelta';\n\t}\n}\n\nfunction apply( batch, delta, operation ) {\n\tdelta.addOperation( operation );\n\tbatch.document.applyOperation( operation );\n}\n\n/**\n * Renames given element.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#rename\n * @param {module:engine/model/element~Element} element The element to rename.\n * @param {String} newName New element name.\n */\nregister( 'rename', function( element, newName ) {\n\tif ( !( element instanceof Element ) ) {\n\t\t/**\n\t\t * Trying to rename an object which is not an instance of Element.\n\t\t *\n\t\t * @error batch-rename-not-element-instance\n\t\t */\n\t\tthrow new CKEditorError( 'batch-rename-not-element-instance: Trying to rename an object which is not an instance of Element.' );\n\t}\n\n\tconst delta = new RenameDelta();\n\tthis.addDelta( delta );\n\n\tapply(\n\t\tthis, delta,\n\t\tnew RenameOperation( Position.createBefore( element ), element.name, newName, this.document.version )\n\t);\n\n\treturn this;\n} );\n\nDeltaFactory.register( RenameDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/renamedelta.js\n// module id = 161\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/delta/weakinsertdelta\n */\n\nimport InsertDelta from './insertdelta';\nimport { register } from '../batch';\nimport DeltaFactory from './deltafactory';\nimport InsertOperation from '../operation/insertoperation';\nimport { normalizeNodes } from './../writer';\n\n/**\n * @classdesc\n * To provide specific OT behavior and better collisions solving, the {@link module:engine/model/batch~Batch#insert} method\n * uses the `WeakInsertDelta` class which inherits from the `Delta` class and may overwrite some methods.\n */\nexport default class WeakInsertDelta extends InsertDelta {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'engine.model.delta.WeakInsertDelta';\n\t}\n}\n\n/**\n * Inserts a node or nodes at given position. {@link module:engine/model/batch~Batch#weakInsert weakInsert} is commonly used for actions\n * like typing or plain-text paste (without formatting). There are two differences between\n * {@link module:engine/model/batch~Batch#insert insert} and {@link module:engine/model/batch~Batch#weakInsert weakInsert}:\n *\n * * When using `weakInsert`, inserted nodes will have same attributes as the current attributes of\n * {@link module:engine/model/document~Document#selection document selection}.\n * * If {@link module:engine/model/operation/insertoperation~InsertOperation insert operation} position is inside a range changed by\n * {@link module:engine/model/operation/attributeoperation~AttributeOperation attribute operation},\n * the attribute operation is split into two operations.\n * Thanks to this, attribute change \"omits\" the inserted nodes. The correct behavior for `WeakInsertDelta` is that\n * {@link module:engine/model/operation/attributeoperation~AttributeOperation AttributeOperation} does not \"break\" and also\n * applies attributes for inserted nodes. This behavior has to be reflected during\n * {@link module:engine/model/delta/transform~transform delta transformation}.\n *\n * @chainable\n * @method module:engine/model/batch~Batch#weakInsert\n * @param {module:engine/model/position~Position} position Position of insertion.\n * @param {module:engine/model/node~NodeSet} nodes The list of nodes to be inserted.\n */\nregister( 'weakInsert', function( position, nodes ) {\n\tconst delta = new WeakInsertDelta();\n\tthis.addDelta( delta );\n\n\tnodes = normalizeNodes( nodes );\n\n\tfor ( let node of nodes ) {\n\t\tnode.setAttributesTo( this.document.selection.getAttributes() );\n\t}\n\n\tconst operation = new InsertOperation( position, nodes, this.document.version );\n\tdelta.addOperation( operation );\n\tthis.document.applyOperation( operation );\n\n\treturn this;\n} );\n\nDeltaFactory.register( WeakInsertDelta );\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/delta/weakinsertdelta.js\n// module id = 162\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/liveposition\n */\n\nimport Position from './position';\nimport Range from './range';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * `LivePosition` is a type of {@link module:engine/model/position~Position Position}\n * that updates itself as {@link module:engine/model/document~Document document}\n * is changed through operations. It may be used as a bookmark.\n *\n * **Note:** Contrary to {@link module:engine/model/position~Position}, `LivePosition` works only in roots that are\n * {@link module:engine/model/rootelement~RootElement}.\n * If {@link module:engine/model/documentfragment~DocumentFragment} is passed, error will be thrown.\n *\n * **Note:** Be very careful when dealing with `LivePosition`. Each `LivePosition` instance bind events that might\n * have to be unbound.\n * Use {@link module:engine/model/liveposition~LivePosition#detach} whenever you don't need `LivePosition` anymore.\n *\n * @extends module:engine/model/position~Position\n */\nexport default class LivePosition extends Position {\n\t/**\n\t * Creates a live position.\n\t *\n\t * @see module:engine/model/position~Position\n\t * @param {module:engine/model/rootelement~RootElement} root\n\t * @param {Array.} path\n\t * @param {module:engine/model/position~PositionStickiness} [stickiness] Defaults to `'sticksToNext'`.\n\t * See {@link module:engine/model/liveposition~LivePosition#stickiness}.\n\t */\n\tconstructor( root, path, stickiness ) {\n\t\tsuper( root, path );\n\n\t\tif ( !this.root.is( 'rootElement' ) ) {\n\t\t\t/**\n\t\t\t * LivePosition root has to be an instance of RootElement.\n\t\t\t *\n\t\t\t * @error liveposition-root-not-rootelement\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-liveposition-root-not-rootelement: LivePosition root has to be an instance of RootElement.' );\n\t\t}\n\n\t\t/**\n\t\t * Flag representing `LivePosition` stickiness. `LivePosition` might be sticking to previous node or next node.\n\t\t * Whenever some nodes are inserted at the same position as `LivePosition`, `stickiness` is checked to decide if\n\t\t * LivePosition should be moved. Similar applies when a range of nodes is moved and one of it's boundary\n\t\t * position is same as `LivePosition`.\n\t\t *\n\t\t * Examples:\n\t\t *\n\t\t *\t\tInsert:\n\t\t *\t\tPosition is at | and we insert at the same position, marked as ^:\n\t\t *\t\t- | sticks to previous node: `

    f|^oo

    ` => `

    f|baroo

    `\n\t\t *\t\t- | sticks to next node: `

    f^|oo

    ` => `

    fbar|oo

    `\n\t\t *\n\t\t *\t\tMove:\n\t\t *\t\tPosition is at | and range [ ] is moved to position ^:\n\t\t *\t\t- | sticks to previous node: `

    f|[oo]

    b^ar

    ` => `

    f|

    booar

    `\n\t\t *\t\t- | sticks to next node: `

    f|[oo]

    b^ar

    ` => `

    f

    b|ooar

    `\n\t\t *\n\t\t * @member {module:engine/model/position~PositionStickiness} module:engine/model/liveposition~LivePosition#stickiness\n\t\t */\n\t\tthis.stickiness = stickiness || 'sticksToNext';\n\n\t\tbindWithDocument.call( this );\n\t}\n\n\t/**\n\t * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance\n\t * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was\n\t * referring to it).\n\t */\n\tdetach() {\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * @static\n\t * @method module:engine/model/liveposition~LivePosition.createAfter\n\t * @see module:engine/model/position~Position.createAfter\n\t * @param {module:engine/model/node~Node} node\n\t * @returns {module:engine/model/liveposition~LivePosition}\n\t */\n\n\t/**\n\t * @static\n\t * @method module:engine/model/liveposition~LivePosition.createBefore\n\t * @see module:engine/model/position~Position.createBefore\n\t * @param {module:engine/model/node~Node} node\n\t * @returns {module:engine/model/liveposition~LivePosition}\n\t */\n\n\t/**\n\t * @static\n\t * @method module:engine/model/liveposition~LivePosition.createFromParentAndOffset\n\t * @see module:engine/model/position~Position.createFromParentAndOffset\n\t * @param {module:engine/model/element~Element} parent\n\t * @param {Number} offset\n\t * @returns {module:engine/model/liveposition~LivePosition}\n\t */\n\n\t/**\n\t * @static\n\t * @method module:engine/model/liveposition~LivePosition.createFromPosition\n\t * @see module:engine/model/position~Position.createFromPosition\n\t * @param {module:engine/model/position~Position} position\n\t * @returns {module:engine/model/liveposition~LivePosition}\n\t */\n\n\t/**\n\t * Fired when `LivePosition` instance is changed due to changes on {@link module:engine/model/document~Document}.\n\t *\n\t * @event module:engine/model/liveposition~LivePosition#change\n\t * @param {module:engine/model/position~Position} oldPosition Position equal to this live position before it got changed.\n\t */\n}\n\n/**\n * Binds this `LivePosition` to the {@link module:engine/model/document~Document document} that owns\n * this position's {@link module:engine/model/position~Position#root root}.\n *\n * @ignore\n * @private\n * @method module:engine/model/liveposition~LivePosition.bindWithDocument\n */\nfunction bindWithDocument() {\n\t/*jshint validthis: true */\n\t// Operation types handled by LivePosition (these are operations that change model tree structure).\n\tconst supportedTypes = new Set( [ 'insert', 'move', 'remove', 'reinsert' ] );\n\n\tthis.listenTo(\n\t\tthis.root.document,\n\t\t'change',\n\t\t( event, type, changes ) => {\n\t\t\tif ( supportedTypes.has( type ) ) {\n\t\t\t\ttransform.call( this, type, changes.range, changes.sourcePosition );\n\t\t\t}\n\t\t},\n\t\t{ priority: 'high' }\n\t);\n}\n\n/**\n * Updates this position accordingly to the updates applied to the model. Bases on change events.\n *\n * @ignore\n * @private\n * @method transform\n * @param {String} type Type of changes applied to the Tree Model.\n * @param {module:engine/model/range~Range} range Range containing the result of applied change.\n * @param {module:engine/model/position~Position} [position] Additional position parameter provided by some change events.\n */\nfunction transform( type, range, position ) {\n\t/*jshint validthis: true */\n\n\tlet howMany = range.end.offset - range.start.offset;\n\tlet transformed;\n\n\tswitch ( type ) {\n\t\tcase 'insert':\n\t\t\tlet insertBefore = this.stickiness == 'sticksToNext';\n\t\t\ttransformed = this._getTransformedByInsertion( range.start, howMany, insertBefore );\n\t\t\tbreak;\n\n\t\tcase 'move':\n\t\tcase 'remove':\n\t\tcase 'reinsert':\n\t\t\tlet originalRange = Range.createFromPositionAndShift( position, howMany );\n\n\t\t\tlet gotMoved = originalRange.containsPosition( this ) ||\n\t\t\t\t( originalRange.start.isEqual( this ) && this.stickiness == 'sticksToNext' ) ||\n\t\t\t\t( originalRange.end.isEqual( this ) && this.stickiness == 'sticksToPrevious' );\n\n\t\t\t// We can't use ._getTransformedByMove() because we have a different if-condition.\n\t\t\tif ( gotMoved ) {\n\t\t\t\ttransformed = this._getCombined( position, range.start );\n\t\t\t} else {\n\t\t\t\tlet insertBefore = this.stickiness == 'sticksToNext';\n\t\t\t\ttransformed = this._getTransformedByMove( position, range.start, howMany, insertBefore );\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tif ( !this.isEqual( transformed ) ) {\n\t\tconst oldPosition = Position.createFromPosition( this );\n\n\t\tthis.path = transformed.path;\n\t\tthis.root = transformed.root;\n\n\t\tthis.fire( 'change', oldPosition );\n\t}\n}\n\nmix( LivePosition, EmitterMixin );\n\n/**\n * Enum representing how position is \"sticking\" with their neighbour nodes.\n * Possible values: `'sticksToNext'`, `'sticksToPrevious'`.\n *\n * @typedef {String} module:engine/model/position~PositionStickiness\n */\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/model/liveposition.js\n// module id = 163\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/domconverter\n */\n\n/* globals Range, Node, NodeFilter */\n\nimport ViewText from './text';\nimport ViewElement from './element';\nimport ViewPosition from './position';\nimport ViewRange from './range';\nimport ViewSelection from './selection';\nimport ViewDocumentFragment from './documentfragment';\nimport ViewTreeWalker from './treewalker';\nimport { BR_FILLER, INLINE_FILLER_LENGTH, isBlockFiller, isInlineFiller, startsWithFiller, getDataWithoutFiller } from './filler';\n\nimport indexOf from '@ckeditor/ckeditor5-utils/src/dom/indexof';\nimport getAncestors from '@ckeditor/ckeditor5-utils/src/dom/getancestors';\nimport getCommonAncestor from '@ckeditor/ckeditor5-utils/src/dom/getcommonancestor';\n\n/**\n * DomConverter is a set of tools to do transformations between DOM nodes and view nodes. It also handles\n * {@link module:engine/view/domconverter~DomConverter#bindElements binding} these nodes.\n *\n * DomConverter does not check which nodes should be rendered (use {@link module:engine/view/renderer~Renderer}), does not keep a\n * state of a tree nor keeps synchronization between tree view and DOM tree (use {@link module:engine/view/document~Document}).\n *\n * DomConverter keeps DOM elements to View element bindings, so when the converter will be destroyed, the binding will\n * be lost. Two converters will keep separate binding maps, so one tree view can be bound with two DOM trees.\n */\nexport default class DomConverter {\n\t/**\n\t * Creates DOM converter.\n\t *\n\t * @param {Object} options Object with configuration options.\n\t * @param {Function} [options.blockFiller=module:engine/view/filler~BR_FILLER] Block filler creator.\n\t */\n\tconstructor( options = {} ) {\n\t\t// Using WeakMap prevent memory leaks: when the converter will be destroyed all referenced between View and DOM\n\t\t// will be removed. Also because it is a *Weak*Map when both view and DOM elements will be removed referenced\n\t\t// will be also removed, isn't it brilliant?\n\t\t//\n\t\t// Yes, PJ. It is.\n\t\t//\n\t\t// You guys so smart.\n\t\t//\n\t\t// I've been here. Seen stuff. Afraid of code now.\n\n\t\t/**\n\t\t * Block {@link module:engine/view/filler filler} creator, which is used to create all block fillers during the\n\t\t * view to DOM conversion and to recognize block fillers during the DOM to view conversion.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Function} module:engine/view/domconverter~DomConverter#blockFiller\n\t\t */\n\t\tthis.blockFiller = options.blockFiller || BR_FILLER;\n\n\t\t/**\n\t\t * Tag names of DOM `Element`s which are considered pre-formatted elements.\n\t\t *\n\t\t * @member {Array.} module:engine/view/domconverter~DomConverter#preElements\n\t\t */\n\t\tthis.preElements = [ 'pre' ];\n\n\t\t/**\n\t\t * Tag names of DOM `Element`s which are considered block elements.\n\t\t *\n\t\t * @member {Array.} module:engine/view/domconverter~DomConverter#blockElements\n\t\t */\n\t\tthis.blockElements = [ 'p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ];\n\n\t\t/**\n\t\t * DOM to View mapping.\n\t\t *\n\t\t * @private\n\t\t * @member {WeakMap} module:engine/view/domconverter~DomConverter#_domToViewMapping\n\t\t */\n\t\tthis._domToViewMapping = new WeakMap();\n\n\t\t/**\n\t\t * View to DOM mapping.\n\t\t *\n\t\t * @private\n\t\t * @member {WeakMap} module:engine/view/domconverter~DomConverter#_viewToDomMapping\n\t\t */\n\t\tthis._viewToDomMapping = new WeakMap();\n\n\t\t/**\n\t\t * Holds mapping between fake selection containers and corresponding view selections.\n\t\t *\n\t\t * @private\n\t\t * @member {WeakMap} module:engine/view/domconverter~DomConverter#_fakeSelectionMapping\n\t\t */\n\t\tthis._fakeSelectionMapping = new WeakMap();\n\t}\n\n\t/**\n\t * Binds given DOM element that represents fake selection to {@link module:engine/view/selection~Selection view selection}.\n\t * View selection copy is stored and can be retrieved by {@link module:engine/view/domconverter~DomConverter#fakeSelectionToView} method.\n\t *\n\t * @param {HTMLElement} domElement\n\t * @param {module:engine/view/selection~Selection} viewSelection\n\t */\n\tbindFakeSelection( domElement, viewSelection ) {\n\t\tthis._fakeSelectionMapping.set( domElement, ViewSelection.createFromSelection( viewSelection ) );\n\t}\n\n\t/**\n\t * Returns {@link module:engine/view/selection~Selection view selection} instance corresponding to given DOM element that represents fake\n\t * selection. Returns `undefined` if binding to given DOM element does not exists.\n\t *\n\t * @param {HTMLElement} domElement\n\t * @returns {module:engine/view/selection~Selection|undefined}\n\t */\n\tfakeSelectionToView( domElement ) {\n\t\treturn this._fakeSelectionMapping.get( domElement );\n\t}\n\n\t/**\n\t * Binds DOM and View elements, so it will be possible to get corresponding elements using\n\t * {@link module:engine/view/domconverter~DomConverter#getCorrespondingViewElement getCorrespondingViewElement} and\n\t * {@link module:engine/view/domconverter~DomConverter#getCorrespondingDomElement getCorrespondingDomElement}.\n\t *\n\t * @param {HTMLElement} domElement DOM element to bind.\n\t * @param {module:engine/view/element~Element} viewElement View element to bind.\n\t */\n\tbindElements( domElement, viewElement ) {\n\t\tthis._domToViewMapping.set( domElement, viewElement );\n\t\tthis._viewToDomMapping.set( viewElement, domElement );\n\t}\n\n\t/**\n\t * Unbinds given `domElement` from the view element it was bound to. Unbinding is deep, meaning that all children of\n\t * `domElement` will be unbound too.\n\t *\n\t * @param {HTMLElement} domElement DOM element to unbind.\n\t */\n\tunbindDomElement( domElement ) {\n\t\tconst viewElement = this._domToViewMapping.get( domElement );\n\n\t\tif ( viewElement ) {\n\t\t\tthis._domToViewMapping.delete( domElement );\n\t\t\tthis._viewToDomMapping.delete( viewElement );\n\n\t\t\tfor ( let child of domElement.childNodes ) {\n\t\t\t\tthis.unbindDomElement( child );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Binds DOM and View document fragments, so it will be possible to get corresponding document fragments using\n\t * {@link module:engine/view/domconverter~DomConverter#getCorrespondingViewDocumentFragment getCorrespondingViewDocumentFragment} and\n\t * {@link module:engine/view/domconverter~DomConverter#getCorrespondingDomDocumentFragment getCorrespondingDomDocumentFragment}.\n\t *\n\t * @param {DocumentFragment} domFragment DOM document fragment to bind.\n\t * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment View document fragment to bind.\n\t */\n\tbindDocumentFragments( domFragment, viewFragment ) {\n\t\tthis._domToViewMapping.set( domFragment, viewFragment );\n\t\tthis._viewToDomMapping.set( viewFragment, domFragment );\n\t}\n\n\t/**\n\t * Converts view to DOM. For all text nodes, not bound elements and document fragments new items will\n\t * be created. For bound elements and document fragments function will return corresponding items.\n\t *\n\t * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} viewNode View node or document fragment to\n\t * transform.\n\t * @param {Document} domDocument Document which will be used to create DOM nodes.\n\t * @param {Object} [options] Conversion options.\n\t * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.\n\t * @param {Boolean} [options.withChildren=true] If true node's and document fragment's children will be converted too.\n\t * @returns {Node|DocumentFragment} Converted node or DocumentFragment.\n\t */\n\tviewToDom( viewNode, domDocument, options = {} ) {\n\t\tif ( viewNode.is( 'text' ) ) {\n\t\t\tconst textData = this._processDataFromViewText( viewNode );\n\n\t\t\treturn domDocument.createTextNode( textData );\n\t\t} else {\n\t\t\tif ( this.getCorrespondingDom( viewNode ) ) {\n\t\t\t\treturn this.getCorrespondingDom( viewNode );\n\t\t\t}\n\n\t\t\tlet domElement;\n\n\t\t\tif ( viewNode.is( 'documentFragment' ) ) {\n\t\t\t\t// Create DOM document fragment.\n\t\t\t\tdomElement = domDocument.createDocumentFragment();\n\n\t\t\t\tif ( options.bind ) {\n\t\t\t\t\tthis.bindDocumentFragments( domElement, viewNode );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Create DOM element.\n\t\t\t\tdomElement = domDocument.createElement( viewNode.name );\n\n\t\t\t\tif ( options.bind ) {\n\t\t\t\t\tthis.bindElements( domElement, viewNode );\n\t\t\t\t}\n\n\t\t\t\t// Copy element's attributes.\n\t\t\t\tfor ( let key of viewNode.getAttributeKeys() ) {\n\t\t\t\t\tdomElement.setAttribute( key, viewNode.getAttribute( key ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( options.withChildren || options.withChildren === undefined ) {\n\t\t\t\tfor ( let child of this.viewChildrenToDom( viewNode, domDocument, options ) ) {\n\t\t\t\t\tdomElement.appendChild( child );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn domElement;\n\t\t}\n\t}\n\n\t/**\n\t * Converts children of the view element to DOM using {@link module:engine/view/domconverter~DomConverter#viewToDom} method.\n\t * Additionally this method adds block {@link module:engine/view/filler filler} to the list of children, if needed.\n\t *\n\t * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElement Parent view element.\n\t * @param {Document} domDocument Document which will be used to create DOM nodes.\n\t * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#viewToDom} options parameter.\n\t * @returns {Iterable.} DOM nodes.\n\t */\n\t*viewChildrenToDom( viewElement, domDocument, options = {} ) {\n\t\tlet fillerPositionOffset = viewElement.getFillerOffset && viewElement.getFillerOffset();\n\t\tlet offset = 0;\n\n\t\tfor ( let childView of viewElement.getChildren() ) {\n\t\t\tif ( fillerPositionOffset === offset ) {\n\t\t\t\tyield this.blockFiller( domDocument );\n\t\t\t}\n\n\t\t\tyield this.viewToDom( childView, domDocument, options );\n\n\t\t\toffset++;\n\t\t}\n\n\t\tif ( fillerPositionOffset === offset ) {\n\t\t\tyield this.blockFiller( domDocument );\n\t\t}\n\t}\n\n\t/**\n\t * Converts view {@link module:engine/view/range~Range} to DOM range.\n\t * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.\n\t *\n\t * @param {module:engine/view/range~Range} viewRange View range.\n\t * @returns {Range} DOM range.\n\t */\n\tviewRangeToDom( viewRange ) {\n\t\tconst domStart = this.viewPositionToDom( viewRange.start );\n\t\tconst domEnd = this.viewPositionToDom( viewRange.end );\n\n\t\tconst domRange = new Range();\n\t\tdomRange.setStart( domStart.parent, domStart.offset );\n\t\tdomRange.setEnd( domEnd.parent, domEnd.offset );\n\n\t\treturn domRange;\n\t}\n\n\t/**\n\t * Converts view {@link module:engine/view/position~Position} to DOM parent and offset.\n\t *\n\t * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.\n\t * If the converted position is directly before inline filler it is moved inside the filler.\n\t *\n\t * @param {module:engine/view/position~Position} viewPosition View position.\n\t * @returns {Object|null} position DOM position or `null` if view position could not be converted to DOM.\n\t * @returns {Node} position.parent DOM position parent.\n\t * @returns {Number} position.offset DOM position offset.\n\t */\n\tviewPositionToDom( viewPosition ) {\n\t\tconst viewParent = viewPosition.parent;\n\n\t\tif ( viewParent.is( 'text' ) ) {\n\t\t\tconst domParent = this.getCorrespondingDomText( viewParent );\n\n\t\t\tif ( !domParent ) {\n\t\t\t\t// Position is in a view text node that has not been rendered to DOM yet.\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet offset = viewPosition.offset;\n\n\t\t\tif ( startsWithFiller( domParent ) ) {\n\t\t\t\toffset += INLINE_FILLER_LENGTH;\n\t\t\t}\n\n\t\t\treturn { parent: domParent, offset: offset };\n\t\t} else {\n\t\t\t// viewParent is instance of ViewElement.\n\t\t\tlet domParent, domBefore, domAfter;\n\n\t\t\tif ( viewPosition.offset === 0 ) {\n\t\t\t\tdomParent = this.getCorrespondingDom( viewPosition.parent );\n\n\t\t\t\tif ( !domParent ) {\n\t\t\t\t\t// Position is in a view element that has not been rendered to DOM yet.\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tdomAfter = domParent.childNodes[ 0 ];\n\t\t\t} else {\n\t\t\t\tdomBefore = this.getCorrespondingDom( viewPosition.nodeBefore );\n\n\t\t\t\tif ( !domBefore ) {\n\t\t\t\t\t// Position is after a view element that has not been rendered to DOM yet.\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tdomParent = domBefore.parentNode;\n\t\t\t\tdomAfter = domBefore.nextSibling;\n\t\t\t}\n\n\t\t\t// If there is an inline filler at position return position inside the filler. We should never return\n\t\t\t// the position before the inline filler.\n\t\t\tif ( this.isText( domAfter ) && startsWithFiller( domAfter ) ) {\n\t\t\t\treturn { parent: domAfter, offset: INLINE_FILLER_LENGTH };\n\t\t\t}\n\n\t\t\tconst offset = domBefore ? indexOf( domBefore ) + 1 : 0;\n\n\t\t\treturn { parent: domParent, offset: offset };\n\t\t}\n\t}\n\n\t/**\n\t * Converts DOM to view. For all text nodes, not bound elements and document fragments new items will\n\t * be created. For bound elements and document fragments function will return corresponding items. For\n\t * {@link module:engine/view/filler fillers} `null` will be returned.\n\t *\n\t * @param {Node|DocumentFragment} domNode DOM node or document fragment to transform.\n\t * @param {Object} [options] Conversion options.\n\t * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.\n\t * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.\n\t * @param {Boolean} [options.keepOriginalCase=false] If `false`, node's tag name will be converter to lower case.\n\t * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} Converted node or document fragment or\n\t * `null`\n\t * if DOM node is a {@link module:engine/view/filler filler} or the given node is an empty text node.\n\t */\n\tdomToView( domNode, options = {} ) {\n\t\tif ( isBlockFiller( domNode, this.blockFiller ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( this.isText( domNode ) ) {\n\t\t\tif ( isInlineFiller( domNode ) ) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tconst textData = this._processDataFromDomText( domNode );\n\n\t\t\t\treturn textData === '' ? null : new ViewText( textData );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( this.getCorrespondingView( domNode ) ) {\n\t\t\t\treturn this.getCorrespondingView( domNode );\n\t\t\t}\n\n\t\t\tlet viewElement;\n\n\t\t\tif ( this.isDocumentFragment( domNode ) ) {\n\t\t\t\t// Create view document fragment.\n\t\t\t\tviewElement = new ViewDocumentFragment();\n\n\t\t\t\tif ( options.bind ) {\n\t\t\t\t\tthis.bindDocumentFragments( domNode, viewElement );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Create view element.\n\t\t\t\tconst viewName = options.keepOriginalCase ? domNode.tagName : domNode.tagName.toLowerCase();\n\t\t\t\tviewElement = new ViewElement( viewName );\n\n\t\t\t\tif ( options.bind ) {\n\t\t\t\t\tthis.bindElements( domNode, viewElement );\n\t\t\t\t}\n\n\t\t\t\t// Copy element's attributes.\n\t\t\t\tconst attrs = domNode.attributes;\n\n\t\t\t\tfor ( let i = attrs.length - 1; i >= 0; i-- ) {\n\t\t\t\t\tviewElement.setAttribute( attrs[ i ].name, attrs[ i ].value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( options.withChildren || options.withChildren === undefined ) {\n\t\t\t\tfor ( let child of this.domChildrenToView( domNode, options ) ) {\n\t\t\t\t\tviewElement.appendChildren( child );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn viewElement;\n\t\t}\n\t}\n\n\t/**\n\t * Converts children of the DOM element to view nodes using {@link module:engine/view/domconverter~DomConverter#domToView} method.\n\t * Additionally this method omits block {@link module:engine/view/filler filler}, if it exists in the DOM parent.\n\t *\n\t * @param {HTMLElement} domElement Parent DOM element.\n\t * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.\n\t * @returns {Iterable.} View nodes.\n\t */\n\t*domChildrenToView( domElement, options = {} ) {\n\t\tfor ( let i = 0; i < domElement.childNodes.length; i++ ) {\n\t\t\tconst domChild = domElement.childNodes[ i ];\n\t\t\tconst viewChild = this.domToView( domChild, options );\n\n\t\t\tif ( viewChild !== null ) {\n\t\t\t\tyield viewChild;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Converts DOM selection to view {@link module:engine/view/selection~Selection}.\n\t * Ranges which cannot be converted will be omitted.\n\t *\n\t * @param {Selection} domSelection DOM selection.\n\t * @returns {module:engine/view/selection~Selection} View selection.\n\t */\n\tdomSelectionToView( domSelection ) {\n\t\t// DOM selection might be placed in fake selection container.\n\t\t// If container contains fake selection - return corresponding view selection.\n\t\tif ( domSelection.rangeCount === 1 ) {\n\t\t\tlet container = domSelection.getRangeAt( 0 ).startContainer;\n\n\t\t\t// The DOM selection might be moved to the text node inside the fake selection container.\n\t\t\tif ( this.isText( container ) ) {\n\t\t\t\tcontainer = container.parentNode;\n\t\t\t}\n\n\t\t\tconst viewSelection = this.fakeSelectionToView( container );\n\n\t\t\tif ( viewSelection ) {\n\t\t\t\treturn viewSelection;\n\t\t\t}\n\t\t}\n\n\t\tconst viewSelection = new ViewSelection();\n\t\tconst isBackward = this.isDomSelectionBackward( domSelection );\n\n\t\tfor ( let i = 0; i < domSelection.rangeCount; i++ ) {\n\t\t\t// DOM Range have correct start and end, no matter what is the DOM Selection direction. So we don't have to fix anything.\n\t\t\tconst domRange = domSelection.getRangeAt( i );\n\t\t\tconst viewRange = this.domRangeToView( domRange );\n\n\t\t\tif ( viewRange ) {\n\t\t\t\tviewSelection.addRange( viewRange, isBackward );\n\t\t\t}\n\t\t}\n\n\t\treturn viewSelection;\n\t}\n\n\t/**\n\t * Converts DOM Range to view {@link module:engine/view/range~Range}.\n\t * If the start or end position can not be converted `null` is returned.\n\t *\n\t * @param {Range} domRange DOM range.\n\t * @returns {module:engine/view/range~Range|null} View range.\n\t */\n\tdomRangeToView( domRange ) {\n\t\tconst viewStart = this.domPositionToView( domRange.startContainer, domRange.startOffset );\n\t\tconst viewEnd = this.domPositionToView( domRange.endContainer, domRange.endOffset );\n\n\t\tif ( viewStart && viewEnd ) {\n\t\t\treturn new ViewRange( viewStart, viewEnd );\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Converts DOM parent and offset to view {@link module:engine/view/position~Position}.\n\t *\n\t * If the position is inside a {@link module:engine/view/filler filler} which has no corresponding view node,\n\t * position of the filler will be converted and returned.\n\t *\n\t * If structures are too different and it is not possible to find corresponding position then `null` will be returned.\n\t *\n\t * @param {Node} domParent DOM position parent.\n\t * @param {Number} domOffset DOM position offset.\n\t * @returns {module:engine/view/position~Position} viewPosition View position.\n\t */\n\tdomPositionToView( domParent, domOffset ) {\n\t\tif ( isBlockFiller( domParent, this.blockFiller ) ) {\n\t\t\treturn this.domPositionToView( domParent.parentNode, indexOf( domParent ) );\n\t\t}\n\n\t\tif ( this.isText( domParent ) ) {\n\t\t\tif ( isInlineFiller( domParent ) ) {\n\t\t\t\treturn this.domPositionToView( domParent.parentNode, indexOf( domParent ) );\n\t\t\t}\n\n\t\t\tconst viewParent = this.getCorrespondingViewText( domParent );\n\t\t\tlet offset = domOffset;\n\n\t\t\tif ( !viewParent ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( startsWithFiller( domParent ) ) {\n\t\t\t\toffset -= INLINE_FILLER_LENGTH;\n\t\t\t\toffset = offset < 0 ? 0 : offset;\n\t\t\t}\n\n\t\t\treturn new ViewPosition( viewParent, offset );\n\t\t}\n\t\t// domParent instanceof HTMLElement.\n\t\telse {\n\t\t\tif ( domOffset === 0 ) {\n\t\t\t\tconst viewParent = this.getCorrespondingView( domParent );\n\n\t\t\t\tif ( viewParent ) {\n\t\t\t\t\treturn new ViewPosition( viewParent, 0 );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst viewBefore = this.getCorrespondingView( domParent.childNodes[ domOffset - 1 ] );\n\n\t\t\t\t// TODO #663\n\t\t\t\tif ( viewBefore && viewBefore.parent ) {\n\t\t\t\t\treturn new ViewPosition( viewBefore.parent, viewBefore.index + 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Gets corresponding view item. This function use\n\t * {@link module:engine/view/domconverter~DomConverter#getCorrespondingViewElement getCorrespondingViewElement}\n\t * for elements, {@link module:engine/view/domconverter~DomConverter#getCorrespondingViewText getCorrespondingViewText} for text\n\t * nodes and {@link module:engine/view/domconverter~DomConverter#getCorrespondingViewDocumentFragment getCorrespondingViewDocumentFragment}\n\t * for document fragments.\n\t *\n\t * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.\n\t *\n\t * @param {Node|DocumentFragment} domNode DOM node or document fragment.\n\t * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} Corresponding view item.\n\t */\n\tgetCorrespondingView( domNode ) {\n\t\tif ( this.isElement( domNode ) ) {\n\t\t\treturn this.getCorrespondingViewElement( domNode );\n\t\t} else if ( this.isDocumentFragment( domNode ) ) {\n\t\t\treturn this.getCorrespondingViewDocumentFragment( domNode );\n\t\t} else if ( this.isText( domNode ) ) {\n\t\t\treturn this.getCorrespondingViewText( domNode );\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Gets corresponding view element. Returns element if an view element was\n\t * {@link module:engine/view/domconverter~DomConverter#bindElements bound} to the given DOM element or `null` otherwise.\n\t *\n\t * @param {HTMLElement} domElement DOM element.\n\t * @returns {module:engine/view/element~Element|null} Corresponding element or `null` if no element was bound.\n\t */\n\tgetCorrespondingViewElement( domElement ) {\n\t\treturn this._domToViewMapping.get( domElement );\n\t}\n\n\t/**\n\t * Gets corresponding view document fragment. Returns document fragment if an view element was\n\t * {@link module:engine/view/domconverter~DomConverter#bindDocumentFragments bound} to the given DOM fragment or `null` otherwise.\n\t *\n\t * @param {DocumentFragment} domFragment DOM element.\n\t * @returns {module:engine/view/documentfragment~DocumentFragment|null} Corresponding document fragment or `null` if none element was\n\t * bound.\n\t */\n\tgetCorrespondingViewDocumentFragment( domFragment ) {\n\t\treturn this._domToViewMapping.get( domFragment );\n\t}\n\n\t/**\n\t * Gets corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},\n\t * corresponding text node is returned based on the sibling or parent.\n\t *\n\t * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used\n\t * to find the corresponding text node.\n\t *\n\t * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}\n\t * element, it is used to find the corresponding text node.\n\t *\n\t * Otherwise `null` is returned.\n\t *\n\t * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.\n\t *\n\t * @param {Text} domText DOM text node.\n\t * @returns {module:engine/view/text~Text|null} Corresponding view text node or `null`, if it was not possible to find a\n\t * corresponding node.\n\t */\n\tgetCorrespondingViewText( domText ) {\n\t\tif ( isInlineFiller( domText ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst previousSibling = domText.previousSibling;\n\n\t\t// Try to use previous sibling to find the corresponding text node.\n\t\tif ( previousSibling ) {\n\t\t\tif ( !( this.isElement( previousSibling ) ) ) {\n\t\t\t\t// The previous is text or comment.\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst viewElement = this.getCorrespondingViewElement( previousSibling );\n\n\t\t\tif ( viewElement ) {\n\t\t\t\tconst nextSibling = viewElement.nextSibling;\n\n\t\t\t\t// It might be filler which has no corresponding view node.\n\t\t\t\tif ( nextSibling instanceof ViewText ) {\n\t\t\t\t\treturn viewElement.nextSibling;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Try to use parent to find the corresponding text node.\n\t\telse {\n\t\t\tconst viewElement = this.getCorrespondingViewElement( domText.parentNode );\n\n\t\t\tif ( viewElement ) {\n\t\t\t\tconst firstChild = viewElement.getChild( 0 );\n\n\t\t\t\t// It might be filler which has no corresponding view node.\n\t\t\t\tif ( firstChild instanceof ViewText ) {\n\t\t\t\t\treturn firstChild;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Gets corresponding DOM item. This function uses\n\t * {@link module:engine/view/domconverter~DomConverter#getCorrespondingDomElement getCorrespondingDomElement} for\n\t * elements, {@link module:engine/view/domconverter~DomConverter#getCorrespondingDomText getCorrespondingDomText} for text nodes\n\t * and {@link module:engine/view/domconverter~DomConverter#getCorrespondingDomDocumentFragment getCorrespondingDomDocumentFragment}\n\t * for document fragments.\n\t *\n\t * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} viewNode View node or document fragment.\n\t * @returns {Node|DocumentFragment|null} Corresponding DOM node or document fragment.\n\t */\n\tgetCorrespondingDom( viewNode ) {\n\t\tif ( viewNode instanceof ViewElement ) {\n\t\t\treturn this.getCorrespondingDomElement( viewNode );\n\t\t} else if ( viewNode instanceof ViewDocumentFragment ) {\n\t\t\treturn this.getCorrespondingDomDocumentFragment( viewNode );\n\t\t} else if ( viewNode instanceof ViewText ) {\n\t\t\treturn this.getCorrespondingDomText( viewNode );\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Gets corresponding DOM element. Returns element if an DOM element was\n\t * {@link module:engine/view/domconverter~DomConverter#bindElements bound} to the given view element or `null` otherwise.\n\t *\n\t * @param {module:engine/view/element~Element} viewElement View element.\n\t * @returns {HTMLElement|null} Corresponding element or `null` if none element was bound.\n\t */\n\tgetCorrespondingDomElement( viewElement ) {\n\t\treturn this._viewToDomMapping.get( viewElement );\n\t}\n\n\t/**\n\t * Gets corresponding DOM document fragment. Returns document fragment if an DOM element was\n\t * {@link module:engine/view/domconverter~DomConverter#bindDocumentFragments bound} to the given view document fragment or `null`\n\t * otherwise.\n\t *\n\t * @param {module:engine/view/documentfragment~DocumentFragment} viewDocumentFragment View document fragment.\n\t * @returns {DocumentFragment|null} Corresponding document fragment or `null` if no fragment was bound.\n\t */\n\tgetCorrespondingDomDocumentFragment( viewDocumentFragment ) {\n\t\treturn this._viewToDomMapping.get( viewDocumentFragment );\n\t}\n\n\t/**\n\t * Gets corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},\n\t * corresponding text node is returned based on the sibling or parent.\n\t *\n\t * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used\n\t * to find the corresponding text node.\n\t *\n\t * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}\n\t * element, it is used to find the corresponding text node.\n\t *\n\t * Otherwise `null` is returned.\n\t *\n\t * @param {module:engine/view/text~Text} viewText View text node.\n\t * @returns {Text|null} Corresponding DOM text node or `null`, if it was not possible to find a corresponding node.\n\t */\n\tgetCorrespondingDomText( viewText ) {\n\t\tconst previousSibling = viewText.previousSibling;\n\n\t\t// Try to use previous sibling to find the corresponding text node.\n\t\tif ( previousSibling && this.getCorrespondingDom( previousSibling ) ) {\n\t\t\treturn this.getCorrespondingDom( previousSibling ).nextSibling;\n\t\t}\n\n\t\t// If this is a first node, try to use parent to find the corresponding text node.\n\t\tif ( !previousSibling && viewText.parent && this.getCorrespondingDom( viewText.parent ) ) {\n\t\t\treturn this.getCorrespondingDom( viewText.parent ).childNodes[ 0 ];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Focuses DOM editable that is corresponding to provided {@link module:engine/view/editableelement~EditableElement EditableElement}.\n\t *\n\t * @param {module:engine/view/editableelement~EditableElement} viewEditable\n\t */\n\tfocus( viewEditable ) {\n\t\tconst domEditable = this.getCorrespondingDomElement( viewEditable );\n\n\t\tif ( domEditable && domEditable.ownerDocument.activeElement !== domEditable ) {\n\t\t\tdomEditable.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Returns `true` when `node.nodeType` equals `Node.TEXT_NODE`.\n\t *\n\t * @param {Node} node Node to check.\n\t * @returns {Boolean}\n\t */\n\tisText( node ) {\n\t\treturn node && node.nodeType == Node.TEXT_NODE;\n\t}\n\n\t/**\n\t * Returns `true` when `node.nodeType` equals `Node.ELEMENT_NODE`.\n\t *\n\t * @param {Node} node Node to check.\n\t * @returns {Boolean}\n\t */\n\tisElement( node ) {\n\t\treturn node && node.nodeType == Node.ELEMENT_NODE;\n\t}\n\n\t/**\n\t * Returns `true` when `node.nodeType` equals `Node.DOCUMENT_FRAGMENT_NODE`.\n\t *\n\t * @param {Node} node Node to check.\n\t * @returns {Boolean}\n\t */\n\tisDocumentFragment( node ) {\n\t\treturn node && node.nodeType == Node.DOCUMENT_FRAGMENT_NODE;\n\t}\n\n\t/**\n\t * Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.\n\t *\n\t * @param {Selection} DOM Selection instance to check.\n\t * @returns {Boolean}\n\t */\n\tisDomSelectionBackward( selection ) {\n\t\tif ( selection.isCollapsed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Since it takes multiple lines of code to check whether a \"DOM Position\" is before/after another \"DOM Position\",\n\t\t// we will use the fact that range will collapse if it's end is before it's start.\n\t\tconst range = new Range();\n\n\t\trange.setStart( selection.anchorNode, selection.anchorOffset );\n\t\trange.setEnd( selection.focusNode, selection.focusOffset );\n\n\t\tconst backward = range.collapsed;\n\n\t\trange.detach();\n\n\t\treturn backward;\n\t}\n\n\t/**\n\t * Takes text data from given {@link module:engine/view/text~Text#data} and processes it so it is correctly displayed in DOM.\n\t *\n\t * Following changes are done:\n\t * * multiple spaces are replaced to a chain of spaces and ` `,\n\t * * space at the beginning of the text node is changed to ` ` if it is a first text node in it's container\n\t * element or if previous text node ends by space character,\n\t * * space at the end of the text node is changed to ` ` if it is a last text node in it's container.\n\t *\n\t * @private\n\t * @param {module:engine/view/text~Text} node View text node to process.\n\t * @returns {String} Processed text data.\n\t */\n\t_processDataFromViewText( node ) {\n\t\tlet data = node.data;\n\n\t\t// If any of node ancestors has a name which is in `preElements` array, then currently processed\n\t\t// view text node is (will be) in preformatted element. We should not change whitespaces then.\n\t\tif ( node.getAncestors().some( ( parent ) => this.preElements.includes( parent.name ) ) ) {\n\t\t\treturn data;\n\t\t}\n\n\t\tconst prevNode = this._getTouchingViewTextNode( node, false );\n\t\tconst nextNode = this._getTouchingViewTextNode( node, true );\n\n\t\t// Second part of text data, from the space after the last non-space character to the end.\n\t\t// We separate `textEnd` and `textStart` because `textEnd` needs some special handling.\n\t\tlet textEnd = data.match( / *$/ )[ 0 ];\n\t\t// First part of data, between first and last part of data.\n\t\tlet textStart = data.substr( 0, data.length - textEnd.length );\n\n\t\t// If previous text node does not exist or it ends by space character, replace space character at the beginning of text.\n\t\t// ` x`\t\t\t-> `_x`\n\t\t// ` x`\t\t-> `_ x`\n\t\t// ` x`\t\t-> `_ x`\n\t\tif ( !prevNode || prevNode.data.charAt( prevNode.data.length - 1 ) == ' ' ) {\n\t\t\ttextStart = textStart.replace( /^ /, '\\u00A0' );\n\t\t}\n\n\t\t// Multiple consecutive spaces. Change them to `  ` pairs.\n\t\t// `_x x`\t\t-> `_x _x`\n\t\t// `_ x x`\t\t-> `_ x _x`\n\t\t// `_ x x`\t-> `_ _x _x`\n\t\t// `_ x x`\t-> `_ _x _ x`\n\t\t// `_ x x`\t-> `_ _x _ _x`\n\t\t// `_ x x` -> `_ _ x _ _x`\n\t\ttextStart = textStart.replace( / /g, ' \\u00A0' );\n\n\t\t// Process `textEnd` only if there is anything to process.\n\t\tif ( textEnd.length > 0 ) {\n\t\t\t// (1) We need special treatment for the last part of text node, it has to end on ` `, not space:\n\t\t\t// `x `\t\t-> `x_`\n\t\t\t// `x `\t-> `x _`\n\t\t\t// `x `\t-> `x_ _`\n\t\t\t// `x `\t-> `x _ _`\n\t\t\t// (2) Different case when there is a node after:\n\t\t\t// `x b`\t\t-> `x b`\n\t\t\t// `x b`\t-> `x _b`\n\t\t\t// `x b`\t-> `x _ b`\n\t\t\t// `x b`\t-> `x _ _b`\n\t\t\t// (3) But different, when that node starts by   (or space that will be converted to  ):\n\t\t\t// `x _b`\t-> `x _b`\n\t\t\t// `x _b`\t-> `x_ _b`\n\t\t\t// `x _b`\t-> `x _ _b`\n\t\t\t// `x _b`\t-> `x_ _ _b`\n\t\t\t// Let's assume that starting from space is normal behavior, because starting from   is a less frequent case.\n\t\t\tlet textEndStartsFromNbsp = false;\n\n\t\t\tif ( !nextNode ) {\n\t\t\t\t// (1)\n\t\t\t\tif ( textEnd.length % 2 ) {\n\t\t\t\t\ttextEndStartsFromNbsp = true;\n\t\t\t\t}\n\t\t\t} else if ( nextNode.data.charAt( 0 ) == ' ' || nextNode.data.charAt( 0 ) == '\\u00A0' ) {\n\t\t\t\t// (3)\n\t\t\t\tif ( textEnd.length % 2 === 0 ) {\n\t\t\t\t\ttextEndStartsFromNbsp = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( textEndStartsFromNbsp ) {\n\t\t\t\ttextEnd = '\\u00A0' + textEnd.substr( 0, textEnd.length - 1 );\n\t\t\t}\n\n\t\t\ttextEnd = textEnd.replace( / /g, ' \\u00A0' );\n\t\t}\n\n\t\treturn textStart + textEnd;\n\t}\n\n\t/**\n\t * Helper function. For given {@link module:engine/view/text~Text view text node}, it finds previous or next sibling that is contained\n\t * in the same block element. If there is no such sibling, `null` is returned.\n\t *\n\t * @private\n\t * @param {module:engine/view/text~Text} node\n\t * @param {Boolean} getNext\n\t * @returns {module:engine/view/text~Text}\n\t */\n\t_getTouchingViewTextNode( node, getNext ) {\n\t\tif ( !node.parent ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst treeWalker = new ViewTreeWalker( {\n\t\t\tstartPosition: getNext ? ViewPosition.createAfter( node ) : ViewPosition.createBefore( node ),\n\t\t\tdirection: getNext ? 'forward' : 'backward'\n\t\t} );\n\n\t\tfor ( let value of treeWalker ) {\n\t\t\tif ( value.item.is( 'containerElement' ) ) {\n\t\t\t\t// ViewContainerElement is found on a way to next ViewText node, so given `node` was first/last\n\t\t\t\t// text node in it's container element.\n\t\t\t\treturn null;\n\t\t\t} else if ( value.item.is( 'text' ) ) {\n\t\t\t\t// Found a text node in the same container element.\n\t\t\t\treturn value.item;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Takes text data from native `Text` node and processes it to a correct {@link module:engine/view/text~Text view text node} data.\n\t *\n\t * Following changes are done:\n\t * * multiple whitespaces are replaced to a single space,\n\t * * space at the beginning of the text node is removed, if it is a first text node in it's container\n\t * element or if previous text node ends by space character,\n\t * * space at the end of the text node is removed, if it is a last text node in it's container.\n\t *\n\t * @param {Node} node DOM text node to process.\n\t * @returns {String} Processed data.\n\t * @private\n\t */\n\t_processDataFromDomText( node ) {\n\t\tlet data = getDataWithoutFiller( node );\n\n\t\tif ( _hasDomParentOfType( node, this.preElements ) ) {\n\t\t\treturn data;\n\t\t}\n\n\t\t// Change all consecutive whitespace characters to a single space character. That's how multiple whitespaces\n\t\t// are treated when rendered, so we normalize those whitespaces.\n\t\t// Note that   (`\\u00A0`) should not be treated as a whitespace because it is rendered.\n\t\tdata = data.replace( /[^\\S\\u00A0]{2,}/g, ' ' );\n\n\t\tconst prevNode = this._getTouchingDomTextNode( node, false );\n\t\tconst nextNode = this._getTouchingDomTextNode( node, true );\n\n\t\t// If previous dom text node does not exist or it ends by whitespace character, remove space character from the beginning\n\t\t// of this text node. Such space character is treated as a whitespace.\n\t\tif ( !prevNode || /[^\\S\\u00A0]/.test( prevNode.data.charAt( prevNode.data.length - 1 ) ) ) {\n\t\t\tdata = data.replace( /^ /, '' );\n\t\t}\n\n\t\t// If next text node does not exist remove space character from the end of this text node.\n\t\tif ( !nextNode ) {\n\t\t\tdata = data.replace( / $/, '' );\n\t\t}\n\t\t// At this point we should have removed all whitespaces from DOM text data.\n\n\t\t// Now we have to change   chars, that were in DOM text data because of rendering reasons, to spaces.\n\t\t// First, change all ` \\u00A0` pairs (space +  ) to two spaces. DOM converter changes two spaces from model/view as\n\t\t// ` \\u00A0` to ensure proper rendering. Since here we convert back, we recognize those pairs and change them\n\t\t// to ` ` which is what we expect to have in model/view.\n\t\tdata = data.replace( / \\u00A0/g, ' ' );\n\t\t// Then, change   character that is at the beginning of the text node to space character.\n\t\t// As above, that   was created for rendering reasons but it's real meaning is just a space character.\n\t\t// We do that replacement only if this is the first node or the previous node ends on whitespace character.\n\t\tif ( !prevNode || /[^\\S\\u00A0]/.test( prevNode.data.charAt( prevNode.data.length - 1 ) ) ) {\n\t\t\tdata = data.replace( /^\\u00A0/, ' ' );\n\t\t}\n\t\t// Since input text data could be: `x_ _`, we would not replace the first   after `x` character.\n\t\t// We have to fix it. Since we already change all `  `, we will have something like this at the end of text data:\n\t\t// `x_ _ _` -> `x_ `. Find   at the end of string (can be followed only by spaces).\n\t\t// We do that replacement only if this is the last node or the next node starts by  .\n\t\tif ( !nextNode || nextNode.data.charAt( 0 ) == '\\u00A0' ) {\n\t\t\tdata = data.replace( /\\u00A0( *)$/, ' $1' );\n\t\t}\n\n\t\t// At this point, all whitespaces should be removed and all   created for rendering reasons should be\n\t\t// changed to normal space. All left   are   inserted intentionally.\n\t\treturn data;\n\t}\n\n\t/**\n\t * Helper function. For given `Text` node, it finds previous or next sibling that is contained in the same block element.\n\t * If there is no such sibling, `null` is returned.\n\t *\n\t * @private\n\t * @param {Text} node\n\t * @param {Boolean} getNext\n\t * @returns {Text|null}\n\t */\n\t_getTouchingDomTextNode( node, getNext ) {\n\t\tif ( !node.parentNode ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst direction = getNext ? 'nextNode' : 'previousNode';\n\t\tconst document = node.ownerDocument;\n\t\tconst treeWalker = document.createTreeWalker( document.childNodes[ 0 ], NodeFilter.SHOW_TEXT );\n\n\t\ttreeWalker.currentNode = node;\n\n\t\tconst touchingNode = treeWalker[ direction ]();\n\n\t\tif ( touchingNode !== null ) {\n\t\t\tconst lca = getCommonAncestor( node, touchingNode );\n\n\t\t\t// If there is common ancestor between the text node and next/prev text node,\n\t\t\t// and there are no block elements on a way from the text node to that ancestor,\n\t\t\t// and there are no block elements on a way from next/prev text node to that ancestor...\n\t\t\tif ( lca && !_hasDomParentOfType( node, this.blockElements, lca ) && !_hasDomParentOfType( touchingNode, this.blockElements, lca ) ) {\n\t\t\t\t// Then they are in the same container element.\n\t\t\t\treturn touchingNode;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\n// Helper function.\n// Used to check if given native `Element` or `Text` node has parent with tag name from `types` array.\n//\n// @param {Node} node\n// @param {Array.} types\n// @param {Boolean} [boundaryParent] Can be given if parents should be checked up to a given element (excluding that element).\n// @returns {Boolean} `true` if such parent exists or `false` if it does not.\nfunction _hasDomParentOfType( node, types, boundaryParent ) {\n\tlet parents = getAncestors( node );\n\n\tif ( boundaryParent ) {\n\t\tparents = parents.slice( parents.indexOf( boundaryParent ) + 1 );\n\t}\n\n\treturn parents.some( ( parent ) => parent.tagName && types.includes( parent.tagName.toLowerCase() ) );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/domconverter.js\n// module id = 164\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/emptyelement\n */\n\nimport Element from './element';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport Node from './node';\n\n/**\n * EmptyElement class. It is used to represent elements that cannot contain any child nodes.\n */\nexport default class EmptyElement extends Element {\n\t/**\n\t * Creates new instance of EmptyElement.\n\t *\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` when third parameter is passed,\n\t * to inform that usage of EmptyElement is incorrect (adding child nodes to EmptyElement is forbidden).\n\t *\n\t * @param {String} name Node name.\n\t * @param {Object|Iterable} [attributes] Collection of attributes.\n\t */\n\tconstructor( name, attributes, children ) {\n\t\tsuper( name, attributes, children );\n\n\t\t/**\n\t\t * Returns `null` because filler is not needed for EmptyElements.\n\t\t *\n\t\t * @method #getFillerOffset\n\t\t * @returns {null} Always returns null.\n\t\t */\n\t\tthis.getFillerOffset = getFillerOffset;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tis( type, name = null ) {\n\t\tif ( !name ) {\n\t\t\treturn type == 'emptyElement' || super.is( type );\n\t\t} else {\n\t\t\treturn ( type == 'emptyElement' && name == this.name ) || super.is( type, name );\n\t\t}\n\t}\n\n\t/**\n\t * Overrides {@link module:engine/view/element~Element#insertChildren} method.\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` to prevent adding any child nodes\n\t * to EmptyElement.\n\t */\n\tinsertChildren( index, nodes ) {\n\t\tif ( nodes && ( nodes instanceof Node || Array.from( nodes ).length > 0 ) ) {\n\t\t\t/**\n\t\t\t * Cannot add children to {@link module:engine/view/emptyelement~EmptyElement}.\n\t\t\t *\n\t\t\t * @error view-emptyelement-cannot-add\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.' );\n\t\t}\n\t}\n}\n\n// Returns `null` because block filler is not needed for EmptyElements.\n//\n// @returns {null}\nfunction getFillerOffset() {\n\treturn null;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/emptyelement.js\n// module id = 165\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/matcher\n */\n\n/**\n * View matcher class.\n * Instance of this class can be used to find {@link module:engine/view/element~Element elements} that match given pattern.\n */\nexport default class Matcher {\n\t/**\n\t * Creates new instance of Matcher.\n\t *\n\t * @param {String|RegExp|Object} [pattern] Match patterns. See {@link module:engine/view/matcher~Matcher#add add method} for\n\t * more information.\n\t */\n\tconstructor( ...pattern ) {\n\t\tthis._patterns = [];\n\n\t\tthis.add( ...pattern );\n\t}\n\n\t/**\n\t * Adds pattern or patterns to matcher instance.\n\t *\n\t * Example patterns matching element's name:\n\t *\n\t *\t\t// String.\n\t *\t\tmatcher.add( 'div' );\n\t *\t\tmatcher.add( { name: 'div' } );\n\t *\n\t *\t\t// Regular expression.\n\t *\t\tmatcher.add( /^\\w/ );\n\t *\t\tmatcher.add( { name: /^\\w/ } );\n\t *\n\t * Example pattern matching element's attributes:\n\t *\n\t *\t\tmatcher.add( {\n\t *\t\t\tattributes: {\n\t *\t\t\t\ttitle: 'foobar',\n\t *\t\t\t\tfoo: /^\\w+/\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * Example patterns matching element's classes:\n\t *\n\t *\t\t// Single class.\n\t *\t\tmatcher.add( {\n\t *\t\t\tclass: 'foobar'\n\t *\t\t} );\n\t *\n\t *\t\t// Single class using regular expression.\n\t *\t\tmatcher.add( {\n\t *\t\t\tclass: /foo.../\n\t *\t\t} );\n\t *\n\t *\t\t// Multiple classes to match.\n\t *\t\tmatcher.add( {\n\t *\t\t\tclass: [ 'baz', 'bar', /foo.../ ]\n\t *\t\t} ):\n\t *\n\t * Example pattern matching element's styles:\n\t *\n\t *\t\tmatcher.add( {\n\t *\t\t\tstyle: {\n\t *\t\t\t\tposition: 'absolute',\n\t *\t\t\t\tcolor: /^\\w*blue$/\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * Example function pattern:\n\t *\n\t *\t\tmatcher.add( ( element ) => {\n\t *\t\t\t// Result of this function will be included in `match`\n\t *\t\t\t// property of the object returned from matcher.match() call.\n\t *\t\t\tif ( element.name === 'div' && element.childCount > 0 ) {\n\t *\t\t\t\treturn { name: true };\n\t *\t\t\t}\n\t *\n\t *\t\t\treturn null;\n\t *\t\t} );\n\t *\n\t * Multiple patterns can be added in one call:\n\t *\n\t * \t\tmatcher.add( 'div', { class: 'foobar' } );\n\t *\n\t * @param {Object|String|RegExp|Function} pattern Object describing pattern details. If string or regular expression\n\t * is provided it will be used to match element's name. Pattern can be also provided in a form\n\t * of a function - then this function will be called with each {@link module:engine/view/element~Element element} as a parameter.\n\t * Function's return value will be stored under `match` key of the object returned from\n\t * {@link module:engine/view/matcher~Matcher#match match} or {@link module:engine/view/matcher~Matcher#matchAll matchAll} methods.\n\t * @param {String|RegExp} [pattern.name] Name or regular expression to match element's name.\n\t * @param {Object} [pattern.attribute] Object with key-value pairs representing attributes to match. Each object key\n\t * represents attribute name. Value under that key can be either a string or a regular expression and it will be\n\t * used to match attribute value.\n\t * @param {String|RegExp|Array} [pattern.class] Class name or array of class names to match. Each name can be\n\t * provided in a form of string or regular expression.\n\t * @param {Object} [pattern.style] Object with key-value pairs representing styles to match. Each object key\n\t * represents style name. Value under that key can be either a string or a regular expression and it will be used\n\t * to match style value.\n\t */\n\tadd( ...pattern ) {\n\t\tfor ( let item of pattern ) {\n\t\t\t// String or RegExp pattern is used as element's name.\n\t\t\tif ( typeof item == 'string' || item instanceof RegExp ) {\n\t\t\t\titem = { name: item };\n\t\t\t}\n\n\t\t\t// Single class name/RegExp can be provided.\n\t\t\tif ( item.class && ( typeof item.class == 'string' || item.class instanceof RegExp ) ) {\n\t\t\t\titem.class = [ item.class ];\n\t\t\t}\n\n\t\t\tthis._patterns.push( item );\n\t\t}\n\t}\n\n\t/**\n\t * Matches elements for currently stored patterns. Returns match information about first found\n\t * {@link module:engine/view/element~Element element}, otherwise returns `null`.\n\t *\n\t * Example of returned object:\n\t *\n\t *\t\t{\n\t *\t\t\telement: ,\n\t *\t\t\tpattern: ,\n\t *\t\t\tmatch: {\n\t *\t\t\t\tname: true,\n \t *\t\t\t\tattributes: [ 'title', 'href' ],\n\t *\t\t\t\tclasses: [ 'foo' ],\n \t *\t\t\t\tstyles: [ 'color', 'position' ]\n\t *\t\t\t}\n\t *\t\t}\n\t *\n\t * @see module:engine/view/matcher~Matcher#add\n\t * @see module:engine/view/matcher~Matcher#matchAll\n\t * @param {...module:engine/view/element~Element} element View element to match against stored patterns.\n\t * @returns {Object|null} result\n\t * @returns {module:engine/view/element~Element} result.element Matched view element.\n\t * @returns {Object|String|RegExp|Function} result.pattern Pattern that was used to find matched element.\n\t * @returns {Object} result.match Object representing matched element parts.\n\t * @returns {Boolean} [result.match.name] True if name of the element was matched.\n\t * @returns {Array} [result.match.attribute] Array with matched attribute names.\n\t * @returns {Array} [result.match.class] Array with matched class names.\n\t * @returns {Array} [result.match.style] Array with matched style names.\n\t */\n\tmatch( ...element ) {\n\t\tfor ( let singleElement of element ) {\n\t\t\tfor ( let pattern of this._patterns ) {\n\t\t\t\tconst match = isElementMatching( singleElement, pattern );\n\n\t\t\t\tif ( match ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\telement: singleElement,\n\t\t\t\t\t\tpattern: pattern,\n\t\t\t\t\t\tmatch: match\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Matches elements for currently stored patterns. Returns array of match information with all found\n\t * {@link module:engine/view/element~Element elements}. If no element is found - returns `null`.\n\t *\n\t * @see module:engine/view/matcher~Matcher#add\n\t * @see module:engine/view/matcher~Matcher#match\n\t * @param {...module:engine/view/element~Element} element View element to match against stored patterns.\n\t * @returns {Array.|null} Array with match information about found elements or `null`. For more information\n\t * see {@link module:engine/view/matcher~Matcher#match match method} description.\n\t */\n\tmatchAll( ...element ) {\n\t\tconst results = [];\n\n\t\tfor ( let singleElement of element ) {\n\t\t\tfor ( let pattern of this._patterns ) {\n\t\t\t\tconst match = isElementMatching( singleElement, pattern );\n\n\t\t\t\tif ( match ) {\n\t\t\t\t\tresults.push( {\n\t\t\t\t\t\telement: singleElement,\n\t\t\t\t\t\tpattern: pattern,\n\t\t\t\t\t\tmatch: match\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn results.length > 0 ? results : null;\n\t}\n\n\t/**\n\t * Returns the name of the element to match if there is exactly one pattern added to the matcher instance\n\t * and it matches element name defined by `string` (not `RegExp`). Otherwise, returns `null`.\n\t *\n\t * @returns {String|null} Element name trying to match.\n\t */\n\tgetElementName() {\n\t\tif ( this._patterns.length !== 1 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst pattern = this._patterns[ 0 ];\n\t\tconst name = pattern.name;\n\n\t\treturn ( typeof pattern != 'function' && name && !( name instanceof RegExp ) ) ? name : null;\n\t}\n\n}\n\n// Returns match information if {@link module:engine/view/element~Element element} is matching provided pattern.\n// If element cannot be matched to provided pattern - returns `null`.\n//\n// @param {module:engine/view/element~Element} element\n// @param {Object|String|RegExp|Function} pattern\n// @returns {Object|null} Returns object with match information or null if element is not matching.\nfunction isElementMatching( element, pattern ) {\n\t// If pattern is provided as function - return result of that function;\n\tif ( typeof pattern == 'function' ) {\n\t\treturn pattern( element );\n\t}\n\n\tconst match = {};\n\t// Check element's name.\n\tif ( pattern.name ) {\n\t\tmatch.name = matchName( pattern.name, element.name );\n\n\t\tif ( !match.name ) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t// Check element's attributes.\n\tif ( pattern.attribute ) {\n\t\tmatch.attribute = matchAttributes( pattern.attribute, element );\n\n\t\tif ( !match.attribute ) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t// Check element's classes.\n\tif ( pattern.class ) {\n\t\tmatch.class = matchClasses( pattern.class, element );\n\n\t\tif ( !match.class ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check element's styles.\n\tif ( pattern.style ) {\n\t\tmatch.style = matchStyles( pattern.style, element );\n\n\t\tif ( !match.style ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn match;\n}\n\n// Checks if name can be matched by provided pattern.\n//\n// @param {String|RegExp} pattern\n// @param {String} name\n// @returns {Boolean} Returns `true` if name can be matched, `false` otherwise.\nfunction matchName( pattern, name ) {\n\t// If pattern is provided as RegExp - test against this regexp.\n\tif ( pattern instanceof RegExp ) {\n\t\treturn pattern.test( name );\n\t}\n\n\treturn pattern === name;\n}\n\n// Checks if attributes of provided element can be matched against provided patterns.\n//\n// @param {Object} patterns Object with information about attributes to match. Each key of the object will be\n// used as attribute name. Value of each key can be a string or regular expression to match against attribute value.\n// @param {module:engine/view/element~Element} element Element which attributes will be tested.\n// @returns {Array|null} Returns array with matched attribute names or `null` if no attributes were matched.\nfunction matchAttributes( patterns, element ) {\n\tconst match = [];\n\n\tfor ( let name in patterns ) {\n\t\tconst pattern = patterns[ name ];\n\n\t\tif ( element.hasAttribute( name ) ) {\n\t\t\tconst attribute = element.getAttribute( name );\n\n\t\t\tif ( pattern instanceof RegExp ) {\n\t\t\t\tif ( pattern.test( attribute ) ) {\n\t\t\t\t\tmatch.push( name );\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} else if ( attribute === pattern ) {\n\t\t\t\tmatch.push( name );\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\treturn match;\n}\n\n// Checks if classes of provided element can be matched against provided patterns.\n//\n// @param {Array.} patterns Array of strings or regular expressions to match against element's classes.\n// @param {module:engine/view/element~Element} element Element which classes will be tested.\n// @returns {Array|null} Returns array with matched class names or `null` if no classes were matched.\nfunction matchClasses( patterns, element ) {\n\tconst match = [];\n\n\tfor ( let pattern of patterns ) {\n\t\tif ( pattern instanceof RegExp ) {\n\t\t\tconst classes = element.getClassNames();\n\n\t\t\tfor ( let name of classes ) {\n\t\t\t\tif ( pattern.test( name ) ) {\n\t\t\t\t\tmatch.push( name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( match.length === 0 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else if ( element.hasClass( pattern ) ) {\n\t\t\tmatch.push( pattern );\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\treturn match;\n}\n\n// Checks if styles of provided element can be matched against provided patterns.\n//\n// @param {Object} patterns Object with information about styles to match. Each key of the object will be\n// used as style name. Value of each key can be a string or regular expression to match against style value.\n// @param {module:engine/view/element~Element} element Element which styles will be tested.\n// @returns {Array|null} Returns array with matched style names or `null` if no styles were matched.\nfunction matchStyles( patterns, element ) {\n\tconst match = [];\n\n\tfor ( let name in patterns ) {\n\t\tconst pattern = patterns[ name ];\n\n\t\tif ( element.hasStyle( name ) ) {\n\t\t\tconst style = element.getStyle( name );\n\n\t\t\tif ( pattern instanceof RegExp ) {\n\t\t\t\tif ( pattern.test( style ) ) {\n\t\t\t\t\tmatch.push( name );\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} else if ( style === pattern ) {\n\t\t\t\tmatch.push( name );\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\treturn match;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/matcher.js\n// module id = 166\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/observer/mutationobserver\n */\n\n/* globals window */\n\nimport Observer from './observer';\nimport ViewSelection from '../selection';\nimport { startsWithFiller, getDataWithoutFiller } from '../filler';\n\n/**\n * Mutation observer class observes changes in the DOM, fires {@link module:engine/view/document~Document#event:mutations} event, mark view\n * elements as changed and call {@link module:engine/view/renderer~Renderer#render}.\n * Because all mutated nodes are marked as \"to be rendered\" and the\n * {@link module:engine/view/renderer~Renderer#render} is called, all changes will be reverted, unless the mutation will be handled by the\n * {@link module:engine/view/document~Document#event:mutations} event listener. It means user will see only handled changes, and the editor\n * will block all changes which are not handled.\n *\n * Mutation Observer also take care of reducing number of mutations which are fired. It removes duplicates and\n * mutations on elements which do not have corresponding view elements. Also\n * {@link module:engine/view/observer/mutationobserver~MutatedText text mutation} is fired only if parent element do not change child list.\n *\n * Note that this observer is attached by the {@link module:engine/view/document~Document} and is available by default.\n *\n * @extends module:engine/view/observer/observer~Observer\n */\nexport default class MutationObserver extends Observer {\n\tconstructor( document ) {\n\t\tsuper( document );\n\n\t\t/**\n\t\t * Native mutation observer config.\n\t\t *\n\t\t * @private\n\t\t * @member {Object}\n\t\t */\n\t\tthis._config = {\n\t\t\tchildList: true,\n\t\t\tcharacterData: true,\n\t\t\tcharacterDataOldValue: true,\n\t\t\tsubtree: true\n\t\t};\n\n\t\t/**\n\t\t * Reference to the {@link module:engine/view/document~Document#domConverter}.\n\t\t *\n\t\t * @member {module:engine/view/domconverter~DomConverter}\n\t\t */\n\t\tthis.domConverter = document.domConverter;\n\n\t\t/**\n\t\t * Reference to the {@link module:engine/view/document~Document#renderer}.\n\t\t *\n\t\t * @member {module:engine/view/renderer~Renderer}\n\t\t */\n\t\tthis.renderer = document.renderer;\n\n\t\t/**\n\t\t * Observed DOM elements.\n\t\t *\n\t\t * @private\n\t\t * @member {Array.}\n\t\t */\n\t\tthis._domElements = [];\n\n\t\t/**\n\t\t * Native mutation observer.\n\t\t *\n\t\t * @private\n\t\t * @member {MutationObserver}\n\t\t */\n\t\tthis._mutationObserver = new window.MutationObserver( this._onMutations.bind( this ) );\n\t}\n\n\t/**\n\t * Synchronously fires {@link module:engine/view/document~Document#event:mutations} event with all mutations in record queue.\n\t * At the same time empties the queue so mutations will not be fired twice.\n\t */\n\tflush() {\n\t\tthis._onMutations( this._mutationObserver.takeRecords() );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tobserve( domElement ) {\n\t\tthis._domElements.push( domElement );\n\n\t\tif ( this.isEnabled ) {\n\t\t\tthis._mutationObserver.observe( domElement, this._config );\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tenable() {\n\t\tsuper.enable();\n\n\t\tfor ( let domElement of this._domElements ) {\n\t\t\tthis._mutationObserver.observe( domElement, this._config );\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tdisable() {\n\t\tsuper.disable();\n\n\t\tthis._mutationObserver.disconnect();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tdestroy() {\n\t\tsuper.destroy();\n\n\t\tthis._mutationObserver.disconnect();\n\t}\n\n\t/**\n\t * Handles mutations. Deduplicates, mark view elements to sync, fire event and call render.\n\t *\n\t * @private\n\t * @param {Array.} domMutations Array of native mutations.\n\t */\n\t_onMutations( domMutations ) {\n\t\t// As a result of this.flush() we can have an empty collection.\n\t\tif ( domMutations.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst domConverter = this.domConverter;\n\n\t\t// Use map and set for deduplication.\n\t\tconst mutatedTexts = new Map();\n\t\tconst mutatedElements = new Set();\n\n\t\t// Handle `childList` mutations first, so we will be able to check if the `characterData` mutation is in the\n\t\t// element with changed structure anyway.\n\t\tfor ( let mutation of domMutations ) {\n\t\t\tif ( mutation.type === 'childList' ) {\n\t\t\t\tconst element = domConverter.getCorrespondingViewElement( mutation.target );\n\n\t\t\t\tif ( element && !this._isBogusBrMutation( mutation ) ) {\n\t\t\t\t\tmutatedElements.add( element );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle `characterData` mutations later, when we have the full list of nodes which changed structure.\n\t\tfor ( let mutation of domMutations ) {\n\t\t\tif ( mutation.type === 'characterData' ) {\n\t\t\t\tconst text = domConverter.getCorrespondingViewText( mutation.target );\n\n\t\t\t\tif ( text && !mutatedElements.has( text.parent ) ) {\n\t\t\t\t\t// Use text as a key, for deduplication. If there will be another mutation on the same text element\n\t\t\t\t\t// we will have only one in the map.\n\t\t\t\t\tmutatedTexts.set( text, {\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\toldText: text.data,\n\t\t\t\t\t\tnewText: getDataWithoutFiller( mutation.target ),\n\t\t\t\t\t\tnode: text\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\t// When we added first letter to the text node which had only inline filler, for the DOM it is mutation\n\t\t\t\t// on text, but for the view, where filler text node did not existed, new text node was created, so we\n\t\t\t\t// need to fire 'children' mutation instead of 'text'.\n\t\t\t\telse if ( !text && startsWithFiller( mutation.target ) ) {\n\t\t\t\t\tmutatedElements.add( domConverter.getCorrespondingViewElement( mutation.target.parentNode ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Now we build the list of mutations to fire and mark elements. We did not do it earlier to avoid marking the\n\t\t// same node multiple times in case of duplication.\n\n\t\t// List of mutations we will fire.\n\t\tconst viewMutations = [];\n\n\t\tfor ( let mutatedText of mutatedTexts.values() ) {\n\t\t\tthis.renderer.markToSync( 'text', mutatedText.node );\n\t\t\tviewMutations.push( mutatedText );\n\t\t}\n\n\t\tfor ( let viewElement of mutatedElements ) {\n\t\t\tconst domElement = domConverter.getCorrespondingDomElement( viewElement );\n\t\t\tconst viewChildren = viewElement.getChildren();\n\t\t\tconst newViewChildren = domConverter.domChildrenToView( domElement );\n\n\t\t\tthis.renderer.markToSync( 'children', viewElement );\n\t\t\tviewMutations.push( {\n\t\t\t\ttype: 'children',\n\t\t\t\toldChildren: Array.from( viewChildren ),\n\t\t\t\tnewChildren: Array.from( newViewChildren ),\n\t\t\t\tnode: viewElement\n\t\t\t} );\n\t\t}\n\n\t\t// Retrieve `domSelection` using `ownerDocument` of one of mutated nodes.\n\t\t// There should not be simultaneous mutation in multiple documents, so it's fine.\n\t\tconst domSelection = domMutations[ 0 ].target.ownerDocument.getSelection();\n\n\t\tlet viewSelection = null;\n\n\t\tif ( domSelection && domSelection.anchorNode ) {\n\t\t\t// If `domSelection` is inside a dom node that is already bound to a view node from view tree, get\n\t\t\t// corresponding selection in the view and pass it together with `viewMutations`. The `viewSelection` may\n\t\t\t// be used by features handling mutations.\n\t\t\t// Only one range is supported.\n\n\t\t\tconst viewSelectionAnchor = domConverter.domPositionToView( domSelection.anchorNode, domSelection.anchorOffset );\n\t\t\tconst viewSelectionFocus = domConverter.domPositionToView( domSelection.focusNode, domSelection.focusOffset );\n\n\t\t\t// Anchor and focus has to be properly mapped to view.\n\t\t\tif ( viewSelectionAnchor && viewSelectionFocus ) {\n\t\t\t\tviewSelection = new ViewSelection();\n\t\t\t\tviewSelection.collapse( viewSelectionAnchor );\n\t\t\t\tviewSelection.setFocus( viewSelectionFocus );\n\t\t\t}\n\t\t}\n\n\t\tthis.document.fire( 'mutations', viewMutations, viewSelection );\n\n\t\t// If nothing changes on `mutations` event, at this point we have \"dirty DOM\" (changed) and de-synched\n\t\t// view (which has not been changed). In order to \"reset DOM\" we render the view again.\n\t\tthis.document.render();\n\t}\n\n\t/**\n\t * Checks if mutation was generated by the browser inserting bogus br on the end of the block element.\n\t * Such mutations are generated while pressing space or performing native spellchecker correction\n\t * on the end of the block element in Firefox browser.\n\t *\n\t * @private\n\t * @param {Object} mutation Native mutation object.\n\t * @returns {Boolean}\n\t */\n\t_isBogusBrMutation( mutation ) {\n\t\tlet addedNode = null;\n\n\t\t// Check if mutation added only one node on the end of its parent.\n\t\tif ( mutation.nextSibling === null && mutation.removedNodes.length === 0 && mutation.addedNodes.length == 1 ) {\n\t\t\taddedNode = this.domConverter.domToView( mutation.addedNodes[ 0 ], {\n\t\t\t\twithChildren: false\n\t\t\t} );\n\t\t}\n\n\t\treturn addedNode && addedNode.is( 'element', 'br' );\n\t}\n}\n\n/**\n * Fired when mutation occurred. If tree view is not changed on this event, DOM will be reverter to the state before\n * mutation, so all changes which should be applied, should be handled on this event.\n *\n * Introduced by {@link module:engine/view/observer/mutationobserver~MutationObserver}.\n *\n * Note that because {@link module:engine/view/observer/mutationobserver~MutationObserver} is attached by the\n * {@link module:engine/view/document~Document}\n * this event is available by default.\n *\n * @see module:engine/view/observer/mutationobserver~MutationObserver\n * @event module:engine/view/document~Document#event:mutations\n * @param {Array.}\n * viewMutations Array of mutations.\n * For mutated texts it will be {@link module:engine/view/observer/mutationobserver~MutatedText} and for mutated elements it will be\n * {@link module:engine/view/observer/mutationobserver~MutatedChildren}. You can recognize the type based on the `type` property.\n * @param {module:engine/view/selection~Selection|null} viewSelection View selection that is a result of converting DOM selection to view.\n * Keep in\n * mind that the DOM selection is already \"updated\", meaning that it already acknowledges changes done in mutation.\n */\n\n/**\n * Mutation item for text.\n *\n * @see module:engine/view/document~Document#event:mutations\n * @see module:engine/view/observer/mutationobserver~MutatedChildren\n *\n * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedText\n *\n * @property {String} type For text mutations it is always 'text'.\n * @property {module:engine/view/text~Text} node Mutated text node.\n * @property {String} oldText Old text.\n * @property {String} newText New text.\n */\n\n/**\n * Mutation item for child nodes.\n *\n * @see module:engine/view/document~Document#event:mutations\n * @see module:engine/view/observer/mutationobserver~MutatedText\n *\n * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedChildren\n *\n * @property {String} type For child nodes mutations it is always 'children'.\n * @property {module:engine/view/element~Element} node Parent of the mutated children.\n * @property {Array.} oldChildren Old child nodes.\n * @property {Array.} newChildren New child nodes.\n */\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js\n// module id = 167\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/rooteditableelement\n */\n\nimport EditableElement from './editableelement';\n\nconst rootNameSymbol = Symbol( 'rootName' );\n\n/**\n * Class representing a single root in the data view. A root can be either {@link #isReadOnly editable or read-only}, but\n * in both cases it is called \"an editable\". Roots can contain other {@link module:engine/view/editableelement~EditableElement editable\n * elements}\n * making them \"nested editables\".\n *\n * @extends module:engine/view/editableelement~EditableElement\n */\nexport default class RootEditableElement extends EditableElement {\n\t/**\n\t * Creates root editable element.\n\t *\n\t * @param {module:engine/view/document~Document} document {@link module:engine/view/document~Document} that is an owner of the root.\n\t * @param {String} name Node name.\n\t */\n\tconstructor( name ) {\n\t\tsuper( name );\n\n\t\t/**\n\t\t * Name of this root inside {@link module:engine/view/document~Document} that is an owner of this root. If no\n\t\t * other name is set, `main` name is used.\n\t\t *\n\t\t * @member {String}\n\t\t */\n\t\tthis.rootName = 'main';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tis( type, name = null ) {\n\t\tif ( !name ) {\n\t\t\treturn type == 'rootElement' || super.is( type );\n\t\t} else {\n\t\t\treturn ( type == 'rootElement' && name == this.name ) || super.is( type, name );\n\t\t}\n\t}\n\n\tget rootName() {\n\t\treturn this.getCustomProperty( rootNameSymbol );\n\t}\n\n\tset rootName( rootName ) {\n\t\tthis.setCustomProperty( rootNameSymbol, rootName );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js\n// module id = 168\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/uielement\n */\n\nimport Element from './element';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport Node from './node';\n\n/**\n * UIElement class. It is used to represent UI not a content of the document.\n * This element can't be split and selection can't be placed inside this element.\n */\nexport default class UIElement extends Element {\n\t/**\n\t * Creates new instance of UIElement.\n\t *\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` when third parameter is passed,\n\t * to inform that usage of UIElement is incorrect (adding child nodes to UIElement is forbidden).\n\t *\n\t * @param {String} name Node name.\n\t * @param {Object|Iterable} [attributes] Collection of attributes.\n\t */\n\tconstructor( name, attributes, children ) {\n\t\tsuper( name, attributes, children );\n\n\t\t/**\n\t\t * Returns `null` because filler is not needed for UIElements.\n\t\t *\n\t\t * @method #getFillerOffset\n\t\t * @returns {null} Always returns null.\n\t\t */\n\t\tthis.getFillerOffset = getFillerOffset;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tis( type, name = null ) {\n\t\tif ( !name ) {\n\t\t\treturn type == 'uiElement' || super.is( type );\n\t\t} else {\n\t\t\treturn ( type == 'uiElement' && name == this.name ) || super.is( type, name );\n\t\t}\n\t}\n\n\t/**\n\t * Overrides {@link module:engine/view/element~Element#insertChildren} method.\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` to prevent adding any child nodes\n\t * to UIElement.\n\t */\n\tinsertChildren( index, nodes ) {\n\t\tif ( nodes && ( nodes instanceof Node || Array.from( nodes ).length > 0 ) ) {\n\t\t\t/**\n\t\t\t * Cannot add children to {@link module:engine/view/uielement~UIElement}.\n\t\t\t *\n\t\t\t * @error view-uielement-cannot-add\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-uielement-cannot-add: Cannot add child nodes to UIElement instance.' );\n\t\t}\n\t}\n}\n\n// Returns `null` because block filler is not needed for UIElements.\n//\n// @returns {null}\nfunction getFillerOffset() {\n\treturn null;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-engine/src/view/uielement.js\n// module id = 169\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module heading/headingengine\n */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport buildModelConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildmodelconverter';\nimport buildViewConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildviewconverter';\nimport Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';\nimport HeadingCommand from './headingcommand';\n\nconst defaultModelElement = 'paragraph';\n\n/**\n * The headings engine feature. It handles switching between block formats – headings and paragraph.\n * This class represents the engine part of the heading feature. See also {@link module:heading/heading~Heading}.\n *\n * @extends modules:core/plugin~Plugin\n */\nexport default class HeadingEngine extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor ) {\n\t\tsuper( editor );\n\n\t\t// TODO: This needs proper documentation, i.e. why paragraph entry does not need\n\t\t// more properties (https://github.com/ckeditor/ckeditor5/issues/403).\n\t\t// TODO: Document CSS classes as well.\n\t\teditor.config.define( 'heading', {\n\t\t\toptions: [\n\t\t\t\t{ modelElement: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },\n\t\t\t\t{ modelElement: 'heading1', viewElement: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },\n\t\t\t\t{ modelElement: 'heading2', viewElement: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },\n\t\t\t\t{ modelElement: 'heading3', viewElement: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }\n\t\t\t]\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ Paragraph ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst data = editor.data;\n\t\tconst editing = editor.editing;\n\t\tconst options = editor.config.get( 'heading.options' );\n\n\t\tfor ( let option of options ) {\n\t\t\t// Skip paragraph - it is defined in required Paragraph feature.\n\t\t\tif ( option.modelElement !== defaultModelElement ) {\n\t\t\t\t// Schema.\n\t\t\t\teditor.document.schema.registerItem( option.modelElement, '$block' );\n\n\t\t\t\t// Build converter from model to view for data and editing pipelines.\n\t\t\t\tbuildModelConverter().for( data.modelToView, editing.modelToView )\n\t\t\t\t\t.fromElement( option.modelElement )\n\t\t\t\t\t.toElement( option.viewElement );\n\n\t\t\t\t// Build converter from view to model for data pipeline.\n\t\t\t\tbuildViewConverter().for( data.viewToModel )\n\t\t\t\t\t.fromElement( option.viewElement )\n\t\t\t\t\t.toElement( option.modelElement );\n\n\t\t\t\t// Register the heading command for this option.\n\t\t\t\teditor.commands.set( option.modelElement, new HeadingCommand( editor, option ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tafterInit() {\n\t\t// If the enter command is added to the editor, alter its behavior.\n\t\t// Enter at the end of a heading element should create a paragraph.\n\t\tconst editor = this.editor;\n\t\tconst enterCommand = editor.commands.get( 'enter' );\n\t\tconst options = editor.config.get( 'heading.options' );\n\n\t\tif ( enterCommand ) {\n\t\t\tthis.listenTo( enterCommand, 'afterExecute', ( evt, data ) => {\n\t\t\t\tconst positionParent = editor.document.selection.getFirstPosition().parent;\n\t\t\t\tconst batch = data.batch;\n\t\t\t\tconst isHeading = options.some( option => positionParent.is( option.modelElement ) );\n\n\t\t\t\tif ( isHeading && !positionParent.is( defaultModelElement ) && positionParent.childCount === 0 ) {\n\t\t\t\t\tbatch.rename( positionParent, defaultModelElement );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-heading/src/headingengine.js\n// module id = 170\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module image/image/imageengine\n */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport buildModelConverter from '@ckeditor/ckeditor5-engine/src/conversion/buildmodelconverter';\nimport { viewToModelImage, createImageAttributeConverter } from './converters';\nimport { toImageWidget } from './utils';\nimport ViewContainerElement from '@ckeditor/ckeditor5-engine/src/view/containerelement';\nimport ViewEmptyElement from '@ckeditor/ckeditor5-engine/src/view/emptyelement';\n\n/**\n * The image engine plugin.\n * Registers `image` as a block element in document's schema and allows it to have two attributes: `src` and `alt`.\n * Registers converters for editing and data pipelines.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class ImageEngine extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst doc = editor.document;\n\t\tconst schema = doc.schema;\n\t\tconst data = editor.data;\n\t\tconst editing = editor.editing;\n\t\tconst t = editor.t;\n\n\t\t// Configure schema.\n\t\tschema.registerItem( 'image' );\n\t\tschema.requireAttributes( 'image', [ 'src' ] );\n\t\tschema.allow( { name: 'image', attributes: [ 'alt', 'src' ], inside: '$root' } );\n\t\tschema.objects.add( 'image' );\n\n\t\t// Build converter from model to view for data pipeline.\n\t\tbuildModelConverter().for( data.modelToView )\n\t\t\t.fromElement( 'image' )\n\t\t\t.toElement( () => createImageViewElement() );\n\n\t\t// Build converter from model to view for editing pipeline.\n\t\tbuildModelConverter().for( editing.modelToView )\n\t\t\t.fromElement( 'image' )\n\t\t\t.toElement( () => toImageWidget( createImageViewElement(), t( 'image widget' ) ) );\n\n\t\tcreateImageAttributeConverter( [ editing.modelToView, data.modelToView ], 'src' );\n\t\tcreateImageAttributeConverter( [ editing.modelToView, data.modelToView ], 'alt' );\n\n\t\t// Converter for figure element from view to model.\n\t\tdata.viewToModel.on( 'element:figure', viewToModelImage() );\n\t}\n}\n\n// Creates view element representing the image.\n//\n//\t\t
    \n//\n// Note that `alt` and `src` attributes are converted separately, so they're not included.\n//\n// @private\n// @return {module:engine/view/containerelement~ContainerElement}\nexport function createImageViewElement() {\n\treturn new ViewContainerElement( 'figure', { class: 'image' }, new ViewEmptyElement( 'img' ) );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-image/src/image/imageengine.js\n// module id = 171\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module image/image/ui/imageballoonpanel\n */\n\nimport throttle from '@ckeditor/ckeditor5-utils/src/lib/lodash/throttle';\nimport global from '@ckeditor/ckeditor5-utils/src/dom/global';\nimport BalloonPanelView from '@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview';\nimport { isImageWidget } from '../utils';\n\nconst arrowVOffset = BalloonPanelView.arrowVerticalOffset;\nconst positions = {\n\t//\t [text range]\n\t//\t ^\n\t//\t+-----------------+\n\t//\t| Balloon |\n\t//\t+-----------------+\n\tsouth( targetRect, balloonRect ) {\n\t\treturn {\n\t\t\ttop: targetRect.bottom + arrowVOffset,\n\t\t\tleft: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n\t\t\tname: 's'\n\t\t};\n\t},\n\n\t//\t+-----------------+\n\t//\t| Balloon |\n\t//\t+-----------------+\n\t//\t V\n\t//\t [text range]\n\tnorth( targetRect, balloonRect ) {\n\t\treturn {\n\t\t\ttop: targetRect.top - balloonRect.height - arrowVOffset,\n\t\t\tleft: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n\t\t\tname: 'n'\n\t\t};\n\t}\n};\n\n/**\n * Image balloon panel class. It extends {module:ui/panel/balloon/balloonpanelview~BalloonPanelView} by adding helpers\n * to use with image widgets. It sets proper positioning on `scroll` and `resize` events and hides the panel when\n * image is no longer selected or focus is lost.\n *\n * @extends module:ui/panel/balloon/balloonpanelview~BalloonPanelView\n */\nexport default class ImageBalloonPanelView extends BalloonPanelView {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor ) {\n\t\tsuper( editor.locale );\n\n\t\tthis.editor = editor;\n\t\tconst editingView = editor.editing.view;\n\n\t\t// Hide the balloon if editor had focus and now focus is lost.\n\t\tthis.listenTo( editor.ui.focusTracker, 'change:isFocused', ( evt, name, is, was ) => {\n\t\t\tif ( was && !is ) {\n\t\t\t\tthis.detach();\n\t\t\t}\n\t\t} );\n\n\t\t// Hide the balloon if no image is currently selected.\n\t\teditor.listenTo( editingView, 'render', () => {\n\t\t\tconst selectedElement = editingView.selection.getSelectedElement();\n\n\t\t\tif ( !selectedElement || !isImageWidget( selectedElement ) ) {\n\t\t\t\tthis.detach();\n\t\t\t}\n\t\t}, { priority: 'low' } );\n\n\t\t/**\n\t\t * Wraps {@link #_attach} method with throttle function that will fire it not more than every 100ms.\n\t\t * It is used as `scroll` and `resize` callback.\n\t\t *\n\t\t * @private\n\t\t * @member {Function} #_throttledAttach\n\t\t */\n\t\tthis._throttledAttach = throttle( () => {\n\t\t\tthis._attach();\n\t\t}, 100 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\t// Let the focusTracker know about new focusable UI element.\n\t\tthis.editor.ui.focusTracker.add( this.element );\n\n\t\treturn super.init();\n\t}\n\n\t/**\n\t * Attaches the panel and enables `scroll` and `resize` listeners.\n\t */\n\tattach() {\n\t\tthis._attach();\n\t\tthis.editor.ui.view.listenTo( global.window, 'scroll', this._throttledAttach );\n\t\tthis.editor.ui.view.listenTo( global.window, 'resize', this._throttledAttach );\n\t}\n\n\t/**\n\t * Detaches the panel and disables `scroll` and `resize` listeners.\n\t */\n\tdetach() {\n\t\tthis.hide();\n\t\tthis.editor.ui.view.stopListening( global.window, 'scroll', this._throttledAttach );\n\t\tthis.editor.ui.view.stopListening( global.window, 'resize', this._throttledAttach );\n\t}\n\n\t/**\n\t * Attaches the panel to the first selection range.\n\t *\n\t * @private\n\t */\n\t_attach() {\n\t\tconst editingView = this.editor.editing.view;\n\n\t\tthis.attachTo( {\n\t\t\ttarget: editingView.domConverter.viewRangeToDom( editingView.selection.getFirstRange() ),\n\t\t\tpositions: [ positions.north, positions.south ]\n\t\t} );\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-image/src/image/ui/imageballoonpanelview.js\n// module id = 172\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module image/imagetoolbar\n */\n\nimport Template from '@ckeditor/ckeditor5-ui/src/template';\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview';\nimport { isImageWidget } from './image/utils';\nimport ImageBalloonPanel from './image/ui/imageballoonpanelview';\n\n/**\n * Image toolbar class. Creates image toolbar placed inside balloon panel that is showed when image widget is selected.\n * Toolbar components are created using editor's {@link module:ui/componentfactory~ComponentFactory ComponentFactory}\n * based on {@link module:core/editor/editor~Editor#config configuration} stored under `image.toolbar`.\n * Other plugins can add new components to the default toolbar configuration by pushing them to `image.defaultToolbar`\n * configuration. Default configuration is used when `image.toolbar` config is not present.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class ImageToolbar extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'image/imagetoolbar';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor ) {\n\t\tsuper( editor );\n\n\t\teditor.config.set( 'image.defaultToolbar', [] );\n\n\t\t/**\n\t\t * When set to `true`, toolbar will be repositioned and showed on each render event and focus change.\n\t\t * Set to `false` to temporary disable the image toolbar.\n\t\t *\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis.isEnabled = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tafterInit() {\n\t\tconst editor = this.editor;\n\t\tconst toolbarConfig = editor.config.get( 'image.toolbar' ) || editor.config.get( 'image.defaultToolbar' );\n\n\t\t// Don't add the toolbar if there is no configuration.\n\t\tif ( !toolbarConfig.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst panel = this._panel = new ImageBalloonPanel( editor );\n\t\tconst promises = [];\n\t\tconst toolbar = new ToolbarView();\n\n\t\t// Add CSS class to the panel.\n\t\tTemplate.extend( panel.template, {\n\t\t\tattributes: {\n\t\t\t\tclass: [\n\t\t\t\t\t'ck-toolbar__container'\n\t\t\t\t]\n\t\t\t}\n\t\t} );\n\n\t\t// Add toolbar to balloon panel.\n\t\tpromises.push( panel.content.add( toolbar ) );\n\n\t\t// Add buttons to the toolbar.\n\t\tpromises.push( toolbar.fillFromConfig( toolbarConfig, editor.ui.componentFactory ) );\n\n\t\t// Add balloon panel to editor's UI.\n\t\tpromises.push( editor.ui.view.body.add( panel ) );\n\n\t\t// Show balloon panel each time image widget is selected.\n\t\tthis.listenTo( this.editor.editing.view, 'render', () => {\n\t\t\tif ( this.isEnabled ) {\n\t\t\t\tthis.show();\n\t\t\t}\n\t\t}, { priority: 'low' } );\n\n\t\t// There is no render method after focus is back in editor, we need to check if balloon panel should be visible.\n\t\tthis.listenTo( editor.ui.focusTracker, 'change:isFocused', ( evt, name, is, was ) => {\n\t\t\tif ( !was && is && this.isEnabled ) {\n\t\t\t\tthis.show();\n\t\t\t}\n\t\t} );\n\n\t\treturn Promise.all( promises );\n\t}\n\n\t/**\n\t * Shows the toolbar.\n\t */\n\tshow() {\n\t\tconst selectedElement = this.editor.editing.view.selection.getSelectedElement();\n\n\t\tif ( selectedElement && isImageWidget( selectedElement ) ) {\n\t\t\tthis._panel.attach();\n\t\t}\n\t}\n\n\t/**\n\t * Hides the toolbar.\n\t */\n\thide() {\n\t\tthis._panel.detach();\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-image/src/imagetoolbar.js\n// module id = 173\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module link/findlinkrange\n */\n\nimport Range from '@ckeditor/ckeditor5-engine/src/model/range';\nimport Position from '@ckeditor/ckeditor5-engine/src/model/position';\n\n/**\n * Walk backward and forward from start position, node by node as long as they have the same `linkHref` attribute value and return\n * {@link module:engine/model/range~Range Range} with found link.\n *\n * @param {module:engine/model/position~Position} position Start position.\n * @param {String} value `linkHref` attribute value.\n * @returns {module:engine/model/range~Range} Link range.\n */\nexport default function findLinkRange( position, value ) {\n\treturn new Range( _findBound( position, value, true ), _findBound( position, value, false ) );\n}\n\n// Walk forward or backward (depends on `lookBack` flag), node by node as long as they have the same `linkHref` attribute value\n// and return position just before or after (depends on `lookBack` flag) last matched node.\n//\n// @param {module:engine/model/position~Position} position Start position.\n// @param {String} value `linkHref` attribute value.\n// @param {Boolean} lookBack Whether walk direction is forward `false` or backward `true`.\n// @returns {module:engine/model/position~Position} Position just before last matched node.\nfunction _findBound( position, value, lookBack ) {\n\t// Get node before or after position (depends on `lookBack` flag).\n\t// When position is inside text node then start searching from text node.\n\tlet node = position.textNode || ( lookBack ? position.nodeBefore : position.nodeAfter );\n\n\tlet lastNode = null;\n\n\twhile ( node && node.getAttribute( 'linkHref' ) == value ) {\n\t\tlastNode = node;\n\t\tnode = lookBack ? node.previousSibling : node.nextSibling;\n\t}\n\n\treturn lastNode ? Position.createAt( lastNode, lookBack ? 'before' : 'after' ) : position;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-link/src/findlinkrange.js\n// module id = 174\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module link/linkelement\n */\n\nimport AttributeElement from '@ckeditor/ckeditor5-engine/src/view/attributeelement';\n\n/**\n * This class is to mark specific {@link module:engine/view/node~Node} as {@link module:link/linkelement~LinkElement}.\n * E.g. There could be a situation when different features will create nodes with the same names,\n * and hence they must be identified somehow.\n *\n * @extends module:engine/view/attributelement~AttributeElement\n */\nexport default class LinkElement extends AttributeElement {\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-link/src/linkelement.js\n// module id = 175\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module list/listengine\n */\n\nimport ListCommand from './listcommand';\nimport IndentCommand from './indentcommand';\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';\n\nimport {\n\tcleanList,\n\tcleanListItem,\n\tmodelViewInsertion,\n\tmodelViewChangeType,\n\tmodelViewMergeAfter,\n\tmodelViewRemove,\n\tmodelViewSplitOnInsert,\n\tmodelViewChangeIndent,\n\tmodelChangePostFixer,\n\tviewModelConverter,\n\tmodelToViewPosition,\n\tviewToModelPosition\n} from './converters';\n\n/**\n * The engine of the lists feature. It handles creating, editing and removing lists and list items.\n * It registers the `numberedList`, `bulletedList`, `indentList` and `outdentList` commands.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class ListEngine extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ Paragraph ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\n\t\t// Schema.\n\t\t// Note: in case `$block` will be ever allowed in `listItem`, keep in mind that this feature\n\t\t// uses `Selection#getSelectedBlocks()` without any additional processing to obtain all selected list items.\n\t\t// If there are blocks allowed inside list item, algorithms using `getSelectedBlocks()` will have to be modified.\n\t\tconst schema = editor.document.schema;\n\t\tschema.registerItem( 'listItem', '$block' );\n\t\tschema.allow( {\n\t\t\tname: 'listItem',\n\t\t\tinside: '$root',\n\t\t\tattributes: [ 'type', 'indent' ]\n\t\t} );\n\t\tschema.requireAttributes( 'listItem', [ 'type', 'indent' ] );\n\n\t\t// Converters.\n\t\tconst data = editor.data;\n\t\tconst editing = editor.editing;\n\n\t\tthis.editor.document.on( 'change', modelChangePostFixer( this.editor.document ), { priority: 'high' } );\n\n\t\t// Unbind all moved model elements before conversion happens. This is important for converters.\n\t\t// TODO: fix this when changes are converted on `changesDone`.\n\t\tthis.editor.document.on( 'change', ( evt, type, changes ) => {\n\t\t\tif ( type == 'move' ) {\n\t\t\t\tfor ( let item of changes.range.getItems() ) {\n\t\t\t\t\tif ( item.is( 'listItem' ) ) {\n\t\t\t\t\t\tediting.mapper.unbindModelElement( item );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, { priority: 'high' } );\n\n\t\tediting.mapper.registerViewToModelLength( 'li', getViewListItemLength );\n\t\tdata.mapper.registerViewToModelLength( 'li', getViewListItemLength );\n\n\t\tediting.mapper.on( 'modelToViewPosition', modelToViewPosition );\n\t\tediting.mapper.on( 'viewToModelPosition', viewToModelPosition );\n\t\tdata.mapper.on( 'modelToViewPosition', modelToViewPosition );\n\n\t\tediting.modelToView.on( 'insert', modelViewSplitOnInsert, { priority: 'high' } );\n\t\tediting.modelToView.on( 'insert:listItem', modelViewInsertion );\n\t\tdata.modelToView.on( 'insert', modelViewSplitOnInsert, { priority: 'high' } );\n\t\tdata.modelToView.on( 'insert:listItem', modelViewInsertion );\n\n\t\t// Only change converter is needed. List item's type attribute is required, so it's adding is handled when\n\t\t// list item is added and you cannot remove it.\n\t\tediting.modelToView.on( 'changeAttribute:type:listItem', modelViewChangeType );\n\t\tdata.modelToView.on( 'changeAttribute:type:listItem', modelViewChangeType );\n\n\t\tediting.modelToView.on( 'remove:listItem', modelViewRemove );\n\t\tediting.modelToView.on( 'remove', modelViewMergeAfter, { priority: 'low' } );\n\t\tdata.modelToView.on( 'remove:listItem', modelViewRemove );\n\t\tdata.modelToView.on( 'remove', modelViewMergeAfter, { priority: 'low' } );\n\n\t\tediting.modelToView.on( 'changeAttribute:indent:listItem', modelViewChangeIndent );\n\t\tdata.modelToView.on( 'changeAttribute:indent:listItem', modelViewChangeIndent );\n\n\t\tdata.viewToModel.on( 'element:ul', cleanList, { priority: 'high' } );\n\t\tdata.viewToModel.on( 'element:ol', cleanList, { priority: 'high' } );\n\t\tdata.viewToModel.on( 'element:li', cleanListItem, { priority: 'high' } );\n\t\tdata.viewToModel.on( 'element:li', viewModelConverter );\n\n\t\t// Register commands for numbered and bulleted list.\n\t\teditor.commands.set( 'numberedList', new ListCommand( editor, 'numbered' ) );\n\t\teditor.commands.set( 'bulletedList', new ListCommand( editor, 'bulleted' ) );\n\n\t\t// Register commands for indenting.\n\t\teditor.commands.set( 'indentList', new IndentCommand( editor, 'forward' ) );\n\t\teditor.commands.set( 'outdentList', new IndentCommand( editor, 'backward' ) );\n\t}\n}\n\nfunction getViewListItemLength( element ) {\n\tlet length = 1;\n\n\tfor ( let child of element.getChildren() ) {\n\t\tif ( child.name == 'ul' || child.name == 'ol' ) {\n\t\t\tfor ( let item of child.getChildren() ) {\n\t\t\t\tlength += getViewListItemLength( item );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn length;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-list/src/listengine.js\n// module id = 176\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module typing/changebuffer\n */\n\nimport count from '@ckeditor/ckeditor5-utils/src/count';\n\n/**\n * Change buffer allows to group atomic changes (like characters that have been typed) into\n * {@link module:engine/model/batch~Batch batches}.\n *\n * Batches represent single undo steps, hence changes added to one single batch are undone together.\n *\n * The buffer has a configurable limit of atomic changes that it can accommodate. After the limit was\n * exceeded (see {@link ~ChangeBuffer#input}), a new batch is created in {@link ~ChangeBuffer#batch}.\n *\n * To use the change buffer you need to let it know about the number of changes that were added to the batch:\n *\n *\t\tconst buffer = new ChangeBuffer( document, LIMIT );\n *\n *\t\t// Later on in your feature:\n *\t\tbuffer.batch.insert( pos, insertedCharacters );\n *\t\tbuffer.input( insertedCharacters.length );\n *\n */\nexport default class ChangeBuffer {\n\t/**\n\t * Creates a new instance of the change buffer.\n\t *\n\t * @param {module:engine/model/document~Document} document\n\t * @param {Number} [limit=20] The maximum number of atomic changes which can be contained in one batch.\n\t */\n\tconstructor( doc, limit = 20 ) {\n\t\t/**\n\t\t * The document instance.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/document~Document} #document\n\t\t */\n\t\tthis.document = doc;\n\n\t\t/**\n\t\t * The number of atomic changes in the buffer. Once it exceeds the {@link #limit},\n\t\t * the {@link #batch batch} is set to a new one.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Number} #size\n\t\t */\n\t\tthis.size = 0;\n\n\t\t/**\n\t\t * The maximum number of atomic changes which can be contained in one batch.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Number} #limit\n\t\t */\n\t\tthis.limit = limit;\n\n\t\t/**\n\t\t * Whether the buffer is locked. The locked buffer cannot be reset unless it gets unlocked.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean} #isLocked\n\t\t */\n\t\tthis.isLocked = false;\n\n\t\tthis._changeCallback = ( evt, type, changes, batch ) => {\n\t\t\tthis._onBatch( batch );\n\t\t};\n\n\t\tthis._selectionChangeCallback = () => {\n\t\t\tthis._reset();\n\t\t};\n\n\t\tdoc.on( 'change', this._changeCallback );\n\n\t\tdoc.selection.on( 'change:range', this._selectionChangeCallback );\n\n\t\tdoc.selection.on( 'change:attribute', this._selectionChangeCallback );\n\n\t\t/**\n\t\t * The current batch instance.\n\t\t *\n\t\t * @private\n\t\t * @member #_batch\n\t\t */\n\n\t\t/**\n\t\t * The callback to document the change event which later needs to be removed.\n\t\t *\n\t\t * @private\n\t\t * @member #_changeCallback\n\t\t */\n\n\t\t/**\n\t\t * The callback to document selection change:attribute and change:range events which resets the buffer.\n\t\t *\n\t\t * @private\n\t\t * @member #_selectionChangeCallback\n\t\t */\n\t}\n\n\t/**\n\t * The current batch to which a feature should add its deltas. Once the {@link #size}\n\t * is reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.\n\t *\n\t * @type {module:engine/model/batch~Batch}\n\t */\n\tget batch() {\n\t\tif ( !this._batch ) {\n\t\t\tthis._batch = this.document.batch();\n\t\t}\n\n\t\treturn this._batch;\n\t}\n\n\t/**\n\t * The input number of changes into the buffer. Once the {@link #size} is\n\t * reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.\n\t *\n\t * @param {Number} changeCount The number of atomic changes to input.\n\t */\n\tinput( changeCount ) {\n\t\tthis.size += changeCount;\n\n\t\tif ( this.size >= this.limit ) {\n\t\t\tthis._reset( true );\n\t\t}\n\t}\n\n\t/**\n\t * Locks the buffer.\n\t */\n\tlock() {\n\t\tthis.isLocked = true;\n\t}\n\n\t/**\n\t * Unlocks the buffer.\n\t */\n\tunlock() {\n\t\tthis.isLocked = false;\n\t}\n\n\t/**\n\t * Destroys the buffer.\n\t */\n\tdestroy() {\n\t\tthis.document.off( 'change', this._changeCallback );\n\t\tthis.document.selection.off( 'change:range', this._selectionChangeCallback );\n\t\tthis.document.selection.off( 'change:attribute', this._selectionChangeCallback );\n\t}\n\n\t/**\n\t * The method to be called in order to notify the buffer about batches which appeared in the document.\n\t * The method will check whether it is a new batch and in that case the buffer will be flushed.\n\t *\n\t * The reason why the buffer needs to be flushed whenever a new batch appears is that the changes added afterwards\n\t * should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,\n\t * the characters typed after inserting the image should be added to a different batch than the characters typed before.\n\t *\n\t * @private\n\t * @param {module:engine/model/batch~Batch} batch The batch which appears in the document.\n\t */\n\t_onBatch( batch ) {\n\t\t// One operation means a newly created batch.\n\t\tif ( batch.type != 'transparent' && batch !== this._batch && count( batch.getOperations() ) <= 1 ) {\n\t\t\tthis._reset( true );\n\t\t}\n\t}\n\n\t/**\n\t * Resets the change buffer.\n\t *\n\t * @private\n\t * @param {Boolean} [ignoreLock] Whether internal lock {@link #isLocked} should be ignored.\n\t */\n\t_reset( ignoreLock ) {\n\t\tif ( !this.isLocked || ignoreLock ) {\n\t\t\tthis._batch = null;\n\t\t\tthis.size = 0;\n\t\t}\n\t}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-typing/src/changebuffer.js\n// module id = 177\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/bindings/clickoutsidehandler\n */\n\n/* global document */\n\n/**\n * Handles a DOM `click` event outside of specified element and fires an action.\n *\n * Note that it is not handled by a `click` event, this is to avoid situation when click on some trigger\n * opens and closes element at the same time.\n *\n * @param {Object} options Configuration options.\n * @param {module:utils/dom/emittermixin~Emitter} options.emitter The emitter to which this behavior should be added.\n * @param {Function} options.activator Function returning a `Boolean`, to determine whether handler is active.\n * @param {HTMLElement} options.contextElement `HTMLElement` that clicking inside of which will not fire the callback.\n * @param {Function} options.callback Function fired after clicking outside of a specified element.\n */\nexport default function clickOutsideHandler( { emitter, activator, callback, contextElement } ) {\n\temitter.listenTo( document, 'mouseup', ( evt, { target } ) => {\n\t\tif ( activator() && !contextElement.contains( target ) ) {\n\t\t\tcallback();\n\t\t}\n\t} );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js\n// module id = 178\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/bindings/submithandler\n */\n\n/**\n * Handles native DOM `submit` event by preventing it and firing\n * the {@link module:ui/view~View view's} `submit` event, which can be then handled by the\n * parent controller.\n *\n * @param {Object} [options] Configuration options.\n * @param {module:ui/view~View} options.view The view to which this behavior should be added.\n */\nexport default function submitHandler( { view } ) {\n\tview.listenTo( view.element, 'submit', ( evt, domEvt ) => {\n\t\tdomEvt.preventDefault();\n\t\tview.fire( 'submit' );\n\t}, { useCapture: true } );\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js\n// module id = 179\n// module chunks = 0","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/inputtext/inputtextview\n */\n\nimport View from '../view';\nimport Template from '../template';\n\n/**\n * The text input view class.\n *\n * @extends module:ui/view~View\n */\nexport default class InputTextView extends View {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( locale ) {\n\t\tsuper( locale );\n\n\t\t/**\n\t\t * The value of the input.\n\t\t *\n\t\t * @observable\n\t\t * @member {String} #value\n\t\t */\n\t\tthis.set( 'value' );\n\n\t\t/**\n\t\t * The `id` attribute of the input (i.e. to pair with a `