{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js","webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js","webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js","webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js","webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js","webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js","webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js","webpack:///./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js"],"names":["BubblingEventInfo","source","name","startRange","_this","Object","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_1__","this","_super","call","_eventPhase","_currentTarget","EventInfo","DomEventObserver","view","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_2__","useCapture","domElement","_this2","types","domEventType","forEach","type","listenTo","eventInfo","domEvent","isEnabled","checkShouldIgnoreEventFromTarget","target","onDomEvent","eventType","additionalData","document","fire","DomEventData","Observer","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__","domTarget","extend","domConverter","mapDomToView","preventDefault","stopPropagation","CompositionObserver","on","isComposing","ClickObserver","ArrowKeysObserver","event","data","isArrowKeyCode","keyCode","selection","getFirstRange","stop","called","FakeSelectionObserver","_fireSelectionChangeDoneDebounced","debounce","isFake","context","_handleSelectionMove","priority","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_get_js__WEBPACK_IMPORTED_MODULE_3__","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_getPrototypeOf_js__WEBPACK_IMPORTED_MODULE_6__","prototype","cancel","newSelection","ViewSelection","getRanges","backward","isBackward","fake","keyCodes","arrowleft","arrowup","setTo","getFirstPosition","arrowright","arrowdown","getLastPosition","oldSelection","domSelection","contextsSymbol","Symbol","BubblingEmitterMixin","eventOrInfo","eventContexts","getBubblingContexts","size","updateEventInfo","_len","arguments","length","eventArgs","Array","_key","fireListenerFor","apply","concat","return","selectedElement","getContainedElement","isCustomContext","Boolean","getCustomContext","node","getDeeperRangeParent","is","parent","err","CKEditorError","rethrowUnexpectedError","_addEventListener","callback","options","_step","contexts","toArray","_iterator","_createForOfIteratorHelper","s","n","done","value","emitter","get","create","EmitterMixin","set","e","f","_removeEventListener","_step2","_iterator2","values","stopListening","eventPhase","currentTarget","_len2","_key2","_step3","_iterator3","_step3$value","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__","Map","range","startParent","start","endParent","end","startPath","getPath","endPath"],"mappings":";;;;OAiBqBA,6CAMpB,SAAAA,EAAaC,EAAQC,EAAMC,GAAa,IAAAC,EAAA,OAAAC,OAAAC,EAAA,KAAAD,CAAAE,KAAAP,GACvCI,EAAAI,EAAAC,KAAAF,KAAON,EAAQC,GAQfE,EAAKD,WAAaA,EAQlBC,EAAKM,YAAc,OAQnBN,EAAKO,eAAiB,KAzBiBP,iDAkCxC,WACC,OAAOG,KAAKG,uCASb,WACC,OAAOH,KAAKI,sBAnDiCC;;;;OCmB1BC,6CAqBpB,SAAAA,EAAaC,GAAO,IAAAV,EAAA,OAAAC,OAAAU,EAAA,KAAAV,CAAAE,KAAAM,GACnBT,EAAAI,EAAAC,KAAAF,KAAOO,GAQPV,EAAKY,YAAa,EATCZ,gDAepB,SAASa,GAAa,IAAAC,EAAAX,KACfY,EAAoC,iBAArBZ,KAAKa,cAA6Bb,KAAKa,cAAiBb,KAAKa,aAElFD,EAAME,QAAS,S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sourcesContent":["/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module engine/view/observer/bubblingeventinfo\n */\n\nimport EventInfo from '@ckeditor/ckeditor5-utils/src/eventinfo';\n\n/**\n * The event object passed to bubbling event callbacks. It is used to provide information about the event as well as a tool to\n * manipulate it.\n *\n * @extends module:utils/eventinfo~EventInfo\n */\nexport default class BubblingEventInfo extends EventInfo {\n\t/**\n\t * @param {Object} source The emitter.\n\t * @param {String} name The event name.\n\t * @param {module:engine/view/range~Range} startRange The view range that the bubbling should start from.\n\t */\n\tconstructor( source, name, startRange ) {\n\t\tsuper( source, name );\n\n\t\t/**\n\t\t * The view range that the bubbling should start from.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/range~Range}\n\t\t */\n\t\tthis.startRange = startRange;\n\n\t\t/**\n\t\t * The current event phase.\n\t\t *\n\t\t * @protected\n\t\t * @member {'none'|'capturing'|'atTarget'|'bubbling'}\n\t\t */\n\t\tthis._eventPhase = 'none';\n\n\t\t/**\n\t\t * The current bubbling target.\n\t\t *\n\t\t * @protected\n\t\t * @member {module:engine/view/document~Document|module:engine/view/node~Node|null}\n\t\t */\n\t\tthis._currentTarget = null;\n\t}\n\n\t/**\n\t * The current event phase.\n\t *\n\t * @readonly\n\t * @member {'none'|'capturing'|'atTarget'|'bubbling'}\n\t */\n\tget eventPhase() {\n\t\treturn this._eventPhase;\n\t}\n\n\t/**\n\t * The current bubbling target.\n\t *\n\t * @readonly\n\t * @member {module:engine/view/document~Document|module:engine/view/node~Node|null}\n\t */\n\tget currentTarget() {\n\t\treturn this._currentTarget;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\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 to. Array of types can be defined\n\t * if the observer 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( view ) {\n\t\tsuper( view );\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 && !this.checkShouldIgnoreEventFromTarget( domEvent.target ) ) {\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.view, domEvent, additionalData ) );\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module engine/view/observer/domeventdata\n */\n\nimport { extend } from 'lodash-es';\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/view~View} view The instance of the view controller.\n\t * @param {Event} domEvent The DOM event.\n\t * @param {Object} [additionalData] Additional properties that the instance should contain.\n\t */\n\tconstructor( view, domEvent, additionalData ) {\n\t\t/**\n\t\t * Instance of the view controller.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/view~View} module:engine/view/observer/observer~Observer.DomEvent#view\n\t\t */\n\t\tthis.view = view;\n\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#document\n\t\t */\n\t\tthis.document = view.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.view.domConverter.mapDomToView( 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 * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module engine/view/observer/compositionobserver\n */\n\nimport DomEventObserver from './domeventobserver';\n\n/**\n * {@link module:engine/view/document~Document#event:compositionstart Compositionstart},\n * {@link module:engine/view/document~Document#event:compositionupdate compositionupdate} and\n * {@link module:engine/view/document~Document#event:compositionend compositionend} events observer.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n *\n * @extends module:engine/view/observer/domeventobserver~DomEventObserver\n */\nexport default class CompositionObserver extends DomEventObserver {\n\tconstructor( view ) {\n\t\tsuper( view );\n\n\t\tthis.domEventType = [ 'compositionstart', 'compositionupdate', 'compositionend' ];\n\t\tconst document = this.document;\n\n\t\tdocument.on( 'compositionstart', () => {\n\t\t\tdocument.isComposing = true;\n\t\t} );\n\n\t\tdocument.on( 'compositionend', () => {\n\t\t\tdocument.isComposing = false;\n\t\t} );\n\t}\n\n\tonDomEvent( domEvent ) {\n\t\tthis.fire( domEvent.type, domEvent );\n\t}\n}\n\n/**\n * Fired when composition starts inside one of the editables.\n *\n * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.\n *\n * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the\n * {@link module:engine/view/view~View} this event is available by default.\n *\n * @see module:engine/view/observer/compositionobserver~CompositionObserver\n * @event module:engine/view/document~Document#event:compositionstart\n * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.\n */\n\n/**\n * Fired when composition is updated inside one of the editables.\n *\n * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.\n *\n * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the\n * {@link module:engine/view/view~View} this event is available by default.\n *\n * @see module:engine/view/observer/compositionobserver~CompositionObserver\n * @event module:engine/view/document~Document#event:compositionupdate\n * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.\n */\n\n/**\n * Fired when composition ends inside one of the editables.\n *\n * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.\n *\n * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the\n * {@link module:engine/view/view~View} this event is available by default.\n *\n * @see module:engine/view/observer/compositionobserver~CompositionObserver\n * @event module:engine/view/document~Document#event:compositionend\n * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.\n */\n","\n/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module engine/view/observer/clickobserver\n */\n\nimport DomEventObserver from './domeventobserver';\n\n/**\n * {@link module:engine/view/document~Document#event:click Click} event observer.\n *\n * Note that this observer is not available by default. To make it available it needs to be added to\n * {@link module:engine/view/view~View view controller}\n * by a {@link module:engine/view/view~View#addObserver} method.\n *\n * @extends module:engine/view/observer/domeventobserver~DomEventObserver\n */\nexport default class ClickObserver extends DomEventObserver {\n\tconstructor( view ) {\n\t\tsuper( view );\n\n\t\tthis.domEventType = 'click';\n\t}\n\n\tonDomEvent( domEvent ) {\n\t\tthis.fire( domEvent.type, domEvent );\n\t}\n}\n\n/**\n * Fired when one of the editables has been clicked.\n *\n * Introduced by {@link module:engine/view/observer/clickobserver~ClickObserver}.\n *\n * Note that this event is not available by default. To make it available\n * {@link module:engine/view/observer/clickobserver~ClickObserver} needs to be added\n * to {@link module:engine/view/view~View} by a {@link module:engine/view/view~View#addObserver} method.\n *\n * @see module:engine/view/observer/clickobserver~ClickObserver\n * @event module:engine/view/document~Document#event:click\n * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.\n */\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module engine/view/observer/arrowkeysobserver\n */\n\nimport Observer from './observer';\nimport BubblingEventInfo from './bubblingeventinfo';\n\nimport { isArrowKeyCode } from '@ckeditor/ckeditor5-utils';\n\n/**\n * Arrow keys observer introduces the {@link module:engine/view/document~Document#event:arrowKey `Document#arrowKey`} event.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n *\n * @extends module:engine/view/observer/observer~Observer\n */\nexport default class ArrowKeysObserver extends Observer {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( view ) {\n\t\tsuper( view );\n\n\t\tthis.document.on( 'keydown', ( event, data ) => {\n\t\t\tif ( this.isEnabled && isArrowKeyCode( data.keyCode ) ) {\n\t\t\t\tconst eventInfo = new BubblingEventInfo( this.document, 'arrowKey', this.document.selection.getFirstRange() );\n\n\t\t\t\tthis.document.fire( eventInfo, data );\n\n\t\t\t\tif ( eventInfo.stop.called ) {\n\t\t\t\t\tevent.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tobserve() {}\n}\n\n/**\n * Event fired when the user presses an arrow keys.\n *\n * Introduced by {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.\n *\n * Note that because {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver} is attached by the\n * {@link module:engine/view/view~View} this event is available by default.\n *\n * @event module:engine/view/document~Document#event:arrowKey\n * @param {module:engine/view/observer/domeventdata~DomEventData} data\n */\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module engine/view/observer/fakeselectionobserver\n */\n\nimport Observer from './observer';\nimport ViewSelection from '../selection';\nimport { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';\nimport { debounce } from 'lodash-es';\n\n/**\n * Fake selection observer class. If view selection is fake it is placed in dummy DOM container. This observer listens\n * on {@link module:engine/view/document~Document#event:keydown keydown} events and handles moving fake view selection to the correct place\n * if arrow keys are pressed.\n * Fires {@link module:engine/view/document~Document#event:selectionChange selectionChange event} simulating natural behaviour of\n * {@link module:engine/view/observer/selectionobserver~SelectionObserver SelectionObserver}.\n *\n * @extends module:engine/view/observer/observer~Observer\n */\nexport default class FakeSelectionObserver extends Observer {\n\t/**\n\t * Creates new FakeSelectionObserver instance.\n\t *\n\t * @param {module:engine/view/view~View} view\n\t */\n\tconstructor( view ) {\n\t\tsuper( view );\n\n\t\t/**\n\t\t * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.\n\t\t *\n\t\t * @private\n\t\t * @param {Object} data Selection change data.\n\t\t * @method #_fireSelectionChangeDoneDebounced\n\t\t */\n\t\tthis._fireSelectionChangeDoneDebounced = debounce( data => this.document.fire( 'selectionChangeDone', data ), 200 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tobserve() {\n\t\tconst document = this.document;\n\n\t\tdocument.on( 'arrowKey', ( eventInfo, data ) => {\n\t\t\tconst selection = document.selection;\n\n\t\t\tif ( selection.isFake && this.isEnabled ) {\n\t\t\t\t// Prevents default key down handling - no selection change will occur.\n\t\t\t\tdata.preventDefault();\n\t\t\t}\n\t\t}, { context: '$capture' } );\n\n\t\tdocument.on( 'arrowKey', ( eventInfo, data ) => {\n\t\t\tconst selection = document.selection;\n\n\t\t\tif ( selection.isFake && this.isEnabled ) {\n\t\t\t\tthis._handleSelectionMove( data.keyCode );\n\t\t\t}\n\t\t}, { priority: 'lowest' } );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tdestroy() {\n\t\tsuper.destroy();\n\n\t\tthis._fireSelectionChangeDoneDebounced.cancel();\n\t}\n\n\t/**\n\t * Handles collapsing view selection according to given key code. If left or up key is provided - new selection will be\n\t * collapsed to left. If right or down key is pressed - new selection will be collapsed to right.\n\t *\n\t * This method fires {@link module:engine/view/document~Document#event:selectionChange} and\n\t * {@link module:engine/view/document~Document#event:selectionChangeDone} events imitating behaviour of\n\t * {@link module:engine/view/observer/selectionobserver~SelectionObserver}.\n\t *\n\t * @private\n\t * @param {Number} keyCode\n\t * @fires module:engine/view/document~Document#event:selectionChange\n\t * @fires module:engine/view/document~Document#event:selectionChangeDone\n\t */\n\t_handleSelectionMove( keyCode ) {\n\t\tconst selection = this.document.selection;\n\t\tconst newSelection = new ViewSelection( selection.getRanges(), { backward: selection.isBackward, fake: false } );\n\n\t\t// Left or up arrow pressed - move selection to start.\n\t\tif ( keyCode == keyCodes.arrowleft || keyCode == keyCodes.arrowup ) {\n\t\t\tnewSelection.setTo( newSelection.getFirstPosition() );\n\t\t}\n\n\t\t// Right or down arrow pressed - move selection to end.\n\t\tif ( keyCode == keyCodes.arrowright || keyCode == keyCodes.arrowdown ) {\n\t\t\tnewSelection.setTo( newSelection.getLastPosition() );\n\t\t}\n\n\t\tconst data = {\n\t\t\toldSelection: selection,\n\t\t\tnewSelection,\n\t\t\tdomSelection: null\n\t\t};\n\n\t\t// Fire dummy selection change event.\n\t\tthis.document.fire( 'selectionChange', data );\n\n\t\t// Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.\n\t\t// This function is debounced what means that `selectionChangeDone` event will be fired only when\n\t\t// defined int the function time will elapse since the last time the function was called.\n\t\t// So `selectionChangeDone` will be fired when selection will stop changing.\n\t\tthis._fireSelectionChangeDoneDebounced( data );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module engine/view/observer/bubblingemittermixin\n */\n\nimport EventInfo from '@ckeditor/ckeditor5-utils/src/eventinfo';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport toArray from '@ckeditor/ckeditor5-utils/src/toarray';\n\nimport BubblingEventInfo from './bubblingeventinfo';\n\nconst contextsSymbol = Symbol( 'bubbling contexts' );\n\n/**\n * Bubbling emitter mixin for the view document as described in the\n * {@link ~BubblingEmitter} interface.\n *\n * @mixin BubblingEmitterMixin\n * @implements module:engine/view/observer/bubblingemittermixin~BubblingEmitter\n */\nconst BubblingEmitterMixin = {\n\t/**\n\t * @inheritDoc\n\t */\n\tfire( eventOrInfo, ...eventArgs ) {\n\t\ttry {\n\t\t\tconst eventInfo = eventOrInfo instanceof EventInfo ? eventOrInfo : new EventInfo( this, eventOrInfo );\n\t\t\tconst eventContexts = getBubblingContexts( this );\n\n\t\t\tif ( !eventContexts.size ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdateEventInfo( eventInfo, 'capturing', this );\n\n\t\t\t// The capture phase of the event.\n\t\t\tif ( fireListenerFor( eventContexts, '$capture', eventInfo, ...eventArgs ) ) {\n\t\t\t\treturn eventInfo.return;\n\t\t\t}\n\n\t\t\tconst startRange = eventInfo.startRange || this.selection.getFirstRange();\n\t\t\tconst selectedElement = startRange ? startRange.getContainedElement() : null;\n\t\t\tconst isCustomContext = selectedElement ? Boolean( getCustomContext( eventContexts, selectedElement ) ) : false;\n\n\t\t\tlet node = selectedElement || getDeeperRangeParent( startRange );\n\n\t\t\tupdateEventInfo( eventInfo, 'atTarget', node );\n\n\t\t\t// For the not yet bubbling event trigger for $text node if selection can be there and it's not a custom context selected.\n\t\t\tif ( !isCustomContext ) {\n\t\t\t\tif ( fireListenerFor( eventContexts, '$text', eventInfo, ...eventArgs ) ) {\n\t\t\t\t\treturn eventInfo.return;\n\t\t\t\t}\n\n\t\t\t\tupdateEventInfo( eventInfo, 'bubbling', node );\n\t\t\t}\n\n\t\t\twhile ( node ) {\n\t\t\t\t// Root node handling.\n\t\t\t\tif ( node.is( 'rootElement' ) ) {\n\t\t\t\t\tif ( fireListenerFor( eventContexts, '$root', eventInfo, ...eventArgs ) ) {\n\t\t\t\t\t\treturn eventInfo.return;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Element node handling.\n\t\t\t\telse if ( node.is( 'element' ) ) {\n\t\t\t\t\tif ( fireListenerFor( eventContexts, node.name, eventInfo, ...eventArgs ) ) {\n\t\t\t\t\t\treturn eventInfo.return;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check custom contexts (i.e., a widget).\n\t\t\t\tif ( fireListenerFor( eventContexts, node, eventInfo, ...eventArgs ) ) {\n\t\t\t\t\treturn eventInfo.return;\n\t\t\t\t}\n\n\t\t\t\tnode = node.parent;\n\n\t\t\t\tupdateEventInfo( eventInfo, 'bubbling', node );\n\t\t\t}\n\n\t\t\tupdateEventInfo( eventInfo, 'bubbling', this );\n\n\t\t\t// Document context.\n\t\t\tfireListenerFor( eventContexts, '$document', eventInfo, ...eventArgs );\n\n\t\t\treturn eventInfo.return;\n\t\t} catch ( err ) {\n\t\t\t// @if CK_DEBUG // throw err;\n\t\t\t/* istanbul ignore next */\n\t\t\tCKEditorError.rethrowUnexpectedError( err, this );\n\t\t}\n\t},\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_addEventListener( event, callback, options ) {\n\t\tconst contexts = toArray( options.context || '$document' );\n\t\tconst eventContexts = getBubblingContexts( this );\n\n\t\tfor ( const context of contexts ) {\n\t\t\tlet emitter = eventContexts.get( context );\n\n\t\t\tif ( !emitter ) {\n\t\t\t\temitter = Object.create( EmitterMixin );\n\t\t\t\teventContexts.set( context, emitter );\n\t\t\t}\n\n\t\t\tthis.listenTo( emitter, event, callback, options );\n\t\t}\n\t},\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_removeEventListener( event, callback ) {\n\t\tconst eventContexts = getBubblingContexts( this );\n\n\t\tfor ( const emitter of eventContexts.values() ) {\n\t\t\tthis.stopListening( emitter, event, callback );\n\t\t}\n\t}\n};\n\nexport default BubblingEmitterMixin;\n\n// Update the event info bubbling fields.\n//\n// @param {module:utils/eventinfo~EventInfo} eventInfo The event info object to update.\n// @param {'none'|'capturing'|'atTarget'|'bubbling'} eventPhase The current event phase.\n// @param {module:engine/view/document~Document|module:engine/view/node~Node} currentTarget The current bubbling target.\nfunction updateEventInfo( eventInfo, eventPhase, currentTarget ) {\n\tif ( eventInfo instanceof BubblingEventInfo ) {\n\t\teventInfo._eventPhase = eventPhase;\n\t\teventInfo._currentTarget = currentTarget;\n\t}\n}\n\n// Fires the listener for the specified context. Returns `true` if event was stopped.\n//\n// @private\n// @param {Map.} eventContexts\n// @param {String|module:engine/view/node~Node} context\n// @param {module:utils/eventinfo~EventInfo} eventInfo The `EventInfo` object.\n// @param {...*} [eventArgs] Additional arguments to be passed to the callbacks.\n// @returns {Boolean} True if event stop was called.\nfunction fireListenerFor( eventContexts, context, eventInfo, ...eventArgs ) {\n\tconst emitter = typeof context == 'string' ? eventContexts.get( context ) : getCustomContext( eventContexts, context );\n\n\tif ( !emitter ) {\n\t\treturn false;\n\t}\n\n\temitter.fire( eventInfo, ...eventArgs );\n\n\treturn eventInfo.stop.called;\n}\n\n// Returns an emitter for a specified view node.\n//\n// @private\n// @param {Map.} eventContexts\n// @param {module:engine/view/node~Node} node\n// @returns {module:utils/emittermixin~Emitter|null}\nfunction getCustomContext( eventContexts, node ) {\n\tfor ( const [ context, emitter ] of eventContexts ) {\n\t\tif ( typeof context == 'function' && context( node ) ) {\n\t\t\treturn emitter;\n\t\t}\n\t}\n\n\treturn null;\n}\n\n// Returns bubbling contexts map for the source (emitter).\nfunction getBubblingContexts( source ) {\n\tif ( !source[ contextsSymbol ] ) {\n\t\tsource[ contextsSymbol ] = new Map();\n\t}\n\n\treturn source[ contextsSymbol ];\n}\n\n// Returns the deeper parent element for the range.\nfunction getDeeperRangeParent( range ) {\n\tif ( !range ) {\n\t\treturn null;\n\t}\n\n\tconst startParent = range.start.parent;\n\tconst endParent = range.end.parent;\n\n\tconst startPath = startParent.getPath();\n\tconst endPath = endParent.getPath();\n\n\treturn startPath.length > endPath.length ? startParent : endParent;\n}\n\n/**\n * Bubbling emitter for the view document.\n *\n * Bubbling emitter is triggering events in the context of specified {@link module:engine/view/element~Element view element} name,\n * predefined `'$text'`, `'$root'`, `'$document'` and `'$capture'` contexts, and context matchers provided as a function.\n *\n * Before bubbling starts, listeners for `'$capture'` context are triggered. Then the bubbling starts from the deeper selection\n * position (by firing event on the `'$text'` context) and propagates the view document tree up to the `'$root'` and finally\n * the listeners at `'$document'` context are fired (this is the default context).\n *\n * Examples:\n *\n *\t\t// Listeners registered in the context of the view element names:\n *\t\tthis.listenTo( viewDocument, 'enter', ( evt, data ) => {\n *\t\t\t// ...\n *\t\t}, { context: 'blockquote' } );\n *\n *\t\tthis.listenTo( viewDocument, 'enter', ( evt, data ) => {\n *\t\t\t// ...\n *\t\t}, { context: 'li' } );\n *\n *\t\t// Listeners registered in the context of the '$text' and '$root' nodes.\n *\t\tthis.listenTo( view.document, 'arrowKey', ( evt, data ) => {\n *\t\t\t// ...\n *\t\t}, { context: '$text', priority: 'high' } );\n *\n *\t\tthis.listenTo( view.document, 'arrowKey', ( evt, data ) => {\n *\t\t\t// ...\n *\t\t}, { context: '$root' } );\n *\n *\t\t// Listeners registered in the context of custom callback function.\n *\t\tthis.listenTo( view.document, 'arrowKey', ( evt, data ) => {\n *\t\t\t// ...\n *\t\t}, { context: isWidget } );\n *\n *\t\tthis.listenTo( view.document, 'arrowKey', ( evt, data ) => {\n *\t\t\t// ...\n *\t\t}, { context: isWidget, priority: 'high' } );\n *\n * Example flow for selection in text:\n *\n *\t\t

Foo[]bar

\n *\n * Fired events on contexts:\n * 1. `'$capture'`\n * 2. `'$text'`\n * 3. `'p'`\n * 4. `'blockquote'`\n * 5. `'$root'`\n * 6. `'$document'`\n *\n * Example flow for selection on element (i.e., Widget):\n *\n *\t\t

Foo[]bar

\n *\n * Fired events on contexts:\n * 1. `'$capture'`\n * 2. *widget* (custom matcher)\n * 3. `'p'`\n * 4. `'blockquote'`\n * 5. `'$root'`\n * 6. `'$document'`\n *\n * There could be multiple listeners registered for the same context and at different priority levels:\n *\n *\t\t

Foo[]bar

\n *\n * 1. `'$capture'` at priorities:\n * 1. `'highest'`\n * 2. `'high'`\n * 3. `'normal'`\n * 4. `'low'`\n * 5. `'lowest'`\n * 2. `'$text'` at priorities:\n * 1. `'highest'`\n * 2. `'high'`\n * 3. `'normal'`\n * 4. `'low'`\n * 5. `'lowest'`\n * 3. `'p'` at priorities:\n * 1. `'highest'`\n * 2. `'high'`\n * 3. `'normal'`\n * 4. `'low'`\n * 5. `'lowest'`\n * 4. `'$root'` at priorities:\n * 1. `'highest'`\n * 2. `'high'`\n * 3. `'normal'`\n * 4. `'low'`\n * 5. `'lowest'`\n * 5. `'$document'` at priorities:\n * 1. `'highest'`\n * 2. `'high'`\n * 3. `'normal'`\n * 4. `'low'`\n * 5. `'lowest'`\n *\n * @interface BubblingEmitter\n * @extends module:utils/emittermixin~Emitter\n */\n"],"sourceRoot":""}